recently i'm developing android app using opencv. encounter problem:
imgproc.findcontours(graymat, contours1, new mat(), imgproc.retr_list, imgproc.chain_approx_simple); after function, want call imgproc.matchshapes detect whether 2 images matched. under java edition matchshapes requires parameters of type mat.
how can convert list<matofpoint> mat?
the function use detect contours returns list of matofpoints. each contour - because there can many - has own matofpoints.
you have find way choose contour want use imgproc.matchshapes. if know there's one, use first entry in list<matofpoints>. if want biggest one, use contour properties find biggest contour. if have time, can check every single contour.
then, once you've found single contour want compare, can use matofpoints. according this stackoverflow question, compatible.
Comments
Post a Comment