Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

crack detect red line opencv

i want to make a decision making process of detection of biscuit crack so i used the hough transform for detection of crack. here is the code. It means counting the red pixels,if present then say as crack and if not present say no crack simply. One more thing i want to measure the size of my biscuit.

Mat src = imread("/home/pi/Desktop/pics/grey.jpg");

Mat dst, cdst,pic;


 Canny(src, dst, 30, 160, 3);
cvtColor(dst, pic, CV_GRAY2BGR);
imwrite("/home/pi/Desktop/pics/bisgry.jpg",pic);
// imshow("source",pic);
cdst=~pic;


vector<Vec2f> lines;
HoughLines(dst, lines, 1, CV_PI/180,33 ,1, 1 );

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( cdst, pt1, pt2, Scalar(0,0,255), 3, CV_AA);
}

  /*vector<Vec4i> lines;
  HoughLinesP(dst, lines, 1, CV_PI/180, 50, 50, 10 );
  for( size_t i = 0; i < lines.size(); i++ )
  {
  Vec4i l = lines[i];
   line( cdst, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(0,0,255), 3, CV_AA);
   }*/

 [enter image description here][1] imshow("source", src);
 imshow("source1",pic);
imshow("detected lines", cdst);
imwrite("/home/pi/Desktop/pics/cracked.jpg",cdst);

waitKey(); image description

crack detect red line opencv

i want to make a decision making process of detection of biscuit crack so i used the hough transform for detection of crack. here is the code. It means counting the red pixels,if present then say as crack and if not present say no crack simply. One more thing i want to measure the size of my biscuit.

Mat src = imread("/home/pi/Desktop/pics/grey.jpg");

Mat dst, cdst,pic;


 Canny(src, dst, 30, 160, 3);
cvtColor(dst, pic, CV_GRAY2BGR);
imwrite("/home/pi/Desktop/pics/bisgry.jpg",pic);
// imshow("source",pic);
cdst=~pic;


vector<Vec2f> lines;
HoughLines(dst, lines, 1, CV_PI/180,33 ,1, 1 );

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( cdst, pt1, pt2, Scalar(0,0,255), 3, CV_AA);
}

  /*vector<Vec4i> lines;
  HoughLinesP(dst, lines, 1, CV_PI/180, 50, 50, 10 );
  for( size_t i = 0; i < lines.size(); i++ )
  {
  Vec4i l = lines[i];
   line( cdst, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(0,0,255), 3, CV_AA);
   }*/

 [enter image description here][1] imshow("source", src);
 imshow("source1",pic);
imshow("detected lines", cdst);
imwrite("/home/pi/Desktop/pics/cracked.jpg",cdst);

waitKey(); image description image description

click to hide/show revision 3
retagged

crack detect red line opencv

i want to make a decision making process of detection of biscuit crack so i used the hough transform for detection of crack. here is the code. It means counting the red pixels,if present then say as crack and if not present say no crack simply. One more thing i want to measure the size of my biscuit.

Mat src = imread("/home/pi/Desktop/pics/grey.jpg");

Mat dst, cdst,pic;


 Canny(src, dst, 30, 160, 3);
cvtColor(dst, pic, CV_GRAY2BGR);
imwrite("/home/pi/Desktop/pics/bisgry.jpg",pic);
// imshow("source",pic);
cdst=~pic;


vector<Vec2f> lines;
HoughLines(dst, lines, 1, CV_PI/180,33 ,1, 1 );

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( cdst, pt1, pt2, Scalar(0,0,255), 3, CV_AA);
}

  /*vector<Vec4i> lines;
  HoughLinesP(dst, lines, 1, CV_PI/180, 50, 50, 10 );
  for( size_t i = 0; i < lines.size(); i++ )
  {
  Vec4i l = lines[i];
   line( cdst, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(0,0,255), 3, CV_AA);
   }*/

 [enter image description here][1] imshow("source", src);
 imshow("source1",pic);
imshow("detected lines", cdst);
imwrite("/home/pi/Desktop/pics/cracked.jpg",cdst);

waitKey(); image description image description

crack detect red line opencv

i want to make a decision making process of detection of biscuit crack so i used the hough transform for detection of crack. here is the code. It means counting the red pixels,if present then say as crack and if not present say no crack simply. One more thing i want to measure the size of my biscuit.

Mat src = imread("/home/pi/Desktop/pics/grey.jpg");

Mat dst, cdst,pic;


 Canny(src, dst, 30, 160, 3);
cvtColor(dst, pic, CV_GRAY2BGR);
imwrite("/home/pi/Desktop/pics/bisgry.jpg",pic);
// imshow("source",pic);
cdst=~pic;


vector<Vec2f> lines;
HoughLines(dst, lines, 1, CV_PI/180,33 ,1, 1 );

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( cdst, pt1, pt2, Scalar(0,0,255), 3, CV_AA);
}

  /*vector<Vec4i> lines;
  HoughLinesP(dst, lines, 1, CV_PI/180, 50, 50, 10 );
  for( size_t i = 0; i < lines.size(); i++ )
  {
  Vec4i l = lines[i];
   line( cdst, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(0,0,255), 3, CV_AA);
   }*/

 [enter image description here][1] imshow("source", src);
 imshow("source1",pic);
imshow("detected lines", cdst);
imwrite("/home/pi/Desktop/pics/cracked.jpg",cdst);

waitKey(); image description image description

@pklab there are the error sir i added headers imgproc.h,highgui.h,opencv2.h

pi@raspberrypi:~/Desktop $ g++ -ggdb `pkg-config --cflags --libs opencv` blob.cpp -o bolb
blob.cpp:12:5: error: ‘Point2d’ does not name a type
 Point2d center;
 ^
 blob.cpp:13:5: error: ‘RotatedRect’ does not name a type
 RotatedRect rr;
 ^
  blob.cpp:15:24: error: ‘vector’ does not name a type
 contourStats(const vector<Point> &contour)
                    ^
  blob.cpp:15:30: error: expected ‘,’ or ‘...’ before ‘<’ token
 contourStats(const vector<Point> &contour)
                          ^
  blob.cpp:19:31: error: ‘vector’ does not name a type
 void calculateStats(const vector<Point> &contour)
                           ^


 blob.cpp:19:37: error: expected ‘,’ or ‘...’ before ‘<’ token
 void calculateStats(const vector<Point> &contour)
                                 ^
  blob.cpp:40:27: error: ‘string’ does not name a type
  void printStats(const string &title)
                       ^
   blob.cpp: In constructor ‘contourStats::contourStats(int)’:
    blob.cpp:17:24: error: ‘contour’ was not declared in this scope
     calculateStats(contour);
                    ^
     blob.cpp: In member function ‘void contourStats::calculateStats(int)’:
      blob.cpp:21:9: error: ‘Moments’ was not declared in this scope
     Moments m = cv::moments(contour, true);
     ^
     blob.cpp:21:9: note: suggested alternative:
     In file included from blob.cpp:2:0:
    /usr/local/include/opencv2/imgproc/imgproc.hpp:1094:24: note:   ‘cv::Moments’
    class CV_EXPORTS_W_MAP Moments
                    ^
     blob.cpp:22:16: error: ‘m’ was not declared in this scope
     area = m.m00;
            ^
       blob.cpp:23:9: error: ‘center’ was not declared in this scope
      center = Point2f(-1, -1);
     ^
    blob.cpp:23:32: error: ‘Point2f’ was not declared in this scope
     center = Point2f(-1, -1);
                            ^
    blob.cpp:23:32: note: suggested alternative:
     In file included from /usr/local/include/opencv2/highgui/highgui.hpp:46:0,
             from blob.cpp:1:
    /usr/local/include/opencv2/core/core.hpp:891:23: note:   ‘cv::Point2f’
     typedef Point_<float> Point2f;
                   ^
     blob.cpp:32:9: error: ‘rr’ was not declared in this scope
     rr = minAreaRect(contour);
     ^
     blob.cpp:32:26: error: ‘contour’ was not declared in this scope
     rr = minAreaRect(contour);
                      ^
     blob.cpp:32:33: error: ‘minAreaRect’ was not declared in this scope
     rr = minAreaRect(contour);
                             ^
    blob.cpp:32:33: note: suggested alternative:
     In file included from blob.cpp:2:0:
     /usr/local/include/opencv2/imgproc/imgproc.hpp:1176:26: note:   ‘cv::minAreaRect’


crack detect red line opencv

i want to make a decision making process of detection of biscuit crack so i used the hough transform for detection of crack. here is the code. It means counting the red pixels,if present then say as crack and if not present say no crack simply. One more thing i want to measure the size of my biscuit.

Mat src = imread("/home/pi/Desktop/pics/grey.jpg");

Mat dst, cdst,pic;


 Canny(src, dst, 30, 160, 3);
cvtColor(dst, pic, CV_GRAY2BGR);
imwrite("/home/pi/Desktop/pics/bisgry.jpg",pic);
// imshow("source",pic);
cdst=~pic;


vector<Vec2f> lines;
HoughLines(dst, lines, 1, CV_PI/180,33 ,1, 1 );

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( cdst, pt1, pt2, Scalar(0,0,255), 3, CV_AA);
}

  /*vector<Vec4i> lines;
  HoughLinesP(dst, lines, 1, CV_PI/180, 50, 50, 10 );
  for( size_t i = 0; i < lines.size(); i++ )
  {
  Vec4i l = lines[i];
   line( cdst, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(0,0,255), 3, CV_AA);
   }*/

 [enter image description here][1] imshow("source", src);
 imshow("source1",pic);
imshow("detected lines", cdst);
imwrite("/home/pi/Desktop/pics/cracked.jpg",cdst);

waitKey(); image description image description

@pklab there are the error sir i added headers imgproc.h,highgui.h,opencv2.h

pi@raspberrypi:~/Desktop $ g++ -ggdb `pkg-config --cflags --libs opencv` blob.cpp -o bolb
blob.cpp:12:5: error: ‘Point2d’ does not name a type
 Point2d center;
 ^
 blob.cpp:13:5: error: ‘RotatedRect’ does not name a type
 RotatedRect rr;
 ^
  blob.cpp:15:24: error: ‘vector’ does not name a type
 contourStats(const vector<Point> &contour)
                    ^
  blob.cpp:15:30: error: expected ‘,’ or ‘...’ before ‘<’ token
 contourStats(const vector<Point> &contour)
                          ^
  blob.cpp:19:31: error: ‘vector’ does not name a type
 void calculateStats(const vector<Point> &contour)
                           ^


 blob.cpp:19:37: error: expected ‘,’ or ‘...’ before ‘<’ token
 void calculateStats(const vector<Point> &contour)
                                 ^
  blob.cpp:40:27: error: ‘string’ does not name a type
  void printStats(const string &title)
                       ^
   blob.cpp: In constructor ‘contourStats::contourStats(int)’:
    blob.cpp:17:24: error: ‘contour’ was not declared in this scope
     calculateStats(contour);
                    ^
     blob.cpp: In member function ‘void contourStats::calculateStats(int)’:
      blob.cpp:21:9: error: ‘Moments’ was not declared in this scope
     Moments m = cv::moments(contour, true);
     ^
     blob.cpp:21:9: note: suggested alternative:
     In file included from blob.cpp:2:0:
    /usr/local/include/opencv2/imgproc/imgproc.hpp:1094:24: note:   ‘cv::Moments’
    class CV_EXPORTS_W_MAP Moments
                    ^
     blob.cpp:22:16: error: ‘m’ was not declared in this scope
     area = m.m00;
            ^
       blob.cpp:23:9: error: ‘center’ was not declared in this scope
      center = Point2f(-1, -1);
     ^
    blob.cpp:23:32: error: ‘Point2f’ was not declared in this scope
     center = Point2f(-1, -1);
                            ^
    blob.cpp:23:32: note: suggested alternative:
     In file included from /usr/local/include/opencv2/highgui/highgui.hpp:46:0,
             from blob.cpp:1:
    /usr/local/include/opencv2/core/core.hpp:891:23: note:   ‘cv::Point2f’
     typedef Point_<float> Point2f;
                   ^
     blob.cpp:32:9: error: ‘rr’ was not declared in this scope
     rr = minAreaRect(contour);
     ^
     blob.cpp:32:26: error: ‘contour’ was not declared in this scope
     rr = minAreaRect(contour);
                      ^
     blob.cpp:32:33: error: ‘minAreaRect’ was not declared in this scope
     rr = minAreaRect(contour);
                             ^
    blob.cpp:32:33: note: suggested alternative:
     In file included from blob.cpp:2:0:
     /usr/local/include/opencv2/imgproc/imgproc.hpp:1176:26: note:   ‘cv::minAreaRect’


Ok i again run the code by including namespace cv and std but these are the errors. please give me some hints so that i can improve. i am learner and student not professional sir.

    alarray<_Tp>’
     Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0;
                                                       ^
      In file included from /usr/include/opencv2/contrib/retina.hpp:76:0,
             from /usr/include/opencv2/contrib/contrib.hpp:979,
             from /usr/local/include/opencv2/opencv.hpp:59,
             from crackb.cpp:5:
             /usr/include/c++/4.9/valarray:1170:1: note:   template argument deduction/substitution failed:
               crackb.cpp:118:59: note:   mismatched types ‘const std::valarray<_Tp>’ and ‘double’
               Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0;
               file included from /usr/local/include/opencv2/core/core.hpp:4884:0,
             from /usr/local/include/opencv2/highgui/highgui.hpp:46,
             from crackb.cpp:2:
              /usr/local/include/opencv2/core/mat.hpp:1301:20: note: cv::MatExpr cv::operator/(const                                  
              CV_EXPORTS MatExpr operator / (const MatExpr& e1, const MatExpr& e2);
                ^
              /usr/local/include/opencv2/core/mat.hpp:1301:20: note:   no known conversion for argument 1 from              ‘cv::Point_<float>’ to ‘const cv::MatExpr&’
          /usr/local/include/opencv2/core/mat.hpp:1300:20: note: cv::MatExpr cv::operator/(double, const    cv::MatExpr&)
              CV_EXPORTS MatExpr operator / (double s, const MatExpr& e);
                ^
             /usr/local/include/opencv2/core/mat.hpp:1300:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’
             /usr/local/include/opencv2/core/mat.hpp:1299:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, double)
              CV_EXPORTS MatExpr operator / (const MatExpr& e, double s);
                ^
                   /usr/local/include/opencv2/core/mat.hpp:1299:20: note:   no known conversion for argument 1 from   ‘cv::Point_<float>’ to ‘const cv::MatExpr&’
              /usr/local/include/opencv2/core/mat.hpp:1298:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::MatExpr&)
              CV_EXPORTS MatExpr operator / (const Mat& m, const MatExpr& e);
                ^
               /usr/local/include/opencv2/core/mat.hpp:1298:20: note:   no known conversion for argument 1 from  ‘cv::Point_<float>’ to ‘const cv::Mat&’
               /usr/local/include/opencv2/core/mat.hpp:1297:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::Mat&)
               CV_EXPORTS MatExpr operator / (const MatExpr& e, const Mat& m);
                ^
                /usr/local/include/opencv2/core/mat.hpp:1297:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’
              /usr/local/include/opencv2/core/mat.hpp:1296:20: note: cv::MatExpr cv::operator/(double, const cv::Mat&)
              CV_EXPORTS MatExpr operator / (double s, const Mat& a);
                ^
              /usr/local/include/opencv2/core/mat.hpp:1296:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’
              /usr/local/include/opencv2/core/mat.hpp:1295:20: note: cv::MatExpr cv::operator/(const cv::Mat&, double)
             CV_EXPORTS MatExpr operator / (const Mat& a, double s);
                ^
             /usr/local/include/opencv2/core/mat.hpp:1295:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’
             /usr/local/include/opencv2/core/mat.hpp:1294:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::Mat&)
             CV_EXPORTS MatExpr operator / (const Mat& a, const Mat& b);
                ^
              /usr/local/include/opencv2/core/mat.hpp:1294:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’
                 In file included from /usr/local/include/opencv2/core/core.hpp:4883:0,
                from /usr/local/include/opencv2/highgui/highgui.hpp:46,
                 from crackb.cpp:2:
                /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template<class _Tp>        cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, const cv::Scalar_<_Tp>&)
                Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b)
          ^
               /usr/local/include/opencv2/core/operations.hpp:2196:14: note:   template argument                    deduction/substitution failed:
               crackb.cpp:118:59: note:   ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’
               Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0;
                                                       ^
              In file included from /usr/local/include/opencv2/core/core.hpp:4883:0,
             from /usr/local/include/opencv2/highgui/highgui.hpp:46,
             from crackb.cpp:2:
             /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template<class _Tp> cv::Scalar_<_Tp>          cv::operator/(_Tp, const cv::Scalar_<_Tp>&)
              Scalar_<_Tp> operator / (_Tp a, const Scalar_<_Tp>& b)
          ^
                 /usr/local/include/opencv2/core/operations.hpp:2189:14: note:   template argument d    deduction/substitution failed:
                crackb.cpp:118:59: note:   mismatched types ‘const cv::Scalar_<_Tp>’ and ‘double’
                Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0;
                                                       ^
                In file included from /usr/local/include/opencv2/core/core.hpp:4883:0,
             from /usr/local/include/opencv2/highgui/highgui.hpp:46,
             from crackb.cpp:2:
               /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template<class _Tp>                  cv::Scalar_<double> cv::operator/(const cv::Scalar_<double>&, double)
            Scalar_<double> operator / (const Scalar_<double>& a, double alpha)
             ^
            /usr/local/include/opencv2/core/operations.hpp:2175:17: note:   template argument deduction/substitution failed:

crackb.cpp:118:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<double>&’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template<class _tp=""> cv::Scalar_<float> cv::operator/(const cv::Scalar_<float>&, float) Scalar_<float> operator / (const Scalar_<float>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template argument deduction/substitution failed: crackb.cpp:118:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<float>&’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, _Tp) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, _Tp alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(_Tp, const cv::Complex<_Tp>&) Complex<_Tp> operator / (_Tp b, const Complex<_Tp>& a) ^ /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: mismatched types ‘const cv::Complex<_Tp>’ and ‘double’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, _Tp) Complex<_Tp> operator / (const Complex<_Tp>& a, _Tp b) ^ /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, const cv::Complex<_Tp>&) Complex<_Tp> operator / (const Complex<_Tp>& a, const Complex<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, double) operator / (const Vec<_Tp, cn>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, float) operator / (const Vec<_Tp, cn>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, int) operator / (const Vec<_Tp, cn>& a, int alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ crackb.cpp:119:57: error: no match for ‘operator/’ (operand types are ‘cv::Point_<float>’ and ‘double’) Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ crackb.cpp:119:57: note: candidates are: In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:411:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const std::complex<_Tp>&, const std::complex<_Tp>&) operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.9/complex:411:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::complex<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:420:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const std::complex<_Tp>&, const _Tp&) operator/(const complex<_Tp>& __x, const _Tp& __y) ^ /usr/include/c++/4.9/complex:420:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::complex<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:429:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const _Tp&, const std::complex<_Tp>&) operator/(const _Tp& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.9/complex:429:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const std::complex<_Tp>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom1,="" class="" _dom2=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_expr,="" _dom1,="" _dom2="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_constant,="" _dom,="" typename="" _dom::value_type="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_constant,="" std::_expr,="" typename="" _dom::value_type,="" _dom="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_valarray,="" _dom,="" typename="" _dom::value_type="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _dom::value_type="">&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_expr,="" typename="" _dom::value_type,="" _dom="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::valarray<typename _dom::value_type="">&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_valarray,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const std::valarray<_Tp>&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::valarray<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_constant,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const std::valarray<_Tp>&, const _Tp&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::valarray<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_constant,="" std::_valarray,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const _Tp&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const std::valarray<_Tp>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4884:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/mat.hpp:1301:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (const MatExpr& e1, const MatExpr& e2); ^ /usr/local/include/opencv2/core/mat.hpp:1301:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1300:20: note: cv::MatExpr cv::operator/(double, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (double s, const MatExpr& e); ^ /usr/local/include/opencv2/core/mat.hpp:1300:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’ /usr/local/include/opencv2/core/mat.hpp:1299:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, double) CV_EXPORTS MatExpr operator / (const MatExpr& e, double s); ^ /usr/local/include/opencv2/core/mat.hpp:1299:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1298:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (const Mat& m, const MatExpr& e); ^ /usr/local/include/opencv2/core/mat.hpp:1298:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ /usr/local/include/opencv2/core/mat.hpp:1297:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::Mat&) CV_EXPORTS MatExpr operator / (const MatExpr& e, const Mat& m); ^ /usr/local/include/opencv2/core/mat.hpp:1297:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1296:20: note: cv::MatExpr cv::operator/(double, const cv::Mat&) CV_EXPORTS MatExpr operator / (double s, const Mat& a); ^ /usr/local/include/opencv2/core/mat.hpp:1296:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’ /usr/local/include/opencv2/core/mat.hpp:1295:20: note: cv::MatExpr cv::operator/(const cv::Mat&, double) CV_EXPORTS MatExpr operator / (const Mat& a, double s); ^ /usr/local/include/opencv2/core/mat.hpp:1295:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ /usr/local/include/opencv2/core/mat.hpp:1294:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::Mat&) CV_EXPORTS MatExpr operator / (const Mat& a, const Mat& b); ^ /usr/local/include/opencv2/core/mat.hpp:1294:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, const cv::Scalar_<_Tp>&) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(_Tp, const cv::Scalar_<_Tp>&) Scalar_<_Tp> operator / (_Tp a, const Scalar_<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const cv::Scalar_<_Tp>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template<class _tp=""> cv::Scalar_<double> cv::operator/(const cv::Scalar_<double>&, double) Scalar_<double> operator / (const Scalar_<double>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template argument deduction/substitution failed: crackb.cpp:119:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<double>&’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template<class _tp=""> cv::Scalar_<float> cv::operator/(const cv::Scalar_<float>&, float) Scalar_<float> operator / (const Scalar_<float>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template argument deduction/substitution failed: crackb.cpp:119:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<float>&’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, _Tp) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, _Tp alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(_Tp, const cv::Complex<_Tp>&) Complex<_Tp> operator / (_Tp b, const Complex<_Tp>& a) ^ /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const cv::Complex<_Tp>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, _Tp) Complex<_Tp> operator / (const Complex<_Tp>& a, _Tp b) ^ /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, const cv::Complex<_Tp>&) Complex<_Tp> operator / (const Complex<_Tp>& a, const Complex<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, double) operator / (const Vec<_Tp, cn>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, float) operator / (const Vec<_Tp, cn>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, int) operator / (const Vec<_Tp, cn>& a, int alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ crackb.cpp:120:57: error: no match for ‘operator/’ (operand types are ‘cv::Point_<float>’ and ‘double’) Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ crackb.cpp:120:57: note: candidates are: In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:411:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const std::complex<_Tp>&, const std::complex<_Tp>&) operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.9/complex:411:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::complex<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:420:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const std::complex<_Tp>&, const _Tp&) operator/(const complex<_Tp>& __x, const _Tp& __y) ^ /usr/include/c++/4.9/complex:420:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::complex<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:429:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const _Tp&, const std::complex<_Tp>&) operator/(const _Tp& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.9/complex:429:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const std::complex<_Tp>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom1,="" class="" _dom2=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_expr,="" _dom1,="" _dom2="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_constant,="" _dom,="" typename="" _dom::value_type="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_constant,="" std::_expr,="" typename="" _dom::value_type,="" _dom="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_valarray,="" _dom,="" typename="" _dom::value_type="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _dom::value_type="">&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_expr,="" typename="" _dom::value_type,="" _dom="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::valarray<typename _dom::value_type="">&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_valarray,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const std::valarray<_Tp>&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::valarray<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_constant,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const std::valarray<_Tp>&, const _Tp&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::valarray<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_constant,="" std::_valarray,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const _Tp&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const std::valarray<_Tp>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4884:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/mat.hpp:1301:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (const MatExpr& e1, const MatExpr& e2); ^ /usr/local/include/opencv2/core/mat.hpp:1301:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1300:20: note: cv::MatExpr cv::operator/(double, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (double s, const MatExpr& e); ^ /usr/local/include/opencv2/core/mat.hpp:1300:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’ /usr/local/include/opencv2/core/mat.hpp:1299:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, double) CV_EXPORTS MatExpr operator / (const MatExpr& e, double s); ^ /usr/local/include/opencv2/core/mat.hpp:1299:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1298:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (const Mat& m, const MatExpr& e); ^ /usr/local/include/opencv2/core/mat.hpp:1298:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ /usr/local/include/opencv2/core/mat.hpp:1297:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::Mat&) CV_EXPORTS MatExpr operator / (const MatExpr& e, const Mat& m); ^ /usr/local/include/opencv2/core/mat.hpp:1297:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1296:20: note: cv::MatExpr cv::operator/(double, const cv::Mat&) CV_EXPORTS MatExpr operator / (double s, const Mat& a); ^ /usr/local/include/opencv2/core/mat.hpp:1296:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’ /usr/local/include/opencv2/core/mat.hpp:1295:20: note: cv::MatExpr cv::operator/(const cv::Mat&, double) CV_EXPORTS MatExpr operator / (const Mat& a, double s); ^ /usr/local/include/opencv2/core/mat.hpp:1295:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ /usr/local/include/opencv2/core/mat.hpp:1294:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::Mat&) CV_EXPORTS MatExpr operator / (const Mat& a, const Mat& b); ^ /usr/local/include/opencv2/core/mat.hpp:1294:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, const cv::Scalar_<_Tp>&) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(_Tp, const cv::Scalar_<_Tp>&) Scalar_<_Tp> operator / (_Tp a, const Scalar_<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const cv::Scalar_<_Tp>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template<class _tp=""> cv::Scalar_<double> cv::operator/(const cv::Scalar_<double>&, double) Scalar_<double> operator / (const Scalar_<double>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template argument deduction/substitution failed: crackb.cpp:120:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<double>&’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template<class _tp=""> cv::Scalar_<float> cv::operator/(const cv::Scalar_<float>&, float) Scalar_<float> operator / (const Scalar_<float>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template argument deduction/substitution failed: crackb.cpp:120:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<float>&’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, _Tp) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, _Tp alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(_Tp, const cv::Complex<_Tp>&) Complex<_Tp> operator / (_Tp b, const Complex<_Tp>& a) ^ /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const cv::Complex<_Tp>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, _Tp) Complex<_Tp> operator / (const Complex<_Tp>& a, _Tp b) ^ /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, const cv::Complex<_Tp>&) Complex<_Tp> operator / (const Complex<_Tp>& a, const Complex<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, double) operator / (const Vec<_Tp, cn>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, float) operator / (const Vec<_Tp, cn>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, int) operator / (const Vec<_Tp, cn>& a, int alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ crackb.cpp:124:33: error: ‘CL_BLACK’ was not declared in this scope line(src, pt0, pt1, CL_BLACK, 2); ^ crackb.cpp:126:33: error: ‘CL_BLACK’ was not declared in this scope line(src, pt2, pt3, CL_BLACK, 2);

crack detect red line opencv

i want to make a decision making process of detection of biscuit crack so i used the hough transform for detection of crack. here is the code. It means counting the red pixels,if present then say as crack and if not present say no crack simply. One more thing i want to measure the size of my biscuit.

Mat src = imread("/home/pi/Desktop/pics/grey.jpg");

Mat dst, cdst,pic;


 Canny(src, dst, 30, 160, 3);
cvtColor(dst, pic, CV_GRAY2BGR);
imwrite("/home/pi/Desktop/pics/bisgry.jpg",pic);
// imshow("source",pic);
cdst=~pic;


vector<Vec2f> lines;
HoughLines(dst, lines, 1, CV_PI/180,33 ,1, 1 );

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( cdst, pt1, pt2, Scalar(0,0,255), 3, CV_AA);
}

  /*vector<Vec4i> lines;
  HoughLinesP(dst, lines, 1, CV_PI/180, 50, 50, 10 );
  for( size_t i = 0; i < lines.size(); i++ )
  {
  Vec4i l = lines[i];
   line( cdst, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(0,0,255), 3, CV_AA);
   }*/

 [enter image description here][1] imshow("source", src);
 imshow("source1",pic);
imshow("detected lines", cdst);
imwrite("/home/pi/Desktop/pics/cracked.jpg",cdst);

waitKey(); image description image description

@pklab there are the error sir i added headers imgproc.h,highgui.h,opencv2.h

pi@raspberrypi:~/Desktop $ g++ -ggdb `pkg-config --cflags --libs opencv` blob.cpp -o bolb
blob.cpp:12:5: error: ‘Point2d’ does not name a type
 Point2d center;
 ^
 blob.cpp:13:5: error: ‘RotatedRect’ does not name a type
 RotatedRect rr;
 ^
  blob.cpp:15:24: error: ‘vector’ does not name a type
 contourStats(const vector<Point> &contour)
                    ^
  blob.cpp:15:30: error: expected ‘,’ or ‘...’ before ‘<’ token
 contourStats(const vector<Point> &contour)
                          ^
  blob.cpp:19:31: error: ‘vector’ does not name a type
 void calculateStats(const vector<Point> &contour)
                           ^


 blob.cpp:19:37: error: expected ‘,’ or ‘...’ before ‘<’ token
 void calculateStats(const vector<Point> &contour)
                                 ^
  blob.cpp:40:27: error: ‘string’ does not name a type
  void printStats(const string &title)
                       ^
   blob.cpp: In constructor ‘contourStats::contourStats(int)’:
    blob.cpp:17:24: error: ‘contour’ was not declared in this scope
     calculateStats(contour);
                    ^
     blob.cpp: In member function ‘void contourStats::calculateStats(int)’:
      blob.cpp:21:9: error: ‘Moments’ was not declared in this scope
     Moments m = cv::moments(contour, true);
     ^
     blob.cpp:21:9: note: suggested alternative:
     In file included from blob.cpp:2:0:
    /usr/local/include/opencv2/imgproc/imgproc.hpp:1094:24: note:   ‘cv::Moments’
    class CV_EXPORTS_W_MAP Moments
                    ^
     blob.cpp:22:16: error: ‘m’ was not declared in this scope
     area = m.m00;
            ^
       blob.cpp:23:9: error: ‘center’ was not declared in this scope
      center = Point2f(-1, -1);
     ^
    blob.cpp:23:32: error: ‘Point2f’ was not declared in this scope
     center = Point2f(-1, -1);
                            ^
    blob.cpp:23:32: note: suggested alternative:
     In file included from /usr/local/include/opencv2/highgui/highgui.hpp:46:0,
             from blob.cpp:1:
    /usr/local/include/opencv2/core/core.hpp:891:23: note:   ‘cv::Point2f’
     typedef Point_<float> Point2f;
                   ^
     blob.cpp:32:9: error: ‘rr’ was not declared in this scope
     rr = minAreaRect(contour);
     ^
     blob.cpp:32:26: error: ‘contour’ was not declared in this scope
     rr = minAreaRect(contour);
                      ^
     blob.cpp:32:33: error: ‘minAreaRect’ was not declared in this scope
     rr = minAreaRect(contour);
                             ^
    blob.cpp:32:33: note: suggested alternative:
     In file included from blob.cpp:2:0:
     /usr/local/include/opencv2/imgproc/imgproc.hpp:1176:26: note:   ‘cv::minAreaRect’

Ok i again run the code by including namespace cv and std but these are the errors. please give me some hints so that i can improve. i am learner and student not professional sir.

    alarray<_Tp>’
     Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0;
                                                       ^
      In file included from /usr/include/opencv2/contrib/retina.hpp:76:0,
             from /usr/include/opencv2/contrib/contrib.hpp:979,
             from /usr/local/include/opencv2/opencv.hpp:59,
             from crackb.cpp:5:
             /usr/include/c++/4.9/valarray:1170:1: note:   template argument deduction/substitution failed:
               crackb.cpp:118:59: note:   mismatched types ‘const std::valarray<_Tp>’ and ‘double’
               Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0;
               file included from /usr/local/include/opencv2/core/core.hpp:4884:0,
             from /usr/local/include/opencv2/highgui/highgui.hpp:46,
             from crackb.cpp:2:
              /usr/local/include/opencv2/core/mat.hpp:1301:20: note: cv::MatExpr cv::operator/(const                                  
              CV_EXPORTS MatExpr operator / (const MatExpr& e1, const MatExpr& e2);
                ^
              /usr/local/include/opencv2/core/mat.hpp:1301:20: note:   no known conversion for argument 1 from              ‘cv::Point_<float>’ to ‘const cv::MatExpr&’
          /usr/local/include/opencv2/core/mat.hpp:1300:20: note: cv::MatExpr cv::operator/(double, const    cv::MatExpr&)
              CV_EXPORTS MatExpr operator / (double s, const MatExpr& e);
                ^
             /usr/local/include/opencv2/core/mat.hpp:1300:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’
             /usr/local/include/opencv2/core/mat.hpp:1299:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, double)
              CV_EXPORTS MatExpr operator / (const MatExpr& e, double s);
                ^
                   /usr/local/include/opencv2/core/mat.hpp:1299:20: note:   no known conversion for argument 1 from   ‘cv::Point_<float>’ to ‘const cv::MatExpr&’
              /usr/local/include/opencv2/core/mat.hpp:1298:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::MatExpr&)
              CV_EXPORTS MatExpr operator / (const Mat& m, const MatExpr& e);
                ^
               /usr/local/include/opencv2/core/mat.hpp:1298:20: note:   no known conversion for argument 1 from  ‘cv::Point_<float>’ to ‘const cv::Mat&’
               /usr/local/include/opencv2/core/mat.hpp:1297:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::Mat&)
               CV_EXPORTS MatExpr operator / (const MatExpr& e, const Mat& m);
                ^
                /usr/local/include/opencv2/core/mat.hpp:1297:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’
              /usr/local/include/opencv2/core/mat.hpp:1296:20: note: cv::MatExpr cv::operator/(double, const cv::Mat&)
              CV_EXPORTS MatExpr operator / (double s, const Mat& a);
                ^
              /usr/local/include/opencv2/core/mat.hpp:1296:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’
              /usr/local/include/opencv2/core/mat.hpp:1295:20: note: cv::MatExpr cv::operator/(const cv::Mat&, double)
             CV_EXPORTS MatExpr operator / (const Mat& a, double s);
                ^
             /usr/local/include/opencv2/core/mat.hpp:1295:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’
             /usr/local/include/opencv2/core/mat.hpp:1294:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::Mat&)
             CV_EXPORTS MatExpr operator / (const Mat& a, const Mat& b);
                ^
              /usr/local/include/opencv2/core/mat.hpp:1294:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’
                 In file included from /usr/local/include/opencv2/core/core.hpp:4883:0,
                from /usr/local/include/opencv2/highgui/highgui.hpp:46,
                 from crackb.cpp:2:
                /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template<class _Tp>        cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, const cv::Scalar_<_Tp>&)
                Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b)
          ^
               /usr/local/include/opencv2/core/operations.hpp:2196:14: note:   template argument                    deduction/substitution failed:
               crackb.cpp:118:59: note:   ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’
               Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0;
                                                       ^
              In file included from /usr/local/include/opencv2/core/core.hpp:4883:0,
             from /usr/local/include/opencv2/highgui/highgui.hpp:46,
             from crackb.cpp:2:
             /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template<class _Tp> cv::Scalar_<_Tp>          cv::operator/(_Tp, const cv::Scalar_<_Tp>&)
              Scalar_<_Tp> operator / (_Tp a, const Scalar_<_Tp>& b)
          ^
                 /usr/local/include/opencv2/core/operations.hpp:2189:14: note:   template argument d    deduction/substitution failed:
                crackb.cpp:118:59: note:   mismatched types ‘const cv::Scalar_<_Tp>’ and ‘double’
                Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0;
                                                       ^
                In file included from /usr/local/include/opencv2/core/core.hpp:4883:0,
             from /usr/local/include/opencv2/highgui/highgui.hpp:46,
             from crackb.cpp:2:
               /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template<class _Tp>                  cv::Scalar_<double> cv::operator/(const cv::Scalar_<double>&, double)
            Scalar_<double> operator / (const Scalar_<double>& a, double alpha)
             ^
            /usr/local/include/opencv2/core/operations.hpp:2175:17: note:   template argument deduction/substitution failed:

crackb.cpp:118:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<double>&’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template<class _tp=""> cv::Scalar_<float> cv::operator/(const cv::Scalar_<float>&, float) Scalar_<float> operator / (const Scalar_<float>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template argument deduction/substitution failed: crackb.cpp:118:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<float>&’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, _Tp) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, _Tp alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(_Tp, const cv::Complex<_Tp>&) Complex<_Tp> operator / (_Tp b, const Complex<_Tp>& a) ^ /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: mismatched types ‘const cv::Complex<_Tp>’ and ‘double’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, _Tp) Complex<_Tp> operator / (const Complex<_Tp>& a, _Tp b) ^ /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, const cv::Complex<_Tp>&) Complex<_Tp> operator / (const Complex<_Tp>& a, const Complex<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, double) operator / (const Vec<_Tp, cn>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, float) operator / (const Vec<_Tp, cn>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, int) operator / (const Vec<_Tp, cn>& a, int alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ crackb.cpp:119:57: error: no match for ‘operator/’ (operand types are ‘cv::Point_<float>’ and ‘double’) Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ crackb.cpp:119:57: note: candidates are: In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:411:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const std::complex<_Tp>&, const std::complex<_Tp>&) operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.9/complex:411:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::complex<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:420:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const std::complex<_Tp>&, const _Tp&) operator/(const complex<_Tp>& __x, const _Tp& __y) ^ /usr/include/c++/4.9/complex:420:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::complex<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:429:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const _Tp&, const std::complex<_Tp>&) operator/(const _Tp& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.9/complex:429:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const std::complex<_Tp>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom1,="" class="" _dom2=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_expr,="" _dom1,="" _dom2="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_constant,="" _dom,="" typename="" _dom::value_type="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_constant,="" std::_expr,="" typename="" _dom::value_type,="" _dom="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_valarray,="" _dom,="" typename="" _dom::value_type="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _dom::value_type="">&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_expr,="" typename="" _dom::value_type,="" _dom="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::valarray<typename _dom::value_type="">&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_valarray,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const std::valarray<_Tp>&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::valarray<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_constant,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const std::valarray<_Tp>&, const _Tp&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::valarray<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_constant,="" std::_valarray,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const _Tp&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const std::valarray<_Tp>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4884:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/mat.hpp:1301:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (const MatExpr& e1, const MatExpr& e2); ^ /usr/local/include/opencv2/core/mat.hpp:1301:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1300:20: note: cv::MatExpr cv::operator/(double, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (double s, const MatExpr& e); ^ /usr/local/include/opencv2/core/mat.hpp:1300:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’ /usr/local/include/opencv2/core/mat.hpp:1299:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, double) CV_EXPORTS MatExpr operator / (const MatExpr& e, double s); ^ /usr/local/include/opencv2/core/mat.hpp:1299:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1298:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (const Mat& m, const MatExpr& e); ^ /usr/local/include/opencv2/core/mat.hpp:1298:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ /usr/local/include/opencv2/core/mat.hpp:1297:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::Mat&) CV_EXPORTS MatExpr operator / (const MatExpr& e, const Mat& m); ^ /usr/local/include/opencv2/core/mat.hpp:1297:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1296:20: note: cv::MatExpr cv::operator/(double, const cv::Mat&) CV_EXPORTS MatExpr operator / (double s, const Mat& a); ^ /usr/local/include/opencv2/core/mat.hpp:1296:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’ /usr/local/include/opencv2/core/mat.hpp:1295:20: note: cv::MatExpr cv::operator/(const cv::Mat&, double) CV_EXPORTS MatExpr operator / (const Mat& a, double s); ^ /usr/local/include/opencv2/core/mat.hpp:1295:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ /usr/local/include/opencv2/core/mat.hpp:1294:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::Mat&) CV_EXPORTS MatExpr operator / (const Mat& a, const Mat& b); ^ /usr/local/include/opencv2/core/mat.hpp:1294:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, const cv::Scalar_<_Tp>&) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(_Tp, const cv::Scalar_<_Tp>&) Scalar_<_Tp> operator / (_Tp a, const Scalar_<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const cv::Scalar_<_Tp>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template<class _tp=""> cv::Scalar_<double> cv::operator/(const cv::Scalar_<double>&, double) Scalar_<double> operator / (const Scalar_<double>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template argument deduction/substitution failed: crackb.cpp:119:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<double>&’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template<class _tp=""> cv::Scalar_<float> cv::operator/(const cv::Scalar_<float>&, float) Scalar_<float> operator / (const Scalar_<float>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template argument deduction/substitution failed: crackb.cpp:119:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<float>&’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, _Tp) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, _Tp alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(_Tp, const cv::Complex<_Tp>&) Complex<_Tp> operator / (_Tp b, const Complex<_Tp>& a) ^ /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const cv::Complex<_Tp>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, _Tp) Complex<_Tp> operator / (const Complex<_Tp>& a, _Tp b) ^ /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, const cv::Complex<_Tp>&) Complex<_Tp> operator / (const Complex<_Tp>& a, const Complex<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, double) operator / (const Vec<_Tp, cn>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, float) operator / (const Vec<_Tp, cn>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, int) operator / (const Vec<_Tp, cn>& a, int alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ crackb.cpp:120:57: error: no match for ‘operator/’ (operand types are ‘cv::Point_<float>’ and ‘double’) Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ crackb.cpp:120:57: note: candidates are: In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:411:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const std::complex<_Tp>&, const std::complex<_Tp>&) operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.9/complex:411:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::complex<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:420:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const std::complex<_Tp>&, const _Tp&) operator/(const complex<_Tp>& __x, const _Tp& __y) ^ /usr/include/c++/4.9/complex:420:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::complex<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:429:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const _Tp&, const std::complex<_Tp>&) operator/(const _Tp& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.9/complex:429:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const std::complex<_Tp>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom1,="" class="" _dom2=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_expr,="" _dom1,="" _dom2="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_constant,="" _dom,="" typename="" _dom::value_type="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_constant,="" std::_expr,="" typename="" _dom::value_type,="" _dom="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_valarray,="" _dom,="" typename="" _dom::value_type="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _dom::value_type="">&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_expr,="" typename="" _dom::value_type,="" _dom="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::valarray<typename _dom::value_type="">&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_valarray,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const std::valarray<_Tp>&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::valarray<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_constant,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const std::valarray<_Tp>&, const _Tp&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::valarray<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_constant,="" std::_valarray,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const _Tp&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const std::valarray<_Tp>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4884:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/mat.hpp:1301:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (const MatExpr& e1, const MatExpr& e2); ^ /usr/local/include/opencv2/core/mat.hpp:1301:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1300:20: note: cv::MatExpr cv::operator/(double, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (double s, const MatExpr& e); ^ /usr/local/include/opencv2/core/mat.hpp:1300:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’ /usr/local/include/opencv2/core/mat.hpp:1299:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, double) CV_EXPORTS MatExpr operator / (const MatExpr& e, double s); ^ /usr/local/include/opencv2/core/mat.hpp:1299:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1298:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (const Mat& m, const MatExpr& e); ^ /usr/local/include/opencv2/core/mat.hpp:1298:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ /usr/local/include/opencv2/core/mat.hpp:1297:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::Mat&) CV_EXPORTS MatExpr operator / (const MatExpr& e, const Mat& m); ^ /usr/local/include/opencv2/core/mat.hpp:1297:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1296:20: note: cv::MatExpr cv::operator/(double, const cv::Mat&) CV_EXPORTS MatExpr operator / (double s, const Mat& a); ^ /usr/local/include/opencv2/core/mat.hpp:1296:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’ /usr/local/include/opencv2/core/mat.hpp:1295:20: note: cv::MatExpr cv::operator/(const cv::Mat&, double) CV_EXPORTS MatExpr operator / (const Mat& a, double s); ^ /usr/local/include/opencv2/core/mat.hpp:1295:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ /usr/local/include/opencv2/core/mat.hpp:1294:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::Mat&) CV_EXPORTS MatExpr operator / (const Mat& a, const Mat& b); ^ /usr/local/include/opencv2/core/mat.hpp:1294:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, const cv::Scalar_<_Tp>&) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(_Tp, const cv::Scalar_<_Tp>&) Scalar_<_Tp> operator / (_Tp a, const Scalar_<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const cv::Scalar_<_Tp>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template<class _tp=""> cv::Scalar_<double> cv::operator/(const cv::Scalar_<double>&, double) Scalar_<double> operator / (const Scalar_<double>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template argument deduction/substitution failed: crackb.cpp:120:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<double>&’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template<class _tp=""> cv::Scalar_<float> cv::operator/(const cv::Scalar_<float>&, float) Scalar_<float> operator / (const Scalar_<float>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template argument deduction/substitution failed: crackb.cpp:120:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<float>&’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, _Tp) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, _Tp alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(_Tp, const cv::Complex<_Tp>&) Complex<_Tp> operator / (_Tp b, const Complex<_Tp>& a) ^ /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const cv::Complex<_Tp>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, _Tp) Complex<_Tp> operator / (const Complex<_Tp>& a, _Tp b) ^ /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, const cv::Complex<_Tp>&) Complex<_Tp> operator / (const Complex<_Tp>& a, const Complex<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, double) operator / (const Vec<_Tp, cn>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, float) operator / (const Vec<_Tp, cn>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, int) operator / (const Vec<_Tp, cn>& a, int alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ crackb.cpp:124:33: error: ‘CL_BLACK’ was not declared in this scope line(src, pt0, pt1, CL_BLACK, 2); ^ crackb.cpp:126:33: error: ‘CL_BLACK’ was not declared in this scope line(src, pt2, pt3, CL_BLACK, 2);

crack detect red line opencv

i want to make a decision making process of detection of biscuit crack so i used the hough transform for detection of crack. here is the code. It means counting the red pixels,if present then say as crack and if not present say no crack simply. One more thing i want to measure the size of my biscuit.

Mat src = imread("/home/pi/Desktop/pics/grey.jpg");

Mat dst, cdst,pic;


 Canny(src, dst, 30, 160, 3);
cvtColor(dst, pic, CV_GRAY2BGR);
imwrite("/home/pi/Desktop/pics/bisgry.jpg",pic);
// imshow("source",pic);
cdst=~pic;


vector<Vec2f> lines;
HoughLines(dst, lines, 1, CV_PI/180,33 ,1, 1 );

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( cdst, pt1, pt2, Scalar(0,0,255), 3, CV_AA);
}

  /*vector<Vec4i> lines;
  HoughLinesP(dst, lines, 1, CV_PI/180, 50, 50, 10 );
  for( size_t i = 0; i < lines.size(); i++ )
  {
  Vec4i l = lines[i];
   line( cdst, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(0,0,255), 3, CV_AA);
   }*/

 [enter image description here][1] imshow("source", src);
 imshow("source1",pic);
imshow("detected lines", cdst);
imwrite("/home/pi/Desktop/pics/cracked.jpg",cdst);

waitKey(); image description image description

@pklab there are the error sir i added headers imgproc.h,highgui.h,opencv2.h

pi@raspberrypi:~/Desktop $ g++ -ggdb `pkg-config --cflags --libs opencv` blob.cpp -o bolb

Ok i again run the code by including namespace cv and std but these are the errors. please give me some hints so that i can improve. i am learner and student not professional sir.

    alarray<_Tp>’
     Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0;
                                                       ^
      In file included from /usr/include/opencv2/contrib/retina.hpp:76:0,
             from /usr/include/opencv2/contrib/contrib.hpp:979,
             from /usr/local/include/opencv2/opencv.hpp:59,
             from crackb.cpp:5:
             /usr/include/c++/4.9/valarray:1170:1: note:   template argument deduction/substitution failed:
               crackb.cpp:118:59: note:   mismatched types ‘const std::valarray<_Tp>’ and ‘double’
               Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0;
               file included from /usr/local/include/opencv2/core/core.hpp:4884:0,
             from /usr/local/include/opencv2/highgui/highgui.hpp:46,
             from crackb.cpp:2:
              /usr/local/include/opencv2/core/mat.hpp:1301:20: note: cv::MatExpr cv::operator/(const                                  
              CV_EXPORTS MatExpr operator / (const MatExpr& e1, const MatExpr& e2);
                ^
              /usr/local/include/opencv2/core/mat.hpp:1301:20: note:   no known conversion for argument 1 from              ‘cv::Point_<float>’ to ‘const cv::MatExpr&’
          /usr/local/include/opencv2/core/mat.hpp:1300:20: note: cv::MatExpr cv::operator/(double, const    cv::MatExpr&)
              CV_EXPORTS MatExpr operator / (double s, const MatExpr& e);
                ^
             /usr/local/include/opencv2/core/mat.hpp:1300:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’
             /usr/local/include/opencv2/core/mat.hpp:1299:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, double)
              CV_EXPORTS MatExpr operator / (const MatExpr& e, double s);
                ^
                   /usr/local/include/opencv2/core/mat.hpp:1299:20: note:   no known conversion for argument 1 from   ‘cv::Point_<float>’ to ‘const cv::MatExpr&’
              /usr/local/include/opencv2/core/mat.hpp:1298:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::MatExpr&)
              CV_EXPORTS MatExpr operator / (const Mat& m, const MatExpr& e);
                ^
               /usr/local/include/opencv2/core/mat.hpp:1298:20: note:   no known conversion for argument 1 from  ‘cv::Point_<float>’ to ‘const cv::Mat&’
               /usr/local/include/opencv2/core/mat.hpp:1297:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::Mat&)
               CV_EXPORTS MatExpr operator / (const MatExpr& e, const Mat& m);
                ^
                /usr/local/include/opencv2/core/mat.hpp:1297:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’
              /usr/local/include/opencv2/core/mat.hpp:1296:20: note: cv::MatExpr cv::operator/(double, const cv::Mat&)
              CV_EXPORTS MatExpr operator / (double s, const Mat& a);
                ^
              /usr/local/include/opencv2/core/mat.hpp:1296:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’
              /usr/local/include/opencv2/core/mat.hpp:1295:20: note: cv::MatExpr cv::operator/(const cv::Mat&, double)
             CV_EXPORTS MatExpr operator / (const Mat& a, double s);
                ^
             /usr/local/include/opencv2/core/mat.hpp:1295:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’
             /usr/local/include/opencv2/core/mat.hpp:1294:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::Mat&)
             CV_EXPORTS MatExpr operator / (const Mat& a, const Mat& b);
                ^
              /usr/local/include/opencv2/core/mat.hpp:1294:20: note:   no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’
                 In file included from /usr/local/include/opencv2/core/core.hpp:4883:0,
                from /usr/local/include/opencv2/highgui/highgui.hpp:46,
                 from crackb.cpp:2:
                /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template<class _Tp>        cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, const cv::Scalar_<_Tp>&)
                Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b)
          ^
               /usr/local/include/opencv2/core/operations.hpp:2196:14: note:   template argument                    deduction/substitution failed:
               crackb.cpp:118:59: note:   ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’
               Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0;
                                                       ^
              In file included from /usr/local/include/opencv2/core/core.hpp:4883:0,
             from /usr/local/include/opencv2/highgui/highgui.hpp:46,
             from crackb.cpp:2:
             /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template<class _Tp> cv::Scalar_<_Tp>          cv::operator/(_Tp, const cv::Scalar_<_Tp>&)
              Scalar_<_Tp> operator / (_Tp a, const Scalar_<_Tp>& b)
          ^
                 /usr/local/include/opencv2/core/operations.hpp:2189:14: note:   template argument d    deduction/substitution failed:
                crackb.cpp:118:59: note:   mismatched types ‘const cv::Scalar_<_Tp>’ and ‘double’
                Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0;
                                                       ^
                In file included from /usr/local/include/opencv2/core/core.hpp:4883:0,
             from /usr/local/include/opencv2/highgui/highgui.hpp:46,
             from crackb.cpp:2:
               /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template<class _Tp>                  cv::Scalar_<double> cv::operator/(const cv::Scalar_<double>&, double)
            Scalar_<double> operator / (const Scalar_<double>& a, double alpha)
             ^
            /usr/local/include/opencv2/core/operations.hpp:2175:17: note:   template argument deduction/substitution failed:

crackb.cpp:118:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<double>&’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template<class _tp=""> cv::Scalar_<float> cv::operator/(const cv::Scalar_<float>&, float) Scalar_<float> operator / (const Scalar_<float>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template argument deduction/substitution failed: crackb.cpp:118:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<float>&’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, _Tp) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, _Tp alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(_Tp, const cv::Complex<_Tp>&) Complex<_Tp> operator / (_Tp b, const Complex<_Tp>& a) ^ /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: mismatched types ‘const cv::Complex<_Tp>’ and ‘double’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, _Tp) Complex<_Tp> operator / (const Complex<_Tp>& a, _Tp b) ^ /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, const cv::Complex<_Tp>&) Complex<_Tp> operator / (const Complex<_Tp>& a, const Complex<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, double) operator / (const Vec<_Tp, cn>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, float) operator / (const Vec<_Tp, cn>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, int) operator / (const Vec<_Tp, cn>& a, int alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template argument deduction/substitution failed: crackb.cpp:118:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt1 = (rect_points[1] + rect_points[2]) / 2.0; ^ crackb.cpp:119:57: error: no match for ‘operator/’ (operand types are ‘cv::Point_<float>’ and ‘double’) Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ crackb.cpp:119:57: note: candidates are: In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:411:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const std::complex<_Tp>&, const std::complex<_Tp>&) operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.9/complex:411:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::complex<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:420:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const std::complex<_Tp>&, const _Tp&) operator/(const complex<_Tp>& __x, const _Tp& __y) ^ /usr/include/c++/4.9/complex:420:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::complex<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:429:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const _Tp&, const std::complex<_Tp>&) operator/(const _Tp& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.9/complex:429:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const std::complex<_Tp>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom1,="" class="" _dom2=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_expr,="" _dom1,="" _dom2="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_constant,="" _dom,="" typename="" _dom::value_type="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_constant,="" std::_expr,="" typename="" _dom::value_type,="" _dom="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_valarray,="" _dom,="" typename="" _dom::value_type="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _dom::value_type="">&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_expr,="" typename="" _dom::value_type,="" _dom="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::valarray<typename _dom::value_type="">&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_valarray,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const std::valarray<_Tp>&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::valarray<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_constant,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const std::valarray<_Tp>&, const _Tp&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::valarray<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_constant,="" std::_valarray,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const _Tp&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const std::valarray<_Tp>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4884:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/mat.hpp:1301:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (const MatExpr& e1, const MatExpr& e2); ^ /usr/local/include/opencv2/core/mat.hpp:1301:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1300:20: note: cv::MatExpr cv::operator/(double, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (double s, const MatExpr& e); ^ /usr/local/include/opencv2/core/mat.hpp:1300:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’ /usr/local/include/opencv2/core/mat.hpp:1299:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, double) CV_EXPORTS MatExpr operator / (const MatExpr& e, double s); ^ /usr/local/include/opencv2/core/mat.hpp:1299:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1298:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (const Mat& m, const MatExpr& e); ^ /usr/local/include/opencv2/core/mat.hpp:1298:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ /usr/local/include/opencv2/core/mat.hpp:1297:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::Mat&) CV_EXPORTS MatExpr operator / (const MatExpr& e, const Mat& m); ^ /usr/local/include/opencv2/core/mat.hpp:1297:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1296:20: note: cv::MatExpr cv::operator/(double, const cv::Mat&) CV_EXPORTS MatExpr operator / (double s, const Mat& a); ^ /usr/local/include/opencv2/core/mat.hpp:1296:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’ /usr/local/include/opencv2/core/mat.hpp:1295:20: note: cv::MatExpr cv::operator/(const cv::Mat&, double) CV_EXPORTS MatExpr operator / (const Mat& a, double s); ^ /usr/local/include/opencv2/core/mat.hpp:1295:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ /usr/local/include/opencv2/core/mat.hpp:1294:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::Mat&) CV_EXPORTS MatExpr operator / (const Mat& a, const Mat& b); ^ /usr/local/include/opencv2/core/mat.hpp:1294:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, const cv::Scalar_<_Tp>&) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(_Tp, const cv::Scalar_<_Tp>&) Scalar_<_Tp> operator / (_Tp a, const Scalar_<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const cv::Scalar_<_Tp>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template<class _tp=""> cv::Scalar_<double> cv::operator/(const cv::Scalar_<double>&, double) Scalar_<double> operator / (const Scalar_<double>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template argument deduction/substitution failed: crackb.cpp:119:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<double>&’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template<class _tp=""> cv::Scalar_<float> cv::operator/(const cv::Scalar_<float>&, float) Scalar_<float> operator / (const Scalar_<float>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template argument deduction/substitution failed: crackb.cpp:119:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<float>&’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, _Tp) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, _Tp alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(_Tp, const cv::Complex<_Tp>&) Complex<_Tp> operator / (_Tp b, const Complex<_Tp>& a) ^ /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: mismatched types ‘const cv::Complex<_Tp>’ and ‘double’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, _Tp) Complex<_Tp> operator / (const Complex<_Tp>& a, _Tp b) ^ /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, const cv::Complex<_Tp>&) Complex<_Tp> operator / (const Complex<_Tp>& a, const Complex<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, double) operator / (const Vec<_Tp, cn>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, float) operator / (const Vec<_Tp, cn>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, int) operator / (const Vec<_Tp, cn>& a, int alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template argument deduction/substitution failed: crackb.cpp:119:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt2 = (rect_points[0] + rect_points[1]) / 2.0; ^ crackb.cpp:120:57: error: no match for ‘operator/’ (operand types are ‘cv::Point_<float>’ and ‘double’) Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ crackb.cpp:120:57: note: candidates are: In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:411:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const std::complex<_Tp>&, const std::complex<_Tp>&) operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.9/complex:411:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::complex<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:420:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const std::complex<_Tp>&, const _Tp&) operator/(const complex<_Tp>& __x, const _Tp& __y) ^ /usr/include/c++/4.9/complex:420:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::complex<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:59:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/include/c++/4.9/complex:429:5: note: template<class _tp=""> std::complex<_Tp> std::operator/(const _Tp&, const std::complex<_Tp>&) operator/(const _Tp& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.9/complex:429:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const std::complex<_Tp>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom1,="" class="" _dom2=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_expr,="" _dom1,="" _dom2="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_constant,="" _dom,="" typename="" _dom::value_type="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_constant,="" std::_expr,="" typename="" _dom::value_type,="" _dom="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_expr,="" std::_valarray,="" _dom,="" typename="" _dom::value_type="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _dom::value_type="">&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/c++/4.9/valarray:587:0, from /usr/include/opencv2/contrib/retina.hpp:76, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template<class _dom=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_expr,="" typename="" _dom::value_type,="" _dom="">, typename std::__fun<std::__divides, typename="" _dom1::value_type="">::result_type> std::operator/(const std::valarray<typename _dom::value_type="">&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/bits/valarray_after.h:405:5: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_valarray,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const std::valarray<_Tp>&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::valarray<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_valarray,="" std::_constant,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const std::valarray<_Tp>&, const _Tp&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const std::valarray<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/include/opencv2/contrib/retina.hpp:76:0, from /usr/include/opencv2/contrib/contrib.hpp:979, from /usr/local/include/opencv2/opencv.hpp:59, from crackb.cpp:5: /usr/include/c++/4.9/valarray:1170:1: note: template<class _tp=""> std::_Expr<std::_binclos<std::__divides, std::_constant,="" std::_valarray,="" _tp,="" _tp="">, typename std::__fun<std::__divides, _tp="">::result_type> std::operator/(const _Tp&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(/, __divides) ^ /usr/include/c++/4.9/valarray:1170:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const std::valarray<_Tp>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4884:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/mat.hpp:1301:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (const MatExpr& e1, const MatExpr& e2); ^ /usr/local/include/opencv2/core/mat.hpp:1301:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1300:20: note: cv::MatExpr cv::operator/(double, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (double s, const MatExpr& e); ^ /usr/local/include/opencv2/core/mat.hpp:1300:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’ /usr/local/include/opencv2/core/mat.hpp:1299:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, double) CV_EXPORTS MatExpr operator / (const MatExpr& e, double s); ^ /usr/local/include/opencv2/core/mat.hpp:1299:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1298:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::MatExpr&) CV_EXPORTS MatExpr operator / (const Mat& m, const MatExpr& e); ^ /usr/local/include/opencv2/core/mat.hpp:1298:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ /usr/local/include/opencv2/core/mat.hpp:1297:20: note: cv::MatExpr cv::operator/(const cv::MatExpr&, const cv::Mat&) CV_EXPORTS MatExpr operator / (const MatExpr& e, const Mat& m); ^ /usr/local/include/opencv2/core/mat.hpp:1297:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::MatExpr&’ /usr/local/include/opencv2/core/mat.hpp:1296:20: note: cv::MatExpr cv::operator/(double, const cv::Mat&) CV_EXPORTS MatExpr operator / (double s, const Mat& a); ^ /usr/local/include/opencv2/core/mat.hpp:1296:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘double’ /usr/local/include/opencv2/core/mat.hpp:1295:20: note: cv::MatExpr cv::operator/(const cv::Mat&, double) CV_EXPORTS MatExpr operator / (const Mat& a, double s); ^ /usr/local/include/opencv2/core/mat.hpp:1295:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ /usr/local/include/opencv2/core/mat.hpp:1294:20: note: cv::MatExpr cv::operator/(const cv::Mat&, const cv::Mat&) CV_EXPORTS MatExpr operator / (const Mat& a, const Mat& b); ^ /usr/local/include/opencv2/core/mat.hpp:1294:20: note: no known conversion for argument 1 from ‘cv::Point_<float>’ to ‘const cv::Mat&’ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, const cv::Scalar_<_Tp>&) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:2196:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(_Tp, const cv::Scalar_<_Tp>&) Scalar_<_Tp> operator / (_Tp a, const Scalar_<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:2189:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const cv::Scalar_<_Tp>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template<class _tp=""> cv::Scalar_<double> cv::operator/(const cv::Scalar_<double>&, double) Scalar_<double> operator / (const Scalar_<double>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2175:17: note: template argument deduction/substitution failed: crackb.cpp:120:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<double>&’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template<class _tp=""> cv::Scalar_<float> cv::operator/(const cv::Scalar_<float>&, float) Scalar_<float> operator / (const Scalar_<float>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2168:16: note: template argument deduction/substitution failed: crackb.cpp:120:39: note: cannot convert ‘cv::operator+(const cv::Point_<_Tp>&, const cv::Point_<_Tp>&) with _Tp = float’ (type ‘cv::Point_<float>’) to type ‘const cv::Scalar_<float>&’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template<class _tp=""> cv::Scalar_<_Tp> cv::operator/(const cv::Scalar_<_Tp>&, _Tp) Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, _Tp alpha) ^ /usr/local/include/opencv2/core/operations.hpp:2159:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Scalar_<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(_Tp, const cv::Complex<_Tp>&) Complex<_Tp> operator / (_Tp b, const Complex<_Tp>& a) ^ /usr/local/include/opencv2/core/operations.hpp:1607:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: mismatched types ‘const cv::Complex<_Tp>’ and ‘double’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, _Tp) Complex<_Tp> operator / (const Complex<_Tp>& a, _Tp b) ^ /usr/local/include/opencv2/core/operations.hpp:1600:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template<class _tp=""> cv::Complex<_Tp> cv::operator/(const cv::Complex<_Tp>&, const cv::Complex<_Tp>&) Complex<_Tp> operator / (const Complex<_Tp>& a, const Complex<_Tp>& b) ^ /usr/local/include/opencv2/core/operations.hpp:1586:14: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Complex<_Tp>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, double) operator / (const Vec<_Tp, cn>& a, double alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1430:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, float) operator / (const Vec<_Tp, cn>& a, float alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1424:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ In file included from /usr/local/include/opencv2/core/core.hpp:4883:0, from /usr/local/include/opencv2/highgui/highgui.hpp:46, from crackb.cpp:2: /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template<class _tp,="" int="" cn=""> cv::Vec<_Tp, m> cv::operator/(const cv::Vec<_Tp, m>&, int) operator / (const Vec<_Tp, cn>& a, int alpha) ^ /usr/local/include/opencv2/core/operations.hpp:1418:1: note: template argument deduction/substitution failed: crackb.cpp:120:59: note: ‘cv::Point_<float>’ is not derived from ‘const cv::Vec<_Tp, m>’ Point2f pt3 = (rect_points[2] + rect_points[3]) / 2.0; ^ crackb.cpp:124:33: error: ‘CL_BLACK’ was not declared in this scope line(src, pt0, pt1, CL_BLACK, 2); ^ crackb.cpp:126:33: error: ‘CL_BLACK’ was not declared in this scope line(src, pt2, pt3, CL_BLACK, 2);