line scanning for the bar code
Hello dears, These days, I am working on reading bar code as a projects for school, since I do not have enough experience and familiarity with Opencv , I have been hanged on this projects ,but of course I did some thing to do. Briefly, I would like to create one scan line class in opencv with c++ ///////////////////////////////code //////////////////////////////
Mat cropped;
cvtColor(cropped_rgb,cropped,CV_RGB2GRAY);
// cout <<"cols " <<cropped.cols<< "\n" << "rows" << cropped.rows/2 << "\n" << cropped.size()<< endl;
LineIterator it(cropped,Point(0,cropped.rows/2),Point(cropped.cols,cropped.rows/2),8,false);
vector<Point> points(it.count);
vector<Vec3b> buf;
for(int i=0; i<it.count; i++)
{
buf.push_back( Vec3b(*it) );
it++;
}
cerr << Mat(buf) << endl;
line(cropped,Point(0,cropped.rows/2),Point(cropped.cols,cropped.rows/2),Scalar(255),1);
imshow( "cropped", cropped );
the result:
as you can see my problem is here,there is <Vec3b>
which is not desirable for me,just the values has been put inside the box are very important to me.
So,is it possible guide me and tell me,how i should catch these values ????really appreciate it.
happy decoding !