12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #pragma once
- #include "ILocalizationManager.h"
- #include "TypeDef.h"
- #include "ILamp.h"
- #include "CManageDB.h"
- using namespace JVision;
- using namespace ns_db;
- namespace ns_pr
- {
- enum PR_OUTPUT_TYPE {
- LOCALIZATION_TYPE, //定位
- CIRCLE_TYPE //找圆
- };
- //此处输出的偏差为:相对于图像左上角像素值
- struct FIND_OUTPUT_STRUCT
- {
- PR_OUTPUT_TYPE type; //方法类型
-
- double score; //分数
- double x; //x方向偏差(像素)
- double y; //y方向偏差(像素)
- union
- {
- double angle; //角度偏差(度)
- double radius; //半径(像素)
- };
- };
- class CPixelLocation
- {
- public:
- CPixelLocation();
- //搜索图片 stOutOffset相对于图片左上角的点的象素值
- // 参数 iPrMethod:方法Id
- // 参数 image:照片
- // 参数 stOutOffset:用于存储搜索结果偏差信息的结构体引用,包括X、Y和角度偏差
- // 返回值:操作结果,例如成功返回 OK,失败返回 FAIL 等
- LONG SearchImageByLocalization(UINT iPrMethod, ImageInfo image, FIND_OUTPUT_STRUCT& stOutOffset);
- LONG EditTemplate(UINT iTemplate);
- private:
- CProduct* m_pCProduct = nullptr;
- ILocalizationManager* m_pLocalizationManager = nullptr;
- bool m_bInitSuccess;
- bool ConvertBMPToImageInfo(const std::string& bmpPath, ImageInfo& imageInfo);
- };
- }
|