NyARToolkit2.2ベースのC++版を作ってます。
・・・が、メモリリークとかクラス表現の違いとかで、難航中。
とりあえずコンパイルは通ったけど、ちゃんと動いてないので、もう少し時間がかかりそう。
参照とポインタの使い分けが難しい。
こんなかんじのクラスがいっぱいできる予定。
#pragma once
#include "NyARSingleDetectMarker.h"
#include "NyARParam.h"
#include "NyARMatchPatt_Color_WITHOUT_PCA.h"
#include "INyARSquareDetector.h"
#include "INyARTransMat.h"
#include "NyARTransMat.h"
#include "NyARRasterFilter_ARToolkitThreshold.h"
#include "NyARTransMatResult.h"
#include "NyARColorPatt_O3.h"
#include "NyARSquareDetector.h"
#include "NyARSquareStack.h"
#include "NyAR_types.h"
namespace NyARToolkitCPP
{
class NyARSingleDetectMarker
{
public:
NyARSingleDetectMarker(const NyARParam& i_param, NyARCode* i_code, double i_marker_width);
virtual ~NyARSingleDetectMarker();
private:
bool _is_continue;
NyARMatchPatt_Color_WITHOUT_PCA* _match_patt;
INyARSquareDetector* _square_detect;
NyARSquareStack* _square_list;// = new NyARSquareStack(AR_SQUARE_MAX);
NyARCode* _code;
protected:
INyARTransMat* _transmat;
private:
double _marker_width;
// 検出結果の保存用
int _detected_direction;
double _detected_confidence;
NyARSquare* _detected_square;
INyARColorPatt* _patt;
NyARBinRaster* _bin_raster;
NyARRasterFilter_ARToolkitThreshold* _tobin_filter;//=new NyARRasterFilter_ARToolkitThreshold(100);
public:
bool detectMarkerLite(const INyARRgbRaster& i_raster,int i_threshold);
void getTransmationMatrix(NyARTransMatResult& o_result)const;
double getConfidence()const;
int getDirection()const;
void setContinueMode(bool i_is_continue);
};
}