Ask Your Question

biagio montesano's profile - activity

2016-12-07 02:43:50 -0500 commented answer Documentation for opencv_annotation

yes, that's what I was thinking. a nice improvement would be to resize each rectangle after drawing it on image, before pressing C to confirm it. in fact, it's not easy to crop image with rectangle at first attempt. using dragable corners to size properly area of interest, would make things easier. do you think it may possible?

thanks for your patience and support.

2016-12-05 09:43:15 -0500 commented answer Documentation for opencv_annotation

one more question: if I stop the process, by pressing ESC, after labelling N images and restart it, does it begin again from first image or does it continue from image N+1?

2016-12-05 09:14:30 -0500 commented answer Documentation for opencv_annotation

thanks a lot, it worked. I see you've added a revision to your original post, I'm glad of having been useful with my question :))))) thanks again.

2016-12-03 10:58:47 -0500 commented answer Documentation for opencv_annotation

folder exists, of course and has right name

2016-12-03 10:57:53 -0500 commented answer Documentation for opencv_annotation

hi. I wrote the following code:

#include "cmd_utils.h"
#include <iostream>

#define PICS_PATH "/home/biagio/Documenti/wise_robotics/annotations/build/data/image_folder/"
//#define PICS_PATH "/data/pics/"
#define ANNOTATIONS_PATH "/home/biagio/Documenti/wise_robotics/annotations/build/data/annotations.txt"
//#define ANNOTATIONS_PATH "/data/annotations.txt"
#define ANNOTATIONS_CMD "opencv_annotation -images " PICS_PATH " -annotations " ANNOTATIONS_PATH

using namespace std;

int main()
{
    //remove(ANNOTATIONS_PATH);

    execute_command(ANNOTATIONS_CMD);
}

I used the same structure for /data, a local folder. absolute paths seem correct but I get

The image folder given does not exist.

why so?

2016-12-03 05:18:41 -0500 commented question A Haar classifier for trees in satellite image: how to generate positive samples?

I have two problems:

  • no dataset available
  • I need an automatic procedure to extract samples (positive or negative) from an image just downloaded from Bing

thus, I take every image and generate 80 samples (in average) by moving a fixed window along image itself. Finally, I label each window as positive or negative.

2016-12-03 05:02:06 -0500 commented question A Haar classifier for trees in satellite image: how to generate positive samples?

thanks for your answer. actually, the images I included in post are not the output of any cropping operation. they are just two samples that I labelled as positive, since they contain a tree for the greatest part of its surface in image.

what worries me is the greatest variance across trees' shapes: just considering Rome's case, you can encounter maritime pines, cypresses (which appear as small spots when seen from above), oaks... do you agree with me in saying that this variance could be a problem?

would you propose any other path to a tree detector, apart from Haar classifier?

thanks

2016-12-03 04:28:33 -0500 commented question A Haar classifier for trees in satellite image: how to generate positive samples?

yes, sure. I've edited post adding three examples of positive samples: 1. a tree completely contained in square 2. a tree comprised in an agglomerate 3. a tree completely contained in square, with pieces of roofs and streets

2016-12-02 13:47:49 -0500 received badge  Editor (source)
2016-12-02 13:18:51 -0500 asked a question A Haar classifier for trees in satellite image: how to generate positive samples?

Hello everyone.

I'm trying to train a Haar classifier for detecting trees in satellite images. While it's almost easy to generate negative samples (it's sufficient to cut parts containing streets or buildings without any tree), I find it difficult to generate positive samples.

I've read (in this forum, too) that I should crop positive sample containing only desired object (a tree, in my case); anyway, it's hard to obtain this result with satellite images since:

  • images are downloaded from Bing with different levels of zoom, thus cutting trees produces samples with different sizes
  • because of the fact satellite images include aerial landscapes of cities, when I cut a tree it's not possible to isolate it from background containing pieces of strees or parts of other trees (this happens when there's an agglomerate of trees, as in parks or small green areas).

I've tried to generate a certain number of random square samples from satellite image. I've chosen size of squares in order to contain, in average, a tree almost completely. Then, I parsed samples one by one, separating them in negative and positive sets. I've stated that a sample is positive if it contains at least a tree at 70% of its surface, by visual inspection. Anyway, detection results are awful.

My questions are;

  • can I skip the request of having positives sample with same ratio?
  • how can I generate, correctly, positive samples to train classifier correctly to detect trees?

I even tried to browse web to look for a dataset of trees extracted from satellite images, but I haven't found anyone. Can you suggest one?

Thanks for support.

EDIT: Here are some examples of positive samples (80x80 pixels) I've used

image description image description image description

2016-11-29 11:26:24 -0500 commented answer Cascade Training: killed and bad_alloc

I'm using some C++ code to generate opencv_train_cascade command

opencv_traincascade -data classifier -vec samples.vec -bg negatives.txt -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 400 -numNeg 961 -w 80 -h 80 -mode ALL -precalcValBufSize 2048 -precalcIdxBufSize 2048

I get the "Killed error" and I tried to add -nonsym -mem 512, but I got

'C++ basic_string::_M_construct null not valid

It seems that such option is not accepted in training command (I haven't found it on official page, indeed). Any suggestion? thanks