Recent Changes - Search:

Main

Robotics I Fall 2007

Robotics II Spring 2007

Robotics I Fall 2006

Vision Servoing Laboratories

FPGA-Based Vision

VDSP

LabVIEW Embedded

Code

Site Admin

edit SideBar

RoboticsIFall2006.Lab6 History

Hide minor edits - Show changes to output

Changed lines 11-12 from:
* OV7260 sample project is on the Share Drive, at K:\Labview Camera Test\OV7620 for labview\.  '''Please make a local copy onto your work machine.'''
to:
* OV7260 sample project is on the Share Drive, at http://www.cs.uml.edu/blackfin/pub/uploads/RoboticsIFall2007/OV7620%20for%20labview.zip.  '''Please make a local copy onto your work machine.'''
Changed line 57 from:
Improvements to speed:\\
to:
Improvements to speed:
Changed lines 58-62 from:
*Make sure that the caches are enabled in the Build Options menu.
*When possible, use shift registers as they prevent to copying and freeing of large data arrays.
*Don't do your calculation on every data member.  Decimate the array by every A elements in both the X and Y direction.
*Make sure this is done in two dimensions, otherwise there will be an unneccesary density of points in one direction.
*Disable Parallel execution (advice From Andrew Chandler)
to:
Make sure that the caches are enabled in the Build Options menu.
When possible, use shift registers as they prevent to copying and freeing of large data arrays.
Don't do your calculation on every data member.  Decimate the array by every A elements in both the X and Y direction.
Make sure this is done in two dimensions, otherwise there will be an unneccesary density of points in one direction.
Disable Parallel execution (advice From Andrew Chandler)
Changed lines 69-70 from:
         2-1. To inflict great destruction or damage on: The fawns decimated my rose bushes.\\
        2-2. To reduce markedly in amount: a profligate heir who decimated his trust fund.\\
to:
         a. To inflict great destruction or damage on: The fawns decimated my rose bushes.\\
        b. To reduce markedly in amount: a profligate heir who decimated his trust fund.\\
Changed lines 55-71 from:
[[http://local.wasp.uwa.edu.au/~pbourke/colour/convert/ | Converting between RGB and CMY, YIQ, YUV]]
to:
[[http://local.wasp.uwa.edu.au/~pbourke/colour/convert/ | Converting between RGB and CMY, YIQ, YUV]]\\
\\
Improvements to speed:\\
*Make sure that the caches are enabled in the Build Options menu.
*When possible, use shift registers as they prevent to copying and freeing of large data arrays.
*Don't do your calculation on every data member.  Decimate the array by every A elements in both the X and Y direction.
*Make sure this is done in two dimensions, otherwise there will be an unneccesary density of points in one direction.
*Disable Parallel execution (advice From Andrew Chandler)

dec·i·mate  (děs'ə-māt')  Pronunciation Key    \\
tr.v.  dec·i·mat·ed, dec·i·mat·ing, dec·i·mates\\

  1. To destroy or kill a large part of (a group).\\
  2. Usage Problem\\
        2-1. To inflict great destruction or damage on: The fawns decimated my rose bushes.\\
        2-2. To reduce markedly in amount: a profligate heir who decimated his trust fund.\\
  3. To select by lot and kill one in every ten of.\\
Changed line 46 from:
!!Notes:!!
to:
!!Notes:
Changed lines 48-49 from:
Each pixel is represented by 16 bits. The MOST SIGNIFICANT 8 bits hold the intensity data, the Y. So to process using the Y data, use the Upper half of the byte. A good set of tools is Functions Palettd > Advanced > Data Manipulation, specifically Split and Join numbers.
to:
Each pixel is represented by 16 bits. The MOST SIGNIFICANT 8 bits hold the intensity data, the Y. So to process using the Y data, use the Upper half of the byte. A good set of tools is Functions Palette > Advanced > Data Manipulation, specifically Split and Join numbers.
Changed lines 46-49 from:
to:
!!Notes:!!
'''Note from Mark & Zack about color format in memory:'''
Each pixel is represented by 16 bits. The MOST SIGNIFICANT 8 bits hold the intensity data, the Y. So to process using the Y data, use the Upper half of the byte. A good set of tools is Functions Palettd > Advanced > Data Manipulation, specifically Split and Join numbers.

Changed lines 47-49 from:
'''Note from Mark:''' To [[ LabViewBufferView | see a buffer]] from labview...

to:
'''Note from Mark:''' To [[ LabViewBufferView | see a custom buffer]] from labview, follow these instructions. This page will show how to find a custom labview array in VisualDSP to display in the ImageViewer.

Changed lines 47-49 from:
to:
'''Note from Mark:''' To [[ LabViewBufferView | see a buffer]] from labview...

Changed line 48 from:
'''Note from Zack:'''  This seems to be a good resource for mapping YUV to RGB. \\
to:
'''Note from Zack:'''  This seems to be a good resource for mapping YUV to RGB. \
Changed lines 48-50 from:
Note from Zack:  This seems to be a good resource for mapping YUV to RGB.  For those interested, there is also a way to get Hue from RGB. --> [[http://local.wasp.uwa.edu.au/~pbourke/colour/convert/ | Converting between RGB and CMY, YIQ, YUV]]
to:
'''Note from Zack:'''  This seems to be a good resource for mapping YUV to RGB. \\
For
those interested, there is also a way to get Hue from RGB. \\
[[http://local.wasp.uwa.edu.au/~pbourke/colour/convert/ | Converting between RGB and CMY, YIQ, YUV]]
Added lines 46-48:


Note from Zack:  This seems to be a good resource for mapping YUV to RGB.  For those interested, there is also a way to get Hue from RGB. --> [[http://local.wasp.uwa.edu.au/~pbourke/colour/convert/ | Converting between RGB and CMY, YIQ, YUV]]
Added lines 3-8:
!!Background

We talked about the [[http://en.wikipedia.org/wiki/Yuv | YUV color space]].  We also looked at the [[http://en.wikipedia.org/wiki/Visible_spectrum | visible spectrum of light]], considering short wavelengths (indigo) through long wavelengths (red).  We came to a hypothesis that the CMOS camera consists of alternating pixels that detect "amount of blue" (U+Y) and "amount of red" (V+Y). 

This was supported by the YUV-to-RGB formulas, in which red is based on luminance (brightness) plus a factor of V, and blue is luminance plus a factor of U.

Changed lines 34-39 from:
  UY VY UY VY etc for 240 total words.
to:
  UY VY UY VY etc for 240 total words.

The challenge is to write LabVIEW code that interprets the image data in the LabVIEW array and does something useful based on it.  Look for the text "Process Buffer Here."

You may want to start by simply displaying a bit of this data as numbers to make sure things are working.

Changed lines 19-20 from:
* Now, go to View:Debug Windows:Image Viewer, and a configuration window will pop up.  Insert (paste) the address at the Start Address field.  Change the pixel format to UYVY.  Width is 320 and Height is 240.  Select "Update at Halt" in Options.  Hit OK. Attach:image-viewer.png
to:
* Now, go to View:Debug Windows:Image Viewer, and a configuration window will pop up.  Insert (paste) the address at the Start Address field.  Change the pixel format to UYVY.  Width is 320 and Height is 240.  Select "Update at Halt" in Options.  Hit OK.

Attach:image-viewer.png
Added lines 29-32:

After the VI @@_BF Device Get Buffer u16@@, the image data is available as a LabVIEW array of 320x240 pixels.  Each pixel is a 16-bit unsigned integer where one byte is either U or V and the other byte is Y.  These words alternate, so each row consists of 160 UY words and 160 VY words; i.e.:

  UY VY UY VY etc for 240 total words.
Changed lines 5-6 from:
* OV7260 sample project is on the Share Drive.  '''Please make a local copy onto your work machine.'''
to:
* OV7260 sample project is on the Share Drive, at K:\Labview Camera Test\OV7620 for labview\.  '''Please make a local copy onto your work machine.'''
Added lines 24-28:
!!The Challenge

In the @@OV7620 test project.vi@@, the heart of the code is:

Attach:ov7620-test-project.PNG
Changed lines 19-20 from:
* Now, go to View:Debug Windows:Image Viewer, and a configuration window will pop up.  Insert (paste) the address at the Start Address field.  Change the pixel format to UYVY.  Width is 320 and Height is 240.  Select "Update at Halt" in Options.  Hit OK.
to:
* Now, go to View:Debug Windows:Image Viewer, and a configuration window will pop up.  Insert (paste) the address at the Start Address field.  Change the pixel format to UYVY.  Width is 320 and Height is 240.  Select "Update at Halt" in Options.  Hit OK. Attach:image-viewer.png
Added line 6:
Added lines 9-23:
* Build and run the project.  LED2 should flash, indicating frame grabs.  Each flash-on and flash-off represents one frame grab.

* To see the image in Visual DSP, do File:Load Program, and find the DXE file (Visual DSP executable) created by LabVIEW.  Then go into Debug:Run (or hit F5) to run the program.  After the 10 second white-balance, the LED should start flashing, indicating the code is running.

* Hit halt, and the file "device.c" should come up.  Scroll all the way to the bottom and insert a breakpoint at the final "return 0" statement.  Run the program; it should halt at the breakpoint.

* Click the "glasses" icon, which will bring up the Expressions window.  In the function lv_adi_dev_WaitBuffer, go into the case statement for ADI_DEV_2D, highlight the variable "p2DBuffer", and drag it to the Expressions window.

* Expand it open, find the ellipses bracket, and then find the value of the "Data" field.  Copy the address. 

* Now, go to View:Debug Windows:Image Viewer, and a configuration window will pop up.  Insert (paste) the address at the Start Address field.  Change the pixel format to UYVY.  Width is 320 and Height is 240.  Select "Update at Halt" in Options.  Hit OK.

* Finally, run the program again.  When the code hits the breakpoint, the Image Viewer should update with your image.

Changed lines 5-7 from:
* OV7260 sample project is on the Share Drive.  '''Please make a local copy onto your work machine.'''
to:
* OV7260 sample project is on the Share Drive.  '''Please make a local copy onto your work machine.'''
* When you build the project, make sure to add the external library file in the project manager, LabVIEW Camera Test/OV7620/for LabVIEW/libov7620/Debug/libov7620.dlb.  You'll have to change the file dialog filter to allow all files (*.*) for this file to be visible.

Changed lines 1-5 from:
!Lab 6: Vision
to:
!Lab 6: Vision

!!Setup

* OV7260 sample project is on the Share Drive.  '''Please make a local copy onto your work machine.'''
Added line 1:
!Lab 6: Vision
Edit - History - Print - Recent Changes - Search
Page last modified on October 05, 2007, at 06:15 PM