Ask Your Question
0

Error while running slic.cpp code

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

murtaza-078 gravatar image

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

https://github.com/opencv/opencv_cont...

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

Comments

1

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 -0600 )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.

https://perso.uclouvain.be/allan.barrea/opencv/cmake_config.html

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

https://github.com/opencv/opencv_cont...

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 -0600 )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 -0600 )edit
1

obviously ;) (the error is specific to VS)

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

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-11-11 15:15:45 -0600

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

Comments

1

use it like:

slic -i=some.png
berak gravatar imageberak ( 2018-11-12 01:12:43 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 240 times

Last updated: Nov 11 '18