Jump to content

Check image input is valid


Recommended Posts

Posted

Hi,

I have a image control as input. I would like to know how to check if the image data is valid or not.

 

I tried to search this on Google but I cannot find answer so if there is already answer, I am sorry but help me point to it.

 

Thanks!

Thang Nguyen

Posted
I check the error output of any vision vi to see there is error or not. But is it better if there is a similar function in comparison check if image is valid or not?

 

It requires a little out of the box thinking but try the Not a Number, Path, Refnum primitive.

Posted

How/Why would a image be invalid?  If the reference could be invalid then Rolfk's response is a good start.  

 

There is are image info function that gives you the size and the type (RGB, U8 grayscale etc.) if that is the issue. (IMAQ GetImageInfo is the function).


If image content is the issue then you get a little harder, but guessing it will be one of the first two if the functions throw errors.

Posted
How/Why would a image be invalid?  If the reference could be invalid then Rolfk's response is a good start.  

 

There is are image info function that gives you the size and the type (RGB, U8 grayscale etc.) if that is the issue. (IMAQ GetImageInfo is the function).

If image content is the issue then you get a little harder, but guessing it will be one of the first two if the functions throw errors.

 

Of course there are different ways an image could be invalid. However considering he was looking for a simple LabVIEW VI "to check if the image data [of an input terminal] is valid or not" it seemed like a logical consideration that he might be looking for something along the lines of the Not a Number/Path/Refnum node. And since IMAQ images are in fact simply a special form of refnum too, which I think isn't obvious to most, I wanted to point out that this might be the solution.

 

He probably wants an easy way to detect if the input terminal received a valid image refnum. Anything else will require implementation specific use of one or more IMAQ Vision VIs to check if the specific properties or contents of the valid image reference meet the desired specifications.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.