1 | initial version |
change
trunctaed.copyTo(target); // erases all content of target and keeps truncated part only.
to
trunctaed.copyTo(target(cv::Rect(0, 0, 30, 30))); // replace specified rect with truncate.
2 | No.2 Revision |
change
trunctaed.copyTo(target); // erases all content of target and keeps truncated part image only.
to
trunctaed.copyTo(target(cv::Rect(0, 0, 30, 30))); // replace specified rect of target with truncate.
truncate image.
3 | No.3 Revision |
change
trunctaed.copyTo(target); // erases all content of target and keeps truncated image only.
to
trunctaed.copyTo(target(cv::Rect(0, 0, 30, 30))); // replace specified rect of target with truncate image.
above change gives.
4 | No.4 Revision |
change
trunctaed.copyTo(target); // erases all content of target and keeps truncated image only.
to
trunctaed.copyTo(target(cv::Rect(0, 0, 30, 30))); // replace specified rect of target with truncate image.
Highgui.imwrite(PATH6, target); //img_3 result is in target.
above change gives.
5 | No.5 Revision |
change
trunctaed.copyTo(target); // erases all content of target and keeps truncated image only.
to
trunctaed.copyTo(target(cv::Rect(0, 0, 30, 30))); // replace specified rect of target with truncate image.
Highgui.imwrite(PATH6, target); //img_3 result is in target.
above change gives.
Update :
Mat temp = Highgui.imread(PATH5);//img_1
Mat trunctaed = temp.submat(new Rect(0, 0, 30, 30));
Mat target = Highgui.imread(PATH6);//img_2
trunctaed.copyTo(target(cv::Rect(0, 0, 30, 30)));
Highgui.imwrite(PATH6, target); //img_3