I want to get sub image from input image by using OpenCV in java API. But after I read the doc about OpenCV java API, I can not find the method to do this just like cvGetSubImage(...) in c. Any help or information? Thanks!
解决方案
What you need to do is find a submatrix or ROI in order to select the particular part of your image.
It turns out JavaCV has a nice little method for doing this submat.
This returns a Mat of the selected area. The method definition is:
public Mat submat(int rowStart,
int rowEnd,
int colStart,
int colEnd)
From The Docs
**The operators make a new header for the specified sub-array of *this. They are the most generalized forms of "Mat.row", "Mat.col", "Mat.rowRange", and "Mat.colRange". For example, A(Range(0, 10), Range.all()) is equivalent to A.rowRange(0, 10). Similarly to all of the above, the operators are O(1) operations, that is, no matrix data is copied.