segfault in findcontour

asked 2013-12-12 15:17:47 -0600

samrat gravatar image

Hi, I searched many of answer blogs but didn't help. So I'm here.

I'm trying to get the depth info of a ball on the flight. I'm using openni and opencv2 on ros groovy. I'm getting a weird segmentation fault when I run the node. I'm calculating the center of the ball using cv::findcontour and then largest contour area. If I start the node keeping the ball inside the image frame, I don't get segmentation fault until I move the ball out of the frame. Again, If I start the node keeping the ball out of the frame, I dont get segmentation fault until I bring the ball inside the frame. The node is given in the following link http:codepad.org/wnC4VWu8

Can anybody please help? Thanks in advance.

edit retag flag offensive close merge delete

Comments

It is hard to know the problem without looking to any code. It probably has something to do with performing operations on empty Mat or comparing different type Mat, but those are just possibilities. I'd have to see your code to understand the problem.

Pedro Batista gravatar imagePedro Batista ( 2013-12-17 11:56:57 -0600 )edit