QRcodeScanner.cpp
void QRcodeScanner::display(Mat &im, vector<decodedObject> &decodedObjects)
{
  // Loop over all decoded objects
  for(int i = 0; i < decodedObjects.size(); i++)
  {
    vector<Point> points = decodedObjects[i].location;
    vector<Point> hull;
    
    // If the points do not form a quad, find convex hull
    if(points.size() > 4)
      convexHull(points, hull);
    else
      hull = points;
    
    // Number of points in the convex hull
    int n = hull.size();
    
    for(int j = 0; j < n; j++)
    {
      line(im, hull[j], hull[ (j+1) % n], Scalar(255,0,0), 3);
    }
    
  }
  
  // Display results 
  imshow("Results", im);
  waitKey(0);
  
}
// Display barcode and QR code location  
Display barcode and QR code location
Display barcode and QR code location
void QRcodeScanner::display(Mat &im, vector<decodedObject> &decodedObjects)
{
  for(int i = 0; i < decodedObjects.size(); i++)
  {
    vector<Point> points = decodedObjects[i].location;
    vector<Point> hull;
    if(points.size() > 4)
      convexHull(points, hull);
    else
      hull = points;
    int n = hull.size();
    for(int j = 0; j < n; j++)
    {
      line(im, hull[j], hull[ (j+1) % n], Scalar(255,0,0), 3);
    }
  }
  imshow("Results", im);
  waitKey(0);
}
void QRcodeScanner :: display ( Mat & im , vector < decodedObject > & decodedObjects ) { for ( int i = 0 ; i < decodedObjects . size ( ) ; i ++ ) { vector < Point > points = decodedObjects [ i ] . location ; vector < Point > hull ; if ( points . size ( ) > 4 ) convexHull ( points , hull ) ; else hull = points ; int n = hull . size ( ) ; for ( int j = 0 ; j < n ; j ++ ) { line ( im , hull [ j ] , hull [ ( j + 1 ) % n ] , Scalar ( 255 , 0 , 0 ) , 3 ) ; } } imshow ( " " , im ) ; waitKey ( 0 ) ; }
Display barcode and QR code location
Display barcode and QR code location
// Loop over all decoded objects // If the points do not form a quad, find convex hull // Number of points in the convex hull // Display results 