Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Open discussion - image processing, Computer vision, Deep CNN and etc

views
     
angch
post Feb 24 2020, 01:56 PM

On my way
****
Junior Member
636 posts

Joined: Jul 2006
https://gist.github.com/angch/e0772b9b3e3be...99bbad6f13528e7

CODE
% go run main.go
Copy paste this to browser:
data:text/html,<html><body><div%20style='background:%23000000;'>Accent</div><div%20style='background:%231c2e04;'>Accent</div><div%20style='background:%23385d08;'>Accent</div><div%20style='background:%23558c0c;'>Accent</div><div%20style='background:%2371ba11;'>Accent</div><div%20style='background:%238ee915;'>Accent</div><div%20style='background:%23a4ed44;'>Accent</div><div%20style='background:%23bbf272;'>Accent</div><div%20style='background:%23d1f6a1;'>Accent</div><div%20style='background:%23e8fad0;'>Accent</div><div%20style='background:%23fefffe;'>Accent</div></body></html>


Fixed.

Convert all pixels to HSL (Hue, Saturation, Lightness). Find the interesting hues. Don't care lightness, but use lightness to find which *hue* sticks out from the image. Once you found the top (hue, saturation), print out 10 versions of it in different lightness, in RGB space.

Easy peasy. Next!

user posted image

This post has been edited by angch: Feb 24 2020, 02:30 PM
angch
post Feb 24 2020, 02:17 PM

On my way
****
Junior Member
636 posts

Joined: Jul 2006
QUOTE(weisinx7 @ Feb 24 2020, 02:13 PM)
Hi,

Mind to explain the higher level concept?

I'm not a go programmer but from what i can see,  you find the brightest colour and use it as accent colour?

For me, i maybe will try steps below:

1. Perform gaussian filter on the image for smoothing purpose
2. Thresholding and separate blobs in image
3. From eachblob, perform analysis (find highest intensity, area and etc)
4. From the analyzed valued in the blob (maybe blob with highest intensity, contrast and etc), determine the accent colour
*
Colour space is the key. Accents are just hues, and since saturation only moves from black to white, with the intensity showing how bright it is. We'll use the total brightness to figure out with hue stands out.

No need fancy filters. Didn't have thresholding, just plain old quantization to about... 16 or so steps from all the colours.

(lol, I found more bugs, kejap, fixing more)

.... and fixed. Some bugs regarding referencing a temp value instead of a copy. My bad. Also add in rejection filter for boring grays (saturation < 0.3)

This post has been edited by angch: Feb 24 2020, 02:31 PM

 

Change to:
| Lo-Fi Version
0.0731sec    0.52    7 queries    GZIP Disabled
Time is now: 11th December 2025 - 08:41 PM