Group rectangles for android

asked 2017-05-13 09:34:18 -0600

Hi,

I am working on merging the rectangles and succeded in doing so for CPP side. Below is the implementation I did for cpp.

1) Find the overlapped rectangles(of fixed dimensions) if it satisifies one of my condition . I will push back it to Rectangle Vector( Reactarray variable ).

2) After traversing through the whole image I will have some overalapped rectangle . I pass Reactarray vector to groupRectangles.

Now I want to implement the same thing in Android. Since std::vector is not supported in Android , I am unable to implement in Android. They have given the MatofRect and some methods for implementing the above 2 steps . But I donot know exactly how to use it.

It would be great help if any one could give a example implementation of GroupRectangles problem I am facing.

Thanks in advance

edit retag flag offensive close merge delete

Comments

well, there is groupRectangles in the java api, i guess, the problem is more, building a MatOfRects from you data now, right ?

it probably helps, if you could describe, in what form you have your data now.

berak gravatar imageberak ( 2017-05-14 06:25:01 -0600 )edit
1

Exactly "building a MatOfRects from you data now, right " is my problem. My data is in "Rect" form.

As mentioned earlier while traversing through the entire image my co-ordinates for Rect changes. Now in CPP I was able to maintain the Rect vector and pass it to the groupRectangles .

But in Java how to do the above same like populating the MatofRect for passing to the groupRectangles.

Subarukun gravatar imageSubarukun ( 2017-05-14 23:59:02 -0600 )edit

maybe from a list ?

berak gravatar imageberak ( 2017-05-15 00:15:29 -0600 )edit
1

Yes it is from the list. I was able to do it If anybody need the answer let me know I will post the answer.

Subarukun gravatar imageSubarukun ( 2017-05-15 02:31:37 -0600 )edit

oh, please do so !

berak gravatar imageberak ( 2017-05-15 02:34:10 -0600 )edit