Segmentation fault (core dumped) OpenCV

asked 2016-05-24 06:18:12 -0600

mkorkmaz gravatar image

Hi There!

I am trying to use the OpenCV and SIFT method on ROS. When I try to use the SIFT I get an error "Segmentation fault (core dumped)"

The example code snippet is shown below.

img = cv2.imread("messi5.jpg")
gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
sift = cv2.FeatureDetector_create("SIFT")

If I delete the "sift.detect(gray,None)" line it works, but doesn't answer the purpose of the work.

I tried to find similar SOLVED questions but no success. So, any recommendation?

edit retag flag offensive close merge delete


The recommendation is to post this question here

Did you try to look what is in sift variable?

ROSkinect gravatar image ROSkinect  ( 2016-05-24 09:22:22 -0600 )edit

Actually, I have just put the code snippet related to OpenCV. Indeed, I was gonna use that function in my own code, but I tried to run all code, it failed then tried to run this little example it failed again.

mkorkmaz gravatar image mkorkmaz  ( 2016-05-24 09:57:07 -0600 )edit

So, I have just wanted to learn whether anyone faced such a similar problem. But thanks, I will try to get an answer from there, too.

mkorkmaz gravatar image mkorkmaz  ( 2016-05-24 09:57:55 -0600 )edit

If you are using opencv 3 it might be that SIFT is not included. The maintainers moved it to an extra repository because of the patent on SIFT.

Felix Endres gravatar image Felix Endres  ( 2016-05-25 04:43:57 -0600 )edit

Actually, I use opencv (2.4) which is installed with ros-indigo. Later, I installed ros-indigo-opencv3 package and corrected the code according to the opencv3 requirements, but it did not work again.

mkorkmaz gravatar image mkorkmaz  ( 2016-05-25 05:23:30 -0600 )edit

Hey mkorkmaz, I am facing the same error with the same system configuration. Did you find any solution?

BotLover gravatar image BotLover  ( 2017-07-21 13:11:52 -0600 )edit