visps overview capture visual data from two cameras find laser triangulate to find x, y, z...

36
VISPS Overview • Capture visual data from two cameras • Find laser • Triangulate to find X, Y, Z coordinates of laser • Output coordinates to RS-232 serial output RS-232 Out

Upload: ralf-clarke

Post on 23-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

VISPS Overview

• Capture visual data from two cameras• Find laser• Triangulate to find X, Y, Z coordinates of laser• Output coordinates to RS-232 serial output

RS-232 Out

Page 2: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Talk Overview

• VISPS goals and requirements – Cephas• Design (Theory + Architecture) – Steve• Design (Details + Communication) – Cephas• Design analysis – Kevin• Issues and testing – Kevin• Schedule – Cephas• Conclusion – Cephas

Page 3: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

GOAL• Produce X, Y, Z coordinates of laser marker

relative to known reference frame

Requirements, use:• 630-680nm laser pointer• 2 RC-2 black and white cameras• XSV300 Development Board• PIC Microcontroller

VISPS Purpose

Page 4: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

High Level Design Goals

• Produce X, Y, Z from visual data

• Simple interface

• Easy to use

• General, Accurate

• Design headroom

Page 5: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

RequirementsTable 3 – VISPS operating parameter

Parameter Value

Coordinate Accuracy @ 63 inches the coordinates will be within 0.1 inches of its true location.

Data Output RS-232 Protocol (19.2 Kbps / 8 data bits / 1 stop bit / no parity)

Voltage Requires 9 and 12 V supply

Maximum Operating Distance

60 feet

Laser Flare Wavelength 630-680 nm

Laser Flare Max Output < 1 mW

Page 6: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Constraints From Requirements

• Code size on PIC C < 20kB

• Enough pins on XSV300 for two cameras input and communication with PIC C

Page 7: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

How Are Design Goals Achieved?

• Mathematics and theory

• Logical implementation and architecture

• Implementation details and subsystem communication

Page 8: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Triangulation Problem Summary

Side ViewTop View

tantan

tantan

DZ tanZY

tantan

tan

DX

Page 9: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Visual Data

Left Camera Right Camera

Pixel coordinates are available.

Page 10: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Camera Calibration

Page 11: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Pixel Distances

• h is a constant 340 pixels at any distance

Page 12: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Angle Derivation From Pixels

a

htan

Page 13: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Triangulation By Pixels

a

htan

b

htan

h

ctan

ba

Da

ah

bh

ah

DD

X

tantan

tan

Page 14: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Math And Theory Summary

• Y, and Z found Similar to X

• Found X, Y, and Z using in terms of pixel coordinates

• No trigonometry or complex math

•No multiplication of error

ba

DaX

ba

DhZ

ba

DcY

Page 15: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Design Implementation

• Goals (Output points at 30fps, Preserve design headroom)

• Black Box design outline

• Component design specifics and I/O details

Page 16: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

PIC µC

• Compute angles from pixel data

• Compute X, Y, Z from angles

• Output coordinates using RS-232 protocol

XSV300

•Locate Marker in pixel data

RoboCam RC-2

• Deliver pixel data

Generic Laser Pointer

• Project marker

RS-232 Coordinate output

Generic Red Filters• Remove non-laser lightVISPS

Page 17: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

System Pin-outs

Page 18: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

First saturated point

Last saturated point

Average of coordinates

Finding Center Of Marker

Page 19: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

XSV300-PIC Protocol

NEW

READY

BUSY

C1hi C1lo C2hi C2lo Rhi RloDATA

Page 20: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Design Analysis

• Goals met

• Requirements satisfied

• Error analysis

• Lab results

Page 21: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Goals Met

• The design will correctly produce X, Y, and Z coordinates.

• We managed to avoid solutions that would have made using VISPS overly cumbersome or complicated.

• VISPS can output points at a full 30 points per second, the same rate as the camera

• Significant upgrades to VISPS accuracy from higher resolution cameras would not require a major design change

Page 22: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Requirements Satisfied

• Reworking our math enabled us to fit all the needed code on the PIC C

• With current cameras, VISPS is accurate to within 0.1 inches at 60 inches

• Moving to XSV300 from XS40 gave us the extra I/O pins we needed

Page 23: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Error Sources and Analysis

• Miscalibration of cameras

• Camera alignment

• Camera leveling

• Camera resolution

• Output resolution

Page 24: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Miscalibration Of Cameras

• All our mathematics are based on initial measurements at Z = 160cm

• Introduction of systematic error in Z if h does not really equal 340 pixels

• Spend extra time taking careful measurements

• Integer value for h is encouraging• Do sanity checks against manual

measurements

Page 25: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Camera Alignment• All our mathematics are based on the assumption

that the two cameras are perfectly parallel• Introduction of systematic error if cameras are not

parallel• Measure D at a distance check

Page 26: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Camera Leveling

• To know the reference frame for the X, Y, Z values produced, camera assembly must be perfectly leveled

• Use bubble levels mounted on camera assembly

• Do sanity checks against manual measurements

Page 27: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

• Pixel size increases with distance

• Error is equal to ½ pixel width as a function of Z

• This error is inherent in VISPS and cannot be reduced except by increasing camera resolution

• Not bad. Even at 340ft, error only = 5.5 inches!

Camera Resolution

18.063

_

Zwidthpixel

Page 28: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Output Resolution

• Output is in tenths of inches

• Not a factor after 63 inches

• This error is inherent in VISPS

• Error can be reduced by reducing the max output distance

Page 29: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Lab Results

• Cameras filtered with red filter produce good, noise free data

• Able to find laser marker quickly, accurately, and consistently

• PIC C output shows that math is correct

• Unable to test system accuracy until parts are integrated

Page 30: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Problem Areas and Testing

• Resolved issues

• Remaining issues

• Reviewers comments

• Testing

Page 31: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Resolved Issues

• Noise filtering

• Interfering light sources

• Complex math and PIC C memory constraints

Page 32: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Remaining Issues

• Porting FPGA design to XSV300

• System accuracy

Page 33: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Reviewers CommentsProblem Their Suggestion What We DidSingle Pixel Noise In Camera Data

9 or 3 pixel median filter. 2 pixel neighbor intensity check.

Noise is not saturated.

Interfering Light Sources

Strobe laser using spinning wheel and take difference.

Red Filter to block non-laser light.

Jittery Or Unstable Coordinates

Average laser location over 4 frames for anti-jitter.

Nothing. We want the jitter.

Limited Memory of XS40

Move FPGA design to XSV300.

Moved FPGA design to XSV300

Floating-Point Math Bloat

Use LUT. Reworked math to avoid trigonometry.

Page 34: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Testing• Do lots of sanity checks against manual measurements• Test validity of math theories• Visually inspect VGA output of laser finding module

and camera perspective• Logic analyzer to check FPGA output• Extra PIC C test environment for PIC C • View serial output on Microsoft Hyperterminal• Output using printf() to test X, Y, Z production

independently of coordinate output protocol

Page 35: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Current Status And RoadmapCompleted:Find laser in visual dataModule to talk to PIC C PIC C mathPIC C, FPGA and RS-232 I/O

Remaining• Port FPGA design to XSV300• Integrate components and test• Win32 App for demo

Port FPGA Designto XSV300.

Integrate Components,test, and debug.

More debugging, test,demo.

Week 8

Week 9

Week 10

Page 36: VISPS Overview Capture visual data from two cameras Find laser Triangulate to find X, Y, Z coordinates of laser Output coordinates to RS-232 serial output

Conclusion And Summary

• Our design will work

• Design goals are met