简体   繁体   中英

What is a good way to extract dominant colors from image without the shadow?

Is it possible to extract the 'true' color of building façade from a photo/ a set of similar photos and removing the distraction of shadow? Currently, I'm using K-means clustering to get the dominant colors, however, it extracts darker colors (if the building is red, then the 1st color would be dark red) as there are lots of shadow areas in real photos.

Any suggestions are greatly appreciated!

Thanks in advance!

You could simply ignore the shadow areas by only evaluating areas of a certain brightness. I suggest you make yourself familiar with the HSI/HSL/HSV colour models

https://en.wikipedia.org/wiki/HSL_and_HSV

Understanding this should help to solve the problem on your own.

If the shadows cover a significant part of the image then this problem is non-trivial.

If the shadow is a small fraction of the area you're interested though you could try using k-medoids instead of k-means and as Piglet mentioned using a different color space with separate chromaticity and luminance channels may help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM