05-25-2010 02:22 AM
I am a beginner of Labview Vision users. i need to convert a RGB image into binary image and superimpose a few random lines on the binary image, and finally measure the intercept lengths from the image. i came across the problem of modifying ROI by incorporating a few random coordinates (by this coordinates, I can generate random lines.). But i could not find how to modify the coordinates or import the data of coordinate from a excel file.
Any help is appreciated.
Jian
Solved! Go to Solution.
05-26-2010 10:07 AM
To import the data from an Excel File, it depends on how the data was written to it. You may want to convert your excel data to a txt tab delimited file and then use the Read from Spreadsheet File.vi.
The following article discusses this in detail. http://digital.ni.com/public.nsf/allkb/C1100406DFFC68D686256F9300828A93
Once you read these coordinates into LabVIEW you can then construct an ROI using Convert Rectangle to ROI.
I hope this helps.
05-29-2010 10:35 PM
Thank you very much for your help.
Maybe i did not explain my problem correctly. I tried your method, but it doesn't work for my problem. so i attached a image and give the problem in the image.
06-01-2010 10:35 AM - edited 06-01-2010 10:38 AM
If you have the Vision package, then you can use the Convert Line to ROI function and feed the line into the ROI property of the image. If you do not, then you have to build your own ROI. Given the line coordinates (X1, Y1) and (X2, Y2) the entries in the ROI are as follows.
Global Rectangle - 4 element array with values [X1, Y1, X2+1, Y2+1]
Countours - Single element (External, Line, 4-element array [X1, Y1, X2, Y2])
06-01-2010 10:11 PM
Thank you very much. your diagrams are almost the same as mine. but i had the problem of "to long integer", because i didnot use this icon. therefore, the "convert line to ROI" doesn't work due to the broken line between the bundle and convert line to ROI. I could not figure out what had happened. but now it's clear. I incorporate this into my loop. it's working. i also tried the one without using Vision, and that one also works properly. i prefer the one without using Vision, even though i have bought Vision for my labview. that one looks better.
Thank you again for your help. I spent two weeks on this. If I come across the other questions, I will ask you about it.
Cheers
Jian