Group rectangles for android
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
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.
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.
maybe from a list ?
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.
oh, please do so !