取消
显示结果 
搜索替代 
您的意思是: 

calculating volume from an image

已解决!
转到解答

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 项奖励
1 条消息(共 34 条)
634 次查看

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 项奖励
2 条消息(共 34 条)
598 次查看

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 项奖励
3 条消息(共 34 条)
572 次查看

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 项奖励
4 条消息(共 34 条)
564 次查看

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 项奖励
5 条消息(共 34 条)
560 次查看

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

 

6 条消息(共 34 条)
554 次查看

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

 

0 项奖励
7 条消息(共 34 条)
548 次查看

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 项奖励
8 条消息(共 34 条)
535 次查看
解答
已被主题作者 Omar-Abdelhameed 接受

Here's a very rough draft.

 

altenbach_0-1760460714175.png

 

0 项奖励
9 条消息(共 34 条)
527 次查看

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 项奖励
10 条消息(共 34 条)
506 次查看