opencv


opencv has triggered a breakpoint Invalid address specified to RtlValidateHeap


I wrote some code in C++ and OpenCV 2.49 in Visual Studio 2013:
cv::Mat mask = Mat::zeros(tmp.size(), CV_8UC1);
modify mask that some elements are zeros and some elements are 255's
cv::vector<cv::vector<cv::Point> > contours;
cv::vector<cv::Vec4i> hierarchy;
cv:findContours(mask, contours, CV_RETR_CCOMP, CV_CHAIN_APPROX_NONE);
cv::imshow("Mask", mask);
When the method ends, following error appears:
Invalid address specified to RtlValidateHeap( 004D0000, 02EBD9D8 )
Project.exe has triggered a breakpoint.
I searched at stackoverflow and other platforms but can't find an answer!
I added the correct opencv path to the "path" environment variable: C:\opencv\build\x86\vc12\bin
and also to the project configurations:
C:\opencv\build\x86\vc12\lib
If I use merge/split from the opencv api it causes the same error, but in this case it is possible to allocate ther vector before going into the method. Then it works. In this case it's not possible to allocate the vector before, because i don't now the size.
I think the problem is that opencv allocates the memory and that's not in the correct heap, but i checked all dll's and paths. Do you have any other ideas?
Thanks in advance!
EDIT:
I replaced the opencv folder with a new downloaded opencv and it works, don't ask me why!
Is the cv::vector declaration valid? You should try std::vector instead of them.
Based on the given code, it is hard to decide what is causing the trouble. Could you provide more details?
Also note that this "function modifies the image while extracting the contours".
You should also check the properties below:
Right click on the Project
Properties - Configurational Properties - General: set Plattform Toolset to Visual Studio 2013 (v120)
Configurational Properties - C/C++ - Code Generation - set Runtime Library:
Multi-threaded Debug DLL (/MDd) for debug builds or Multi-threaded
DLL (/MD) for release build

Related Links

OpenCV error in flann knnmatch
How to mix up a stereo image with EmguCV?
Declare a cv::Mat member in managed c++ class
Calculate focus to map world point on imageplane
Forcing cmake to use a specific OpenCV version
In Javacv cvCreateFileCapture is not able to read the video from the memory
get information from connectedComponentsWithStats in opencv via c++ [duplicate]
What are some good sources for tutorials on structure from motion using OpenCV in Python? [closed]
Kinect Point Cloud To Color Space Transform
OpenCV + OpenGL Using solvePnP camera pose - object is offset from detected marker
opencv Unable to record video from camera to a file
opencv3.2 dnn module error
Why Dense SIFT produces these keypoints?
OpenCV: How to get the GMM co-variance matrix?
Where can I find the full forms of abbreviations used in OpenCV?
Build a Lab color model in opencv

Categories

HOME
uwp
mongodb
wix
codenameone
applet
afp
backand
prebuild
asana
wxpython
redhat
intel-xdk
oracle-adf
r-caret
tin-can-api
jena
clion
wso2ei
executable
oracle-agile-plm
facebook-opengraph
spring-boot-admin
curve-fitting
gitlab-ci-runner
freetype
textmatebundles
man
hough-transform
polynomials
ssms-2014
liferay-aui
editorconfig
clappr
skyscanner
lync
groove
webcenter
aem-6
jdk1.6
spring-data-cassandra
dwm
ecmascript-4
signing
extjs4
mindstorms
google-slides
permgen
hostname
mergesort
mobile-browser
appdynamics
openwebanalytics
federation
domdocument
xssf
attributerouting
mspgcc
autogen
mysql-error-1050
lapply
sizing
post-increment
nuitka
app-engine-ndb
illegalstateexception
tag-helpers
asp.net-authorization
greenfoot
appv
error-log
gevent-socketio
movie
cordova-cli
targetinvocationexception
swift-array
misra
cvs2git
repaint
notifydatasetchanged
bunny
bonecp
custom-titlebar
dfsort
resolver
ioerror
emacs-jedi
adlds
double-precision
guvnor
qbwc
hiphop
mysql-backup
ariatemplates
semantic-zoom
jtemplates
etrade-api
codi
.net-1.1
noaa
polyglot
utility
iphone-sdk-3.1
web-based
sqlprofileprovider

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App