@@ -20,6 +20,9 @@ <h1>Mango Sorter</h1>
2020 <!-- <h3>Demonstrates simple 320x240 capture & display</h3> -->
2121
2222 < div id ="my_camera "> </ div >
23+
24+
25+
2326
2427 <!-- First, include the Webcam.js JavaScript Library -->
2528 < script src ="https://cdnjs.cloudflare.com/ajax/libs/webcamjs/1.0.25/webcam.min.js "> </ script >
@@ -42,11 +45,16 @@ <h1>Mango Sorter</h1>
4245 < form >
4346 < input type =button value ="Submit Data " onClick ="submit_data() ">
4447 </ form >
48+
49+ < br >
50+ < hr >
51+ < div id ="detectedColor "> </ div >
52+ < div id ="hashedFile "> </ div >
4553
4654 <!-- Code to handle taking the snapshot and displaying it locally -->
4755 < script language ="JavaScript ">
4856
49- var redCount = 1 ;
57+ var redCount = 0 ;
5058 // make it 0
5159 var greenCount = 0 ;
5260 var temp ;
@@ -58,6 +66,8 @@ <h1>Mango Sorter</h1>
5866 axios . get ( urlQuery ) . then ( function ( response ) {
5967
6068 console . log ( response . data ) ;
69+ document . getElementById ( 'hashedFile' ) . innerHTML =
70+ '<h3>Hashed File :' + response . data + '</h3>' ;
6171
6272 } ) . then ( function ( response ) {
6373
@@ -104,19 +114,20 @@ <h1>Mango Sorter</h1>
104114 if ( temp . toString ( ) == 'red' ) {
105115 console . log ( 'in website red' ) ;
106116 redCount ++ ;
117+ document . getElementById ( 'detectedColor' ) . innerHTML =
118+ '<h2>Color:Red</h2>' ;
107119 console . log ( 'redCount' + redCount ) ;
108120 } else if ( temp . toString ( ) == 'green' ) {
109121 console . log ( 'in website green' )
110122 greenCount ++ ;
123+ document . getElementById ( 'detectedColor' ) . innerHTML =
124+ '<h2>Color:Green</h2>' ;
111125 console . log ( 'greenCount' + greenCount ) ;
112126 }
113-
114- } ) . then ( function ( response ) {
115-
116-
117-
118127
119128
129+
130+ } ) . then ( function ( response ) {
120131
121132
122133 } ) . catch ( function ( error ) {
0 commit comments