Ask Your Question

Pranav Buradkar's profile - activity

2017-05-17 10:26:33 -0500 received badge  Necromancer (source)
2016-05-20 01:17:37 -0500 received badge  Enthusiast
2016-05-17 04:35:31 -0500 answered a question Receiving Empty OpenCV Mat images in Android NDK JNI.

I think it should be

Mat* mGray = (Mat*) GrayImage;
2016-05-17 04:16:26 -0500 received badge  Editor (source)
2016-05-16 07:45:53 -0500 asked a question How can I detect multiple occurrence of of an object in an Image

Hi I am using JavaCV plugin in Unity for android /ios to detect floorplan.

I want to detect the position of windows, doors and few other objects in the floorplan image. First I used template matching for detection, but later I figured out it wont work if object is placed in different orientation or size of object is mismatched. I am using the device camera to capture the image hence image may get a little skewed hence I abandoned this technique.

So now I am trying to use feature detection but I am not able to get the position of object in the image, also how can it be used for multiple occurrence of the same object. Any help would be appreciated.

Following is the reference image and the highlighted portion shows the windows found using template matching.

image description

2016-05-15 06:26:52 -0500 answered a question matching one template with multiple object with opencv and java for android

The application seems to be crashing because of the infinite loop. As you are looking for new match by Core.minMaxLoc(result) in same result matrix its always returning the first occurrence.

So whenever you found a match you need to remove that match from the result and look for the next match. I removed the match by using filled rectangleCV_FILLED or (-1) in result matrix.

    mmr = Core.minMaxLoc(result);
    matchLoc = mmr.maxLoc;
    if(mmr.maxVal >=0.9)
        Core.rectangle(img, matchLoc, 
            new Point(matchLoc.x + templ.cols(),matchLoc.y + templ.rows()), 
            new    Scalar(0,255,0));
        Core.rectangle(result, matchLoc, 
            new Point(matchLoc.x + templ.cols(),matchLoc.y + templ.rows()), 
            new    Scalar(0,255,0),-1);
        break; //No more results within tolerance, break search