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.
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.
04-11-2013 05:58 PM - edited 04-11-2013 06:03 PM
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.
04-11-2013 06:06 PM
I have attached the image that I was using in the vi.
04-12-2013 10:34 AM
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.
04-12-2013 10:38 AM
04-12-2013 10:48 AM
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.
04-12-2013 01:11 PM
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.
04-12-2013 01:22 PM
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.
04-12-2013 01:27 PM
Can you expand a little on the plane extraction?
In the meantime I'm going with grayscale until I figure it out.
Thanks !
04-12-2013 01:51 PM
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.
04-12-2013 02:10 PM
This sounds very interesting and may even solve this problem. I will difinitely look into this, thanks again for the super fast responses!