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.
已解决! 转到解答。
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?
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.
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?
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.
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))
How I can get that chart from an image and then how I will be able to calculate the volume ?
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.)
Thank you for that. when I am trying to use the vi, the picture rotates and gives different readings. what would be the reason?