Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 6

Answer by StevenPuttemans for Hi,i'm totally new with OpenCV and i'm starting with the Java version.I'm trying some basics. The first part in the java tutorial was a success. I'm trying the Lena's Face detection. But i've a problem when I'm loading the file :Mat image = Highgui.imread(getClass().getResource("lena.png").getPath()); System.out.println(image.toString()); Console return :Mat [ 0*0*CV_8UC1, isCont=false, isSubmat=false, nativeObj=0x1ffed20, dataAddr=0x0 ] I'm sure the path to the picture is good, if i change it i've a segmentation fault.If someone have a idea...

$
0
0
Like @berak said, the command you use for the path is expecting the lena picture to be added to the resources of your java project. If you don't do that, the code has no idea where to actually get the image data. Relative paths are the way to go as basics! Configuring your project resources is a step further. This guide could help you out : [http://sandeepverma.wordpress.com/2009/11/27/accessing-a-resource-in-java/](http://sandeepverma.wordpress.com/2009/11/27/accessing-a-resource-in-java/)

Viewing all articles
Browse latest Browse all 6

Trending Articles