From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the input of ROI descriptor?

Solved!
Go to solution

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

0 Kudos
Message 1 of 5
(4,573 Views)

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.

Tejinder Gill
National Instruments
Applications Engineer
Visit ni.com/gettingstarted for step-by-step help in setting up your system.
0 Kudos
Message 2 of 5
(4,536 Views)

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. 

0 Kudos
Message 3 of 5
(4,516 Views)
Solution
Accepted by topic author lenienter

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])

Message Edited by rpursley8 on 06-01-2010 11:38 AM
Randall Pursley
Message 4 of 5
(4,462 Views)

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

0 Kudos
Message 5 of 5
(4,429 Views)