/*! * \file CyclopsEnums.h * \date 2018/04/12 * * \author Lin, Chi * Contact: lin.chi@hzleaper.com * * * \note */ #if ( !defined(__CyclopsEnums_h_) || defined(GENERATE_ENUM_STRINGS) ) #if (!defined(GENERATE_ENUM_STRINGS)) #define __CyclopsEnums_h_ #endif #include "EnumToString.h" /////////////////////////////// // The enum declaration /////////////////////////////// /*! \brief FilterType used by ImageFilter */ BEGIN_ENUM(FilterType) { /*! Pixels equal to or above the threshold are white, otherwise are black. * Controlled by CustomThreshold or UseAutoThreshold */ DECL_ENUM_ELEMENT(Binarize), /*! Morphology Transformations: Erase small elements and details from given images. * Bottom-hat filtering is the equivalent of subtracting the input image from * the result of performing a morphological closing operation on the input image. * Controlled by KSize */ DECL_ENUM_ELEMENT(BottomHat), /*! Morphology Transformations: Extracts small elements and details from given images. * Top-hat filtering is the equivalent of subtracting the result of performing * a morphological opening operation on the input image from the input image itself. * Controlled by KSize */ DECL_ENUM_ELEMENT(TopHat), /*! Pixels within the lower/upper threshold values is assigned the value of the input pixel, * otherwise, is assigned to the value of lower/upper threshold. * To make the output more uniform. * Controlled by MinValue and MaxValue */ DECL_ENUM_ELEMENT(Clip), /*! Morphology Transformations: Close operation, reduces or completely removes dark areas of the image. * Close operation is a dilation followed by an erosion. * Controlled by KSize */ DECL_ENUM_ELEMENT(Close), /*! Morphology Transformations: Open operation, slightly decreased overall brightness; * removing small amounts of bright pixels and enhancing the remaining bright features * Open operation is an erosion followed by a dilation. * Controlled by KSize */ DECL_ENUM_ELEMENT(Open), /*! Morphology Transformations: Dilate operation * Controlled by KSize */ DECL_ENUM_ELEMENT(Dilate), /*! Morphology Transformations: Erode operation * Controlled by KSize */ DECL_ENUM_ELEMENT(Erode), /*! Morphology Transformations: Gradient operation * Controlled by KSize */ DECL_ENUM_ELEMENT(EdgeMagnitude), /*! Equalizes the histogram of the input gray image. * It will normalizes the brightness and increases the contrast of the image. * Controlled by None */ DECL_ENUM_ELEMENT(Equalize), /*! NOT IMPLEMENTED */ DECL_ENUM_ELEMENT(FillDarkHoles), /*! NOT IMPLEMENTED */ DECL_ENUM_ELEMENT(FillLightHoles), /*! Both vertically and horizontally oriented edges are represented by bright pixels. * Controlled by KSize */ DECL_ENUM_ELEMENT(GradientFull), /*! Horizontally oriented edges are represented by bright pixels. * Controlled by KSize.Width */ DECL_ENUM_ELEMENT(GradientHorizontal), /*! Vertically oriented edges are represented by bright pixels. * Controlled by KSize.Height */ DECL_ENUM_ELEMENT(GradientVertical), /*! Each output pixel represents the difference between the greyscale value of each input pixel and * the threshold level * (for example, if the input pixel value is 100 and the threshold is 25, then the output pixel value will be 75) * Controlled by CustomThreshold or UseAutoThreshold */ DECL_ENUM_ELEMENT(GreyscaleDistance), /*! Edges are enhanced relative to areas with more consistent greyscale gradient * High-pass filtering is the equivalent of subtracting gaussian blur image from input image * Controlled by KSize, if KSize is not set, controlled by Gain */ DECL_ENUM_ELEMENT(HighPass), /*! Edges are enhanced relative to areas with more consistent greyscale gradient * Low-pass filtering is the equivalent of apply gaussian blur on the input image * Controlled by KSize, if KSize is not set, controlled by Gain */ DECL_ENUM_ELEMENT(LowPass), /*! Output image that is a "negative" of the input image * Controlled by KSize, if KSize is not set, controlled by Gain */ DECL_ENUM_ELEMENT(Invert), /*! Each output pixel represents the median pixel value of the pixel values in the kernel neighborhood * Controlled by KSize, if KSize is not set, controlled by Gain */ DECL_ENUM_ELEMENT(LocalMedian), /*! Used to subtract the background from an image. * This filter is the equivalent of subtracting the local median from the input image, shifts the result * right by one, and then adds 128. * Controlled by KSize, if KSize is not set, controlled by Gain */ DECL_ENUM_ELEMENT(LocalMedianNorm), /*! Each output pixel represents the maximum value of TopHat or BottomHat * Controlled by KSize */ DECL_ENUM_ELEMENT(MaxTopOrBottomHat), /*! Reveals the density of objects and features in the input image by measuring the amount of light that * passes through them. Denser objects and features are represented by lighter pixels in the output image. * This filter is the equivalent of 45*(ln(255) - ln(input pixel)) */ DECL_ENUM_ELEMENT(OpticalDensity), /*! Used to enhance the edges. Evaluates the contrast between adjacent pixels, and increases the contrast * when the contrast is high. * Controlled by SmoothValue (Identify the edges) and GainValue (Strength of sharpening) */ DECL_ENUM_ELEMENT(Sharpen), /*! Stretch the pixel value within the minimum and maximum value, others is assigned to 0 or 255 respectively. * For example, if minimum is 100, maximum is 200, pixel is assigned to 0 if its input value is within range (0, 100); * it's assigned to 255 if within range (200, 255); finally, it's assigned (input value)*255/200 if within range (101, 199). * Controlled by MinValue and MaxValue */ DECL_ENUM_ELEMENT(Stretch), /*! Useful fro determine background and foreground. * If the input pixel value is within the minimum and maximum, the output pixel retains its value, otherwise, the output pixel is set to the background level. * If the minimum value is greater than the maximum value, the background is inverted. * Controlled by MinValue and MaxValue and CustomThreshold or UseAutoThreshold */ DECL_ENUM_ELEMENT(ThresholdRange), /*! Extract one channel using the given color space. * The output image will be a gray image represent the extracted channel. * Controlled by ConvertCode and ChannelIndex */ DECL_ENUM_ELEMENT(ChannelExtract), /*! Mixed several channels using the given weights. * The output image will be a gray image represent the mixed result. * Controlled by ChannelWeights */ DECL_ENUM_ELEMENT(ChannelMix), /* Each output pixel represents the mean pixel value of the pixel values in the kernel neighborhood * Controlled by KSize, if KSize is not set, controlled by Gain */ DECL_ENUM_ELEMENT(BoxFilter), /* each output pixel value y = gain * oriValue + offset * Controlled by gain and offset */ DECL_ENUM_ELEMENT(GrayGain), // add new filter type here /*! Custom filter that use the customized kernel definition * Controlled by CustomKernel */ DECL_ENUM_ELEMENT(Custom), }END_ENUM(FilterType) /*! \brief Define threshold type for Binarize, used in Binarize.*/ BEGIN_ENUM(ThresholdType) { /*! Define the custom threshold type */ DECL_ENUM_ELEMENT(Custom), /*! Define the global adaptive threshold type */ DECL_ENUM_ELEMENT(GlobalAdaptive), /*! Define the local adaptive threshold type */ DECL_ENUM_ELEMENT(LocalAdaptive), }END_ENUM(ThresholdType) /*! \brief Specifies the polarity of the edge to be located, according to scan direction of roi. * The detection algorithm will only report edges of the specified polarity */ BEGIN_ENUM2(Polarity) { /*! Specify the edge is from black pixel to white, according to scan direction of roi. */ DECL_ENUM_ELEMENT2_S(Black2White, 0), /*! Specify a black object on white background */ DECL_ENUM_ELEMENT2_S(BlackOnWhite, 0), /*! Specify the edge is from white pixel to black, according to scan direction of roi. */ DECL_ENUM_ELEMENT2_S(White2Black, 1), /*! Specify a white object on black background. */ DECL_ENUM_ELEMENT2_S(WhiteOnBlack, 1), /*! Specify either a black or white object on background with opposite color. Specify the edge polarity could be either black-to-white or white-to-black. */ DECL_ENUM_ELEMENT2_S(Either, 2), }END_ENUM2(Polarity) /*! \brief Specifies the strategy how to select one target from multiple candidates. */ BEGIN_ENUM(FindBy) { /*! Select the one of highest score */ DECL_ENUM_ELEMENT(Best), /*! Select the first one, according to scan direction of roi */ DECL_ENUM_ELEMENT(First), /*! Select the last one, according to scan direction of roi */ DECL_ENUM_ELEMENT(Last), /*! Get all */ DECL_ENUM_ELEMENT(All), }END_ENUM(FindBy) /*! \brief Define shaped roi type for detection, used in DetectRoi */ BEGIN_ENUM(ShapedRoiType) { /*! Reserved for internal usage indicating an invalid value */ DECL_ENUM_ELEMENT(Reserved), /*! Define a rectangle shape */ DECL_ENUM_ELEMENT(Rectangle), /*! Define a polygon shape */ DECL_ENUM_ELEMENT(Polygon), /*! Define a circle shape */ DECL_ENUM_ELEMENT(Circle), /*! Define a annulus shape */ DECL_ENUM_ELEMENT(Annulus), /*! Define a annulus sector shape */ DECL_ENUM_ELEMENT(AnnulusSector), /*! Define a ellipse shape */ DECL_ENUM_ELEMENT(Ellipse), /*! Define a custom mask, zero for excluded pixels */ DECL_ENUM_ELEMENT(Mask), }END_ENUM(ShapedRoiType) /*! \brief Define algorithms used for circle fitting * Refer to Nikolai Chernov's book and code: http://people.cas.uab.edu/~mosya/cl/index.html */ BEGIN_ENUM(CircleFitAlgo) { /*! Algebraic Fit: The simplest and fastest fit, but biased toward smaller circles when an incomplete arc is observed. * Could used to as initial guess for geometric fit. */ DECL_ENUM_ELEMENT(KasaFit), /*! Algebraic Fit: More robust than Kasa fit, but a little slower. * Could used to as initial guess for geometric fit. */ DECL_ENUM_ELEMENT(PrattFit), /*! Algebraic Fit: Similar to Pratt fit, but a bit faster and a bit more accurate. * Perhaps the best algebraic circle fit. Could used to as initial guess for geometric fit. */ DECL_ENUM_ELEMENT(TaubinFit), /*! Geometric Fit: Levenberg-Marquardt fit in the "full" (a,b,R) space. Perhaps the best geometric circle fit. */ DECL_ENUM_ELEMENT(LMFit), /*! Geometric Fit: Chernov-Lesort fit. Designed to converge from any initial guess, but slower that the Levenberg-Marquardt. * Not implemented yet, as not required. */ DECL_ENUM_ELEMENT(CLFit), /*! Geometric Fit: Chernov-Houssam fit. Designed to converge from any initial guess; * Employs numerically stable formulas for large circles. Not implemented yet, as not required. */ DECL_ENUM_ELEMENT(CHFit), } END_ENUM(CircleFitAlgo) /*! \brief Define Normalized method used for scores of peak methods */ BEGIN_ENUM(NormBy) { /*! Normalized by the maximum in the selected region */ DECL_ENUM_ELEMENT(RegionMax), /*! Normalized by the theoretic maximum */ DECL_ENUM_ELEMENT(TheoMax), } END_ENUM(NormBy) /*! \brief Define calibration models, including built-ins and custom */ BEGIN_ENUM(CalibModel) { /*! Use custom, user has to define world position for corresponding object points himself */ DECL_ENUM_ELEMENT(NPoints), /*! Use built-in chessboard */ DECL_ENUM_ELEMENT(Chessboard), /*! Use built-in symmetric circle grid calibration board */ DECL_ENUM_ELEMENT(CircleGrid), /*! Use scalar, user has to define scalar and its corresponding scale factor*/ DECL_ENUM_ELEMENT(Custom), /*! Use distributed Charuco */ DECL_ENUM_ELEMENT(DistCharuco), /*! Use built-in Charuco */ DECL_ENUM_ELEMENT(Charuco) } END_ENUM(CalibModel) /*! \brief Define camera models */ BEGIN_ENUM(CameraModel) { /*! The default normal camera, with slight distortion */ DECL_ENUM_ELEMENT(Normal), /*! The fish-eye camera, with dramatic radial distortion */ DECL_ENUM_ELEMENT(FishEye), /*! A camera with no distortion */ DECL_ENUM_ELEMENT(NoDistort), } END_ENUM(CameraModel) /*! \brief Define distortion models */ BEGIN_ENUM2(DistortionModel) { /*! Default radial(lens are not flat) and tangential(lens and sensor are decentering) distortion model, works for most camera */ DECL_ENUM_ELEMENT2_S(Default, 0x00), /*! Rational radial distortion model, works for "fisheye" camera or if you want very high precision, */ DECL_ENUM_ELEMENT2_S(RationalRadial, 0x01), /*! Thin prism distortion model, works for sensor and lens are not slightly parallel */ DECL_ENUM_ELEMENT2_S(ThinPrism, 0x02), /*! Enable all distortion parameters */ DECL_ENUM_ELEMENT2_S(All, 0x07), } END_ENUM2(DistortionModel) /*! \brief Specify where the pixel position is defined in undistorted image generated by CameraCalibrator */ BEGIN_ENUM(UndistortPixelStage) { /*! It's on the original image */ DECL_ENUM_ELEMENT(Original), /*! It's on the undistorted image */ DECL_ENUM_ELEMENT(Undistorted), /*! It's on the undistorted then transformed image where camera tilt is compensated */ DECL_ENUM_ELEMENT(PerspectiveTransform), } END_ENUM(UndistortPixelStage) /*! \brief Define symbologies (types of barcodes) */ BEGIN_ENUM2(BarCodeType) { /*! Unknown */ DECL_ENUM_ELEMENT2(Unknown, 0x0000000, "Unknown (Internal)"), /*! Popular 1D code: EAN-8 */ DECL_ENUM_ELEMENT2(EAN8, 0x0000001, "EAN-8"), /*! Popular 1D code: UPC-E */ DECL_ENUM_ELEMENT2(UPCE, 0x00000002, "UPC-E"), /*! Popular 1D code: ISBN-10 (from EAN-13) */ DECL_ENUM_ELEMENT2(ISBN10, 0x00000004, "ISBN-10"), /*! Popular 1D code: UPC-A */ DECL_ENUM_ELEMENT2(UPCA, 0x00000008, "UPC-A"), /*! Popular 1D code: EAN-13 */ DECL_ENUM_ELEMENT2(EAN13, 0x00000010, "EAN-13"), /*! Popular 1D code: ISBN-13 (from EAN-13) */ DECL_ENUM_ELEMENT2(ISBN13, 0x00000020, "ISBN-13"), /*! Popular 1D code: EAN/UPC composite */ DECL_ENUM_ELEMENT2(COMPOSITE, 0x00000040, "EAN/UPC"), /*! Popular 1D code: Interleaved 2 of 5 */ DECL_ENUM_ELEMENT2(I25, 0x00000080, "Interleaved 2 of 5"), /*! Popular 1D code: GS1 DataBar (RSS 14) */ DECL_ENUM_ELEMENT2(DataBar, 0x00000100, "DataBar"), /*! Popular 1D code: GS1 DataBar Expanded (RSS Expanded) */ DECL_ENUM_ELEMENT2(DataBarEXP, 0x00000200, "DataBar Expanded"), /*! Popular 1D code: CodaBar */ DECL_ENUM_ELEMENT2(CodaBar, 0x00000400, "CodaBar"), /*! Popular 1D code: Code 39 */ DECL_ENUM_ELEMENT2(Code39, 0x00000800, "Code 39"), /*! Popular 1D code: Code 93 */ DECL_ENUM_ELEMENT2(Code93, 0x00001000, "Code 93"), /*! Popular 1D code: Code 128 */ DECL_ENUM_ELEMENT2(Code128, 0x00002000, "Code 128"), /*! Popular 2D code: QR code */ DECL_ENUM_ELEMENT2(QRCode, 0x00100000, "QR Code"), /*! Popular 2D code: Data Matrix */ DECL_ENUM_ELEMENT2(DataMatrix, 0x00200000, "Data Matrix"), /*! Popular 2D code: PDF 417 */ DECL_ENUM_ELEMENT2(PDF417, 0x00400000, "PDF 417"), /*! 2D code: AZTEC */ /* Per our test, ZXing's Aztec detector doesn't work on skewed image. But rotation is fine. */ DECL_ENUM_ELEMENT2(Aztec, 0x00800000, "Aztec"), /*! 2D code: MaxiCode*/ /*ŁĄZXing in in fact doesn't provided a detector but a recoder, which only takes a "pure" image * -- that is, pure monochrome image which contains only an unrotated, unskewed, image of a code, * with some white border * around it. So this code type only works when you know exactly where it is. */ DECL_ENUM_ELEMENT2(MaxiCode, 0x01000000, "MaxiCode"), /*! Represent all 1D code types */ DECL_ENUM_ELEMENT2(All1D, 0x00003fff, "All 1D Code"), /*! Represent all 2D code types */ DECL_ENUM_ELEMENT2(All2D, 0x01f00000, "All 2D Code"), /*! Represent all code types */ DECL_ENUM_ELEMENT2(All, 0x01f03fff, "All"), } END_ENUM2(BarCodeType) /*! \brief Define the sort mode */ BEGIN_ENUM(SortBy) { /*! no sort */ DECL_ENUM_ELEMENT(None), /*! By x position, left to right */ DECL_ENUM_ELEMENT(LeftToRight), /*! By x position, right to left */ DECL_ENUM_ELEMENT(RightToLeft), /*! By y position, top down */ DECL_ENUM_ELEMENT(TopDown), /*! By y position, down top */ DECL_ENUM_ELEMENT(DownTop), /*! By alphabetical */ DECL_ENUM_ELEMENT(Alphabetical), /*! By length */ DECL_ENUM_ELEMENT(Length), /*! By score */ DECL_ENUM_ELEMENT(Score), /*! By area */ DECL_ENUM_ELEMENT(Area), /*! By width */ DECL_ENUM_ELEMENT(Width), /*! By height */ DECL_ENUM_ELEMENT(Height), /*! By circularity */ DECL_ENUM_ELEMENT(Circularity), /*! By convexity */ DECL_ENUM_ELEMENT(Convexity), /*! By inertia */ DECL_ENUM_ELEMENT(Inertia), /*! By name */ DECL_ENUM_ELEMENT(Name), /*! By date */ DECL_ENUM_ELEMENT(Date), /*! By random */ DECL_ENUM_ELEMENT(Random), } END_ENUM(SortBy) /*! \brief Define filter strategy of blob detection */ BEGIN_ENUM2(BlobFilterMode) { /*! None */ DECL_ENUM_ELEMENT2_S(Reserved, 0), /*! Filter by area */ DECL_ENUM_ELEMENT2_S(Area, 0x01), /*! Filter by perimeter */ DECL_ENUM_ELEMENT2_S(Perimeter, 0x02), /*! Filter by width */ DECL_ENUM_ELEMENT2_S(Width, 0x04), /*! Filter by height */ DECL_ENUM_ELEMENT2_S(Height, 0x08), /*! Filter by circularity */ DECL_ENUM_ELEMENT2_S(Circularity, 0x10), /*! Filter by convexity */ DECL_ENUM_ELEMENT2_S(Convexity, 0x20), /*! Filter by inertia */ DECL_ENUM_ELEMENT2_S(Inertia, 0x40), } END_ENUM2(BlobFilterMode) /*! \brief Define feature descriptor type */ BEGIN_ENUM(FeatureType) { /*! Reserved for uninitialized */ DECL_ENUM_ELEMENT(Reserved), /*! Image feature: ORB (oriented BRIEF) */ DECL_ENUM_ELEMENT(ORB), /*! Image feature: HOG */ DECL_ENUM_ELEMENT(HOG), /*! Image feature: AKAZE */ DECL_ENUM_ELEMENT(AKAZE), /*! Image feature: Pixel-by-pixel */ DECL_ENUM_ELEMENT(PixelByPixel), /*! Image feature: foreground fraction, percentage of foreground pixels */ DECL_ENUM_ELEMENT(FGFraction), /*! Geometric feature: How the sample looks like a circle */ DECL_ENUM_ELEMENT(Circularity), /*! Geometric feature: How the sample looks like a convex hull */ DECL_ENUM_ELEMENT(Convexity), /*! Geometric feature: Difference between the sample and its bounding convex hull */ DECL_ENUM_ELEMENT(ConvexityDefects), /*! Geometric feature: Sin value of orientation of the bonding convex hull of the sample, not rotation-invariant */ DECL_ENUM_ELEMENT(Orientation), /*! Geometric feature: Ratio of convex hull's min axes and max axes, whether the sample is long or like a square */ DECL_ENUM_ELEMENT(Inertia), /*! Geometric feature: How many contours the sample has */ DECL_ENUM_ELEMENT(ContourCount), /*! Geometric feature: How many holes the sample has */ DECL_ENUM_ELEMENT(HoleCount), /*! Size feature: Aspect ratio of sample image */ DECL_ENUM_ELEMENT(AspectRatio), /*! Size feature: Width of sample image */ DECL_ENUM_ELEMENT(Width), /*! Size feature: Height of sample image */ DECL_ENUM_ELEMENT(Height), /*! Size feature: Difference in size between the sample image and uniformed image's sizes */ DECL_ENUM_ELEMENT(ZoomFactor), } END_ENUM(FeatureType) /*! \brief Define machine learning model */ BEGIN_ENUM(MLModel) { /*! Reserved for uninitialized */ DECL_ENUM_ELEMENT(Reserved), /*! Classification model: K-Nearest-Neighbor */ DECL_ENUM_ELEMENT(KNN), /*! Classification model: Support Vector Machine */ DECL_ENUM_ELEMENT(SVM), } END_ENUM(MLModel) /*! \brief Define sampling mode of test */ BEGIN_ENUM(SamplingMode) { /*! Classic n-folds cross validation */ DECL_ENUM_ELEMENT(CrossValidation), /*! Randomly pick fixed percentage of samples as train datasets and remaining as test datasets */ DECL_ENUM_ELEMENT(RandomSampling), /*! Leave-one-out cross validation */ DECL_ENUM_ELEMENT(LeaveOneOut), /*! Test on training dataset */ DECL_ENUM_ELEMENT(TestOnTrain), /*! Test on test dataset */ DECL_ENUM_ELEMENT(TestOnTest), } END_ENUM(SamplingMode) /*! \brief Define out-of-the-box font of OCR */ BEGIN_ENUM2(OCRFont) { /*! Arial, mostly used in printed documents and industrial marking */ DECL_ENUM_ELEMENT2(Arial, 0x0001, "Arial"), /*! Courier, mostly used in printed documents */ DECL_ENUM_ELEMENT2(Courier, 0x0002, "Courier"), /*! Times New Roman, mostly used in printed documents */ DECL_ENUM_ELEMENT2(TNR, 0x0004, "Times New Roman"), /*! MICR, short for Magnetic ink character recognition, mainly used by the banking industry, only digits and symbols */ DECL_ENUM_ELEMENT2(MICR, 0x0008, "MICR"), /*! OCR-A, font designed for OCR, monospaced */ DECL_ENUM_ELEMENT2(OCRA, 0x0010, "OCR-A"), /*! OCR-B, font designed for OCR, monospaced */ DECL_ENUM_ELEMENT2(OCRB, 0x0020, "OCR-B"), /*! SEMI, regular type, used for marking silicon wafers in the semi-conductor industry, monospaced */ DECL_ENUM_ELEMENT2(SEMI, 0x0040, "SEMI"), /*! Special character, such as amp, dollar, etc. */ DECL_ENUM_ELEMENT2(Special, 0x0080, "Special"), /*! Dot-printed 5x7 */ DECL_ENUM_ELEMENT2(Dot5x7, 0x1000, "Dot5x7"), /*! reserved for unknown user-customized normal font */ DECL_ENUM_ELEMENT2(UnknownNormal, 0x0fff, "Unknown Normal"), /*! reserved for unknown user-customized dot-printed font */ DECL_ENUM_ELEMENT2(UnknownDot, 0xf000, "Unknown Dot"), /*! reserved for unknown user-customized font, either normal or dot-printed */ DECL_ENUM_ELEMENT2(Unknown, 0xffff, "Unknown"), } END_ENUM2(OCRFont) /*! \brief Define type of a character */ BEGIN_ENUM2(OCRCharType) { /*! Unknown, type is not defined */ DECL_ENUM_ELEMENT2_S(Unknown, 0xff), /*! Digits, 0 - 9 */ DECL_ENUM_ELEMENT2_S(Digit, 0x01), /*! Upper-case letters */ DECL_ENUM_ELEMENT2_S(UpperCase, 0x02), /*! Lower-case letters */ DECL_ENUM_ELEMENT2_S(LowerCase, 0x04), /*! Digits, or letters */ DECL_ENUM_ELEMENT2_S(Character, 0x0f), /*! Punctuation */ DECL_ENUM_ELEMENT2_S(Punctuation, 0x10), /*! Special characters */ DECL_ENUM_ELEMENT2_S(Special, 0x20), } END_ENUM2(OCRCharType) /*! \brief Define feature types used for OCR */ BEGIN_ENUM2(OCRFeatureTypes) { /*! Gray values of the character */ DECL_ENUM_ELEMENT2(Pixel, 0x00000001, "Pixel"), /*! Gray values of the character with maximum scaling */ DECL_ENUM_ELEMENT2(PixelNorm, 0x00000002, "Pixel (Normalized)"), /*! Binary values of the character */ DECL_ENUM_ELEMENT2(PixelBin, 0x0004, "Pixel (Binary)"), /*! Horizontal projection of the gray values */ DECL_ENUM_ELEMENT2(HProjection, 0x00000008, "Horizontal Projection"), /*! Horizontal projection of the gray values with maximum scaling */ DECL_ENUM_ELEMENT2(HProjectionNorm, 0x00000010, "Horizontal Projection (Normalized)"), /*! Horizontal projection of Binary values of the character, report 1 if more than half of the row are 1 */ DECL_ENUM_ELEMENT2(HProjectionBin, 0x00000020, "Horizontal Projection (Binary)"), /*! Horizontal projection of the gray values */ DECL_ENUM_ELEMENT2(VProjection, 0x00000040, "Vertical Projection"), /*! Vertical projection of the gray values with maximum scaling */ DECL_ENUM_ELEMENT2(VProjectionNorm, 0x00000080, "Vertical Projection (Normalized)"), /*! Vertical projection of Binary values of the character, report 1 if more than half of the row are 1 */ DECL_ENUM_ELEMENT2(VProjectionBin, 0x00000100, "Vertical Projection (Binary)"), /*! Fraction of foreground pixels in entire character image */ DECL_ENUM_ELEMENT2(FGFraction, 0x00000200, "Foreground Fraction"), /*! Fraction of foreground pixels in grid, grid size is auto-selected based on sample image size */ DECL_ENUM_ELEMENT2(FGFractionGrid, 0x00000400, "Foreground Fraction (Grid)"), /*! All pixel-based features */ DECL_ENUM_ELEMENT2(AllPixelFeature, 0x000007ff, "All Pixel-based Features"), /*! How the character looks like a circle */ DECL_ENUM_ELEMENT2(Circularity, 0x00000800, "Circularity"), /*! How the character looks like a convex hull */ DECL_ENUM_ELEMENT2(Convexity, 0x00001000, "Convexity"), /*! Difference between the character and its bounding convex hull */ DECL_ENUM_ELEMENT2(ConvexityDefects, 0x00002000, "Convexity Defects"), /*! Sin value of orientation of the bonding convex hull of the character, not rotation-invariant */ DECL_ENUM_ELEMENT2(Orientation, 0x00004000, "Orientation"), /*! Ratio of convex hull's min axes and max axes, whether the character is long or like a square */ DECL_ENUM_ELEMENT2(Inertia, 0x00008000, "Inertia"), /*! How many components character has */ DECL_ENUM_ELEMENT2(ComponentCount, 0x00010000, "Component Count"), /*! How many holes character has */ DECL_ENUM_ELEMENT2(HoleCount, 0x00020000, "Hole Count"), /*! All geometric features */ DECL_ENUM_ELEMENT2(AllGeomFeature, 0x0003f800, "All Geometric Features"), /*! Aspect ratio of the character */ DECL_ENUM_ELEMENT2(AspectRatio, 0x00040000, "Aspect Ratio"), /*! Width of the character */ DECL_ENUM_ELEMENT2(Width, 0x00080000, "Width"), /*! Height of the character */ DECL_ENUM_ELEMENT2(Height, 0x00100000, "Height"), /*! Difference in size between the character and pattern size */ DECL_ENUM_ELEMENT2(ZoomFactor, 0x00200000, "Zoom Factor"), /*! All size-based features */ DECL_ENUM_ELEMENT2(AllSizeFeature, 0x003c0000, "All Size-based Features"), // add new features above /*! System will optimize the best selection of features based on training sample set */ DECL_ENUM_ELEMENT2(Auto, 0x80000000, "Auto-Selected"), /*! All features */ DECL_ENUM_ELEMENT2(All, 0xffffffff, "All"), } END_ENUM2(OCRFeatureTypes) /*! \brief Define detection mode for dot-print text */ BEGIN_ENUM(DotPrint) { /*! Definitely NOT dot-printed */ DECL_ENUM_ELEMENT(No), /*! Definitely IS dot-printed */ DECL_ENUM_ELEMENT(Yes), /*! Auto detected according to distribution of character candidate's area */ DECL_ENUM_ELEMENT(Auto), } END_ENUM(DotPrint) /*! \brief Define type of contour, either hole or external */ BEGIN_ENUM(ContourType) { /*! External contour */ DECL_ENUM_ELEMENT(External), /*! Hole contour */ DECL_ENUM_ELEMENT(Hole), } END_ENUM(ContourType) #endif // CyclopsEnums_h_