Laser Shot
A Video-based Alternativeto Arcade Light Guns
By Tiffany Chen, Spencer Sugimoto, and Paul Yang
Introduction
Dot FinderDuck Hunt SystemPotential IssuesMaterials Needed
Block Diagram
display
gameover3
score_rgb
life
tv_in_ycrcb
threshold
set
corner_select
vcount
hcountDot Finder
xy
pixel
Duck
cloud_speed
Cloud
Video ControllerScore
Keeper
3
duck_rgb
duck_enablecloud_rgb
3
score_enable
Bushbush_select
bush_rgb3
triggerAudio handler
Speaker
Dot Finder
Goal: Given an camera view of the screen with the laser dot, find the coordinates of the dot on the screen.
What the Camera SeesScreen Location of Dot
Dot Finder Algorithm
Remove blue, green
Apply a threshold
Dot Finder Algorithm
Find the center of mass of resulting dotApply a perspective transformation of the form
(x,y) – coordinates of dot in camera image(X,Y) – coordinates of the dot on the screena,b,c,d,e,f,g,h – calibration coefficients
1
1 Perspective Transform Estimation - <http://alumni.media.mit.edu/~cwren/interpolator/>
Dot Finder Block Diagram
tv_in_ycrcb x XCenter of Mass
Coordinate Transformerthreshold y Y
Calibration Screen
Generator
setCalibration Coefficients
a,b,c,d,e,f,g
corner_select
pixelvcount
hcount
Dot Finder – Center of Mass
NTSC Decoder
tv_in_ycrcbf
v
h
y rycrcbcr g
Pixel x,y
Counter
YCrCb2
RGB
RedFilter
cb b
x x
y y
x
y
red
xxPoint
Averagethreshold yThreshold y
v
Duck Hunt System
800 x 600, 60 Hz displayShoot ducks before time runs outFeatures
Animated ducks and bushesSound effectsScore keeping & timing
Duck Hunt System - Cloud Generator
Clouds move at constant speed across the sky
cloud_controllercloud_speed
cloud_
image
cloud_rgbto & from video
controller
cloud_ROM
15 KB
cloud_
addr
3
Duck Hunt System - Bush Generator
Bushes are hard coded onto the screenBushes sway left and right each secondIf a bush is selected, bush shudders
from random number generator
bush_select
bush_controllerbush_rgbto video
controller 3
bush_image
addr
bush_rom
Duck Hunt System - Bush FSMexpire
State 00:Bush Right
State 01:Bush Left
State 11:Up Left
expirebush_select
FSM Component
State 10:Up Right
Default progression-bushes sway left and rightIf bush_select ever goes high, bush shudders
bush_selectexpire
expire
Duck Hunt System – Score Keeper
Increments score whenever a duck is shotDisplays current scoreCounts down timeIndicates a game over
lifefrom duck_controller
one_hz_enable score_rgbfrom second_timer score_keeper to video_controller
score_enable gameoverfrom video_controller to video_controller
to audio_controller
Duck Hunt System - Duck Modulesto & from video controller
second_timer
duck_enable
duck_rgb
one_hz_enable
3
expire
duck_addr
duck_image
timerappear_enable
duck_ROM
45 KBappear_counterappear
duck_controller r_interval_
enable
r_interval
xyfrom dot
finder r_bush_enabletrigger random_number_generatorbush_selectto score keeper,
audio handlerlife
speed enable
duck
speed
to bush generatorspeed_determination
Duck Hunt System - Duck Controller
State 00:Wings Up
State 01:Wings Down
State 10:Die
expire
expire
~life~life
appear Compares x & y coordinates of laser dot to duck coordinatesTakes 3 shots to kill duckFSM Component
Duck Hunt System - Video Controller
Priority encoderEnsures ducks hide behind bushes & cloudsOutputs pixel RGBs Controls image transparency
displaypixel3bush_rgb
cloud_rgb cloud_speed
video
controller
score_rgb score_enablegameover duck_enableduck_rgb
Duck Hunt System - Audio Controller
Sound SelectorChooses sound to output to speaker
Duck death, Laser shot, Bush rustle, Gameover, Duck Flapping
gameoveraudio_handleraddr = (x || y) ? shot :
life ? shudder :
death;
(from Scorekeeper)trigger sound
(from Dot Finder)Speaker
4life
(from Duck Handler)
sound_dataaddr
audio_rom
144 KB
Timeline
11/22 Center of Mass Module fully functional, Duck module basic functionality11/29 Dot Finder fully functional; Duck and Video Controller fully functional; Bush module, scorekeeping, and Audio fully functional12/4 Initial integration of dot finder & duck hunt system12/11 finish debugging & final checkoff
Materials Needed
NES Light “Zapper” Gun5mW Red Laser Pointer10mW Green Laser PointerPlastic SheetFine-Grit Sandpaper
Dot Finder – Potential Issues
Reflectivity - Dot must be brightest object on screenLCD reflectivity may not reflect laser strongly enoughUse a diffusive reflector overlay or brighter laser
Noise - Assumed noise was low enough such that the threshold filter would be sufficient
If not, and mean or median filter will be necessary
OtherOver saturation of imageDifficult perspective transformAccuracyBlurring of dot due to exposure times