OpenCV array error?

I have implemented some code in Code::Blocks regarding color tracking and have succesfully build the project, but everytime I run it this error appears:


Does anybody have a solution to this problem?

DS

sorry, hard to see without the code. can you upload the src? happy to take a look, could be initializing a cv image with w/h of 0, or something like that… - z

sure…

here it is:

main.cpp:
http://www.2shared.com/file/4256023/d4db59ab/main.html

testApp.cpp:
http://www.2shared.com/file/4256032/bac7587c/testApp.html

testApp.h:
http://www.2shared.com/file/4256039/2d1581f4/testApp.html

and here is the CBP-file:
http://www.2shared.com/file/4256064/2ed3090c/ColorTrack.html

I got it from an example that was lying on the forum too…
So i can’t rly find what’s the error…

But I would appreciate your help:) THX

DS

do you have the image that’s loaded in (calder.jpg) in the data folder?

if not these lines mess up:

  
  
calder.loadImage("calder.jpg");  
colorImg.allocate(calder.width,calder.height);  
  

since if it can’t find calder, the width and height of the ofImage is 0, then opencv gets unhappy (and gives the error message you see).

  • zach

Yeah THX alot…that fixed the error :slight_smile: Now it works fine…

DS