Ask Your Question

Error while running slic.cpp code

asked 2018-11-08 15:17:25 -0500

murtaza-078 gravatar image

i get error while running the sample code provided in opencv-contrib github.

0xC0000005: Access violation reading location 0x00000000.

after my research i found out its def-referencing a pointer.

the exact location of error is line93 in the code stated in link above.

how can i avoid this error??

edit retag flag offensive close merge delete



the error is certainly not in the code (it runs fine elsewhere, and for other folks)

  • any chance you're mixing release and debug libs in your project ?
  • did you build the opencv libs from exactly the same opencv and opencv_contrib version ?
  • don't link to opencv_world !
berak gravatar imageberak ( 2018-11-09 01:08:07 -0500 )edit

Thanks so much for your response.

  • my project does not build for release version even if link libraries properly it gives link error.
  • i downloaded the latest version of opencv and opencv- contrib from github.

    can you recommend the version you have used for your codes.

i used instructions from this website for my building with cmake.

murtaza-078 gravatar imagemurtaza-078 ( 2018-11-09 07:30:51 -0500 )edit

clean your build folder, and try to re-run cmake (with path to opencv_contrib/modules added)

if you get build errors, please show us.

(i've been trying with 3.4 / master yesterday, but it worked fine with all previous versions before)

berak gravatar imageberak ( 2018-11-09 07:44:33 -0500 )edit

okay i will do that. i will get opencv3.4 and opencv_contrib and start everything again. i would like to mention i am using windows.

murtaza-078 gravatar imagemurtaza-078 ( 2018-11-09 08:03:48 -0500 )edit

obviously ;) (the error is specific to VS)

berak gravatar imageberak ( 2018-11-09 08:12:51 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2018-11-11 15:15:45 -0500

murtaza-078 gravatar image

Berak, Thanks for the help my code start working fine after build with exact same release versions of opencv and opencv-contrib. i really appreciate that, i have one last question , when i run the program it enables my camera, i want to do it for jpg images. when i pass the image in command line. it still runs with camera.

how did you run it for images.

edit flag offensive delete link more



use it like:

slic -i=some.png
berak gravatar imageberak ( 2018-11-12 01:12:43 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-11-08 15:17:25 -0500

Seen: 60 times

Last updated: Nov 11 '18