|
|
|
|
|
// 调用完整流程,叠加3个静止目标,发送引导指令(引导2个),自动转入跟踪,且跟踪目标与引导批号一致。
|
|
|
|
|
|
|
|
|
|
|
|
#include "NeoArithStandardDll.h"
|
|
|
|
|
|
#include "utils.h"
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
|
|
using std::cout;
|
|
|
|
|
|
using std::endl;
|
|
|
|
|
|
int main()
|
|
|
|
|
|
{
|
|
|
|
|
|
int nWidth = 640;
|
|
|
|
|
|
int nHeight = 512;
|
|
|
|
|
|
|
|
|
|
|
|
ArithHandle pTracker = STD_CreatEOArithHandle();
|
|
|
|
|
|
|
|
|
|
|
|
ARIDLL_EOArithInit(pTracker, nWidth, nHeight, GD_PIXEL_FORMAT_E::GD_PIXEL_FORMAT_GRAY_Y16);
|
|
|
|
|
|
|
|
|
|
|
|
ARIDLL_INPUTPARA stInputPara = { 0 };
|
|
|
|
|
|
stInputPara.unFrmId++;
|
|
|
|
|
|
stInputPara.stCameraInfo.fPixelSize = 15;
|
|
|
|
|
|
stInputPara.stCameraInfo.nFocus = 300;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ARIDLL_OUTPUT stOutput = { 0 };
|
|
|
|
|
|
|
|
|
|
|
|
TargetGuide* guideList = new TargetGuide[2];
|
|
|
|
|
|
memset(guideList, 0, sizeof(TargetGuide) * 2);
|
|
|
|
|
|
guideList[0].ID = 1;
|
|
|
|
|
|
guideList[0].stTargetPole.beta = 0.8;
|
|
|
|
|
|
guideList[0].stTargetPole.alpha = 0.3;
|
|
|
|
|
|
|
|
|
|
|
|
guideList[1].ID = 2;
|
|
|
|
|
|
guideList[1].stTargetPole.beta = -0.8;
|
|
|
|
|
|
guideList[1].stTargetPole.alpha = 0.3;
|
|
|
|
|
|
|
|
|
|
|
|
SimTargetImage_Y16 factory(nWidth, nHeight);
|
|
|
|
|
|
factory.setBackGround(5000, 10);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
factory.addTarget(100, 160, 3, 3, 6500);
|
|
|
|
|
|
factory.addTarget(200, 340, 15, 15, 6500);
|
|
|
|
|
|
factory.addTarget(499, 200, 15, 15, 6500);
|
|
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < 300; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
stInputPara.unFrmId++;
|
|
|
|
|
|
|
|
|
|
|
|
if (i == 3)
|
|
|
|
|
|
{
|
|
|
|
|
|
ARIDLL_GuideLockMultiCommand(pTracker, guideList,2);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GD_VIDEO_FRAME_S img = { 0 };
|
|
|
|
|
|
img.enPixelFormat = GD_PIXEL_FORMAT_E::GD_PIXEL_FORMAT_GRAY_Y16;
|
|
|
|
|
|
img.u32Width = nWidth;
|
|
|
|
|
|
img.u32Height = nHeight;
|
|
|
|
|
|
img.u32Stride[0] = img.u32Width * 2;
|
|
|
|
|
|
img.u64VirAddr[0] = (UBYTE8*)factory.getImageData();
|
|
|
|
|
|
|
|
|
|
|
|
int targetNum = 0;
|
|
|
|
|
|
targetNum = ARIDLL_SearchFrameTargets(pTracker, img);
|
|
|
|
|
|
|
|
|
|
|
|
ARIDLL_RunController(pTracker, img,stInputPara, &stOutput);
|
|
|
|
|
|
|
|
|
|
|
|
if (stOutput.nStatus == GLB_STATUS_TRACK && stOutput.nTrackObjCnts == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
cout << "pass" << endl;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|