Simple Image Saliency Detection From Histogram Backprojection
Simple Image Saliency Detection From Histogram Backprojection
The basic idea is that usually salient pixels should have very di erent colors than
most of the other pixels in the image.
We measure each pixel’s similarity to the background by histogram back-
projection.
Finally, we re ne the saliency map with Grabcut.
So here we go.
Original image (taken at Mount. Takao, Japan)
https://jacobgil.github.io/computervision/saliency-from-backproj 2/9
6/20/2019 Simple Image saliency detection from histogram backprojection
Notice how the blue jacket gets low values, since it’s unique and di erent from
the background.
Also notice how the face back-projection is not unique.
That’s bad, we will try to x that later.
https://jacobgil.github.io/computervision/saliency-from-backproj 3/9
6/20/2019 Simple Image saliency detection from histogram backprojection
cv2.normalize(backproj,backproj,0,255,cv2.NORM_MINMAX)
Threshold.
https://jacobgil.github.io/computervision/saliency-from-backproj 4/9
6/20/2019 Simple Image saliency detection from histogram backprojection
def largest_contour_rect(saliency):
contours, hierarchy = cv2.findContours(saliency * 1,
cv2.RETR_LIST,cv2.CHAIN_APPROX_SIMPLE)
https://jacobgil.github.io/computervision/saliency-from-backproj 6/9
6/20/2019 Simple Image saliency detection from histogram backprojection
I like this method since it’s simple, but it has it’s drawbacks.
https://jacobgil.github.io/computervision/saliency-from-backproj 7/9