/// <summary> /// Raises the destroy event. /// </summary> void OnDestroy() { webCamTextureToMatHelper.Dispose(); if (detector != null) { detector.Dispose(); } }
public static string DecodeQR(string inputImagePath) { Mat inputImage = new Mat(inputImagePath); QRCodeDetector qrDecoder = new QRCodeDetector(); Point2f[] point2Fs; string data = qrDecoder.DetectAndDecode(inputImage, out point2Fs); if (data.Length > 0) { Display(inputImage, point2Fs, inputImagePath); inputImage.Dispose(); qrDecoder.Dispose(); return(data); } else { throw new Exception("QR Not Found"); inputImage.Dispose(); qrDecoder.Dispose(); } }