LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calculating volume from an image

Solved!
Go to solution

Hello NI community, I need your help in understanding how I can measure a volume from the attached picture. What needed is to calculate number of lines between the upper and lower limits and then the user will enter the number of pixels between each two lines and then the LV application will produce a volume of each picture. Any assistance will be much appreciated. 10 min.jpg 

0 Kudos
Message 1 of 26
(359 Views)

A volume is a 3D measure, your picture is only 2D. Do you have a formula to translate # of lines into volume?

Are the limits selected by the user? How? (there seems to be a change in brightness for the upper limit, but the lower limits does not look very distinct.

You cannot "calculate" the number of lines, you need to measure it unless the magnification is fixed and you exactly know the number of pixels per line.

 

Do you have just plain LabVIEW or also vision toolkits? Can you attach a typical image without the red markings?

What does the object represent? Is this a syringe or sight glass, for example?

0 Kudos
Message 2 of 26
(323 Views)

Thank you for your response. The distance between each two lines is 17.1 pixel, so after get the number of lines I have to multiply it to a constant and then subtract constant. The limits are upper and lower, the lower is the complete line of the glass, and the upper is when the brightness changes. As I mentioned, the number of pixels per line is exactly 17.1. I don't have vision toolkits I am using the LV development license. Please see attached picture for. This is a sight glass. 20 min.jpg

0 Kudos
Message 3 of 26
(297 Views)

Thanks. I am currently in a meeting, but this would be easy to do in plain LabVIEW. I'll look at it later.

I guess once you know the  number of lines, you can calculate the volume.

 

Is the scale always in the same place relative to the image corner?

0 Kudos
Message 4 of 26
(289 Views)

Thank you for your attention. The scale is always the same. I will wait your reply in guiding how to get that and I will give it some more tries.

0 Kudos
Message 5 of 26
(285 Views)

You can average all rows, then get the column where the average is at a maximum.

 

You can clearly see the black line and the level transition. A proper thresholding would detect these features easily and automatically. (you can average a few adjacent columns for less noise (not shown))

 

altenbach_0-1760456313642.png

 

Message 6 of 26
(279 Views)

How I can get that chart from an image and then how I will be able to calculate the volume ?

 

0 Kudos
Message 7 of 26
(273 Views)

We need the volume per line.

 

(From the number of pixels per line and the number of pixels from zero to the brightness transition, we can calculate the number of lines.)

 

0 Kudos
Message 8 of 26
(260 Views)
Solution
Accepted by topic author Omar-Abdelhameed

Here's a very rough draft.

 

altenbach_0-1760460714175.png

 

0 Kudos
Message 9 of 26
(252 Views)

Thank you for that. when I am trying to use the vi, the picture rotates and gives different readings. what would be the reason? Capture.JPG

0 Kudos
Message 10 of 26
(231 Views)