Skip to content

Instantly share code, notes, and snippets.

@bowbowbow
Last active December 31, 2015 14:55
Show Gist options
  • Save bowbowbow/f5546e490186c0de00e7 to your computer and use it in GitHub Desktop.
Save bowbowbow/f5546e490186c0de00e7 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <math.h>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int main(){
Mat sourceImg =imread("/Users/clsrn1581/Desktop/sample.png", CV_LOAD_IMAGE_GRAYSCALE);
for(int y = 0 ;y < sourceImg.rows; y++){
for(int x = 0; x < sourceImg.cols; x++){
printf("%3d ", (int)sourceImg.at<unsigned char>(y,x));
}
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment