LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set ranges for the drawn lines using line coordinates which is drawn by multiple lines..???

I have drawn continous line below using line coordinates which represent the sensor laying... now i wanna set up the sensing ranging for each line i have drawn.

0 Kudos
Message 1 of 8
(512 Views)

@dtharun wrote:

I have drawn continous line below using line coordinates which represent the sensor laying... 


That's reasonable clear (it would help if you told us if this is in IMAQ image, a pixmap or a picture control, OpenCV a .NET canvas or logo turtle graphics).

 


@dtharun wrote:

now i wanna set up the sensing ranging for each line i have drawn.


That isn't...

 

Show some code, tell us what the inputs are and what the desired result is.

0 Kudos
Message 2 of 8
(443 Views)

dtharun_0-1720434457929.pngdtharun_1-1720434477577.png

The given picture resembles the dfoss sensor mapping, i am flowing resin on it in real time. during the resin flowing colour of the lines pixel should change when resin comes in contact with sensor. when strain is applied on particular index point in real time on the senor,at that particular place of the line of pixel color should change to red.

i can only draw the line of sensor using line coordinates but i couldn't able to figure out to set ranges and change the color when strain acts on particular point. 

Can someone explain??

Message 3 of 8
(435 Views)

Scaling the coordinates can be done by multiplying and adding to the coordinates.

 

Basically, anything can be linearly scaled, by this formula: X' = X * a + b. So, once you determined a and b, scaling is just a multiply and an add.

 

The Set Pen vi (or picture control VIs that use it) has a color input. If you change the black default to another color, it will... change the color.

 

If you have a criterium (based on line coordinates), you can select the color with a selector, or get it from an array, or whatever suits you.

Message 4 of 8
(422 Views)

Screenshot 2024-07-09 093241.pngScreenshot 2024-07-09 093307.pngso this is the sub vi i have created for color indications using draw rectangle, and i have used case structure for the true and false case with a threshold range, with comparison with numeric controller. but the coordinates are starting from the [0,0] and not from where i required... 

and i haven't understood the range setting how it is done. it would be useful if u can help me in detail a bit...

0 Kudos
Message 5 of 8
(385 Views)

For linear conversions, you need Ax+B. You have Ax+A (A is pixel).

 

There's a pixel factor (*A ) and a pixel offset (+ B). B can be negative... A can be <1.

Message 6 of 8
(373 Views)

thanks i have figured it out the way to setup the ranges ... now i'm currently working on the changing of pixel color. if anything you could help and suggest me for the code it would be useful. 

0 Kudos
Message 7 of 8
(364 Views)

@dtharun wrote:

thanks i have figured it out the way to setup the ranges ... now i'm currently working on the changing of pixel color. if anything you could help and suggest me for the code it would be useful. 


Create a color box constant, create a 2nd one. Use a Selector (not a case) to pick the one or the other. Compare coordinates (any which way you want) and wire the Boolean result to the selector.

 

If you want to select the color per line segment, you can't use one polyline VI, you either draw all lines as individual lines, or call poly line multiple times (if they can be grouped per color).

It's hard to advice without knowing what you want exactly. 

0 Kudos
Message 8 of 8
(356 Views)