LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resizing Binary Image Background Colour Problem

Solved!
Go to solution

Hi,

 

I am trying to resize an array of binary images and dsplay it with a specific interval of time.

I built a VI which working well as per my requirement but the problem is white colour is turning into blue,

I could not able to trace out the problem exactly...could you suggest some thing?

Download All
0 Kudos
Message 1 of 9
(4,463 Views)

could you resend your vi in lower version at least    2014

0 Kudos
Message 2 of 9
(4,448 Views)

You didn't attach your Resize 2D Array2 vi which is probably the source of the problem.

 

Ben64

0 Kudos
Message 3 of 9
(4,430 Views)

Please find attached 2011 version VIs

0 Kudos
Message 4 of 9
(4,401 Views)

You should manipulate the 1-bit pixmap 2D boolean array instead of converting to U8, rotating and convert again to U32. Even if you initiaze to color white each data point gets overwritten by a color value resulting from all the previous manipulations.

 

Change your Resize 2D array2.vi to receive a 2D boolean input and replace the white color constant to a boolean value (T/F doesn't matter since it will be overwritten) and change the output to the resulting 2D boolean array. In the main vi use Flatten Pixmap.vi (connect the resulting 2D boolean array to the 1-bit pixmap input) followed by Draw Flattened Pixmap.vi to obtain the resized image. You may need to invert the 2D boolean array values.

 

Ben64

 

 

0 Kudos
Message 5 of 9
(4,379 Views)

ben64 a écrit :

You should manipulate the 1-bit pixmap 2D boolean array instead of converting to U8, rotating and convert again to U32. Even if you initiaze to color white each data point gets overwritten by a color value resulting from all the previous manipulations.

 

Change your Resize 2D array2.vi to receive a 2D boolean input and replace the white color constant to a boolean value (T/F doesn't matter since it will be overwritten) and change the output to the resulting 2D boolean array. In the main vi use Flatten Pixmap.vi (connect the resulting 2D boolean array to the 1-bit pixmap input) followed by Draw Flattened Pixmap.vi to obtain the resized image. You may need to invert the 2D boolean array values.

 

Ben64

 

 


No need to invert, you can set the T/F colors by by wiring an array to the Color input of Draw Flattend Pixmap.vi. Set index 0 (T color) to 0x000000 for black, set index 1 (F color) to 0xFFFFFF for white.

 

Ben64

0 Kudos
Message 6 of 9
(4,352 Views)

I tried it as per your update, Draw Flattened Pixmap.vi is not accepting the input values as you suggested. T colour & F colour

I also traied that rotating and convrting it to U32. but it also din't work. Smiley Frustrated

 

 

 

 

0 Kudos
Message 7 of 9
(4,289 Views)
Solution
Accepted by Haristhota
Message 8 of 9
(4,266 Views)
Solution
Accepted by Haristhota

@Haristhota wrote:
[...] the problem is white colour is turning into blue,

I could not able to trace out the problem exactly...could you suggest some thing?


2016-02-17_blues.PNG

 

you translate the background color to a  1 fromated as an u8.

 

If you rotate this via -1 you get 128

 

your "Resize 2D array2.vi" does except an u32, so your input is auto-formated from u8 in u32, indicated by the small red dot in the upper left corner of your vi.

 

u8 = 128 -->

 

u32 = r g b = u8 u8 u8  = 0 0 128 = BLUE

 

 

you either take the pretty solution from ben64 (which I would prefer)

or you just do somthing quick and dirty like this:

2016-02-17_white.PNG

 

or this

 

2016-02-17_white2.PNG

 

 

 

Message 9 of 9
(4,240 Views)