123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- #ifndef __COMMON_UTILS_H__
- #define __COMMON_UTILS_H__
- #include "TypeDef.h"
- #include "Figure.h"
- class BaseItem;
- namespace JVision
- {
-
- enum class JVision_API E_PERMISSION_LEVEL : int
- {
- E_PERMISSION_USER = 0,
- E_PERMISSION_ADMIN,
- E_PERMISSION_SUPER_ADMIN,
- };
-
- enum class JVision_API E_LOCALIZATION_TYPE : int
- {
- E_LOCALIZATION_INVALID = 0,
- E_MODEL_LOCATION,
- E_DOUBLE_MODEL_LOCATION,
- E_LINE_LOCATION,
- E_CORNER_LOCATION,
- E_CIRCLE_LOCATION,
- E_DOUBLE_CIRCLE_LOCATION,
- E_CIRCLE_LINE_LOCATION,
- E_RRECTANGLE_LOCATION,
- E_NINESQUARE_LOCATION,
- E_GLUE_DETECT,
- E_LOCATION_MAX,
- };
-
- enum class JVision_API E_LOCALIZATION_PARAM : ParamID
- {
- E_LOCALIZATION_PARAM_INVALID = 0,
- E_LOCALIZATION_PARAM_MARK,
- E_LOCALIZATION_PARAM_SEARCH,
- E_LOCALIZATION_PARAM_CIRCLE,
- E_LOCALIZATION_PARAM_LINE,
- E_LOCALIZATION_PARAM_RECTANGLE,
- E_LOCALIZATION_PARAM_GLUE,
- E_LOCALIZATION_PARAM_SCALED_IMG,
- E_LOCALIZATION_PARAM_BINARY_IMG,
- E_LOCALIZATION_PARAM_MAX,
- };
-
-
-
-
- struct JVision_API MarkParameter
- {
- BaseFigure* figure;
- BaseFigure* mask;
- Line* referencePoint;
- int start;
- int end;
- std::string pyrimid;
- std::string searchPo;
- bool UseContour;
- };
-
- struct JVision_API SearchParameter
- {
- BaseFigure* figure;
- int start;
- int end;
- int pyrimid;
- int matchCount;
- double minScore;
- double overlap;
- bool isSubPix;
- bool isDetect;
- };
-
- struct JVision_API GlueParameter
- {
- BaseFigure* figure;
- int methodIndex;
- int threshMin;
- int threshMax;
- int areaMin;
- int areaMax;
- };
-
- struct JVision_API CCircleParameter
- {
- CCircle* figure;
- std::string grayDirection;
- std::string scanDirection;
- int threshold;
- int cullDistance;
- int SegNums;
- int UnitWidth;
- int UnitLength;
- };
-
- struct JVision_API CircleParameter
- {
- Circle* figure;
- std::string grayDirection;
- std::string scanDirection;
- int threshold;
- int cullDistance;
- int SegNums;
- int UnitWidth;
- int UnitLength;
- };
-
- struct JVision_API LineParameter
- {
- Caliper* figure;
- std::string grayDirection;
- std::string scanDirection;
- int threshold;
- int cullDistance;
- int CaliperHeight;
- int CaliperWidth;
- };
-
- struct JVision_API RectangleParameter
- {
- CRectangle* figure;
- std::string grayDirection;
- std::string scanDirection;
- int threshold;
- int cullDistance;
- int segNums;
- int width;
- int height;
- };
-
- struct JVision_API IlluminateImgParameter
- {
- int cameraID;
- int min;
- int max;
- };
-
- struct JVision_API ScaledImgParameter
- {
- int imgIdx;
- int scaledAdd;
- double scaledMulti;
- };
-
- struct JVision_API ThresholdImgParameter
- {
- int imgIdx;
- int thresholdMin;
- int thresholdMax;
- };
-
-
-
-
- struct JVision_API ModelLocalization_Result
- {
- Point RefPoint;
- Point ActualPoint[9];
- double Score[9];
- double UsedTime;
- };
-
- struct JVision_API DoubleModelLocalization_Result
- {
- ModelLocalization_Result resArr[2];
- };
-
- struct JVision_API Corner_ModelLocalization_Result
- {
- bool isMark;
- Point ModelPoint;
- Point2D RefPoint;
- Point2D CrossPoint;
- Point2D Line1Start;
- Point2D Line1End;
- Point2D Line2Start;
- Point2D Line2End;
- double Score;
- double UsedTime;
- };
-
- struct JVision_API Circle_ModelLocalization_Result
- {
- bool isMark;
- Point ModelPoint;
- Point2D RefPoint;
- CircleResult CirclePoint;
- double Score;
- double UsedTime;
- };
-
- struct JVision_API Line_ModelLocalization_Result
- {
- bool isMark;
- Point ModelPoint;
- Point2D RefPoint;
- Point2D LineStart;
- Point2D LineEnd;
- double Score;
- double UsedTime;
- };
-
- struct JVision_API Circles_ModelLocalization_Result
- {
- bool isMark;
- Point ModelPoint;
- Point2D RefPoint;
- double Score;
- double UsedTime;
- CircleResult CirclePointArr[2];
- };
-
- struct JVision_API CirCleLine_ModelLocalization_Result
- {
- bool isMark;
- Point ModelPoint;
- Point2D RefPoint;
- double Score;
- double UsedTime;
-
- CircleResult CirclePoint;
-
- Point2D LineStart;
- Point2D LineEnd;
- };
-
- struct JVision_API RRectangle_ModelLocalization_Result
- {
- bool isMark;
- Point ModelPoint;
- Point2D RefPoint;
- double Score;
- double UsedTime;
- Point RectangleCenter;
- Point2D CornerPointArr[4];
- };
-
- struct JVision_API Glue_Detection_Result
- {
- bool isMark;
- Point ModelPoint;
- Point2D RefPoint;
- double Score;
- double UsedTime;
- Point2D CornerPointArr[2];
- double area;
- double roundness;
- };
- }
- #endif
|