#include <opencv\cv.h>
#include <opencv\highgui.h>
#include <iostream>
using namespace cv;
using namespace std;
int main()
{
	Mat frame = imread("3A4.bmp"); // cols*rows = 630*891
	int nc = frame.channels();
	
	int nWidthOfROI = 90;
	for (int j=0;j<frame.rows;j++)
	{
		uchar* data= frame.ptr<uchar>(j);
		for(int i=0;i<frame.cols*nc;i+=nc)
		{			
			if( (i/nc/nWidthOfROI + j/nWidthOfROI) % 2)
			{
				// bgr
				data[i/nc*nc + 0] = 255 ;
				data[i/nc*nc + 1] = 255 ;
				data[i/nc*nc + 2] = 255 ;				
			}
		}
	}
	imshow("test",frame);
	waitKey(0);
	return 0;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文:http://blog.csdn.net/lonelyrains/article/details/46874723