hi @danilo_fme,
This error might appear when your annotation coordinates exceed the extents of the raster (for example, your raster is 100 by 100 pixels, and you place the annotation frame to go from 90th to 102nd pixel).
Did you use the utility that comes with OpenCV (opencv_annotation.exe) or some other method?
Unfortunately, everything involving opencv requires extra attention to every tiny detail - from file encoding to paths to boundaries - a single error leads to a failure with no good error message :(
Dmitri
hi @danilo_fme,
This error might appear when your annotation coordinates exceed the extents of the raster (for example, your raster is 100 by 100 pixels, and you place the annotation frame to go from 90th to 102nd pixel).
Did you use the utility that comes with OpenCV (opencv_annotation.exe) or some other method?
Unfortunately, everything involving opencv requires extra attention to every tiny detail - from file encoding to paths to boundaries - a single error leads to a failure with no good error message :(
Dmitri
Hi @dmitribagh
First - thank you your reply.
My annotations.txt was created using line command and draw option like describe the blog:
C:\apps\FME2019\plugins\opencv\opencv_annotation.exe --annotations="C:\Temp\StopSignDataset\annotations.txt" --images="C:\Temp\StopSignDataset\Positive\" --maxWindowHeight=1000
My annotations:
Thanks your help and time.
Danilo
Hi @danilo_fme,
try using relative paths to images - relative to your annotation file.
For example, if your annotation.txt is in c:\\ROD\\, and images are in c:\\ROD\\Positives\\, use
Positives\\image1.jpg 1 10 10 20 20
instead of
c:\\ROD\\Positives\\image1.jpg 1 10 10 20 20
When you change the annotation file, make sure it stays in the original encoding - OpenCV does not like Unicode. Also delete all the rows with zero images (for example, if you skipped an image while making annotations).
I know, this is a bit (or a lot) confusing, but that's how OpenCV often works, I am sorry about that. And please keep me posted about your progress/struggles, I really want to help you with this.
Dmitri
Hi @danilo_fme,
try using relative paths to images - relative to your annotation file.
For example, if your annotation.txt is in c:\\ROD\\, and images are in c:\\ROD\\Positives\\, use
Positives\\image1.jpg 1 10 10 20 20
instead of
c:\\ROD\\Positives\\image1.jpg 1 10 10 20 20
When you change the annotation file, make sure it stays in the original encoding - OpenCV does not like Unicode. Also delete all the rows with zero images (for example, if you skipped an image while making annotations).
I know, this is a bit (or a lot) confusing, but that's how OpenCV often works, I am sorry about that. And please keep me posted about your progress/struggles, I really want to help you with this.
Dmitri
Hi @dmitribagh,
Thanks your informations. Yours tips were valuable for my case.
I did make the changes in the way of annotation file and is Works now the transformer RasterObjectDetectorSamplePreparer. Very Nice.
Now I'm going to try to works the transformer RasterObjectDetectionModelTrainer
I'll keep you inform my progress.
Thanks,
Danilo
@dmitribagh: I'm dealing with the same issue: I've tried using the kept_-file as well as relative paths in the annotation file. Features are processed correctly, although they are being rejected by the transformer. I'm using geotiff images btw. These should be supported by opencv.
Any ideas?
Kind regards,
Ronny