Exemplo n.º 1
0
 /// <summary>
 /// Release the unmanaged memory associated with this object
 /// </summary>
 protected override void DisposeObject()
 {
     if (_sharedPtr != IntPtr.Zero)
     {
         MccInvoke.cveCCheckerDetectorRelease(ref _sharedPtr);
         _ptr = IntPtr.Zero;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Find the ColorCharts in the given image. The found charts are not returned but instead stored in the
 /// detector, these can be accessed later on using BestColorChecker
 /// and GetListColorChecker()
 /// </summary>
 /// <param name="image">Image in color space BGR</param>
 /// <param name="chartType">Type of the chart to detect</param>
 /// <param name="nc">Number of charts in the image, if you don't know the exact then keeping this number high helps.</param>
 /// <param name="useNet">If it is true, the network provided using the setNet() is used for preliminary search for regions where chart
 /// could be present, inside the regionsOfInterest provided.</param>
 /// <param name="p">Parameters of the detection system</param>
 /// <returns>true if at least one chart is detected, otherwise false</returns>
 public bool Process(
     IInputArray image,
     CChecker.TypeChart chartType,
     int nc               = 1,
     bool useNet          = false,
     DetectorParameters p = null
     )
 {
     using (InputArray iaImage = image.GetInputArray())
     {
         return(MccInvoke.cveCCheckerDetectorProcess(
                    _ptr,
                    iaImage,
                    chartType,
                    nc,
                    useNet,
                    p ?? IntPtr.Zero));
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Create a new CCheckerDetector.
 /// </summary>
 public CCheckerDetector()
 {
     _ptr = MccInvoke.cveCCheckerDetectorCreate(ref _algorithmPtr, ref _sharedPtr);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Create a new CChecker
 /// </summary>
 public CChecker()
 {
     _ptr         = MccInvoke.cveCCheckerCreate(ref _sharedPtr);
     _needDispose = true;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Create a new CCheckerDraw object.
 /// </summary>
 /// <param name="cchecker">The checker which will be drawn by this object.</param>
 /// <param name="color">The color by with which the squares of the checker will be drawn</param>
 /// <param name="thickness">The thickness with which the squares will be drawn</param>
 public CCheckerDraw(CChecker cchecker, MCvScalar color, int thickness = 2)
 {
     _ptr = MccInvoke.cveCCheckerDrawCreate(cchecker, ref color, thickness, ref _sharedPtr);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Parameters for the detectMarker process
 /// </summary>
 public DetectorParameters()
 {
     _ptr = MccInvoke.cveCCheckerDetectorParametersCreate();
 }
Exemplo n.º 7
0
 /// <summary>
 /// Set the RGB charts
 /// </summary>
 /// <param name="chartsRgb">The RGB charts</param>
 public void SetChartsRGB(Mat chartsRgb)
 {
     MccInvoke.cveCCheckerSetChartsRGB(_ptr, chartsRgb);
 }