Ask Your Question

Davaaron's profile - activity

2017-11-09 23:47:49 -0600 commented question Train haar cascade using all images

Youre right in both arguments. My idea was to create a robust classifier as using multiple classifiers reduce the perf

2017-11-09 15:39:52 -0600 commented question Train haar cascade using all images

Thanks for your answer. The reason I stick to the outdated 3rd party is that the official documentation doesn't mention

2017-11-09 15:33:00 -0600 commented question Train haar cascade using all images

Thanks for your answer. The reason I stick to the outdated 3rd party is that the official documentation doesn't mention

2017-11-09 12:19:32 -0600 asked a question Train haar cascade using all images

Train haar cascade using all images Hi, I've downloaded and edited a lot of images. Currently I have about 70k face ima

2017-10-14 09:06:05 -0600 answered a question Java Maven Deployment

If anyone is still concerning the same issues like I had, try this Maven dependency which allows a multi-platform soluti

2017-09-27 14:30:43 -0600 asked a question Java Maven Deployment

Java Maven Deployment Hi, I would like to deploy my javafx project with all dependencies, so that the client do not nee

2017-05-30 15:22:00 -0600 commented question Purpose of trained xml file

Ok, I know that. What I really mean is: What's the model containing? I mean what do all these xml-elements stand for? And how does it help to classify inputs?

2017-05-30 05:44:57 -0600 asked a question Purpose of trained xml file

Hi,

I'm dealing with machine learning / deep learning and read a lot about it (how it works, kinds of net structures, kinds of learnings, etc) and read the paper from Paul Viola and Michael Jones whose method is used in OpenCV. But I just couldn't find out what the purpose of the *.xml file is, produced by the OpenCV training.

It contains a lot of training information in the header and, it seems so to me, a lot of random points.

The xml file contains a lot of weak classifiers which are combined to become a strong classifier.

My question, however, is: How does OpenCV use this *.xml file to detect objects?

What are the internal leafs and what's meant by "leaf values"?

I'd appreciate any helpful answer :)

2017-03-20 06:40:53 -0600 commented answer copyTo not working: Java

Hey, thanks for your answer. What about if I want to put some random pixels (or modify the pixels with an algorithm that's not within org.opencv.Core*)?

2017-03-19 18:09:14 -0600 commented question copyTo not working: Java

Why downvoting wihtout comment? This isn't helping anyone ..

2017-03-19 13:58:42 -0600 asked a question copyTo not working: Java

Hi,

I'm retrieving a ROI of mat, want to manipulate its values and put the manipulated matrix back into the original matrix but it's not working, though.. I googled that result together as it seems to be the best documentation, but I'm stuck and don't know why the original matrix won't hold the new values. The code is as follows.

for (int i = 0; i < objectArray.length; i++) {

        Imgproc.rectangle(frame, objectArray[i].tl(), objectArray[i].br(), scalar, 3);
        Mat A = frame.submat(objectArray[i]);
        A.convertTo(A, CvType.CV_64FC3);
        int size = (int) (A.total() * A.channels());
        double[] temp = new double[size]; 
        A.get(0, 0, temp);
        for (int j = 0; j < size; j++)
            temp[j] = (temp[j] / 2);
        A.put(0, 0, temp);
        A.copyTo(frame.submat(objectArray[i]));
    }

where objectArray contains Rectangles, my ROIs and frame is my original Matrix, which is, of course, bigger than A. Can someone help me?

Edit: It's working on every webpage i see. In my case, nothing happens. The rectangular is drawn but thats it. Actually the RIO Image should appear darker, but it doesn't. When I try

A.copyTo(frame)

then the original image/mat has the same size as my ROI, what's definitely not wanted. I also tried applying a mask with the same size as my Matrix 'A', but the image was turned completely black afterwards. Seems like I'm running from one pitfall straight into the other. Would appreciate some help.

2017-03-14 14:50:04 -0600 commented question Createsamples.exe: Error Code -9

Still not working. Why is opencv even that crap and undocumented? Because it's "open source" (yes, in quotes)? I'm delighted..

2017-03-11 20:03:21 -0600 commented question Createsamples.exe: Error Code -9

Thanks for the answer. So let's break this down a bit. The data specified in the annotation text file is "C:\Users\myUsername\Pictures\positive\9336923.1.jpg 1 47 18 121 155". How could the bounding box be outside of the image? So it's obviously that the backslash is the reason. How could I change this now, afterwards? Usually, Windows uses a single backslash as path separator (or escape in programming), but reading from a file won't be a problem for Java, e.g. What about the dot (not for extension) ? Is that a problem, too?

2017-03-11 08:53:34 -0600 received badge  Editor (source)
2017-03-11 08:50:02 -0600 commented answer opencv_createsamples doesn't create samples

I did annotate around 3k images and stored them in file.txt using the specified tool. Running createsamples results now in an error:

Unable to open image: C:\...\Pictures\positive\9336923.1.jpg
OpenCV Error: Unknown error code -9 () in cvSetImageROI, file C:\build\master_winpack-build-win64-vc14\opencv\modules\core\src\array.cpp, line 3021

I opened another issue for that: link text

2017-03-10 15:34:14 -0600 asked a question Createsamples.exe: Error Code -9

Hi there,

as I finished creating my info.txt file containg the absolute paths to the images and the rectangle information of my desired objects to be detected, I just ran

opencv_createsamples.exe -info C:\Software\training\file.txt -vec C:\Software\training\samples.vec -w 20 -h 20

Unfortunaley I get an error code -9, saying:

OpenCV Error: Unknown error code -9 () in cvSetImageROI, file C:\build\master_winpack-build-win64-vc14\opencv\modules\core\src\array.cpp, line 3021

Anyone knows what's that about? Further it says it's not able to open my image, which is in a .jpg format. The funny thing is, that the specified location (C:\build\master_winpack-build-win64-vc14....) doesn't even exist. Not even in the opencv-folder. So is this a mess by opencv (like bad handling of paths)?

I'd be glad about some help. As always, the documentation of opencv doesn't give me any hint about what to do.

2017-03-04 05:01:30 -0600 commented answer Resume annotation tool

Thank you, that should be a possible approach. Didn't think in this way.

2017-03-04 05:00:52 -0600 received badge  Scholar (source)
2017-03-04 05:00:50 -0600 received badge  Supporter (source)
2017-03-04 04:59:39 -0600 received badge  Enthusiast
2017-03-03 21:56:32 -0600 received badge  Student (source)
2017-03-03 19:45:42 -0600 asked a question Resume annotation tool

Hi,

as I got around 6k positive images, is there a possibility to resume the annotation tool? like started where i quit the last time and continue annotating the images? It'd take hours to finish this job...

Thanks in advance.

2017-02-27 15:22:51 -0600 commented question Train own HOG

I see it's for python. I need to use Java tho.. openCV seems to be the only possibility tho... I think I need to expand my knowledge in neural nets if I wanted to train my own SVM, it seems. Unluckily the method names and parameters of opencv SVM aren't chosen happily, but well, I got some research going on.

2017-02-25 11:54:58 -0600 commented question Train own HOG

Thanks for that hint! When searching on the web for HOGDescriptor, I just get results of some C++ code, but no openCV library tool that generates a data file of the result.

When training my own haar and lbp cascades (as the face detection is not so good with the standard XML-Files), the result was pretty disappointing as it detected several other objects than faces (legs, feet, bottles, ..).

I expect HOG to give a better result, right? Do you maybe have a good link for what I'm looking for? (how to use the HOGDescriptor properly)

2017-02-25 09:51:34 -0600 asked a question Train own HOG

Hi,

how to train a HOG in openCV? As I understood it correctly, it's just, besides Haar and LBP, another algorithm that can be used for face detection (and recognitiion). I want to achieve the first, so only face detection. I got around 5000 positive samples and 3000 negative samples.

As I can't find any explanation of how to train a hog, how to generate a SVM and such, I thought I could ask some professionals in here, as the openCV docs is the worst documentation I ever met (I can't win any useable information from there doc, especially when it's about implementation docs like for Java).

So, the concrete questions are:

  1. What to do first after collecting positive and negative pictures?

  2. How to train the HOG? (What is required for training it, how to DO the training and how to save the results [for further training?!])

  3. How to use the HOG in Java?

I'd appreciate some answers :)

Last but not least: I know it's a pretty awkward place to ask, but: isn't there another, better (documented, more efficient, more explained, more intuitive) library for detecing and tracking faces (in Java or Python)?

2017-02-24 15:45:48 -0600 commented question Get values of a Mat object

I'd like to extract "image" (pixel...) values from certain spots of my images to manipulate and store them in a database. After that, I want to replace the old values by the new calculated values and convert the Mat object to a javafx Image again. Yea the thing with pixel. I realized fighting the opencv dev's will mostly goes a bad way.

2017-02-24 13:54:33 -0600 asked a question Get values of a Mat object

Hi guys,

I'm pretty stuck right now. My goal is the following one: JavaFX Image -> Mat -> byte values So I already made it to convert the image to a openCV mat, but I'm confused about the getter and setter methods of the Mat object. I mean, at a specific row and column, let' say X=30 and Y=20, I would get a array back, in all cases, for one value? Like this:

double[] arr = mat.get(j, i);

Why should I even consider to do this? And what's the point behind the getter method "mat.get(int col, int row, byte[] array)? I mean, what's that byte doing there?

Anyways, I want to manipulate specific mat values and I need a byte representation of each value. How would you do this?

I appreciate any help :)

2017-02-01 20:01:04 -0600 asked a question opencv_createsamples doesn't create samples

Hi,

i'm pretty new to openCV and I need it for an university project. As I couldn't found any proper classifier that is capable of detecting side-way faces, I wanted to create my own classifier. What I've already done:

  1. Loaded positive images from a database containg faces and negative images not containing faces
  2. Put all images from positives to positves.txt like find ./positive_images -iname "*.jpg" -or -iname "*.gif" > positives.txt (same way for negatives)
  3. Fired 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"

And thats the problem. No samples are generated. I've read several tutorials but it seems like I don't get it.

Do I need to get a info file? Do I need to draw rectangles around the objects in my positive images? I have like 1500 positive and 800 negative images.

The thing is that the script runs without any error but not even a single sample file is created. What do I miss? I couldn't find any answer out there.. hope anyone of you can help me!

Thanks in advance.

Info: I'm on Linux Mint 18. The output is similar to:

/positive_samples/93-13.jpg -bg tmp -vec -num/positive_samples/93-13.jpg.vec -num 0
Info file name: (NULL)
Img file name: ./positive_samples/93-13.jpg
Vec file name: -num/positive_samples/93-13.jpg.vec
BG  file name: tmp
Num: 0
BG color: 0
BG threshold: 0
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: 80
Height: 40
Max Scale: -1
Create training samples from single image applying distortions...
Done

The field 'Num: 0' is a needle in my eye, as Info file name: (NULL). Could this occur the problem that no samples are generated? What about the script 'createtrainsamples.pl' you can find at github? I mean I want to generate samples for the training. Am I actually using the right script?

I'm desperate..