Ask Your Question

arash's profile - activity

2020-10-21 07:18:08 -0600 received badge  Notable Question (source)
2019-04-29 05:03:01 -0600 received badge  Popular Question (source)
2018-08-06 22:42:17 -0600 received badge  Famous Question (source)
2017-09-15 12:08:27 -0600 received badge  Student (source)
2017-08-30 02:13:32 -0600 received badge  Notable Question (source)
2017-06-13 11:28:40 -0600 received badge  Popular Question (source)
2016-04-16 11:03:31 -0600 commented answer line scanning for the bar code

if i use int y = cropped.rows/2; Mat line = cropped.row(y);

how can i access to the values ?

2016-04-16 09:24:16 -0600 commented answer line scanning for the bar code

indeed, i have tried this code and the result of this is same as i have illustrated it. and "buf.push_back(Vec3b(*it))" is correct,anyway thank for reply me.

2016-04-16 07:29:56 -0600 asked a question 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++image description ///////////////////////////////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: image description

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.

2016-04-16 04:50:49 -0600 received badge  Enthusiast
2016-04-10 11:49:13 -0600 asked a question gain the four corner point

Hello dears, i would like to gain the coordinates of corers according to the pictures which are my progress in this process,but i could not do it.is it possible to guide me for addressing my challenge. Thank you greatly.image description

2016-04-08 11:54:27 -0600 commented answer how to find coordinates of intersection of lines after using "houghlines"

actually my main question is obtaining the coordinates from the contours,as you told me i used the second one,but unfortunately i do not know how can i solve my problem,i really appreciate. is it possible bring me one example according solution one?

2016-04-08 11:52:33 -0600 received badge  Scholar (source)
2016-04-08 08:51:21 -0600 commented answer how to find coordinates of intersection of lines after using "houghlines"

thank you for your answers, to be quiet honest , i am new one in opencv and image processing. i would like to "wrapaffine" the following picture which i have attached as same as the "card image"

i think the first solution is better for me is it possible for you describe it more ? Thank you.

2016-04-07 10:40:35 -0600 commented answer how to find coordinates of intersection of lines after using "houghlines"

thank you for fast answering,but there is a critical problem and as you can see from the picture there are 7 lines not four lines.Hence, i hanged on it. i just need to know the exact coordinates of largest polygon with each method that you think its fast and easier to do. Indeed, i need the coordinates for going on this code. Thank you.

 Point2f   inputQuad[4];  
 Point2f   outputQaud[4];


outputQaud[0] = Point2f( 0,0 );
    outputQaud[1] = Point2f( cropped.cols,-10);
    outputQaud[2] = Point2f( cropped.cols,cropped.rows);
    outputQaud[3] = Point2f( 0,cropped.rows  );



lambda = getPerspectiveTransform(inputQuad, outputQaud );

     warpPerspective(cropped,output,lambda,output.size() );
2016-04-07 10:31:07 -0600 received badge  Supporter (source)
2016-04-07 10:31:01 -0600 received badge  Critic (source)
2016-04-07 05:09:16 -0600 asked a question how to find coordinates of intersection of lines after using "houghlines"

Hello dears,

image description

As you can see,i would like to find the coordinates of lines,but unfortunately i could not do it. i used this code for drawing the lines:

Canny(result , can , 50 , 200 , 3);
imshow("can",can);
vector<Vec2f> lines;
HoughLines(can,lines ,1,CV_PI/180,75,0,0);
 for( size_t i = 0; i < lines.size(); i++ )  
{  
   float rho = lines[i][0], theta = lines[i][1];  
   Point pt1, pt2;  
   double a = cos(theta), b = sin(theta);  
   double x0 = a*rho, y0 = b*rho;  
   pt1.x = cvRound(x0 + 1000*(-b));  
   pt1.y = cvRound(y0 + 1000*(a));  
   pt2.x = cvRound(x0 - 1000*(-b));  
   pt2.y = cvRound(y0 - 1000*(a));  
   line( can, pt1, pt2, Scalar(255), 2, CV_AA);
 }
cvtColor(can,can,CV_GRAY2RGB);
imshow("cdst",can);

in continue, i do not know how i can find the coordinate.Please help me,thank you.

Best, Arash