Ask Your Question
0

OpenCV Crash Issue when using in xcode

asked Dec 10 '12

srinu ambati gravatar image

updated Dec 10 '12

I am doing a iOS App to detect the circles and squares in an image . For that I am using the openCV link . When I compile it it is crashing at the this line

  int iheight = 460;
int jwidth = 320;

if( (data[istep+jchannels+0] > 200) && (data[istep+jchannels+1] > 200) && (data[istep+jchannels+2] > 220) )` Please help me , Thanks in advance.

Preview: (hide)

1 answer

Sort by » oldest newest most voted
1

answered Dec 10 '12

bjoernz gravatar image

You need to change

  • for(int i=0;iheight;i=i++) to for(int i=0; i < img->height; i++) and
  • for(int j=0;jwidth;j++) to for(int j=0; j < img->width; j++).

<img-> was incorrectly identified as a HTML tag and because the browser does not understand that tag, it ignores it.

Generally, you should try to understand the source code, that you are trying to compile :-).

BTW: In case of inexplicable crashes:

  1. Assume, you are accessing a resource, that has not been initialized yet.
  2. Prove the assumption to be wrong.
  3. Assume, you are accessing an array beyond its bounds.
  4. Prove the assumption to be wrong.
  5. ...
Preview: (hide)

Comments

Thank you bjoemz. Last doubt is Whatever Image I am passing it is giving the output as square. Please help me . Thanks in advance.

srinu ambati gravatar imagesrinu ambati (Dec 10 '12)edit

Question Tools

Stats

Asked: Dec 10 '12

Seen: 335 times

Last updated: Dec 10 '12