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: 

Replace or rebuild array, please help

Hi, everyone

 

I have to get the color values array from an input image and then increase or decrease the number of elements (pixel).
For example, If I have 2x2 color values and I have to change it to be 4x4 and then change array to image to represent a new image.
The size of array is from the input image size 

In case of increasing, it will look like this,


2 4>>>>>>>>>> 2 2 4 4     >>>>>>> new image
6 8                     2 2 4 4
                         6 6 8 8
                         6 6 8 8


But if I have to decrease array from 4x4 to 2x2 , I have to find and average of each array group
2 3 4 10 >>>>>>>>  2.5  7  >>>>>>> new image  

3 2 10 4                   5     8

6 4 8  8

4 6 8  8 

 

My problem is I don't know how to do it. Now, I only get the color value array but I cannot increase or decrease to form a new array.
Please help, I am just the beginner.

Regard
Thank you in advance

P.S. Sorry for my poor English grammar.  

0 Kudos
Message 1 of 3
(1,997 Views)

Hello,

 

I've made this. This VI only scales in whole numbers and I programmed only scale- factor up to 4. It is able to enlarge and to shrink the image data.

 

Greets, Dave
0 Kudos
Message 2 of 3
(1,977 Views)

Thank you so much!
I will try to adapt it with others sizes Smiley Wink 

0 Kudos
Message 3 of 3
(1,970 Views)