Created
September 22, 2013 20:02
-
-
Save EvaGL/6663250 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cv.h> | |
#include <highgui.h> | |
int main() { | |
cv::Mat image(200, 200, CV_8UC3); | |
for (int i = 0; i < 200; ++i) | |
for (int j = 0; j < 200; ++j) { | |
image.ptr<unsigned char>(i)[3*j] = j * 255 / 200; | |
image.ptr<unsigned char>(i)[3*j + 2] = j * 255 / 200; | |
} | |
cv::imwrite("circle.jpg", image); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment