0

using SharpCV, i want get contours list but get errror System.Runtime.InteropServices.SEHException: "External component has thrown an exception."

        var image = cv2.imread("b8ddbd62baa067f41dd8e821141ad835.jpg");
        var gray = cv2.cvtColor(image, ColorConversionCodes.COLOR_BGR2GRAY);
        var (ret, thresh) = cv2.threshold(gray, 127, 255, ThresholdTypes.THRESH_OTSU);
        var (contours, hierarchy) = cv2.findContours(thresh, RetrievalModes.RETR_EXTERNAL, ContourApproximationModes.CHAIN_APPROX_SIMPLE);

what i doing wrong ?

Domestos
  • 29
  • 5
  • i using SharpCV – Domestos Dec 26 '21 at 15:49
  • 1
    *Kindly see this* https://stackoverflow.com/questions/1313853/how-should-you-diagnose-the-error-sehexception-external-component-has-thrown-a – Shafin Junayed Dec 26 '21 at 16:04
  • i using try catch get error: system.AccessViolationException: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." – Domestos Dec 26 '21 at 16:22
  • 2
    that's not enough info. there needs to be more info. possibly this indicates a violated assertion, and the assertion uses an intentional access violation to stop the program? talk to the developers of SharpCV. it is *their* responsibility to deliver usable error messages. this isn't a usable error message... sharpCV appears to be **unmaintained** and generally has no user base. -- beyond that, *debug* your code, meaning single-step through it and **look at** the variables' values. – Christoph Rackwitz Dec 26 '21 at 17:19

0 Answers0