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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Image Processing

Solved!
Go to solution

The Program is running almost as intended; for some reason the outputs "New Picture 3" and "New Picture" appear as an "aqua-scale" but the intended result was a gray-scale. And I really dont know where my coding went wrong; I am still learning and would be very grateful If someone could offer some assistance. I attached the VI and an example image to be used as input. I attached the image as jpeg but it should really be a BMP (The website does not allow BMP files) Thanks in advance

Download All
0 Kudos
Message 1 of 3
(2,232 Views)
Solution
Accepted by topic author boli98

There was one small bug, a little difficult to find because there were too many wires running "haphazardly".  I took the liberty of isolating the problematic code, selecting it, and using the "Clean Up VI" function (the "broom" icon at the top right of the menu icons).  This code fragment occurs twice in your VI, and leads to the two "colorful" images (very pretty, but not what you want).

Color Fix.png

Look at the code in the For Loop.  See all of the red Coercion dots?  See how the output wire that goes into Flatten Pixmap also has a Coercion dot?  Why?  Well, inside the For Loop you are combining a U8 derived from the Loop Index with 0, brought in from outside the loop.  What type should this 0 be?  Why, U8.  What type is it?  Oops, I32, the default type.  If you right-click the 0, and change its Representation from I32 to U8, all the Coercion dots disappear, and all the "Shades of Cyan" images turn to Shades of Grey (not 50 Shades of Grey, but 256 Shades of Grey, which include Black and White, so maybe only 254 Shades of Grey).

 

Bob Schor

 

Message 2 of 3
(2,195 Views)

Hahaha,Thanks! Totally Overlooked that tiny detail that turned my world upside down! 

Thanks a lot! It works perfectly! Really made my day ( Really my 2 am Labview Binge)

0 Kudos
Message 3 of 3
(2,191 Views)