LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Optimal method for flipping a 2D array

We're looking for a fast method to perform a horizontal/vertical flip to a 2D array of around 150 by 150 elements.  At the moment, the array enters a for loop, and then the corresponding 1D vectors are flipped using Reverse 1D Array.  The output of the for loop has the correct form, but we need to perform this operation on over 5 million images. The image flip is a huge bottleneck on the speed of the program.  Any ideas as to a better way to perform a horizontal/vertical flip?

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

I need pictures.

 

Do mean

11  12  13  14

21  22  23  24

31  32  33  34

41  42  44  44

to ?

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

Done right, this is a fast in-place operation. Did you calculate how many cpu clock cycles per element you are currently using, then decide if the speed can be improved at all. What is the datatype (U8, U32, etc.)

 

Show us your code, including the benchmarking and explain the operation. Just reversing rows will do nothing interesting in the vertical direction, but you are talking about "horizontal/vertical" so there has to be more than what you are saying.

 

One thing you could probably do is use a parallel FOR loop and process several images at once.

 

Where are the images coming from and where are they going? Do you read each one from disk and write it back later? Most likely the disk IO will be the bottleneck in this case.

0 Kudos
Message 3 of 3
(3,271 Views)