Ask Your Question

Joshitha's profile - activity

2020-04-08 12:50:34 -0600 received badge  Famous Question (source)
2020-02-24 00:46:11 -0600 received badge  Popular Question (source)
2019-10-16 19:29:00 -0600 received badge  Notable Question (source)
2019-02-14 16:42:44 -0600 received badge  Popular Question (source)
2018-03-16 01:58:33 -0600 commented question Bad argument in function cvReleaseData, how to fix the error?

@berak, I have found a solution. please look into the answer as the moderator

2018-03-16 01:58:19 -0600 received badge  Self-Learner (source)
2018-03-16 01:58:16 -0600 marked best answer Bad argument in function cvReleaseData, how to fix the error?

I tried creating samples for my 100 positive images but run into this error:

ERROR

At first I assumed that I had not extracted the same number of samples as I was specifying in the command using Objectmarker.exe but even on rectifying that,I still ran into this error.

Currently I am using 100 positive images , but I got the error when I used 70 images as well.

What exactly is the Bad Argument here and how do I fix it?

TEXT VERSION

PS E:\FYP\dasar_haartrain> .\createsamples.exe -info positive/info.txt -vec vector/vector.vec -num 100000 -w 55 -h 35

Info file name: positive/info.txt

Img file name: (NULL)

Vec file name: vector/vector.vec

BG file name: (NULL)

Num: 100000

BG color: 0

BG threshold: 80

Invert: FALSE

Max intensity deviation: 40

Max x angle: 1.1

Max y angle: 1.1

Max z angle: 0.5

Show samples: FALSE

Width: 55

Height: 35

Create training samples from images collection...

2018-03-16 01:57:39 -0600 answered a question Bad argument in function cvReleaseData, how to fix the error?

I think I have finally resolved this issue. My positive images were named as ' pr(1).bmp, pr(2).bmp, pr(3).bmp' and so

2018-03-13 00:36:57 -0600 received badge  Critic (source)
2018-03-12 10:24:52 -0600 commented answer cv2.VideoCapture : can not read saved videos

yes, tried that, still throwing the error :(

2018-03-12 02:07:56 -0600 answered a question Is it possible to measure distance to object?

I think these papers may be of help to you: Rahman, Ashfaqur, et al. "An image based approach to compute object distanc

2018-03-12 01:45:05 -0600 commented answer cv2.VideoCapture : can not read saved videos

@supra56 , yes my video exists in the same folder and i have also tried giving in the path. The dll files have been plac

2018-03-12 01:41:55 -0600 commented question cv2.VideoCapture : can not read saved videos

@LBerger, I have checked the pat variables and both opencv and python do exist

2018-03-11 12:28:23 -0600 commented answer cv2.VideoCapture : can not read saved videos

tried your code @supra56 , still getting isOpened= False

2018-03-11 12:27:35 -0600 commented answer cv2.VideoCapture : can not read saved videos

tried in your code, still getting isOpened= False

2018-03-11 12:23:12 -0600 commented answer cv2.VideoCapture : can not read saved videos

python 2.7.14 only

2018-03-11 12:16:49 -0600 commented question cv2.VideoCapture : can not read saved videos

Yes i have put them in C:\Python27(where python.exe exists) and C:\Python27\Scripts. Still nothing. can you please elabo

2018-03-11 09:38:45 -0600 commented question cv2.VideoCapture : can not read saved videos

hey @LBerger, still no luck. I copied openh264-1.7.0-win64.dll into C:\Python27 and the file containing video to be read

2018-03-11 09:17:55 -0600 commented question cv2.VideoCapture : can not read saved videos

@berak , i have placed the dll file in the same folder as the video, yet no results

2018-03-11 09:17:37 -0600 edited question cv2.VideoCapture : can not read saved videos

cv2.VideoCapture : can not read saved videos My problem is the same as mentioned in http://answers.opencv.org/question/

2018-03-09 09:28:28 -0600 asked a question cv2.VideoCapture : can not read saved videos

cv2.VideoCapture : can not read saved videos My problem is the same as mentioned in http://answers.opencv.org/question/

2018-03-08 10:44:04 -0600 commented question Bad argument in function cvReleaseData, how to fix the error?

EXACTLY! and the said path does not even exit

2018-03-08 09:47:26 -0600 commented question Bad argument in function cvReleaseData, how to fix the error?

@berak any views?

2018-03-06 04:06:18 -0600 answered a question Are there any ways to generate a HAAR cascade faster?

I found this Blog helpful: Amin Ahmadi But the xml file created at the end of the process does not work with our Pyth

2018-03-06 04:01:54 -0600 answered a question Can someone explain me these terms (acceptanceRatio, HR, FA) in training haar cascade, and "acceptanceRatio 800:4.97153e-05" is it consider good?

The precision of your cascade classifier is determined by your Acceptance Ratio of the last stage. Technically, the acce

2018-03-06 03:51:59 -0600 answered a question Haar Like and Adaboost

Yes, the AdaBoosting algorithm is used for Haar based Classifier training. Essentially we combine weak classifiers int

2018-03-05 21:50:00 -0600 asked a question Bad argument in function cvReleaseData, how to fix the error?

Bad argument in function cvReleaseData, how to fix the error? I tried creating samples for my 100 positive images but ru

2018-03-04 12:07:41 -0600 marked best answer Insufficient memory in function cvAlloc, how to release memory?

I have tried training my own classifier for a couple of times now (to detect cows) and just when I finally fine-tune my images in the positives data-set, I run into this while training: Error

I realize I have to release memory in order to free some space and referred to THIS

But I am actually a little confused as to how to proceed further. Can anyone help with an optimal solution for this so that I can resume my training? Thanks in advance.

Note:

  1. my positives vary from 20-25KB on an average and negatives from 30-55KB.
  2. Positives: 355x 280 pixels, I read somewhere that w,h must maintain this aspect ratio , hence used -w 71 -h 56
  3. Im using 133 positives and 200 negatives, cows in positives all face the left side ( same profile)

EDIT::

text version:

PS E:\FYP\haar training\jo_haartrain> .\haartraining.exe -data cascades -vec vector/vector.vec -bg negative/bg.txt -n pos 67 -nneg 200 -nstages 12 -mem 2000 -mode ALL -w 64 -h 32

Data dir

name: cascades

Vec file name: vector/vector.vec

BG file name: negative/bg.txt

Num pos: 67

Num neg: 200

Num stages: 12

Num splits: 1 (stump as weak classifier)

Mem: 2000 MB

Symmetric: TRUE

Min hit rate: 0.995000

Max false alarm rate: 0.500000

Weight trimming: 0.950000

Equal weights: FALSE

Mode: ALL

Width: 64

Height: 32

Max num of precalculated features: 1309083

Applied boosting algorithm: GAB

Error (valid only for Discrete and Real AdaBoost): misclass

Max number of splits in tree cascade: 0

Min number of positive samples per cluster: 500

Required leaf false alarm rate: 0.000244141

Tree Classifier Stage

+---+ | 0| +---+

Number of features used : 1472939

Parent node: NULL

* 1 cluster *

2018-03-04 11:41:41 -0600 commented question Insufficient memory in function cvAlloc, how to release memory?

edit made @berak when i ran it for -mem 1024 , training continued. This was probably my human mistake, I read that you c

2018-03-04 11:39:07 -0600 received badge  Editor (source)
2018-03-04 11:39:07 -0600 edited question Insufficient memory in function cvAlloc, how to release memory?

Insufficient memory in function cvAlloc, how to release memory? I have tried training my own classifier for a couple of

2018-03-04 11:22:55 -0600 received badge  Enthusiast
2018-03-03 06:04:35 -0600 commented question Insufficient memory in function cvAlloc, how to release memory?

oh no..!!! this means i cant train anything anymore? even if i reduce the number of images, i get the error :(

2018-03-03 05:00:22 -0600 commented question Insufficient memory in function cvAlloc, how to release memory?

@LBerger , no, it is opencv 3.4.0. any idea how i can free up the opencv cache n proceed with my training?

2018-03-02 22:36:26 -0600 commented question Insufficient memory in function cvAlloc, how to release memory?

Yes, Win32/x86, 4GB RAM. I read somewhere that the images are stored during the processing, how do I release this to fee

2018-03-02 13:30:51 -0600 received badge  Student (source)
2018-03-02 11:31:37 -0600 asked a question Insufficient memory in function cvAlloc, how to release memory?

Insufficient memory in function cvAlloc, how to release memory? I have tried training my own classifier for a couple of

2018-03-02 03:39:49 -0600 commented answer Haar-cascade training took very little time and no xml was produced

were you able to create your xml file after that?

2018-02-28 21:31:12 -0600 received badge  Nice Answer (source)
2018-02-28 21:25:39 -0600 received badge  Supporter (source)
2018-02-28 12:13:00 -0600 marked best answer Haar Classifier does not work, only one feature seems to be trained.

II have been trying to use OpenCV to create my own Haar Cascade Classifier to detect cows from images.

  • Number of positive images:83 , size 430x 280 px, .bmp format
  • Number of negative images:200, size 640x480px

My images aren't of that good a quality:

image description

used this to create the samples:

createsamples.exe -info positive/info.txt -vec vector/vector.vec -num 100000 -w 24 -h 24

used this to train:

haartraining.exe -data cascades -vec vector/vector.vec -bg negative/bg.txt -npos 83 -nneg 200 -nstages 18 -mem 2000 -mode ALL -w 24 -h 24

rem -nonsym

And this is a snippet of the training. I realized only one feature is being used (correct me if I am wrong)

Parent node: 6 Chosen number of splits: 0

Total number of splits: 0

Tree Classifier Stage +---+---+---+---+---+---+---+---+ | 0| 1| 2| 3| 4| 5| 6| 7| +---+---+---+---+---+---+---+---+

0---1---2---3---4---5---6---7

Parent node: 7

* 1 cluster * POS: 7 7 1.000000 NEG: 16 1.80409e-005 BACKGROUND PROCESSING TIME: 16.41 Precalculation time: 0.41 +----+----+-+---------+---------+---------+---------+ | N |%SMP|F| ST.THR | HR |
FA | EXP. ERR| +----+----+-+---------+---------+---------+---------+ | 1|100%|-| 0.882353| 1.000000| 0.062500| 0.043478| +----+----+-+---------+---------+---------+---------+ Stage training time: 0.12 Number of used features: 1

Parent node: 7 Chosen number of splits: 0

Total number of splits: 0

Tree Classifier Stage +---+---+---+---+---+---+---+---+---+ | 0| 1| 2| 3| 4| 5| 6| 7| 8| +---+---+---+---+---+---+---+---+---+

0---1---2---3---4---5---6---7---8

It ran upto 8 stages in less than 3mins !

I used this to convert to an xml file:

haarconv.exe cascades myhaar.xml 24 24

My python code uses this xml and can not detect a cow from the positive data set itself. Where am I going here?

2018-02-28 12:11:04 -0600 marked best answer How to use a dpm cascade model xml file in a Python script?

I was wondering if I can use the same code used to run a Haar Cascade xml file , to run the dpm cascade model xml file.

My code looks like this :

import numpy as np

import cv2

cow_cascade = cv2.CascadeClassifier('cow.xml')

img = cv2.imread('Cow3.bmp')

gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

cows = cow_cascade.detectMultiScale(gray, 1.3, 5)

for (x,y,w,h) in cows:

cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)

roi_gray = gray[y:y+h, x:x+w]

roi_color = img[y:y+h, x:x+w]

cv2.imshow('img',img)

cv2.waitKey(0)

cv2.destroyAllWindows()

What are the modifications to be made to use a dpm cascade model xml file ?

2018-02-28 12:01:20 -0600 received badge  Teacher (source)
2018-02-28 11:00:03 -0600 answered a question -w -h in create_samples

I think -w and -h signify the size of the window the Haar algorithm will use to sample the images, from the set of posit

2018-02-28 10:49:21 -0600 commented answer Error while running code that uses Haar Classifier xml: "Incorrect type of self "

I have figured out where I went wrong, this particular error is thrown if an xml file from dpm cascade model is used