Add multi-thread code for applying the filter with a mask
Extract input and seed original values in a multi-thread way.

TODO: maybe create special code for the case when input image = seed image to save time.