From a53a10965bff29d912d7b4a2a079289b7e63ab15 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Sun, 6 Apr 2014 11:58:08 -0500 Subject: [PATCH] Removed comment --- src/openalpr/platelines.cpp | 114 ------------------------------------ 1 file changed, 114 deletions(-) diff --git a/src/openalpr/platelines.cpp b/src/openalpr/platelines.cpp index ecea379..20741b5 100644 --- a/src/openalpr/platelines.cpp +++ b/src/openalpr/platelines.cpp @@ -117,124 +117,10 @@ void PlateLines::processImage(Mat inputImage, CharacterRegion* charRegion, float getTime(&endTime); cout << "Plate Lines Time: " << diffclock(startTime, endTime) << "ms." << endl; } - //smoothed.release(); - //////////////// METHOD2!!!!!!!//////////////////// - - /* - Mat imgBlur; - Mat imgCanny; - GaussianBlur(inputImage, imgBlur, Size(9, 9), 1, 1); - - Canny(imgBlur, imgCanny, 10, 30, 3); - - //int morph_elem = 2; - //int morph_size = 1; - //Mat element = getStructuringElement( morph_elem, Size( 2*morph_size + 1, 2*morph_size+1 ), Point( morph_size, morph_size ) ); - morphologyEx( imgCanny, imgCanny, MORPH_CLOSE, element ); - - Mat imgShaped; - imgCanny.copyTo(imgShaped); - //Find contours of possibles characters - vector< vector< Point> > biggestShapes; - findContours(imgShaped, - biggestShapes, // a vector of contours - CV_RETR_EXTERNAL, // retrieve the external contours - CV_CHAIN_APPROX_SIMPLE ); // all pixels of each contours - - // Draw blue contours on a white image - //cvtColor(imgShaped, imgShaped, CV_GRAY2RGB); - cv::drawContours(imgShaped,biggestShapes, - -1, // draw all contours - cv::Scalar(255,255,255), // in blue - 1); // with a thickness of 1 - - displayImage(config, "Blurred", imgCanny); - displayImage(config, "Blurred Contours", imgShaped); - - vector shapeRects( biggestShapes.size() ); - - vector >hull( biggestShapes.size() ); - for( int i = 0; i < biggestShapes.size(); i++ ) - { - //approxPolyDP( Mat(biggestShapes[i]), shapeRects[i], 3, true ); - convexHull( biggestShapes[i], hull[i], false ); - //approxPolyDP( biggestShapes[i], hull[i], 10, true ); - - //minEnclosingCircle( (Mat)contours_poly[i], center[i], radius[i] ); - } - */ } -/* -vector PlateLines::getLines(Mat edges, bool vertical) -{ - vector filteredLines; - int sensitivity; - - LSWMS lswms(Size(edges.cols, edges.rows), 3, 155, false); - - vector lsegs; - vector errors; - lswms.run(edges, lsegs, errors); - - for( size_t i = 0; i < lsegs.size(); i++ ) - { - if (vertical) - { - LineSegment candidate; - if (lsegs[i][0].y <= lsegs[i][1].y) - candidate = LineSegment(lsegs[i][0].x, lsegs[i][0].y, lsegs[i][1].x, lsegs[i][1].y); - else - candidate = LineSegment(lsegs[i][1].x, lsegs[i][1].y, lsegs[i][0].x, lsegs[i][0].y); - - cout << "VERT Angle: " << candidate.angle << endl; - //if ((candidate.angle > 70 && candidate.angle < 110) || (candidate.angle > 250 && candidate.angle < 290)) - //{ - // good vertical - filteredLines.push_back(candidate); - - //} - } - else - { - LineSegment candidate; - if (lsegs[i][0].x <= lsegs[i][1].x) - candidate = LineSegment(lsegs[i][0].x, lsegs[i][0].y, lsegs[i][1].x, lsegs[i][1].y); - else - candidate = LineSegment(lsegs[i][1].x, lsegs[i][1].y, lsegs[i][0].x, lsegs[i][0].y); - cout << "HORIZAngle: " << candidate.angle << endl; - - //if ( (candidate.angle > -20 && candidate.angle < 20) || (candidate.angle > 160 && candidate.angle < 200)) - //{ - // good horizontal - filteredLines.push_back(candidate); - - //} - } - } - - // if debug is enabled, draw the image - if (this->debug) - { - Mat debugImg(edges.size(), edges.type()); - edges.copyTo(debugImg); - cvtColor(debugImg,debugImg,CV_GRAY2BGR); - - for( size_t i = 0; i < filteredLines.size(); i++ ) - { - line( debugImg, filteredLines[i].p1, filteredLines[i].p2, Scalar(0,0,255), 1, CV_AA); - } - if (vertical) - displayImage(config, "Lines Vertical", debugImg); - else - displayImage(config, "Lines Horizontal", debugImg); - } - - return filteredLines; -} -*/ void PlateLines::cleanupColors(Mat inputImage, Mat outputImage) {