05-01-2017 03:18 PM
In the case shown there it wouldn't, especially since it is an uninitialised shift register. The data is held in the shift register unless this is the first time that loop is being entered.
But that doesn't even matter, the outputs are only read when the loop terminates so you would get the first picture from the tunnel and the comparison image from the shift register.
05-01-2017 03:32 PM
Oh, thanks for that clarification.
05-01-2017 03:36 PM
Another possibility, as I mentioned. Using a producer/consumer design pattern, grab two images and build a 3D array with it. Pass to the consumer loop, do the math, and display or write to file.