Giter Site home page Giter Site logo

Comments (4)

mrnugget avatar mrnugget commented on July 3, 2024

Glad you found a solution :)

from opencv-haar-classifier-training.

rajarao47 avatar rajarao47 commented on July 3, 2024

Hello,
I have uploaded 655 positive and 1975 negative pictures. I could generate and merge .vec file.
While executing below command;
opencv_traincascade -data classifier -vec samples.vec -bg negatives.txt -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 1976 -numNeg 655 -w 24 -h 24 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024 -featureType LBP
I am getting following error message:

OpenCV Error: Assertion failed (_img.rows * _img.cols == vecSize) in get, file /build/opencv-SviWsf/opencv-2.4.9.1+dfsg/apps/traincascade/imagestorage.cpp, line 157
terminate called after throwing an instance of 'cv::Exception'
what(): /build/opencv-SviWsf/opencv-2.4.9.1+dfsg/apps/traincascade/imagestorage.cpp:157: error: (-215) _img.rows * _img.cols == vecSize in function get

Aborted (core dumped)

I am using web server with 1Gb RAM and hope this is adequate enough to train the cascade.
I have installed opencv-2.4.9.
Positive image size used is 50 by 50
Negative image size is 100 by 100
pepper_13
neg_02

Please help.

train cascade error

from opencv-haar-classifier-training.

MilindKgp avatar MilindKgp commented on July 3, 2024

@rajarao47
Try changing -w 50 -h 50 in your command.
I encountered a similar problem, changed them to image dimensions and it worked.

from opencv-haar-classifier-training.

jpmoraga avatar jpmoraga commented on July 3, 2024

Hello,

After the opencv_traincascade command I have this error message :
Parameters can not be written, because file classifier/params.xml can not be opened.

I think that the folder have to be created by hand, no ?

[EDIT] I've got it.
I was not using your tool from the default folder.
Despite for mergevec which is creating "samples" folder, opencv_traincascade is not creating "classifier" folder.

Where do you create the classifier folder? In the data folder?

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.