[Question] Best method for contour identification based on my images?

What’s up everyone,

I have two colorized depth scale images of the same environment. In one image, the depth imager is very nearly parallel to the surface so the colorization is fairly uniform other than the object I’m trying to identify. The other image I have is the same image except the imager is no longer nearly parallel to the surface resulting in a drastic change in color with the same object still noticeable. I know this is kind of a unique case, but is there a way to group color changes by change over time/ pixel count? For example, the parallel image has a sharp drastic change from greenish → blue in a short time relative to the whole image frame. Where as the non-parallel image changes color over the entire image. I kind of want to make a mask of some type that is able to filter out the long ranging color changes and keeps the sharp color changes for contour finding.

Any help/ suggestions are appreciated.

See both images below: First Image is nearly parallel to the surface and the contour is easily identifiable, second image is not parallel and is not as easy to see… I will try and post it in the comments as I can only do one media file.

Second Image:

low pass filter.

use original depth values (grayscale), not this colorized version.

run a median, box blur, or gaussian blur with very large kernel size.

subtract that from the data.

values remaining should be around 0 so be aware of that when visualizing.

related: difference of gaussians (a band pass filter)

Sorry, I have some experience in OpenCV but not much. I saw on the tutorial site the box filter example. What is a “large” kernel size relatively? 10?

What do you mean by subtract that from the data?

Then would I just run find contours? That’s how I was previously finding outliers.