Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Error while using OpenCV absdiff on Xamarin Android

MaciejGawelMaciejGawel PLMember
edited April 2016 in Xamarin.Android

I'm trying to use absdiff function in order to implement basic motion detection on android. My code looks following:
public Mat OnCameraFrame(CameraBridgeViewBase.ICvCameraViewFrame inputFrame) { Mat frame = inputFrame.Gray(); if (firstFrame == null) { firstFrame = frame; } else { Mat temp = new Mat(); Core.Absdiff(firstFrame, frame, temp); Imgproc.Threshold(temp, temp, 25, 255, Imgproc.ThreshBinary); return temp; } return frame; }
But in line where Absdiff function is executed I get an error like:
at cv::Mat::create(int, int const*, int)+103 [0x7e7ed304] at cv::_OutputArray::create(int, int const*, int, int, bool, int) const+1064 [0x7e801af1] Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. Fatal signal 11 (SIGSEGV) at 0x77a482e1 (code=2), thread 8967 (Thread-2162)

I'd be grateful for any kind of help, because I'm totally out of ideas. Greets, Maciek

Sign In or Register to comment.