Skip to content

Commit 7a2c4d3

Browse files
committed
Update readme files.
1 parent 158e769 commit 7a2c4d3

File tree

3 files changed

+71
-37
lines changed

3 files changed

+71
-37
lines changed

README.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# geoid
22

3-
An augmented reality globe through your android device's camera! Radical, dude!
3+
An augmented reality globe application in Python and OpenCV, as well as a ocean current visulization project in Javascript/WebGL.
44

5-
This is Steven Ruppert's final project for **EGGN 512 Computer Vision** in the Spring 2013 semester at the Colorado School of Mines.
5+
These are Steven Ruppert's final projects for **EGGN 512 Computer Vision** and **CSCI 547 Scientific Visulization** in the Spring 2013 semester at the Colorado School of Mines.
6+
7+
## Contents
8+
9+
* The `android` directory contains an Android application that draws a camera frame through OpenGL ES 2.0.
10+
* The `images` directory contains older training images, not used.
11+
* The `octave` directory contains some code to pull and process the ocean dataset from ECCO2 for the WebGL project.
12+
* The `python` directory contains the main AR globe application and supporting code.
13+
* The `training` directory contains raw and cropped training images for the `geoid.py` program in the `python` directory.
14+
* The `webgl` directory contains the ocean current visualization program, also hosted at <http://blendmaster.github.io/geoid/>
15+
16+
View the README.md in each folder for more details

python/README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# geoid.py
2+
3+
`geoid.py` connects to either a camera attached to your computer or a video file, such as `test.ogv`, and attempts to augment a globe with a virtual overlay.
4+
5+
You'll need OpenCV 2.5.4 and Python 2.7.2 installed.
6+
7+
Run:
8+
9+
python geoid.py -h
10+
11+
To list options.
12+
13+
To run against the training images and test video included in this repository, run:
14+
15+
python geoid.py ../training/cropped -v test.ogv
16+
17+
## record.py
18+
19+
`record.py` captures webcam frames and records them to `output.mpg`.
20+
21+
## train.py
22+
23+
`train.py` will save an image from the camera called `train-{n}.jpg` every time the spacebar is pressed.

python/geoid.py

+35-35
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def filter_matches(kp1, kp2, matches, ratio = 0.75):
232232
camera_intrinsics = K(w, h)
233233

234234
vis = img
235-
g = grid_img.copy()
235+
#g = grid_img.copy()
236236

237237
img_keypoints, img_desc = image_detector.detectAndCompute(img, None)
238238
if img_desc != None: # if there are any keypoints
@@ -251,13 +251,13 @@ def filter_matches(kp1, kp2, matches, ratio = 0.75):
251251
xg, yg = known_kp.pt
252252

253253
# draw kp on output
254-
cv2.circle(vis, (int(xim), int(yim)), 2, know.color, -1)
254+
#cv2.circle(vis, (int(xim), int(yim)), 2, know.color, -1)
255255

256256
# draw original on grid
257-
p = (int((xg / ksize * fgrid) + know.j),
258-
int((yg / ksize * fgrid) + know.i))
259-
grid_points.append(p)
260-
cv2.circle(g, p, 2, know.color, -1)
257+
#p = (int((xg / ksize * fgrid) + know.j),
258+
#int((yg / ksize * fgrid) + know.i))
259+
#grid_points.append(p)
260+
#cv2.circle(g, p, 2, know.color, -1)
261261

262262
image_points.append(img_kp.pt)
263263
object_points.append(known_globe_point(known_kp.pt, know.lat, know.lon))
@@ -293,17 +293,17 @@ def filter_matches(kp1, kp2, matches, ratio = 0.75):
293293

294294
radius = int(np.sqrt((x_c - x_n)**2 + (y_c - y_n)**2))
295295

296-
cv2.circle(vis, (int(x_c), int(y_c)), radius, (255, 0, 0), -1)
296+
#cv2.circle(vis, (int(x_c), int(y_c)), radius, (255, 0, 0), -1)
297297

298-
for i in inliers:
299-
xim, yim = image_points[i]
300-
color = point_colors[i]
301-
p = grid_points[i]
298+
#for i in inliers:
299+
#xim, yim = image_points[i]
300+
#color = point_colors[i]
301+
#p = grid_points[i]
302302

303-
cv2.circle(vis, (int(xim), int(yim)), 5, (0, 0, 0), -1)
304-
cv2.circle(vis, (int(xim), int(yim)), 2, color, -1)
303+
#cv2.circle(vis, (int(xim), int(yim)), 5, (0, 0, 0), -1)
304+
#cv2.circle(vis, (int(xim), int(yim)), 2, color, -1)
305305

306-
cv2.circle(g, p, 5, (0,0,0), 1)
306+
#cv2.circle(g, p, 5, (0,0,0), 1)
307307

308308
#[[est_x], [est_y], [est_z]] = tvec
309309
#[[est_rx], [est_ry], [est_rz]] = rvec
@@ -316,32 +316,32 @@ def filter_matches(kp1, kp2, matches, ratio = 0.75):
316316
#print "dot(eye, norm):", np.dot(np.array([-est_x, -est_y, -est_z]), norm)
317317

318318
## draw equator/prime meridian
319-
for j in range(-90, 90, 5):
320-
x, y, z, _ = surface_point(0, j, model_globe)
321-
[[[x_im, y_im]]], _ = cv2.projectPoints(np.array([(x, y, z)]), rvec, tvec, camera_intrinsics, None)
319+
#for j in range(-90, 90, 5):
320+
#x, y, z, _ = surface_point(0, j, model_globe)
321+
#[[[x_im, y_im]]], _ = cv2.projectPoints(np.array([(x, y, z)]), rvec, tvec, camera_intrinsics, None)
322322

323-
x2, y2, z2, _ = surface_point(0, j + 5, model_globe)
324-
[[[x_im2, y_im2]]], _ = cv2.projectPoints(np.array([(x2, y2, z2)]), rvec, tvec, camera_intrinsics, None)
323+
#x2, y2, z2, _ = surface_point(0, j + 5, model_globe)
324+
#[[[x_im2, y_im2]]], _ = cv2.projectPoints(np.array([(x2, y2, z2)]), rvec, tvec, camera_intrinsics, None)
325325

326-
cv2.line(vis, (int(x_im), int(y_im)), (int(x_im2), int(y_im2)), (255, 0, 255), 2)
326+
#cv2.line(vis, (int(x_im), int(y_im)), (int(x_im2), int(y_im2)), (255, 0, 255), 2)
327327

328-
# prime meridian
329-
for j in range(-90, 90, 5):
330-
x, y, z, _ = surface_point(j, 0, model_globe)
331-
[[[x_im, y_im]]], _ = cv2.projectPoints(np.array([(x, y, z)]), rvec, tvec, camera_intrinsics, None)
332-
x2, y2, z2, _ = surface_point(j + 5, 0, model_globe)
333-
[[[x_im2, y_im2]]], _ = cv2.projectPoints(np.array([(x2, y2, z2)]), rvec, tvec, camera_intrinsics, None)
328+
## prime meridian
329+
#for j in range(-90, 90, 5):
330+
#x, y, z, _ = surface_point(j, 0, model_globe)
331+
#[[[x_im, y_im]]], _ = cv2.projectPoints(np.array([(x, y, z)]), rvec, tvec, camera_intrinsics, None)
332+
#x2, y2, z2, _ = surface_point(j + 5, 0, model_globe)
333+
#[[[x_im2, y_im2]]], _ = cv2.projectPoints(np.array([(x2, y2, z2)]), rvec, tvec, camera_intrinsics, None)
334334

335-
cv2.line(vis, (int(x_im), int(y_im)), (int(x_im2), int(y_im2)), (0, 255, 255), 2)
335+
#cv2.line(vis, (int(x_im), int(y_im)), (int(x_im2), int(y_im2)), (0, 255, 255), 2)
336336

337-
## draw edge of globe
338-
for j in range(0, 360, 5):
339-
x, y, z, _ = surface_point(j, 90, model_globe)
340-
[[[x_im, y_im]]], _ = cv2.projectPoints(np.array([(x, y, z)]), rvec, tvec, camera_intrinsics, None)
341-
x2, y2, z2, _ = surface_point(j + 5, 90, model_globe)
342-
[[[x_im2, y_im2]]], _ = cv2.projectPoints(np.array([(x2, y2, z2)]), rvec, tvec, camera_intrinsics, None)
337+
### draw edge of globe
338+
#for j in range(0, 360, 5):
339+
#x, y, z, _ = surface_point(j, 90, model_globe)
340+
#[[[x_im, y_im]]], _ = cv2.projectPoints(np.array([(x, y, z)]), rvec, tvec, camera_intrinsics, None)
341+
#x2, y2, z2, _ = surface_point(j + 5, 90, model_globe)
342+
#[[[x_im2, y_im2]]], _ = cv2.projectPoints(np.array([(x2, y2, z2)]), rvec, tvec, camera_intrinsics, None)
343343

344-
cv2.line(vis, (int(x_im), int(y_im)), (int(x_im2), int(y_im2)), (255, 255, 255), 2)
344+
#cv2.line(vis, (int(x_im), int(y_im)), (int(x_im2), int(y_im2)), (255, 255, 255), 2)
345345
dt = clock() - t
346346

347347
total_time = total_time + dt
@@ -350,7 +350,7 @@ def filter_matches(kp1, kp2, matches, ratio = 0.75):
350350
draw_str(vis, (20, 20), 'time: %.1f ms' % (dt*1000))
351351

352352
cv2.imshow('camera', vis)
353-
cv2.imshow('training', g)
353+
#cv2.imshow('training', g)
354354

355355
if 0xFF & cv2.waitKey(5) == 27:
356356
break

0 commit comments

Comments
 (0)