From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI VideoMASTER and NI AudioMASTER

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ SSIM Doesn't Work for RGB (U32) Images

I have a VI that is trying to compare two images using the IMAQ SSIM function.  When I have the vi do the SSIM comparison with Grayscale (U8) as the image type the measurement is successfully done. When I run the same VI as RGB (U32) I get a failure from IMAQ SSIM.vi.  The error description = "Error -1074396080 occurred at IMAQ Fast SSIM Possible reason(s): IMAQ Vision: Invalid image type."  From all the documentation that I read, RGB (U32) is supported.  What is going on?

 

I have attached my vi and pasted a screenshot as seen below. 

 

Untitled.png

0 Kudos
Message 1 of 16
(14,756 Views)

I have attached the image that I was using in the vi. 

0 Kudos
Message 2 of 16
(14,748 Views)

Greetings, Daniel;

 

What documentation would you happen to be looking at? A cursory search led me to the Help Document for the IMAQ SSIM VI and it only makes mention of U8 as format:

http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_ssim/

 

I used the VI that you posted as well as one of the examples that we ship with LabVIEW and I am seeing the same behaviour, so I am not quite surprised.

 

In order to use this particular VI then, you could try extracting the color planes and then comparing those. Would that be something that could work for your application?

 

Ultimately, what are you trying to accomplish with this code? I ask because we are in a different forum than the vanilla Vision forum; as such, is there a reason as to why you are attempting to perform this SSIM outside of PQA?

 

I wish you a great day!

 

Cordially;

Simon P. 

National Instruments
Applications Engineer
0 Kudos
Message 3 of 16
(14,721 Views)
I will comment more later; how would I move this to a vision forum? I put this post here by accident, when I realized it I tried to move it but could not.
0 Kudos
Message 4 of 16
(14,718 Views)

Greetings, Daniel;

 

I am not quite sure how to move the topic to a different forum other than contacting a moderator or creating a new topic. If you do create a new topic in the vision forum though, I'll take a look at those posts as well.

 

I wish you a great day.

 

Cordially;

Simon P.

National Instruments
Applications Engineer
0 Kudos
Message 5 of 16
(14,712 Views)

I looked at your link and I don't see where it says that it only works for the U8 format.  I'm trying to find where I saw information about this supporting grayscale u8 and rgb u32 but for the life of me I cannot.  Although IMAQ create vi and IMAQ ReadFile vi seem to say that they explicitly support RGB U32. 

 

What I'm trying to do is navigate a menu system via a labview controller IR transceiver and verify that I'm in the correct screen by simply acquiring an image and doing a SSIM comparison.  

0 Kudos
Message 6 of 16
(14,697 Views)

Greetings, Daniel;

 

Certainly, just above the wiring diagram there is a little square that has U8 written within. That referes to what kind of Image will be either required or used by the VI. For example, IMAQ Readfile does, as you mention, support RGB as per the RGB U32 mention just above the wiring diagram :

http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_readfile/

 

Since you are navigating a Menu System then it might be worthwhile to consider the plane extraction. In the meantime, let me know if you do find any information regarding RGB for this particular VI. On my side, I'll look around as well, and I'll inform you if I find anything either about this VI, or a different version of this VI that can accept RGB.

 

Cordially;

Simon P.

National Instruments
Applications Engineer
0 Kudos
Message 7 of 16
(14,694 Views)

Can you expand a little on the plane extraction?

 

In the meantime I'm going with grayscale until I figure it out. 

 

Thanks !

0 Kudos
Message 8 of 16
(14,692 Views)

Greetings, Daniel;

 

An RGB Image is composed of three values. If you Typecast the image that you receive into a U8 grayscale from an RGB you will likely be loosing information. However, if you split the image into three images by doing a plane extraction, then you can simply remove a "slice" of that image. Then you can run your comparison with that same color plane of the test image.

 

For example, a pixel that has the following values: (50,150,250) will be split into three points (in three grayscale images) when passed by the Extract Single Color Plane VI. The first image, the Red Plane, will have that pixel contain a value of 50, while the Green plane will have that pixel as a 150.

 

The VI that you will likely need to use is the following:

http://zone.ni.com/reference/en-XX/help/370281M-01/imaqvision/imaq_extractsinglecolorplane/

 

An example on how to extract a color plane is the following VI. It allows you to pick and swap color planes:

https://decibel.ni.com/content/docs/DOC-17956

 

Cordially;

Simon P.

National Instruments
Applications Engineer
0 Kudos
Message 9 of 16
(14,689 Views)

This sounds very interesting and may even solve this problem.  I will difinitely look into this, thanks again for the super fast responses!

0 Kudos
Message 10 of 16
(14,685 Views)