Functions of OpenCV GPU module
Ejemplo n.º 1
0
 private void ThrowIfNotAvailable()
 {
     if (disposed)
     {
         throw new ObjectDisposedException(GetType().Name);
     }
     if (Cv2Gpu.GetCudaEnabledDeviceCount() < 1)
     {
         throw new OpenCvSharpException("GPU module cannot be used.");
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Checks whether the opencv_gpu*.dll includes CUDA support.
        /// </summary>
        protected void ThrowIfNotAvailable()
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException(GetType().Name);
            }
            if (Cv2Gpu.GetCudaEnabledDeviceCount() < 1)
            {
                throw new OpenCvSharpException("Your OpenCV DLL does not support GPU module.");
            }

            if (!IsGpuCompatible)
            {
                throw new OpenCvSharpException("The selected GPU device is not compatible.");
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates DeviceInfo object for the given GPU
 /// </summary>
 /// <param name="deviceId"></param>
 public DeviceInfo(int deviceId)
 {
     Cv2Gpu.ThrowIfGpuNotAvailable();
     ptr = NativeMethods.cuda_DeviceInfo_new2(deviceId);
 }