Commits

Anonymous committed 60abee3

Threshold dump added. Adding bin and obj directories for the makefile.

  • Participants
  • Parent commits a518e60

Comments (0)

Files changed (11)

Cosc428_NPR/contours.cpp

     pyrUp(pyr, timg, image.size());
     vector<vector<Point> > contours;
 
+    double min, max;
     // find squares in every color plane of the image
-    for( int c = 0; c < image.channels(); c++ )
+    for( int c = 1; c < image.channels(); c++ )
     {
         int ch[] = {c, 0};
         mixChannels(&timg, 1, &gray0, 1, ch, 1);
         
+        minMaxLoc(gray0, &min, &max);
 		// try several threshold levels
         for( int l = 0; l < incremental_threshold_count; l++ )
         {
             {
                 // apply threshold if l!=0:
                 //     tgray(x,y) = gray(x,y) < (l+1)*255/N ? 255 : 0
-                gray = gray0 >= (l+1)*255/incremental_threshold_count;
+                gray = gray0 >= (int)min + (l+1)*(int)(max-min)/incremental_threshold_count;
             }
 			
+			writeImage("_thresh-" + itos(c) + "-" + itos(l), gray);
 			// find contours and store them all as a list
             findContours(gray, contours, hierarchy, CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE);
             

Cosc428_NPR/start.cpp

 	cout << "finding plate candidates..." << endl;
 	//findPolygons(plate_cand, plate_candidates, 50, 11);
 	//findPolygons(plate_cand, plate_candidates, hierarchy, -1, 7);
-	findPolygons(hsv, plate_candidates, hierarchy, 50, 7);
+	findPolygons(hsv, plate_candidates, hierarchy, 50, 1);
 	cout << "found " << plate_candidates.size() << " polygons. filtering..." << endl;
 	
 	PolygonFilter tempFilter(4);
 	tempFilter.max_area = 1000;
 	tempFilter.area_tol = 0;
 	tempFilter.min_cos = 0.0;
-	tempFilter.max_cos = 0.2;
+	tempFilter.max_cos = 0.3;
 	
 	tempFilter.print();
 	filterPolygons(plate_candidates, plate_candidates, tempFilter);

bin/npr

Binary file added.

literature/anpr.pdf

Binary file added.

obj/contour.o

Binary file added.

obj/contours.o

Binary file added.

obj/hierarchy.o

Binary file added.

obj/image.o

Binary file added.

obj/perspective.o

Binary file added.

obj/segmentation.o

Binary file added.

obj/util.o

Binary file added.