LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Distortion Correction with Lookup Table

Hello,
I am trying to run an image through lookup tables in order to correct some distortion.
I have two 2D lookup tables "LUTsXnew.raw" and "LUTsYnew.raw" which locate the new (x,y) coordinates that i want to move the pixel intensities from original image "writing_final_D.raw" into the corrected image.
However, Labview takes too much time (12 seconds), if you have some experience with arrays and images can you please have a look at my code and tell me what i am doing wrong?
I am running the same algorithm in C on the same pc and it takes less than 1second.
Thanks,
CK
PS: I am attaching the VI plus the required raw images
       Please ignore the resulting image, i just care about speed for the moment


Download All
0 Kudos
Message 1 of 2
(3,521 Views)
CK,

I cannot run your VI because Vision is not supported on my platform. So my comments are general rather than specific.

1. Your while loops can be replaced with for loops because you know the number of iterations in advance.

2. If you transpose the arrays before entering the loops, you can use autoindexing rather than using Index array in the inner loop.

3. If you only update the inner and outer iteration count indicators every 100 iterations you will not have displays that are meaningless to the user using up processor time. Eliminate them completely for the fastest performance.

4. Avoid coercion inside the loops. The IMAQ Set Pixel Value function has coercion dots on three inputs. Doing explicit conversions outside the loops may be faster.

5. The Tick Count functions should be in frames of their own to assure accurate timing.

6. Local variables are not needed and are generally slower than wires.

Lynn
Message 2 of 2
(3,502 Views)