Ask Your Question

Priyanka Agarwal's profile - activity

2016-01-14 06:32:50 -0600 received badge  Enthusiast
2016-01-12 06:04:48 -0600 commented question Imgproc.matchTemplate() API returns void. IS there any way to know that a match has been found?

Below is the code: Imgproc.matchTemplate(image, template, result, match_method); Imgproc.threshold(result, result,0.8, 1.0, Imgproc.THRESH_TOZERO);

    //Core.normalize(result, result, 0, 255, Core.NORM_MINMAX, -1, new Mat());
    // Localizing the best match with minMaxLoc
    Core.MinMaxLocResult mmr = Core.minMaxLoc(result);
    Point matchLoc;
    if (match_method == Imgproc.TM_SQDIFF || match_method == Imgproc.TM_SQDIFF_NORMED) {
        matchLoc = mmr.minLoc;
    } else {
        matchLoc = mmr.maxLoc;
    }

    //Rendering the rectangle around the template
    double tolerance = 0.80;
    Point pt2 = new Point(matchLoc.x + template.cols(), matchLoc.y + template.rows());
    Scalar color = new Scalar(0, 255, 0, 255);
    if (mmr.maxVal >= tolerance)
        Imgproc.rectangle(image, matchLoc, pt2, color);
2016-01-12 06:04:13 -0600 commented question Imgproc.matchTemplate() API returns void. IS there any way to know that a match has been found?

I managed drawing the rectangle only when my image is in camera preview, but that is very hard to detect. As well as when I rotate this image nothing happens, is this the correct algorithm to detect an image. The frames per second is 1, which makes it very slow. How can I fix these issues?

2016-01-11 03:08:57 -0600 commented question Imgproc.matchTemplate() API returns void. IS there any way to know that a match has been found?

Hi Steven, I am trying to match a template in camera frame, but even before I bring the template in camera frame , a rectangle is displayed.However, once the template is in camera frame,, then the rectangle is drawn only around the template. So I wanted to draw the rectangle only when template is found. Any suggestion will be of great help.

2016-01-11 01:26:02 -0600 asked a question Imgproc.matchTemplate() API returns void. IS there any way to know that a match has been found?

A rectangle is drawn irrespective of the template found or not. How can I know taht a valid match for the template has been found?

2016-01-06 02:56:37 -0600 commented question How do I generate a good cascade file to detect an image

Thank you so much for the input. All I want is to detect a particular image (similar to ImageTargets in Vuforia SDK). So what would be the correct way to do so. Please suggest, as I am blocked at cascade generation with one positive image only.

2016-01-06 02:34:25 -0600 commented question How do I generate a good cascade file to detect an image

I get it now, I have to have negatives, which can be anything other than my image. What should be the number of negatives when I have only one positive image?

2016-01-06 00:15:48 -0600 commented question How do I generate a good cascade file to detect an image

thank you, but what should I do to detect an image (one particular image), which can be anywhere, on a wall, a desk, a bottle, etc. Then where do I get these negatives from? Any suggestion would be of great help.

2016-01-05 04:30:57 -0600 asked a question How do I generate a good cascade file to detect an image

What value should we use as -numNeg and -numPos. Why are negatives needed at all? For example, When I am trying to detect a particular car image, and not sure about the background,why is negative dataset required? Can I generate a cascade file with no negative images and one car image?

2016-01-05 04:24:58 -0600 commented question I am a beginner in openCV. I want to detect some images, do I need to generate cascade file similar to one present in face detection sample app? What is the correct way?

Hi Berak, I used the below commands to generate one cascade file but card detection is very hard.. 1. Generate positive samples using 1 image – \opencv_createsamples -img car.png -bg bg.txt -info annotations.lst -maxxangle 0.1 -maxyangle 0.1 -maxzangle 0.1
2. Generate vec file from the annotation.lst – \opencv_createsamples -vec car.vec -info annotations.lst -maxxangle 0.1 -maxyangle 0.1 -maxzangle 0.1
3. View the .vec file – \opencv_createsamples -vec car.vec -w 24 -h 24 4. Train the cascade,generate xml – \opencv_traincascade -data carcascade -vec car.vec -bg bg.txt -nstages 10 -minhitrate 0.999 -maxfalsealarm 0.5 -featureType LBP -numPos 100 -numNeg 100 -w 24 -h 24.

2015-12-23 06:53:52 -0600 commented question I am a beginner in openCV. I want to detect some images, do I need to generate cascade file similar to one present in face detection sample app? What is the correct way?

So it means that with one image, I will not be able to generate a good cascade file. How many positive and negative images are actually needed, is there some proportion which I need to maintain?

2015-12-23 06:43:38 -0600 commented question I am a beginner in openCV. I want to detect some images, do I need to generate cascade file similar to one present in face detection sample app? What is the correct way?

I have an image of a company's logo and now I want to detect it. This logo can be present anywhere, on top of any thing. As soon as I get this logo in my camera feed, I want to detect it and mark it.

2015-12-23 06:28:47 -0600 commented question I am a beginner in openCV. I want to detect some images, do I need to generate cascade file similar to one present in face detection sample app? What is the correct way?

Thanks Berak. Yes I am trying with one positive, because my goal is to detect a particular image. Is that not possible with OpenCV?

2015-12-23 06:24:31 -0600 commented question I am a beginner in openCV. I want to detect some images, do I need to generate cascade file similar to one present in face detection sample app? What is the correct way?

I am going through many other links and materials, but any suggestion will be of great help.

2015-12-23 06:23:16 -0600 commented question I am a beginner in openCV. I want to detect some images, do I need to generate cascade file similar to one present in face detection sample app? What is the correct way?

I tried generating a cascade file for detecting a car. I have 500 images in negative folder and one positive image. I used the below commands: 1. opencv_createsamples -img car.png -num 550 -w 48 -h 24 –vec cars.vec 2. 2. opencv_traincascade -data data -vec cars.vec -bg bg.txt -numStages 10 -minhitrate 0.999 -maxfalsealarm 0.1 -featureType LBP -numPos 1 -numNeg 500 -w 48 -h 24 3. I replaced the cascade file in face-detection sample app with this new generated cascade file.

But many false positives gets detected too along with the car. Probably the cascade file which I generated is not correct enough to detect only the car which I supplied as a positive image.

2015-12-23 05:54:51 -0600 commented question I am a beginner in openCV. I want to detect some images, do I need to generate cascade file similar to one present in face detection sample app? What is the correct way?

Thanks for the response Berak. Can you help me get the steps to generate a correct cascade file?

2015-12-23 05:22:50 -0600 asked a question I am a beginner in openCV. I want to detect some images, do I need to generate cascade file similar to one present in face detection sample app? What is the correct way?

I have installed opencv-3.0.0 using the installer from "http://downloads.sourceforge.net/opencvlibrary/opencv-3.0.0.exe". I am running the utilities opencv_createsamples and opencv_traincascade directly after running the installer. Is this the correct way to run the utilities?