Invalid OpenCV Description File

When I try to use this command: opencv_createsamples -img image.jpg -bg bg.txt -info /info/info.lst -pngoutput info -num 2600it tells me: Invalid background description file.

Now I tried:

./neg/1.jpg



./net/2.jpg

Does not work.

./neg/1.jpg
./neg/2.jpg

Does not work.

neg/1.jpg
neg/2.jpg

Same problem

neg/1.jpg



neg/2.jpg

Also does not work. Any ideas?? I really need some help. thanks FritzFurtz

0
source share
6 answers

I had the same problem, and I tried many different things (adding full paths to the bg.txt file, converting to UTF-8, ...) - which resulted in slightly different errors - but still to no avail. I follow this guide - and I prepare all the files on my Windows laptop, and then send them to the Ubuntu server.

, (CLRF LF), ( Ubuntu):

$ file bg.txt  
bg.txt: UTF-8 Unicode (with BOM) text, with CRLF line terminators

dos2unix:

$ sudo apt install dos2unix
$ dos2unix bg.txt
dos2unix: converting file bg.txt to Unix format ...
$ file bg.txt
bg.txt: ASCII text

opencv_createsamples .

+5

. bg.txt, . OpenCV Ubuntu . :

git clone https://github.com/Itseez/opencv.git

.

:

opencv_createsamples -img image.jpg -bg bg.txt -info /info/info.lst -pngoutput info -num 1500

, ​​ " ".

, OpenCV .

OpenCV !

+1

, , bg.txt UTF-8. , :

neg/1.jpg
neg/2.jpg
0

, . .

1) CTRL + A ; CTRL + C; , .

2) (, bg2.txt) CTRL + V, , . .

3) , , , bg (-bg bg2.txt).

.

,

0

Linux (Ubuntu) ​​ doe snot. utf-8. "linux" "dos".

0

: 1. . 2. opencv 3.

, , . , ?

, ( 16.04 ubuntu): : neg/cat.117.jpg/ : neg/cat.1597.jpg/ : neg/cat. 208.jpg/ : neg/cat.1586.jpg/ : neg/dog.73.jpg/ .

0
source

Source: https://habr.com/ru/post/1523360/