Beispiel #1
0
 /// <summary>
 /// ChArUco board
 /// </summary>
 /// <param name="squaresX">number of chessboard squares in X direction</param>
 /// <param name="squaresY">number of chessboard squares in Y direction</param>
 /// <param name="squareLength">chessboard square side length (normally in meters)</param>
 /// <param name="markerLength">marker side length (same unit than squareLength)</param>
 /// <param name="dictionary">dictionary of markers indicating the type of markers.</param>
 public CharucoBoard(
     int squaresX, int squaresY,
     float squareLength, float markerLength,
     Dictionary dictionary)
 {
     _ptr = ArucoInvoke.cveCharucoBoardCreate(squaresX, squaresY, squareLength, markerLength, dictionary, ref _boardPtr);
 }
Beispiel #2
0
 /// <summary>
 /// Release the unmanaged resource
 /// </summary>
 protected override void DisposeObject()
 {
     if (_ptr != IntPtr.Zero)
     {
         ArucoInvoke.cveArucoDictionaryRelease(ref _ptr, ref _sharedPtr);
     }
 }
        /// <summary>
        /// Get the detector parameters with default values
        /// </summary>
        /// <returns>The default detector parameters</returns>
        public static DetectorParameters GetDefault()
        {
            DetectorParameters p = new DetectorParameters();

            ArucoInvoke.cveArucoDetectorParametersGetDefault(ref p);
            return(p);
        }
Beispiel #4
0
        /// <summary>
        /// Release the unmanage resource associated with this GridBoard
        /// </summary>
        protected override void DisposeObject()
        {
            if (_ptr != IntPtr.Zero)
            {
                ArucoInvoke.cveArucoGridBoardRelease(ref _ptr);
            }

            _boardPtr = IntPtr.Zero;
        }
Beispiel #5
0
 /// <summary>
 /// Release the unmanaged resource
 /// </summary>
 protected override void DisposeObject()
 {
     if (_predefined)
     {
         //no need to release any object here.
         //The dictionary is static global in C++ code
         _ptr = IntPtr.Zero;
     }
     else
     {
         if (_ptr != IntPtr.Zero)
         {
             ArucoInvoke.cveArucoDictionaryRelease(ref _ptr);
         }
     }
 }
Beispiel #6
0
 /// <summary>
 /// Draw a GridBoard.
 /// </summary>
 /// <param name="outSize">size of the output image in pixels.</param>
 /// <param name="img">output image with the board. The size of this image will be outSize and the board will be on the center, keeping the board proportions.</param>
 /// <param name="margindSize">minimum margins (in pixels) of the board in the output image</param>
 /// <param name="borderBits">width of the marker borders.</param>
 public void Draw(Size outSize, IOutputArray img, int margindSize = 0, int borderBits = 1)
 {
     using (OutputArray oaImg = img.GetOutputArray())
         ArucoInvoke.cveArucoGridBoardDraw(_ptr, ref outSize, oaImg, margindSize, borderBits);
 }
Beispiel #7
0
 /// <summary>
 /// Create a GridBoard object.
 /// </summary>
 /// <param name="markersX">number of markers in X direction</param>
 /// <param name="markersY">number of markers in Y direction</param>
 /// <param name="markerLength">marker side length (normally in meters)</param>
 /// <param name="markerSeparation">separation between two markers (same unit than markerLenght)</param>
 /// <param name="dictionary">dictionary of markers indicating the type of markers. The first markersX*markersY markers in the dictionary are used.</param>
 public GridBoard(int markersX, int markersY, float markerLength, float markerSeparation,
                  Dictionary dictionary)
 {
     _ptr = ArucoInvoke.cveArucoGridBoardCreate(markersX, markersY, markerLength, markerSeparation, dictionary, ref _boardPtr);
 }
Beispiel #8
0
 /// <summary>
 /// Generates a new customizable marker dictionary.
 /// </summary>
 /// <param name="nMarkers">number of markers in the dictionary</param>
 /// <param name="markerSize">number of bits per dimension of each markers</param>
 /// <param name="baseDictionary">Include the markers in this dictionary at the beginning (optional)</param>
 public Dictionary(int nMarkers, int markerSize, Dictionary baseDictionary)
 {
     //_predefined = false;
     _ptr = ArucoInvoke.cveArucoDictionaryCreate2(nMarkers, markerSize, baseDictionary._sharedPtr, ref _sharedPtr);
 }
Beispiel #9
0
 /// <summary>
 /// Create a Dictionary using predefined values
 /// </summary>
 /// <param name="name">The name of the predefined dictionary</param>
 public Dictionary(PredefinedDictionaryName name)
 {
     //_predefined = true;
     _ptr = ArucoInvoke.cveArucoGetPredefinedDictionary(name, ref _sharedPtr);
 }
Beispiel #10
0
 /// <summary>
 /// Create a Dictionary using predefined values
 /// </summary>
 /// <param name="name">The name of the predefined dictionary</param>
 public Dictionary(PredefinedDictionaryName name)
 {
     _ptr = ArucoInvoke.cveArucoGetPredefinedDictionary(name);
 }
Beispiel #11
0
 /// <summary>
 /// Generates a new customizable marker dictionary.
 /// </summary>
 /// <param name="nMarkers">number of markers in the dictionary</param>
 /// <param name="markerSize">number of bits per dimension of each markers</param>
 public Dictionary(int nMarkers, int markerSize)
 {
     _predefined = false;
     _ptr        = ArucoInvoke.cveArucoDictionaryCreate1(nMarkers, markerSize);
 }