Search code examples
javaopencvpseudocode

How to transform that pseudocode into java code?


I found out a piece of pseudocode that I wish to try using opencv; however, I'm not fully familiar with the dictionary used in it.

Below, is the first part of it:

stackedPixels ← ∅
for all pixelRow in image do 
    for all pixel in pixelRow do 
        stackedPixels ← stackedPixels ∪ pixel   
    end for 
end for
  1. As showed above stackedPixels is an array?
  2. In the loop, what the union stackedPixels ∪ pixel represents?

Could some one help me to understand it?


Solution

    1. stackedPixels could be an array or any sort of Collection that can store the pixel objects.
    2. stackedPixels ∪ pixel represents appending the current pixel to stackedPixels