I have thousands of images where a cylindrical shape is moving up and down (see attachment). I need to find the pixels that correspond to the lower part of this cylindrical shape (the edge between the cylinder and the background). By hand this is relatively easy to do but how can I automate the process?