LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shift Register reducing 2D array size in for loop for frame averaging

Solved!
Go to solution

Hi, i recently made my first VI (so apologies for the messy VI) and am using it to acquire data from a USB color camera. The purpose of the vi was to extract 2-D intensity plots  and 1-D intensity traces with the camera for each separate color (R,G,B) as the camera was running.

 

I then attempted to average several frames of the images by using a for loop where I've converted the images into array form and add it via a shift register to an initialized array. While it does seem to be working and averaging the frames as expected, for some reason my image data is truncated to 1280 x 1280 pixels, while the resolution I've set the camera to is 2048x1536. In the image I've attached, the intensity plot for blue color (left) is fed through the loop with just regular loop tunnels, while the red is fed through shift register where the array size is reduced to 1280 x 1280. Can also see this in the 1-D plots where I've used shift registers for red and green. 

 

I think this should be an easy solve but I can't figure out why its specifically truncated to 1280 pixels with the shift register, any help in figuring this out would be greatly appreciated. 

Download All
0 Kudos
Message 1 of 3
(958 Views)
Solution
Accepted by topic author Ausboi97

Initialize your shift register with arrays of the correct size. Setting the index of the array container has nothing to do with array size, it just determines what element is shown in the upper left.. Use "initialize array" instead.

 

(Can't say much about the rest of the code because most subVIs are missing. I don't have your modules)

Message 2 of 3
(946 Views)

Cheers, this worked. 

0 Kudos
Message 3 of 3
(909 Views)