Beispiel #1
0
 /// <summary>
 /// Release all unmanaged memory associated with the Device.
 /// </summary>
 protected override void DisposeObject()
 {
     if (_ptr != IntPtr.Zero)
     {
         DepthAIInvoke.depthaiDeviceRelease(ref _ptr);
     }
 }
 /// <summary>
 /// Release all unmanaged memory associated with the NNetAndDataPackets.
 /// </summary>
 protected override void DisposeObject()
 {
     if (_ptr != IntPtr.Zero)
     {
         DepthAIInvoke.depthaiNNetAndDataPacketsRelease(ref _ptr);
     }
 }
Beispiel #3
0
 /// <summary>
 /// Release all unmanaged memory associated with the FrameMetadata.
 /// </summary>
 protected override void DisposeObject()
 {
     if (_ptr != IntPtr.Zero)
     {
         DepthAIInvoke.depthaiFrameMetadataRelease(ref _ptr);
     }
 }
Beispiel #4
0
 /// <summary>
 /// Release all unmanaged memory associated with the CNNHostPipeline.
 /// </summary>
 protected override void DisposeObject()
 {
     if (_sharedPtr != IntPtr.Zero)
     {
         DepthAIInvoke.depthaiCNNHostPipelineRelease(ref _sharedPtr);
         _ptr = IntPtr.Zero;
     }
 }
Beispiel #5
0
        /// <summary>
        /// Create a pipeline
        /// </summary>
        /// <param name="jsonConfigStr">The Json configuration string</param>
        /// <returns>The CNNHostPipeline</returns>
        public CNNHostPipeline CreatePipeline(string jsonConfigStr)
        {
            using (CvString csJsonConfigStr = new CvString(jsonConfigStr))
            {
                IntPtr sharedPtr = IntPtr.Zero;

                IntPtr ptr = DepthAIInvoke.depthaiDeviceCreatePipeline(_ptr, csJsonConfigStr, ref sharedPtr);
                return(new CNNHostPipeline(sharedPtr, ptr));
            }
        }
Beispiel #6
0
        public FrameMetadata GetFrameMetadata()
        {
            FrameMetadata metaData = new FrameMetadata();
            bool          success  = DepthAIInvoke.depthaiNNetPacketGetMetadata(_ptr, metaData.Ptr);

            if (success)
            {
                return(metaData);
            }
            else
            {
                metaData.Dispose();
                return(null);
            }
        }
Beispiel #7
0
 /// <summary>
 /// Get the available NNet and data packets
 /// </summary>
 /// <param name="blocking">If true, this will be a blocking function call</param>
 /// <returns>The available NNet and data packets</returns>
 public NNetAndDataPackets GetAvailableNNetAndDataPackets(bool blocking)
 {
     return(new NNetAndDataPackets(
                DepthAIInvoke.depthaiCNNHostPipelineGetAvailableNNetAndDataPackets(_ptr, blocking)));
 }
Beispiel #8
0
 /// <summary>
 /// Create a new device
 /// </summary>
 /// <param name="usbDevice">Usb device</param>
 /// <param name="usb2Mode">If true, will use usb 2 mode</param>
 public Device(String usbDevice, bool usb2Mode = false)
 {
     using (CvString csUsbDevice = new CvString(usbDevice))
         _ptr = DepthAIInvoke.depthaiDeviceCreate(csUsbDevice, usb2Mode);
 }
Beispiel #9
0
 /// <summary>
 /// Create a FrameMetaData object
 /// </summary>
 public FrameMetadata()
 {
     _ptr = DepthAIInvoke.depthaiFrameMetadataCreate();
 }