Converting Java BufferedImage to OpenCV Mat and vice versa

The code below allows us to convert BufferedImage to Mat (in OpenCV) and vice versa.

This becomes handy when getting images from network or certain other sources:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.