Ask Your Question
0

Hi, I Want to ask about Open CV Java

asked 2018-06-03 23:31:03 -0500

Fascal gravatar image

Can I get image crop using opencv java? from browse image i use netbean for developping sorry im very2 new in java

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-06-04 00:48:18 -0500

berak gravatar image

updated 2018-06-04 01:53:59 -0500

you can use one of the submat functions here , e.g.:

Mat orig = Imgcodecs.imread("my.jpg");
if (orig.empty()) { // did it work ? we HAVE to check !
    // error handling
}
Rect roi = new Rect(20,20,60,60);
Mat crop = orig.submat(roi);

and please, bookmark the docs !

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-06-03 23:31:03 -0500

Seen: 52 times

Last updated: Jun 04 '18