LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mapping an irregular shape to represent monitor screen

Hi everyone,

 

I have captured movements inside an irregular shape and need to map it on the monitor's screen. The input space is a 2D shape with 4 boundaries and these boundaries are not straight lines but irregular and nonlinear. The 2nd space is simply a 2D screen i.e. cursor position on the monitor screen. Maybe, I can use some kind of stretching out or stretching down function or perhaps a combination of both to cover the entire screen. I want this irregular quadrilateral to represent the monitor screen. Another difficulty is that the input space can be different each time and is not unique but I will always have the 4 corners and boundary of the input space.

I appreciate your thoughts on this,
Elnaz

0 Kudos
Message 1 of 4
(2,117 Views)

Hi Elnaz,

 

What format is this input space and what exactly is the data you are collecting? Is it some sort of image? path? coordinates? Also, are you trying to skew the nonlinear edges into straight lines? Or do you want just the nearest edge of the nonlinear side to meet the edge of the monitor screen, keeping the actual proportions of the image the same?

 

Are you using any toolkits or modules? Or are you just trying to do this with low-level coding?

 

-Chris G

Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(2,079 Views)

Hi Chris,

 

Actually my data is coming from 4 magnetic sensors located at 4 corners of a rectangle. Then I record the data while a magnet moves on the surface of this rectangle.

In my algorithm I read the x,y,z components of these sensors and output X and Y coordinates. The problem, however, is that when I use X and Y together i.e. plotting Y with respect to X or when I feed the X and Y outputs to cursor control dll I get some distorted movements rather than what I'm looking for and how the magnet has actually moved. The algorithm is in C and I've implemented it into a dll. You can see the result of moving across the 3 sides of this rectangle (moving from one sensor to another) and how the movement is changed. As you can see, the middle of the screen is shrinked making the space inhomogeneous. Now, as you mentioned, I want to change this shape back to rectangle, actually, to make the movements inside this shape represent the cursor movement in the screen. So, I need to change the proportion and make it cover the entire screen i.e. skew the nonlinearity into straight lines.

 

I hope I have made some sense of what I want to do and answered the questions.

Thank you

Elnaz

0 Kudos
Message 3 of 4
(2,072 Views)

 

Yeah it seems like what is probably happening is the magnetic fields created by the sensors are interfering with each other, creating the distortion you see. In short, there are some tools available in LabVIEW that can help you do this, but they are only available in separate toolkits (see here). In particular, the IMAQ (Image Acquisition) toolkit has some calibration functions that do what you are trying to do. This page and this page provide some information about using the calibration tools in IMAQ.

 

If you are trying to do this on your own though, you'll have to use some fairly complex logic. You would have to step through each coordinate data point to eventually develop a transfer function that shifts your coordinates into a rectangle. This forum has some information that may help you develop code for doing this. But the exact algorithm LabVIEW uses for this is proprietary.

 

Hopefully this will at least give you an idea where to start. Again, probably the easiest thing to do would use a toolkit.

 

Chris G

Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(2,040 Views)