Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV Android - convert MatOfPoint to Mat

Tags:

android

opencv

I'd like to convert a MatOfPoint found with Imgproc.findContours into a (binary) Mat. I know there's a way to do the reverse conversion (just use the constructor MatOfPoint(Mat m)) but is there a built-in way to do this conversion? If not, what is the correct way to convert element-by-element. Thanks!

like image 312
1'' Avatar asked Nov 23 '25 03:11

1''


1 Answers

You don't need any converters. MatOfPoint is a subclass of Mat:

From OpenCV source:

public class MatOfPoint extends Mat
like image 131
Andrey Kamaev Avatar answered Nov 24 '25 18:11

Andrey Kamaev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!