3DCube

From ProjectWiki
(Difference between revisions)
Jump to: navigation, search
(Download)
(Download)
Line 95: Line 95:
 
3DCube is written for Windows but will run fine and was even developed under Wine on linux. currently offered in executable format only. The archive contains the .exe as well as several images for testing and evaluation. Any image in the PNG file format may be used.
 
3DCube is written for Windows but will run fine and was even developed under Wine on linux. currently offered in executable format only. The archive contains the .exe as well as several images for testing and evaluation. Any image in the PNG file format may be used.
  
3DCube executable may be downloaded [http://blea.ch/~eris/win32application.rar here]. 57MB so please allow some time for download to complete.  
+
3DCube executable may be downloaded [http://blea.ch/~eris/win32application.rar here] in rar archive format.
 +
Since the file contains several test image, total size is 57MB. Please allow some time for download to complete.  
  
Simple unrar the archive, and click on win32application.exe. To open images click the Open Image button, to process an image click the button labeled Automagic.
+
==Operation==
 
+
Simply unrar the archive, and click on win32application.exe. To open images click the Open Image button, to process an image click the button labeled Automagic.
[[Image:Houghdialog.png|thumb|100px|Hough dialog box.]]
+
By default the settings are configured to find even irregularly shaped rectangles as quickly as possible. By adjusting the controls in the Hough dialog under the Operation's menu, it is possible to adjust these parameters for different situations.
+
 
+
It is also possible to select that all found lines, or all found corners be displayed after conversion which is useful when adjusting settings.
+
  
 +
'''Operations Menu'''<br>
 
[[Image:Dropdown.png|thumb|100px|Operations menu]]
 
[[Image:Dropdown.png|thumb|100px|Operations menu]]
 
The operations menu also offers many filters, many of which should be familiar to users of image editing programs. Including:
 
The operations menu also offers many filters, many of which should be familiar to users of image editing programs. Including:
* Image subtraction
+
* Subtract ~ Displays the difference between two equally sized images (Images 1 and 2)
 +
* Revert ~ to original image
 +
* Histogram EQ ~ Auto adjust image brightness
 +
* Amplify ~ Adjust brightness and contrast of image
 
* Blur
 
* Blur
 
* Sharpen
 
* Sharpen
* High-pass
+
* High-pass ~ This is essentally an edge enhancement tool, typically applied after one or more blur cycles and results in a binary image.
* Erode
+
* Erode ~ Blur outward
* Median
+
* Median ~ Finds the median value of pixels in a 3x3 neighborhood. Good for speckle and noise reduction.
* Dilate
+
* Dilate ~ Blur inwards
* etc etc blah blah
+
* Threshold ~ Convert to binary based on pixel intensity alone.
 +
* Thin ~ reduces binary lines to smallest possible width
 +
* Hough Transform ~ convert image into hough space, and back.
 +
 
 +
'''Hough Dialog'''<br>
 +
[[Image:Houghdialog.png|thumb|100px|Hough dialog box.]]
 +
By default the settings are configured to find even irregularly shaped rectangles as quickly as possible. By adjusting the controls in the Hough dialog it is possible to adjust these parameters for many different situations.
 +
 
 +
It is also possible to select that all found lines, or all found corners be displayed after conversion which is useful when adjusting settings.
  
 
[[Category:Computer Vision]]
 
[[Category:Computer Vision]]
 
[[Category:Geometry]]
 
[[Category:Geometry]]
 
[[Category:Measurement]]
 
[[Category:Measurement]]

Revision as of 13:29, 16 January 2009

Image Processing Software

Contents

What is it?

3D Cube is a system for acquiring measurements from image data. The objective of this project is to quickly determine the volumetric data of an object using high resolution camera with as little operator intervention as possible. Currently the system will detect and measure most objects with a single click, however the program may be adjusted to compensate for the environment, improve speed, selectivity, and desired accuracy.

Currently the only supported input format is .png files, however the software may be easily adapted to accept images directly from high resolution cameras or video sources.

Background clutter, writing, etc... will not affect detection so long as there are no other rectangles in the image larger than the one being measured. By default the rectangles can be at any angle between -30 and 30 degrees and still be detected accurately. The box must be generally centered in middle of the image however a great amount of offset is allowed, so long as the each edge of the box is in a different quadrant of the screen measurements will not be affected.

The images to right are some examples of output.

Box and its measurements...
Measurements of irregularly shaped box
Perfect measurement of CD
Another misshapen box

How does it work?

In the most basic sense, the system first identifies all straight edges within the image using various filters and the well documented Hough Transform which is able to detect lines even in otherwise cluttered images. Next it finds the largest rectangle formed by these lines and from that the size of the box can be determined in pixels. This combined with height information obtained either via lasers, stereoscopic cameras, or using multiple light sources and shadows can be then used to obtain volumetric information in the future.

The process actually involves about two dozen individual procedures. During each step a variety of settings may be adjusted or even performed manually in order to allow less or more perfect rectangles to be found. In this way accuracy can be increased depending on the application. Some of these steps may be observed during program's operation such as binary conversion of the image.

For purposes of discussion these procedures are be grouped into three major steps:

  • Preprocessing
  • Transformation
  • and Post-processing.
Original image of Brookyln bridge before binary conversion.
Lines found in image after binary converstion and applying the hough transform.
Cube after binary conversion.

Preprocessing
The process begins by obtaining an edge enhanced binary image—where the pixels are either totally black or totally white—using 3x3 kernel based blur and high-pass filters. This results in an image where the edges of objects are clearly visible.

At this time it is possible to apply additional filters such as thinning, erodes, medians, etc to further enhance the desired edges or compensate for noise and/or clutter in the images. Some of these filters are provided in 3DCube but are not at present utilized by default, they may however be applied manually in order to experiment with various processing techniques.

Demonstration of Hough's inner workings. Image on right represent votes for potential lines, bright spots represent most likely line parameters and have more votes while darker areas have less votes. This representation is commonly refered to as 'Hough space'.

Transformation
Next the image is translated into Hough space as shown in the image on right. This is done by calculating all possible lines intersecting each white pixel in the binary source image. Lines are represented use rho (distance), theta (angle) parameterization which corrosponds to a distance and angle perpendicular from the top left of source image. In this way every possible line may be represented by only 2 parameters (rho/theta). In the Hough space accumulator image X coordinate is the angle (theta), and Y coord is the distance (rho). Each possible line intersecting each white pixel gets a 'vote' in the Hough space accumulator. As a the white pixels in a straight line are processed, lines common to each pixel accumulate more votes. This can be observed in image on right as the brighter spots.

With the Rubic's cube image its very easy to see the 4 bright spots representing lines at 71 degrees and the 5 bright spots representing lines at 161 degrees (right angle of 71 degrees). There are 5 spots at 161 degrees because of the shadow cast by the flash.

Postprocessing
Now that the Hough space image contains line vote informations, it too may be processed as an image to further enhance the votes.

Next 3DCube must decide which are important lines and which are random clutter. It does this using a variety of proprietary procedures which determine the threshold for what is considered an accepted vote, detecting related lines, and finally for determining which rectangle formed by the lines is most likely the target to be measured.

Can it find other shapes?

It is possible with some reprogramming to allow accepting any numbers of sides, even circles. In some cases, this may slow the process down.

The images on the right shows how other images may be detected.




Original star image.
Lines found from image.

Download

3D Cube's startup screen.

3DCube is written for Windows but will run fine and was even developed under Wine on linux. currently offered in executable format only. The archive contains the .exe as well as several images for testing and evaluation. Any image in the PNG file format may be used.

3DCube executable may be downloaded here in rar archive format. Since the file contains several test image, total size is 57MB. Please allow some time for download to complete.

Operation

Simply unrar the archive, and click on win32application.exe. To open images click the Open Image button, to process an image click the button labeled Automagic.

Operations Menu

Operations menu

The operations menu also offers many filters, many of which should be familiar to users of image editing programs. Including:

  • Subtract ~ Displays the difference between two equally sized images (Images 1 and 2)
  • Revert ~ to original image
  • Histogram EQ ~ Auto adjust image brightness
  • Amplify ~ Adjust brightness and contrast of image
  • Blur
  • Sharpen
  • High-pass ~ This is essentally an edge enhancement tool, typically applied after one or more blur cycles and results in a binary image.
  • Erode ~ Blur outward
  • Median ~ Finds the median value of pixels in a 3x3 neighborhood. Good for speckle and noise reduction.
  • Dilate ~ Blur inwards
  • Threshold ~ Convert to binary based on pixel intensity alone.
  • Thin ~ reduces binary lines to smallest possible width
  • Hough Transform ~ convert image into hough space, and back.

Hough Dialog

Hough dialog box.

By default the settings are configured to find even irregularly shaped rectangles as quickly as possible. By adjusting the controls in the Hough dialog it is possible to adjust these parameters for many different situations.

It is also possible to select that all found lines, or all found corners be displayed after conversion which is useful when adjusting settings.

Personal tools
irssi scripts
eggdrop scripts