Skip to content

Instantly share code, notes, and snippets.

@EvaGL
Created September 22, 2013 20:02
Show Gist options
  • Save EvaGL/6663250 to your computer and use it in GitHub Desktop.
Save EvaGL/6663250 to your computer and use it in GitHub Desktop.
#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