This program is line trace program by image processing(NTSC 60fps).

Dependencies:   GR-PEACH_video mbed

Files at this revision

API Documentation at this revision

Comitter:
TetsuyaKonno
Date:
Tue Jan 10 04:57:12 2017 +0000
Parent:
0:b20adb7baebc
Commit message:
We changed the contents of the "intTimer" function. but there is no design changes of the function.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r b20adb7baebc -r 51650f3f8d4f main.cpp
--- a/main.cpp	Thu Sep 22 09:10:03 2016 +0000
+++ b/main.cpp	Tue Jan 10 04:57:12 2017 +0000
@@ -2,8 +2,8 @@
 //Supported MCU:   RZ/A1H
 //File Contents:   Trace Program by Image Processing
 //                                 (GR-PEACH version on the Micon Car)
-//Version number:  Ver.1.00
-//Date:            2016.09.22
+//Version number:  Ver.1.01
+//Date:            2017.01.10
 //Copyright:       Renesas Electronics Corporation
 //                 Hitachi Document Solutions Co., Ltd.
 //------------------------------------------------------------------//
@@ -547,68 +547,34 @@
     cnt1++;
  
     /* field check */
-    if( vfield_count2 == vfield_count2_buff ) {
+    if( vfield_count2 != vfield_count2_buff ) {
         vfield_count2_buff = vfield_count2;
+        counter = 0;
     }
-    /* Top field */
-    if( !vfield_count2 ) {
-        led_m_user( 1 );
-        switch( counter++ ) {
-        case 0:
-            Image_Extraction( write_buff_addr, ImageData_A, vfield_count2 );
-            break;
-        case 1:
-            Image_Extraction( write_buff_addr, ImageData_A, vfield_count2 );
-            break;
-        case 2:
-            Image_Reduction( ImageData_A, 160, ImageComp_A, 8 );
-            break;
-        case 3:
-            Image_Reduction( ImageData_A, 160, ImageComp_A, 8 );
-            break;
-        case 4:
-            Binarization_process( ImageComp_A, ImageBinary, 20*15, 128 );
-            break;
-        case 5:
-            /* Trace by image processing */
-            digital_sensor_process( ImageBinary );
-            break;
-        case 15:
-            counter = 0;
-            break;
-        default:
-            break;
-        }
-    }
-    /* bottom field */
-    else {
-        led_m_user( 0 );
-        switch( counter++ ) {
-        case 0:
-            Image_Extraction( write_buff_addr, ImageData_A, vfield_count2 );
-            break;
-        case 1:
-            Image_Extraction( write_buff_addr, ImageData_A, vfield_count2 );
-            break;
-        case 2:
-            Image_Reduction( ImageData_A, 160, ImageComp_A, 8 );
-            break;
-        case 3:
-            Image_Reduction( ImageData_A, 160, ImageComp_A, 8 );
-            break;
-        case 4:
-            Binarization_process( ImageComp_A, ImageBinary, 20*15, 128 );
-            break;
-        case 5:
-            /* Trace by image processing */
-            digital_sensor_process( ImageBinary );
-            break;
-        case 15:
-            counter = 0;
-            break;
-        default:
-            break;
-        }
+    /* Top field / bottom field */
+    led_m_user( vfield_count2 );
+    switch( counter++ ) {
+    case 0:
+        Image_Extraction( write_buff_addr, ImageData_A, vfield_count2 );
+        break;
+    case 1:
+        Image_Extraction( write_buff_addr, ImageData_A, vfield_count2 );
+        break;
+    case 2:
+        Image_Reduction( ImageData_A, 160, ImageComp_A, 8 );
+        break;
+    case 3:
+        Image_Reduction( ImageData_A, 160, ImageComp_A, 8 );
+        break;
+    case 4:
+        Binarization_process( ImageComp_A, ImageBinary, 20*15, 128 );
+        break;
+    case 5:
+        /* Trace by image processing */
+        digital_sensor_process( ImageBinary );
+        break;
+    default:
+        break;
     }
 
     /* LED processing */