07-05-2024 03:02 AM
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.
07-08-2024 03:30 AM
@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.
07-08-2024 05:35 AM
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??
07-08-2024 06:22 AM - edited 07-08-2024 06:25 AM
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.
07-08-2024 11:14 PM
so 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...
07-09-2024 03:02 AM
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.
07-09-2024 05:02 AM
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.
07-09-2024 12:36 PM
@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.