Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

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

views
     
TSweisinx7
post Feb 20 2020, 12:50 PM, updated 5y ago

Getting Started
**
Junior Member
212 posts

Joined: Oct 2019
Hi,

If anyone of you need someone to discuss on your image processing, or computer vision related problem, i'm interested to hear from you and discuss further as well.

Thanks
Palindrome
post Feb 23 2020, 02:06 AM

New Member
*
Validating
30 posts

Joined: Feb 2020
I don't have experience in Artificial Intelligence and tools related to computer vision.

In the old days, I worked with 256-color down to 16-color depth processing using Pascal.

I am not sure if this is related to your topic of discussion, but how would one pick the color accent from a image?

Presumably a greenish tent in a dark night, the black color is dominant, but why is green color the right theme or accent color?

I hope not to derail your thread. sweat.gif
TSweisinx7
post Feb 24 2020, 09:35 AM

Getting Started
**
Junior Member
212 posts

Joined: Oct 2019
QUOTE(Palindrome @ Feb 23 2020, 02:06 AM)
I don't have experience in Artificial Intelligence and tools related to computer vision.

In the old days, I worked with 256-color down to 16-color depth processing using Pascal.

I am not sure if this is related to your topic of discussion, but how would one pick the color accent from a image?

Presumably a greenish tent in a dark night, the black color is dominant, but why is green color the right theme or accent color?

I hope not to derail your thread.  sweat.gif
*
Hi,

Actually i'm not so understand on your question, but please correct me if i'm wrong.

So do you mean in dark night, why the green colour is the correct accent colour?

And what do you mean by pick the color accent from an image? Is it picking the correct colour accent from the images?

Do you mind to elaborate further?



Palindrome
post Feb 24 2020, 10:55 AM

New Member
*
Validating
30 posts

Joined: Feb 2020
QUOTE(weisinx7 @ Feb 24 2020, 09:35 AM)
Hi,

Actually i'm not so understand on your question, but please correct me if i'm wrong.

So do you mean in dark night, why the green colour is the correct accent colour?

And what do you mean by pick the color accent from an image? Is it picking the correct colour accent from the images?

Do you mind to elaborate further?
*
I should have elaborated lengthly. It is a personalization feature in Windows 10.

QUOTE
Use these steps to change the accent color of the desktop automatically on Windows 10:
Open Settings on Windows 10.
Click on Personalization.
Click on Colors.
Under the “Choose your accent color” section, check the Automatically pick accent color from my background option.


Do you notice the last line, "Automatically pick accent color from wallpaper".

There is one wallpaper with black starry sky, and a green tent on the ground. But Windows 10 is able to use green color instead of majority black color. How did it do that?


Palindrome
post Feb 24 2020, 10:58 AM

New Member
*
Validating
30 posts

Joined: Feb 2020
https://pictr.com/images/2020/02/24/5FrPh2.md.jpg

I mean this wallpaper.
TSweisinx7
post Feb 24 2020, 12:06 PM

Getting Started
**
Junior Member
212 posts

Joined: Oct 2019
i see, actually that would depend on their algorithm. If green colour is the accent colour, probably they choose based on the highest contrast compared to the background, in this case, black is the background, while there are a few contrasted colour:

user posted image

I might be wrong, but this is just my thought
SUSjbcoder
post Feb 24 2020, 01:52 PM

Enthusiast
*****
Junior Member
783 posts

Joined: Sep 2019
QUOTE(weisinx7 @ Feb 24 2020, 12:06 PM)
i see, actually that would depend on their algorithm. If green colour is the accent colour, probably they choose based on the highest contrast compared to the background, in this case, black is the background, while there are a few contrasted colour:

user posted image

I might be wrong, but this is just my thought
*
Actually we need to first get the pixels and obtain the RGB component values and from there calculate their percentage from all white and each other then from there should be able to determine which is the dominant/accent color. RGB is easy to extract because they're all contained in 8-bits or 1 byte.

Usually it's stored in 32-bit for alignment/performance issues so the last byte (the alpha channel) is usually not used in background wallpaper, only used as textures in 3d graphics involving the GPU.

For certain formats, the old style 16-bit, you have to determine whether it's in 565 or 1555 but I think that's quite old already, and now most systems should use 888 in 4 bytes.

angch
post Feb 24 2020, 01:56 PM

On my way
****
Junior Member
635 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
TSweisinx7
post Feb 24 2020, 02:13 PM

Getting Started
**
Junior Member
212 posts

Joined: Oct 2019
QUOTE(angch @ Feb 24 2020, 01:56 PM)
https://gist.github.com/angch/e0772b9b3e3be...99bbad6f13528e7

CODE
% go run main.go
Copy paste this to browser:
data:text/html,<html%20contenteditable> <div style='background:#000000;'>Accent</div><div style='background:#30471f;'>Accent</div><div style='background:#608e3e;'>Accent</div><div style='background:#93c271;'>Accent</div><div style='background:#c9e1b8;'>Accent</div> </html>


Dang, works on Safari only. Fixing.
*
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
angch
post Feb 24 2020, 02:17 PM

On my way
****
Junior Member
635 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
Palindrome
post Feb 24 2020, 09:36 PM

New Member
*
Validating
30 posts

Joined: Feb 2020
QUOTE(weisinx7 @ Feb 24 2020, 12:06 PM)

i see, actually that would depend on their algorithm. If green colour is the accent colour, probably they choose based on the highest contrast compared to the background, in this case, black is the background, while there are a few contrasted colour: 

https://pictr.com/images/2020/02/24/5FrO4v.md.png

I might be wrong, but this is just my thought
*



Thank you for your kind explanation. Now I know have to ignore the background color.

QUOTE(angch @ Feb 24 2020, 01:56 PM)

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!
*



Now see if your code pick the following accent color as well: bruce.gif
Attached Image

https://pictr.com/images/2020/02/24/5Fzyff.md.jpg
https://pictr.com/images/2020/02/24/5FzORU.md.jpg

Keep up the good work! (BTW, I am not familiar with H,S,L although I am okay with RGB)
Palindromes
post Feb 24 2020, 09:44 PM

Getting Started
**
Validating
157 posts

Joined: Jan 2020
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
*
I think you're right, must find the "area" also, the larger the area (with the highest intensity), the possibility of becoming accent color would be higher.
( See screenshot below)

QUOTE(angch @ Feb 24 2020, 02:17 PM)
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)
*
angch, a little update to the wall paper. Depending on the size of the photo, the accent color would differs too.

As you can see, this is the Windows 10 personalization preview. There are two version (although same objects) with different accent color.
Attached Image

 

Change to:
| Lo-Fi Version
0.0144sec    0.83    6 queries    GZIP Disabled
Time is now: 29th March 2024 - 06:01 PM