- I wanted to copy eyeblow region, but copied unexpected region
- I noticed that cropped region is mirrored by green line
- I checked docs
submat(int rowStart, int rowEnd, int colStart, int colEnd) Extracts a rectangular submatrix.
- parameter order is y, y, x, x!
- I wrote like this, and it works!
Mat sub = new Mat(); int xStart = (int)cutRegion.x; int xEnd = (int)cutRegion.y; int yStart = (int)cutRegion.z; int yEnd = (int)cutRegion.w; im.submat(yStart, yEnd, xStart, xEnd).copyTo(sub);
Learning OpenCV 3: Computer Vision in C++ with the OpenCV Library (English Edition)
- 作者: Adrian Kaehler,Gary Bradski
- 出版社/メーカー: O'Reilly Media
- 発売日: 2016/12/14
- メディア: Kindle版
- この商品を含むブログを見る