@@ -20,6 +20,9 @@ <h1>Mango Sorter</h1>
20
20
<!-- <h3>Demonstrates simple 320x240 capture & display</h3> -->
21
21
22
22
< div id ="my_camera "> </ div >
23
+
24
+
25
+
23
26
24
27
<!-- First, include the Webcam.js JavaScript Library -->
25
28
< script src ="https://cdnjs.cloudflare.com/ajax/libs/webcamjs/1.0.25/webcam.min.js "> </ script >
@@ -42,11 +45,16 @@ <h1>Mango Sorter</h1>
42
45
< form >
43
46
< input type =button value ="Submit Data " onClick ="submit_data() ">
44
47
</ form >
48
+
49
+ < br >
50
+ < hr >
51
+ < div id ="detectedColor "> </ div >
52
+ < div id ="hashedFile "> </ div >
45
53
46
54
<!-- Code to handle taking the snapshot and displaying it locally -->
47
55
< script language ="JavaScript ">
48
56
49
- var redCount = 1 ;
57
+ var redCount = 0 ;
50
58
// make it 0
51
59
var greenCount = 0 ;
52
60
var temp ;
@@ -58,6 +66,8 @@ <h1>Mango Sorter</h1>
58
66
axios . get ( urlQuery ) . then ( function ( response ) {
59
67
60
68
console . log ( response . data ) ;
69
+ document . getElementById ( 'hashedFile' ) . innerHTML =
70
+ '<h3>Hashed File :' + response . data + '</h3>' ;
61
71
62
72
} ) . then ( function ( response ) {
63
73
@@ -104,19 +114,20 @@ <h1>Mango Sorter</h1>
104
114
if ( temp . toString ( ) == 'red' ) {
105
115
console . log ( 'in website red' ) ;
106
116
redCount ++ ;
117
+ document . getElementById ( 'detectedColor' ) . innerHTML =
118
+ '<h2>Color:Red</h2>' ;
107
119
console . log ( 'redCount' + redCount ) ;
108
120
} else if ( temp . toString ( ) == 'green' ) {
109
121
console . log ( 'in website green' )
110
122
greenCount ++ ;
123
+ document . getElementById ( 'detectedColor' ) . innerHTML =
124
+ '<h2>Color:Green</h2>' ;
111
125
console . log ( 'greenCount' + greenCount ) ;
112
126
}
113
-
114
- } ) . then ( function ( response ) {
115
-
116
-
117
-
118
127
119
128
129
+
130
+ } ) . then ( function ( response ) {
120
131
121
132
122
133
} ) . catch ( function ( error ) {
0 commit comments