Extract the outline of the pots in an image

I have a video looking at a conveyor
I need to extract the outline of the 2 pots in the below image
I have tried thresholding and edge detection but I am picking up the background

Can anyone help?
There are also gold lids on the pots which I can find using HSV thresholding but the silver ones are causing me a lot of issues

Also please note that the pots can be off the edge of the visual area
I can’t post the second image but if you manually remove the top or the bottom of the image then you can test

the lighting is the issue. stop trying to filter this. first you have to get the lighting right.

you will have to change the whole setup physically.

you should share the purpose of this.

If you notice on the top of the left pot there is a small hole
If I can get the outline then I can look inside for any holes or other anomalies

The lights can be rotated so I can probably do something about that

I can’t see any holes.

to me those look like cups of cat food.

anything discernible on the cover foil may just be warps, creases, folds.

I doubt the application of the foil cover to the cup is capable of making holes.

if someone’s asking you to determine whether the cup is airtight, that would require actual physical testing, likely some kind of pressure/force test. not everything can or should be solved by looking. and even those things that can and should be solved by looking, cannot be solved by looking or lighting arbitrarily.

Its not really feasible to pressure test every one
Its more the alignment of the lid I’m interested in and flagging maintenance on the packing machine so folds etc. are of great interest

Thanks for all the help buddy it has been enlightening