-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuddy_search.html
262 lines (226 loc) · 11 KB
/
buddy_search.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
<html>
<!--
This software is provided under the provisions of the Lesser GNU Public License (LGPL). see: http://www.gnu.org/copyleft/lesser.html.
This software can be used only for research purposes, you should cite the aforementioned papers in any resulting publication.
The Software is provided "as is", without warranty of any kind.
-->
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Buddy Search App</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="static/buddy_search.css" type="text/css">
</head>
<body>
<div id="firstScreen" style='display:block'>
<br>
<label class="container">Upload files
<input type="radio" name="gender" value="Up" checked onclick="show2();">
<span class="checkmark"></span>
</label>
<label class="container"> Sample files
<input type="radio" name="gender" value="Sam" onclick="show1();">
<span class="checkmark"></span>
</label>
<input id="submit" class="button" type="submit" value='Start' onclick="chooseImageComplete()">
<div id='image-sample-screen' style='display:none'>
<div>
<select class="select-css" id="selectSample" onchange="myFunction()" style="width:200px;">
<option value="sample_1">Sample1</option>
<option value="sample_2">Sample2</option>
<option value="sample_3">Sample3</option>
<option value="sample_4">Sample4</option>
</select></div>
<div id='sample1' style='display:block'>
<table><tr><td><div id="myImga" height="20%"></div></td><td><div id="myImgb"></div> </td></tr></table>
</div>
<div id='sample2' style='display:none'>
<table><tr><td><div id="myImga2" height="20%"></div></td><td><div id="myImgb2"></div> </td></tr></table>
</div>
<div id='sample3' style='display:none'>
<table><tr><td><div id="myImga3" height="20%"></div></td><td><div id="myImgb3"></div> </td></tr></table>
</div>
<div id='sample4' style='display:none'>
<table><tr><td><div id="myImga4" height="20%"></div></td><td><div id="myImgb4"></div> </td></tr></table>
</div>
</div>
<div id='image-uploud-screen' style='display:block'>
<div class=row>
<div class='col-6'>
<div class='bs-thumbnail bs-container content'>
<img id='img1' name='img1'/>
</div>
<input id="file1" type="file" accept="image/*" onchange="readURL(this,'img1')">
</div>
<div class='col-6'>
<div class='bs-thumbnail bs-container'>
<img id='img2' name='img2'/>
</div>
<input id="file2" type="file" accept="image/*" onchange="readURL(this,'img2')">
</div>
</div>
</div>
</div>
<div id='points-selection-screen' style='display:none;'>
<nav id='#navbar' class='navbar navbar-default'>
<button class=btn-navbar id="back-btn">Back</button>
<button class=btn-navbar id="next-btn">Next</button>
<span id="instruction">Please select the epipole in image #1</span>
</nav>
<section>
<div id='layer1' class=bs-layer>
<div id="container1" class=bs-canvas-container>
<canvas id="canvas1" class=bs-canvas width=2208 height=1242></canvas>
</div>
</div>
<div id='layer2' class=bs-layer>
<div id="container2" class=bs-canvas-container>
<canvas id="canvas2" class=bs-canvas width=2208 height=1242></canvas>
</div>
</div>
</section>
</div>
</body>
<script >
//https://drive.google.com/file/d/14oiogMv2AeauOvKCZmDkkeloZVEm68KO/edit
//https://images2.minutemediacdn.com/image/upload/c_fill,g_auto,h_1248,w_2220/f_auto,q_auto,w_1100/v1555387742/shape/mentalfloss/640field.jpg
//next step. use hard codded images and make it work. Select bar. radio file/examples
//https://upload.wikimedia.org/wikipedia/commons/7/77/Delete_key1.jpg
fetch('https://raw.githubusercontent.com/ykasten/BuddySearch/master/1_a.png').then(res => res.blob()) // Gets the response and returns it as a blob
.then(blob => {
// Here's where you get access to the blob
// And you can use it for whatever you want
// Like calling ref().put(blob)
// Here, I use it to make an image appear on the page
let objectURL = URL.createObjectURL(blob);
let myImage = new Image();
myImage.src = objectURL;
document.getElementById("myImga").appendChild(myImage)
});
fetch('https://raw.githubusercontent.com/ykasten/BuddySearch/master/1_b.png').then(res => res.blob()) // Gets the response and returns it as a blob
.then(blob => {
// Here's where you get access to the blob
// And you can use it for whatever you want
// Like calling ref().put(blob)
// Here, I use it to make an image appear on the page
let objectURL = URL.createObjectURL(blob);
let myImage = new Image();
myImage.src = objectURL;
document.getElementById("myImgb").appendChild(myImage)
});
//https://drive.google.com/file/d/14oiogMv2AeauOvKCZmDkkeloZVEm68KO/edit
//https://images2.minutemediacdn.com/image/upload/c_fill,g_auto,h_1248,w_2220/f_auto,q_auto,w_1100/v1555387742/shape/mentalfloss/640field.jpg
//next step. use hard codded images and make it work. Select bar. radio file/examples
//https://upload.wikimedia.org/wikipedia/commons/7/77/Delete_key1.jpg
fetch('https://raw.githubusercontent.com/ykasten/BuddySearch/master/2_a.png').then(res => res.blob()) // Gets the response and returns it as a blob
.then(blob => {
// Here's where you get access to the blob
// And you can use it for whatever you want
// Like calling ref().put(blob)
// Here, I use it to make an image appear on the page
let objectURL = URL.createObjectURL(blob);
let myImage = new Image();
myImage.src = objectURL;
document.getElementById("myImga2").appendChild(myImage)
});
fetch('https://raw.githubusercontent.com/ykasten/BuddySearch/master/2_b.png').then(res => res.blob()) // Gets the response and returns it as a blob
.then(blob => {
// Here's where you get access to the blob
// And you can use it for whatever you want
// Like calling ref().put(blob)
// Here, I use it to make an image appear on the page
let objectURL = URL.createObjectURL(blob);
let myImage = new Image();
myImage.src = objectURL;
document.getElementById("myImgb2").appendChild(myImage)
});
//https://drive.google.com/file/d/14oiogMv2AeauOvKCZmDkkeloZVEm68KO/edit
//https://images2.minutemediacdn.com/image/upload/c_fill,g_auto,h_1248,w_2220/f_auto,q_auto,w_1100/v1555387742/shape/mentalfloss/640field.jpg
//next step. use hard codded images and make it work. Select bar. radio file/examples
//https://upload.wikimedia.org/wikipedia/commons/7/77/Delete_key1.jpg
fetch('https://raw.githubusercontent.com/ykasten/BuddySearch/master/3_a.png').then(res => res.blob()) // Gets the response and returns it as a blob
.then(blob => {
// Here's where you get access to the blob
// And you can use it for whatever you want
// Like calling ref().put(blob)
// Here, I use it to make an image appear on the page
let objectURL = URL.createObjectURL(blob);
let myImage = new Image();
myImage.src = objectURL;
document.getElementById("myImga3").appendChild(myImage)
});
fetch('https://raw.githubusercontent.com/ykasten/BuddySearch/master/3_b.png').then(res => res.blob()) // Gets the response and returns it as a blob
.then(blob => {
// Here's where you get access to the blob
// And you can use it for whatever you want
// Like calling ref().put(blob)
// Here, I use it to make an image appear on the page
let objectURL = URL.createObjectURL(blob);
let myImage = new Image();
myImage.src = objectURL;
document.getElementById("myImgb3").appendChild(myImage)
});
//https://drive.google.com/file/d/14oiogMv2AeauOvKCZmDkkeloZVEm68KO/edit
//https://images2.minutemediacdn.com/image/upload/c_fill,g_auto,h_1248,w_2220/f_auto,q_auto,w_1100/v1555387742/shape/mentalfloss/640field.jpg
//next step. use hard codded images and make it work. Select bar. radio file/examples
//https://upload.wikimedia.org/wikipedia/commons/7/77/Delete_key1.jpg
fetch('https://raw.githubusercontent.com/ykasten/BuddySearch/master/4a.png').then(res => res.blob()) // Gets the response and returns it as a blob
.then(blob => {
// Here's where you get access to the blob
// And you can use it for whatever you want
// Like calling ref().put(blob)
// Here, I use it to make an image appear on the page
let objectURL = URL.createObjectURL(blob);
let myImage = new Image();
myImage.src = objectURL;
document.getElementById("myImga4").appendChild(myImage)
});
fetch('https://raw.githubusercontent.com/ykasten/BuddySearch/master/4b.png').then(res => res.blob()) // Gets the response and returns it as a blob
.then(blob => {
// Here's where you get access to the blob
// And you can use it for whatever you want
// Like calling ref().put(blob)
// Here, I use it to make an image appear on the page
let objectURL = URL.createObjectURL(blob);
let myImage = new Image();
myImage.src = objectURL;
document.getElementById("myImgb4").appendChild(myImage)
});
</script>
<script>
var using_sample=false;
function show1(){
using_sample=true;
document.getElementById('image-uploud-screen').style.display ='none';
document.getElementById('image-sample-screen').style.display = 'block';
}
function show2(){
using_sample=false;
document.getElementById('image-uploud-screen').style.display ='block';
document.getElementById('image-sample-screen').style.display = 'none';
}
function myFunction(){
var sel = document.getElementById('selectSample');
document.getElementById('sample1').style.display ='none';
document.getElementById('sample2').style.display = 'none';
document.getElementById('sample3').style.display = 'none';
document.getElementById('sample4').style.display = 'none';
if(sel.value=="sample_1"){
document.getElementById('sample1').style.display ='block';
}else if(sel.value=="sample_2"){
document.getElementById('sample2').style.display ='block';
}
else if(sel.value=="sample_3"){
document.getElementById('sample3').style.display ='block';
}
else if(sel.value=="sample_4"){
document.getElementById('sample4').style.display ='block';
}
}
</script>
<script src="static/buddy_search.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://unpkg.com/mathjs/dist/math.min.js"></script>
<script src="static/lalolib.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/lodash/4.17.4/lodash.min.js"></script>
</html>