Ask Your Question
0

Access violation reading location - when I am trying to do a clone(). The exception is in opencv_world300.dll

asked 2016-11-17 07:35:17 -0600

corneliu.cincea gravatar image

When I am trying to make a clone on a matrix an exception is thrown randomly for clone and for flip too. These exceptions are from opencv_world300.dll.image description

cv::Mat matrixDecoded = imdecode(cv::Mat(vectorImageDecoded), cv::IMREAD_UNCHANGED); imageMatrix = matrixDecoded.clone();
cv::flip(imageMatrix, imageMatrix, 0);

Somebody knows why is happening? Thank you.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-11-17 07:56:38 -0600

berak gravatar image

please link your DEBUG build against opencv_world300d.lib (not against the release version)

edit flag offensive delete link more

Comments

Is not working to link with debug version of opencv_world300(I tried, not working). I am developing a c++ nodejs addon an asynchronous addon and this error happens only if I run multiple calls async. Like I said, randomly it happens. I tried to lock with a mutex the clone and flip method from opencv and is working(I didn't see that crash anymore). Do you know why is happening in this way?

corneliu.cincea gravatar imagecorneliu.cincea ( 2016-11-18 01:16:07 -0600 )edit

"I am developing a c++ nodejs addon an asynchronous addon" -- that sounds like a horrible idea already. note, that opencv code is not threadsafe by design.

berak gravatar imageberak ( 2016-11-18 02:01:30 -0600 )edit

Thank you :) .

corneliu.cincea gravatar imagecorneliu.cincea ( 2016-11-18 02:18:27 -0600 )edit

you'll need a lot of mutex/lock things there ...

berak gravatar imageberak ( 2016-11-18 02:20:39 -0600 )edit

Yep :| thanks.

corneliu.cincea gravatar imagecorneliu.cincea ( 2016-11-18 02:24:26 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-11-17 07:35:17 -0600

Seen: 1,752 times

Last updated: Nov 17 '16