-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspecificPhotoRecognize.html
284 lines (282 loc) · 14.4 KB
/
specificPhotoRecognize.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>tulipQuant 御宽-策略广场</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- 引入 Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/cropper/3.1.3/cropper.min.css" rel="stylesheet">
<!-- main css file -->
<link rel="stylesheet" href="css/specificPhotoRecognize.css">
<link rel="stylesheet" href="css/basic.css">
<link rel="stylesheet" href="css/reset.css">
<!-- Icomoon Icon Fonts-->
<link rel="stylesheet" href="css/style.css">
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<header class="specificHead">
<div class="top inner-wrap clearfix ">
<a href="#" class="logo"><img src="img/logo11.png" alt=""></a>
<span class="blue-btn" id="login-wrap" style="display: block;">
<a href="#" id="login">登录</a>/<a href="#" id="register">注册</a>
</span>
<ul class="clearfix" id="menu" style="margin-right: 110px;">
<li>
<a href="index.html">首页</a>
</li>
<li class="help">
<a href="javascript:;">量化策略</a>
<div class="sub">
<a href="celue.html">策略商场</a>
<a href="celue.html">售卖我的策略</a>
<span class="arrow"></span>
</div>
</li>
<li class="help">
<a href="feature.html">特色功能</a>
<div class="sub">
<a href="feature.html#AR">AR增强显示</a>
<a href="feature.html#wordCloud">热门股票词云</a>
<a href="feature.html#imageIdentity">随手拍 出股票</a>
<a href="feature.html#recommend">智能策略推荐</a>
<a href="feature.html#news">舆情分析</a>
<span class="arrow"></span>
</div>
</li>
<li>
<a href="#" class="help">量化选股</a>
</li>
<li class="help">
<a href="javascript:;">帮助</a>
<div class="sub">
<a href="#">关于御宽</a>
<a href="#">团队概况</a>
<a href="#">加入我们</a>
<a href="#">反馈</a>
<span class="arrow"></span>
</div>
</li>
<li id="userCenter" class="help hidden">
<a href="userCenter.html">个人中心</a>
<div class="sub">
<a href="userCenter.html">我的策略</a>
<a href="userCenter.html">我的订阅</a>
<a href="userCenter.html">我的收藏</a>
<a href="userCenter.html">账户设置</a>
<a href="userCenter.html" class="cancel">注销</a>
<span class="arrow"></span>
</div>
</li>
<li id="admin" class="help hidden">
<a href="admin.html">管理中心</a>
<div class="sub">
<a href="javascript:;" class="cancel">注销</a>
<span class="arrow"></span>
</div>
</li>
</ul>
</div>
</header>
<div class="main">
<div class="content left fleft clearfix">
<!-- 图片浏览筐 -->
<div class="user-photo-box browse">
<img id="user-photo" src="img/Wechat_no.jpeg">
</div>
<!-- 上传按钮 -->
<button class="uploadBtn btn btn-primary" data-target="#changeModal" data-toggle="modal" style="margin-left: 130px">上传图片</button>
<button class="uploadBtn btn btn-primary" data-target="#camera" data-toggle="modal">随手拍</button>
<!-- 上传图片 -->
<div class="modal fade" id="changeModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title text-primary">上传图片</h4>
</div>
<div class="modal-body">
<p class="tip-info text-center">
未选择图片
</p>
<div class="img-container hidden">
<img src="" alt="" id="photo">
</div>
</div>
<div class="modal-footer">
<label class="btn btn-danger pull-left" for="photoInput">
<input type="file" class="sr-only" id="photoInput" accept="image/*" name="file">
<span>打开图片</span>
</label>
<button class="btn btn-primary disabled" disabled="true" onclick="sendPhoto();" id="uploadImg">提交</button>
<button class="btn btn-close" aria-hidden="true" data-dismiss="modal">取消</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="camera" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title text-primary">随手拍</h4>
</div>
<div class="modal-body">
<video id="video" width="400" height="320" autoplay></video>
<button class="btn btn-primary" id="snap" class="hidden">拍照</button>
<br>
<canvas id="canvas" width="400" height="320"></canvas>
<script type="text/javascript">
var context = canvas.getContext("2d");
//当DOM树构建完成的时候就会执行DOMContentLoaded事件
window.addEventListener("DOMContentLoaded", function() {
//获得Canvas对象
var canvas = document.getElementById("canvas");
//获得video摄像头区域
var video = document.getElementById("video");
var videoObj = {
"video": true
};
var errBack = function(error) {
console.log("Video capture error: ", error.code);
};
//获得摄像头并显示到video区域
if (navigator.getUserMedia) { // Standard
navigator.getUserMedia(videoObj, function(stream) {
video.src = stream;
video.play();
}, errBack);
} else if (navigator.webkitGetUserMedia) { // WebKit-prefixed
navigator.webkitGetUserMedia(videoObj, function(stream) {
video.src = window.webkitURL.createObjectURL(stream);
video.play();
}, errBack);
} else if (navigator.mozGetUserMedia) { // Firefox-prefixed
navigator.mozGetUserMedia(videoObj, function(stream) {
video.src = window.URL.createObjectURL(stream);
video.play();
}, errBack);
} else if (navigator.msGetUserMedia) {
navigator.msGetUserMedia(videoObj, function(stream) {
video.src = window.URL.createObjectURL(stream);
video.play();
}, errBack);
}
}, false);
// 触发拍照动作
document.getElementById("snap").addEventListener("click", function() {
context.drawImage(video, 0, 0, 400, 320);
});
</script>
</div>
<div class="modal-footer">
<label class="btn btn-danger pull-left" for="snap">
<span>重新拍摄</span>
</label>
<button class="btn btn-primary" onclick="sendPhotoCam();" id="uploadImgCam">提交</button>
<button class="btn btn-close" aria-hidden="true" data-dismiss="modal">取消</button>
</div>
</div>
</div>
</div>
</div>
<div class="line"></div>
<div class="middle fleft clearfix">
<!-- <p>图片识别结果:</p>
<p>披萨,概率为:0.84126</p>
<p>玉米,概率为:0.01614</p>
<p>煎锅,煎锅,锅,概率为:0.00581</p> -->
<table class="table">
<caption><b>图片识别结果:</b></caption>
<thead class="hidden">
<tr>
<th>名称</th>
<th>识别概率</th>
</tr>
</thead>
<tbody class="" id="photoResult">
<!-- <tr>
<td>披萨</td>
<td>0.8412</td>
</tr>
<tr>
<td>玉米</td>
<td>0.01614</td>
</tr>
<tr>
<td>煎锅,煎锅,锅</td>
<td>0.00581</td>
</tr>
<tr>
<td>bagel, beigel</td>
<td>0.01117</td>
</tr>
<tr>
<td>木耳</td>
<td>0.00261</td>
</tr> -->
</tbody>
</table>
<img src="img/loading.gif" id="loading1" style="margin-top: -30px" class="hidden">
</div>
<div class="line"></div>
<div class="right fright clearfix ">
<p><b>股票识别结果:</b></p>
<br></br>
<img src="img/loading.gif" id="loading2" style="margin-top: -30px" class="hidden">
<div id="StockResult" class="hidden">
<!-- <p>上市公司:苏泊尔</p>
<p>股票代码:002032.SZ</p>
<p>主营业务:锅</p> -->
<button class="btn btn-primary btn-sm hidden" style="margin-top: 60px" id="modalTrigger" data-toggle="modal" data-target="#myModal">
结果不准确?点击校准
</button>
</div>
<!-- 模态框(Modal) -->
<div class="modal fade bs-example-modal-sm" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title" id="myModalLabel">
校准结果
</h4>
</div>
<div class="modal-body">
<div class="inline-block shuxian"></div>
<label for="">请输入上图心仪的结果</label>
<br>
<span class="f12">(例如:紫光国芯或002049)</span>
<br>
<input type="text" style="BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE:2px solid;height: 36px;margin-top: 10px;">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" id="changeResButt">
提交更改
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
</div>
<div class="bottom clear">
<h3>请上传图片</h3>
<span class="barContainer">
<span id="progressBar" class="h-100P bar"></span>
</span>
</div>
</div>
<script src="https://cdn.bootcss.com/cropper/3.1.3/cropper.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="js/ajaxfileupload.js"></script>
<script src="js/cropperfunc.js"></script>
<!-- <script src="js/cropperfuncCam.js"></script> -->
<script src="js/specificPhotoRecognize.js"></script>
</body>