Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to scan lines vertically?

Hi, Currently im scanning lines in a binary image. The thing is i wanted to scan vertically yet i only found out that the for loop is only scanning it vertically. Here is the example of the code. Is there any way that i could scan the image vertically? I did swap the x and y together with rows and cols but it does not work.

for( int y=0; y< frame_gray.rows; y+=10){
    for (int x=0;x< frame_gray.cols;x+=1){

        if (frame_gray.at<uchar>(y,x)==0)
        {  cout << "0 binary=" << endl;}

        else
        {  cout << "1 binary=" << endl;}
        //waitKey(0);

    }

    cout << "new pixel line" << endl;
}