Monday, April 15, 2013

左右交換


Step1:
source code:

Mat screen = new Mat(height, width, CvType.CV_8UC4);
Mat[] s = new Mat[2];
Mat[] cells = new Mat[2];

cells[0] = screen.submat(0, height, 0, width/2);
cells[1] = screen.submat(0, height, width/2, width);
s[0] = src.submat(0, height, 0, width/2);
s[1] = src.submat(0, height, width/2, width);

s[0].copyTo(cells[1]);
s[1].copyTo(cells[0]);

return screen;

Step2: test result:





No comments:

Post a Comment