LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calculating volume from an image

Solved!
Go to solution

Hi Omar,

 


@Omar-Abdelhameed wrote:

The issue I am facing now is when the position of the opject changes, the vi wrongly calculates number of lines!! is there are way to fix that? 


Sure: avoid position changes!

 

More seriously: you could develop an algorithm to crop the image to the interesting part by removing "black borders". This way you only need to analyze very similar images, no matter how large the border area actually is…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 31 of 33
(36 Views)

Thank you Gerdw for your advise. can you please help me applying that! I have never done something similar before. 

0 Kudos
Message 32 of 33
(31 Views)

Hi Omar,

 


@Omar-Abdelhameed wrote:

can you please help me applying that! I have never done something similar before. 


You never played with GIMP or Photoshop to auto-crop an image?

You never thought about "how did they do that?"?

 

Building an auto-crop algorithm:

  1. Define a limit to check for "background" vs. "real image content" and compare the image data against that limit
  2. In the resulting image: remove all rows/columns that only contain background pixels
  3. extra step: add a new border of defined width around the "real image content" or center the "real image content" inside a larger background image of fixed size. This will ensure your next analysis steps will always work with images of known/fixed size…

(I will not write the code for you.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 33 of 33
(27 Views)