LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read a set of 100000+ bmp file images

OK, I took another look at your code, and noticed that you were, in fact, doing more than deciding which input images to copy -- you appear to sometimes be creating new images.  Note that this is not easy to tell from looking at your code!

 

Here's a piece of code that appears to be creating a Clipped Difference between two Images:

Create Clipped Difference.pngNote that I created some constants (like the Queue) to allow me to create a "small" Snippet.  By my analysis (and I could have made a mistake!), the top code is computing the "Clipped Difference" between the two U8 Arrays (representing two Images).  But who can tell that by glancing at the code?  Try this, which does the same thing, but is much easier to recognize (and fix if it doesn't work):

Clipped Difference.png

 

But is it as fast?  Well, you can test this.  Turns out doing a 640 x 480 pair of random images takes 2.54 msec with the original subtract/Abs/subtract/halve/add algorithm, and 2.65 msec with In Range and Coerce, so if you processed 10,000 Images, my method would be 11 seconds slower.  If this matters, then I recommend replacing "Divide by 2 and convert to I16" (in the original algorithm) with "Quotient and Remainder), which reduces the time to 2.03 msec, saving a minute when processing 10,000 images over the In Range/Coerce method.  My guess, however, is that this time difference is trivial -- simply reading all those Images probably takes orders of magnitude more time.

 

Bob Schor

0 Kudos
Message 11 of 11
(223 Views)