nasa-jpl / autoRIFT

A Python module of a fast and intelligent algorithm for finding the pixel displacement between two images
Apache License 2.0
212 stars 52 forks source link

Preference of displacement values to return zero #61

Closed ShashankBice closed 2 years ago

ShashankBice commented 2 years ago

Hi, I have been noticing that when I run autoRIFT with two images and there is shadow over one of them, the displacement values around the the shadow area are assigned value very close to zero. Is this a known issue and are there existing logical workarounds about it ? I was thinking of masking off two low displacement values, but does not seem to be a clean hack to me. Example1: Input image: image Output displacement (m/day) (Notice the areas around the shadow in either of the input images): image Thanks, Shashank

alex-s-gardner commented 2 years ago

It looks like you have artifacts in the image or being introduced in the orthorectification. This is why you have banding in the displacement results. My guess is that when you lose features in the image due to shading these artifacts are the most prominent feature for autoRIFT to lock onto (maximum NCC). My conclusion is that your imagery may not be of high enough quality for feature tracking. You could try doing and fft decomposition, remove frequencies with abnormally large power then reconstruct the image and try again. Or you could try to improve the orthorectification or imagery quality

ShashankBice commented 2 years ago

Hi Alex, Thanks for your response, your high frequency removal suggestion made me question my methods a bit, and looks like using a laplacian pre filtering kernel with too small a window size was introducing those. They do not appear if I do not prefilter the images. To get rid of absolute zero displacement values in shadowed areas, I just simply apply a np.ma.masked_equal operator for now. vm_alex I think this issue can be closed for now. Thanks, Shashank

alex-s-gardner commented 2 years ago

Sounds good.. closing.