Dear all,
In my code I want to
- read in an image from file
- use threshold-operation on that image
access the data from thresholded image, in order to read the pixel values
`// read image source
Mat src = imread("image.png", CV_LOAD_IMAGE_COLOR); if(src.empty()) {
return -1; }cvtColor(src,src,CV_RGB2GRAY);
threshold(src, src, 220, 255, CV_THRESH_BINARY );
int line[1200];
int lineCount = 0;
for(int i=src.rows; i>src.rows/2; i-=10)
{ uchar* rowi = src.ptr(i-1);int columnCount = 0; // begin on the left of the image for(int j=0; j<src.cols; j++) { uchar grayscale = src.at<uchar>(rowi[j]); // write data to array line[columnCount] = grayscale; columnCount++; }`
My Problem: After using the threshold-operation on the image the src::date is " ". What can I do to fix that?
Thanks, Cima