Community Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Map Image to Surface of Cone

Contestant Info:

Bruce Ammons, Ammons Engineering
User Group Affiliation:

Southeast Michigan LabVIEW User Group

Location:

National Instruments office
20255 Victor Pkwy
Suite 195
Livonia, MI 48152

Contact:

Dan Shangraw, P.E.
shangraw@autosofttech.net
517.316.2138
-or-
Arjun   Khullar
arjun.khullar@ni.com
248.885.6046

Meeting Details:

Quarterly meetings, 11:00 a.m. –   1:00 p.m.

User Group Website:

http://www.ni.com/detroit

Summary:

This program will map a circular image to the surface of a cone.  By folding the quarter circle image generated by the program into a cone shape and looking down on the point of the cone, the original image can be seen.  This makes a great challenge to your friends - give them the distorted image and challenge them to figure it out.  Tell them it is an IQ test that will make them think.  This program only uses the standard picture control, so it doesn't require any special modules or toolkits to run.  It works best with high resolution images.  Low resolution images become a little blocky during resampling.

Function:

The program loads the image as a 2D array.  The mapping loops through each coordinate in the destination image and finds the matching coordinate in the original image, then copies that pixel value.  The end result is another 2D array which can be saved as an image.  The distorted image is a quarter circle which must be printed, cut out, and folded to construct the cone.

Steps to execute code:

  1. Run Cone Mapping Main.vi
  2. Press Load button and select image to be mapped.
  3. Adjust Zoom Out factor so entire image can be seen.
  4. Adjust Circle settings so circle contains portion of image to be mapped to cone.  The angle determines where the circle is cut for the cone.
  5. Press Map button to generate the new image.
  6. Adjust Zoom Out factor so entire mapped image can be seen.
  7. If it looks good, press the Save button to save the image to disk for printing or distribution.

Screenshots:

Main Front Panel:

Front Panel.png

Main Block Diagram:

Block Diagram.png

VI Snippet:

Cone Map Snippet.png

VI attached below

Bruce Ammons
Ammons Engineering
Comments
peter_smith
Member
Member
on

Hi! Isn't your code a bit "buggy"?

These seem to me a bit interesting results:

cone_result.png

cone_result_2.png

Peter

peter_smith
Member
Member
on

Changing Zoom out to 0 or a negative value results in No image displayed.

BruceAmmons
Trusted Enthusiast
Trusted Enthusiast
on

Shame on me.  I didn't really push the code to the limits.  I knew about the limitations, but simply avoided them.  I set limits on the range of the Zoom, and checked to see if pixels are within limits during mapping.  Both of these problems should be fixed in v2.  I think the code should be a little more bug proof now.

Bruce

Bruce Ammons
Ammons Engineering
Contributors