LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pixel coordinates along a ROI (line)

Hi
 
Problem: Calculating distance using "distance formula" for all the pixel points along a line on an image.
 
I am grabbing images using a camera and then using "ROI line.vi" , to define a line as region of interest.For that I have to provide,initial and final coordinates of the line (pixels) , then I use ROI transform.vi to rotate this line about a point which is one of the ends of the line.This way I get a new line (ROI) and using "ROI to line" I get the pixel coordinates of two ends for the rotated line.
 
Now I want to get the distance between two points on a line and for that I need the pixel cooridinates for the whole line.Does someone know how to get this ? or is there any better way of doing this?
 
And yah I am using 100 pixels = 34.29 mm to convert pixel distance into mm.Is it correct ?
Is it possible to switch on and off a bulb/electrical appliance using lab view ? Just want to try this out for fun ....
 
 
Thanks a lot !
 
Deepak
 
 
 
 
 
 
 
 
 
LAB View 2010 SP1
0 Kudos
Message 1 of 6
(4,951 Views)
Hey Deepak,
 
To answer your questions, I am assuming that you have the Vision Development Module installed, especially if you are using some of the Vision functions already (that you mentioned). Now, what I understand of what you are trying to do, it sounds like you already have the two endpoints of the line, and you want to get the pixel points in between to be able to make measurements on those. So if you already have the two end points of the line, then I would recommend you check out the following functions: IMAQ LineProfile.VI or IMAQ GetPixelLine.VI. The help documentation on these two will tell you more details about them, but basically you can get the values of the pixels on a line. Then once you have the other points and their values, you can do either use the IMAQ Caliper functions to measure distances on the line, or perform your own calculations using simple LabVIEW functions (like add, subtract, divide, etc.).
 
You also mentioned something about converting pixel values to real world values. You can use the Calibration VI's in order to calibrate your image, and also use some of the other functions like IMAQ Convert Pixel to Real World.VI. If you don't want to use the Calibration functions, then you can perform your own conversion, again using simple LabVIEW functions.
 
Last, for your question about switching on/off a light bulb or some other electrical appliance using LabVIEW, I would have to mention that LabVIEW can control electrical components, but usually with the help of some kind of hardware. Some hardware that I could think of would be some kind of electrical switch hooked up to a DAQ (data acquisition) board that can do either digital or analog output. Another option would be to use some 3rd party hardware and communicate with LabVIEW via some kind of protocol, such as serial, TCP/IP, modbus, Datasocket, etc. etc.There are numerous ways you can go about having LabVIEW control things via hardware.
 
I hope these answers help. Please let me know if you need any clarification on anything. Thanks, and have a great day.
 
Regards,
DJ L.
0 Kudos
Message 2 of 6
(4,923 Views)

Hey DJ L

 

Thanks a lot for such a detailed answer.I am done with distance calculations and the pixel conversion.I want to get started with controlling electrical appliances using LabView.Do you know someone who does that ? I can get in touch with him/her and get started soon.Haven't done this before.

 

Thanks! I will look on the web if I can find any help onn this.

 

Deepak

LAB View 2010 SP1
0 Kudos
Message 3 of 6
(4,893 Views)
Hey Deepak,
 
So in order to control electrical appliances using LabVIEW you will need to have some hardware to output the electrical signals to the appliance. Most of the time you could just use a simple Data Acquisition device to output either an Analog or Digital signal. So I would suggest that you create a new discussion forum thread in the DAQ or Data Acquisition forum, and you will probably get more help there. Also, when you post a new post on your electrical appliances thread, I would recommend that you include a lot of detail about what appliance, what signals need to be sent to the appliance to control it, and what hardware you are considering using. This will help others on that thread help you with your application.
 
Regards,
DJ L.
0 Kudos
Message 4 of 6
(4,878 Views)

can anyone show me example of how to extract pixel value along the ROI (line). now my program is that i drawn a line using a overlay line as i do not want to destroy the image and i convert the starting point and ending point of the line drawn to the ROI(line) using convert IMAQ Convert Line to ROI VI. And i am stuck here as i do not know how to continue my program. please reply me asap as i need this program urgently, thank you very much.

0 Kudos
Message 5 of 6
(4,395 Views)

can upload your distance VI?? i need it as my thesis also dealing with this problem...

0 Kudos
Message 6 of 6
(4,290 Views)