LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding the area of this picture

Hi everyone,
 
I would like to find the area and volume of a throat and I've attached a picture here too. I do have an idea of how it is done, but due to my vast inexperience with Labview, I'm encountering problems after problems doing it.
 
My idea is that I will have to convert that picture first to grayscale, and then use the thresholding method to differentiate the dark pixels from the brighter ones. Then I will have the area. Below are my problems encountered:
  • Firstly, can I use purely Labview to do something like that or do I have to use NI Vision? I'm currently using Labview 8.5 and Vision Assistant 8.5, both evaluation copies.
  • Say if I use NI Vision, how do I actually combine usage of both Labview and Vision? When I attempted to run a VI file in Vision Assistant 8.5, it says "This step only supports Labview 8.2.1 VIs".
  • How do I convert a jpeg file into grayscale?

RIght now my only problem is finding the area. The volume isn't a problem if I can get a few areas from different pictures. I understand that Labview is a pretty powerful program, but being held back by these problems are making me frustrated, to say the least. I read a few textbooks on Labview but I can hardly find anything about these.

Would greatly appreciate it if someone can offer me some help, and preferably show me some examples. Thank you very much!

0 Kudos
Message 1 of 6
(3,433 Views)

Hi jbelim,

i think you can do it only with LabView. To convert it into grayscale a attach an image like i do it. The Input is a 2D Array of image data (one Pixel = 3 Byte) and the output is a 2D Array with one Byte per Pixel. Additionally the Sobel-Operator should help you.

Mike

0 Kudos
Message 2 of 6
(3,412 Views)

Thanks mike!

Will look into what you said.

0 Kudos
Message 3 of 6
(3,364 Views)

Hi Jbelim,

 

Have you looked at this Developer Zone article?  Color Threshold Example

After converting the image, you can do a search for colors that are not black, for example, traversing pixel by pixel, and then count the number of pixels on the x and y axes (from start of red color for example, to the end of the red color).  I may be wrong, but throats seem to be fairly rectangular in shape, so you probably would not need to worry about exactly where you started counting.  After you have the number of pixels, you can do a simple conversion to inches by taking a ratio of your screen resolution to your monitor size and then multiplying by your pixel counts.

 

0 Kudos
Message 4 of 6
(3,338 Views)
Hi Tolga,
 
Thanks a lot for that link! It was really a great help! Prior to that, I didn't know that I can find such examples in Labview. This program never ceases to amaze me...
0 Kudos
Message 5 of 6
(3,316 Views)
I've been looking at the histogram example in Labview and I wanna modify it so that it can display the total number of pixels in the ROI. What controls and functions should I be adding in?
0 Kudos
Message 6 of 6
(3,306 Views)