I am new to image processing using Python. Now I am learning OpenCV and the mahotas module in Python. Many functions in these modules are related to watershed of an image. I don't know what watershed means for an image. Here is an example from the OpenCV documentation: http://docs.opencv.org/search.html?q=watershed&check_keywords=yes&area=default
Image Processing – What is Watershed Algorithm?
computer visionimage manipulation
Related Solutions
You have pairs of images that you want to compare?
What is the source of these images?
ie. Screen shots of a gui testing app or low quality noisy CCTV
What are the circumstances of the image?
Is it the same calibrated fixed camera at the same angle.
Are these hand held shots at different exposures, focus and angle
What constitutes 'the same' ?
ie. Every pixel value identical.
The art work isn't missing.
It's the same person.
They are both pictures of a tree
It basically comes down to two approaches, histogram and structure.
Histogram approaches just count the number of pixels of each colour in the two images. If you are only trying to find the pair that are a face then having a similar percentage of skin coloured pixels is probably good enough. For skin you often do this in a different colour space.
Structure means looking for particular shapes and objects in the scene. There is an opencv Tutorial on template matching. But this normally requires high quality very similar images (same angle, scale, exposure). Or there are more complex procedures to identify features and look for patterns in the ratio of various distances - this is how most biometrics work.
edit: If you are comparing very similar images, eg screen shots from a gui test tool, and you only need to know if two are identical then you need to calculate a hash of the image and compare that.
Simplest is just a histogram of pixel values - but this wouldn't detect if an identical window had moved on screen for example.
The next easiest is a list of features found by SURF
Actually, there are two very different algorithms in Adobe Photoshop CS3 or later.
The old one just shifts linearly the color of a pixel. The second one works proportionally. If your intent is to understand, in general, how contrast is applied, use the legacy contrast only. Here's an image showing a difference:
When using legacy contrast, you see that it's much more intuitive from developers point of view. It actually lightens the dark pixels, and darkens the light ones when reducing the contrast. When increasing the contrast, you will see the same happening with gray color (turning lighter, then white at 100%), while blank and white staying the same.
From the point of view of photographers, on the other hand, this doesn't make any sense. As you can see below, when applied to real images, the new contrast algorithm has much better visual results than the old one:
See also:
Better Brightness And Contrast In Photoshop CS3: describes the difference between legacy and new contrast in Photoshop,
Brightness Calculation in Digital Image Processing (PDF)is explaining scientifically the brightness and contrast editing algorithms.
Best Answer
Watershed transformation is an image enhancement method. You can think of it like a possible preprocessing step to improve the results of your algorithm.
This site has some imho very illustrative animation: http://cmm.ensmp.fr/~beucher/wtshed.html
Wikipedia has an explanation: http://en.wikipedia.org/wiki/Watershed_(image_processing)