Giter Site home page Giter Site logo

Comments (15)

lyhoangnam-archway avatar lyhoangnam-archway commented on July 23, 2024 3

Dear @johnd3v !
Can you get your result?
I still waiting for the author...he do not reply my question!

:( :( :(

from opencv-haar-classifier-training.

kapslocker avatar kapslocker commented on July 23, 2024 2

@johnd3v
I hope it's not too late. I had the same issue as you do. It was an OpenCV bug. I was working with a newer version of OpenCV (3.4.1). The code works when I use it with OpenCV version 3.2.0.
No files were generated because a segmentation fault was thrown by opencv_createsamples.
Hope this helps.
The issue can be closed.

from opencv-haar-classifier-training.

saideepthik avatar saideepthik commented on July 23, 2024 1

Dear @johnd3v !
naotoshio seo explained this mechanism in creating samples. how means, vector samples are images which include positives in negative background images.
so, it all depends on your object how complex it is and whether +ve images needed more or -ve images needed more to generate the .vec files.
i got this error many times while creating samples using createsamples.pl file at that time i change the ratio of +ves and -ves then it will work fine.
and one noticeable point is here size also matters because if positive image is having more resolution than -ve image then it cant be impose its features on -ve background. so its good if all images having same size.
but one thing disappointing me is i haven't get exact information on this! till searching for this..........

from opencv-haar-classifier-training.

johnd3v avatar johnd3v commented on July 23, 2024

hi man. what did you do to have vec files in perl bin/createsample.bin. i have try the code yet not creating any file in samples forlder

from opencv-haar-classifier-training.

lyhoangnam-archway avatar lyhoangnam-archway commented on July 23, 2024

Dear @johnd3v !
I do as the guide in this repository:
Step 5

perl bin/createsamples.pl positives.txt negatives.txt samples 1500\
   "opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1\
   -maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 80 -h 40"

Which error occured with you?

from opencv-haar-classifier-training.

johnd3v avatar johnd3v commented on July 23, 2024

@lyhoangnam-archway thanks for the reply.
i got only this sir.
screenshot from 2018-01-22 18-32-32

no file created in sample folder

from opencv-haar-classifier-training.

lyhoangnam-archway avatar lyhoangnam-archway commented on July 23, 2024

Dear @johnd3v !
It did not throw any error, I think that all seem to be done
Try next step(number 6). I think so!

from opencv-haar-classifier-training.

johnd3v avatar johnd3v commented on July 23, 2024

@lyhoangnam-archway thanks for the reply.
i tried step6 yet this is the result.

badly need to create my own classifier for my last year research

from opencv-haar-classifier-training.

saideepthik avatar saideepthik commented on July 23, 2024

@lyhoangnam-archway !
There were 1 params.xml file and 9 stage.xml file
I wonder where is the finished_classifier.xml ?

because classifier achieved the accuracy in training the .vec files at the stage of 9th. please look this image.
classifier

f you want to convert an intermediate haartraining output dir tree data into a xml file, there is a software at the OpenCV/samples/c/convert_cascade.c (that is, in your installation directory). Compile it.
how to compile ? -->> https://www.learnopencv.com/how-to-compile-opencv-sample-code/
so, you can create the cascade.xml file using this command
$ convert_cascade --size="<sample_width>x<sampe_height>" <haartraining_ouput_dir> <ouput_file>
example : convert_cascade --size="20x20" classifier haarcascade.xml

from opencv-haar-classifier-training.

lyhoangnam-archway avatar lyhoangnam-archway commented on July 23, 2024

Dear @saideepthik !
It means that I have to manually merge all stage.xml file to finished_classifier.xml
I think that this tool will do all of this step...

from opencv-haar-classifier-training.

saideepthik avatar saideepthik commented on July 23, 2024

@lyhoangnam-archway
"I have to manually merge all stage.xml file to finished_classifier.xml
I think that this tool will do all of this step...
"
for this, actually say no need to do manually just give less number of stages while training or else give more positives and negatives do same from first step (delete .vec files in samples folder then do) you will get cascade.xml file

from opencv-haar-classifier-training.

arizalzr avatar arizalzr commented on July 23, 2024

i already run

perl bin/createsamples.pl positives.txt negatives.txt samples 1500
"opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1
-maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 80 -h 40"

but there is no sample.vec created, anyone can help me ?

from opencv-haar-classifier-training.

arizalzr avatar arizalzr commented on July 23, 2024

@saideepthik
how to change the image ratio ? can you help my problem ?

from opencv-haar-classifier-training.

saideepthik avatar saideepthik commented on July 23, 2024

@arizalzr
Ratio in the sense increase or decrease the number of input images (positive images and negative images) for the training.
check while testing the image detection whether r u getting more false positives or not, if getting false positives means just take (save as images ) those false positives give as negative images and train the same.
observable thing is sometime u need to give more appropriate positive images (depends on how complicated is your object to be detected) it will give good results.
try u will get...........

from opencv-haar-classifier-training.

arizalzr avatar arizalzr commented on July 23, 2024

@saideepthik
why after run this :

perl bin/createsamples.pl positives.txt negatives.txt samples 1500 "opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1
-maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 80 -h 40"

there is no sample.vec created ? can you help me to solve this ?

from opencv-haar-classifier-training.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.