Createsamples.exe: Error Code -9 [closed]
Hi there,
as I finished creating my info.txt file containg the absolute paths to the images and the rectangle information of my desired objects to be detected, I just ran
opencv_createsamples.exe -info C:\Software\training\file.txt -vec C:\Software\training\samples.vec -w 20 -h 20
Unfortunaley I get an error code -9, saying:
OpenCV Error: Unknown error code -9 () in cvSetImageROI, file C:\build\master_winpack-build-win64-vc14\opencv\modules\core\src\array.cpp, line 3021
Anyone knows what's that about? Further it says it's not able to open my image, which is in a .jpg format. The funny thing is, that the specified location (C:\build\master_winpack-build-win64-vc14....) doesn't even exist. Not even in the opencv-folder. So is this a mess by opencv (like bad handling of paths)?
I'd be glad about some help. As always, the documentation of opencv doesn't give me any hint about what to do.
cc @StevenPuttemans
if
cvSetImageROI
give you an error you are probably defining a bounding box that is outside your image region boundaries. Make sure your annotations are actually all within the image dimensions. Second possibility is that the path is incorrect. Third is that your paths are defined by a single backslash, which is an escape char in windows and should be replaced by double backslashes. Also OpenCV cannot handle spaces in image path locations, so avoid that.Thanks for the answer. So let's break this down a bit. The data specified in the annotation text file is "C:\Users\myUsername\Pictures\positive\9336923.1.jpg 1 47 18 121 155". How could the bounding box be outside of the image? So it's obviously that the backslash is the reason. How could I change this now, afterwards? Usually, Windows uses a single backslash as path separator (or escape in programming), but reading from a file won't be a problem for Java, e.g. What about the dot (not for extension) ? Is that a problem, too?
Still not working. Why is opencv even that crap and undocumented? Because it's "open source" (yes, in quotes)? I'm delighted..
Actually your way of reacting is far from helping you... double backslash issues is not related to OpenCV, but to the windows backend, there is no issue at all with this on Linux based systems. That being said, I know of multiple people that are able to use the createsample tool without issue, so it probably is not that crappy ...