Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Design and Implementation] Baseline Solutions #11

Open
alpaylan opened this issue Jul 13, 2022 · 1 comment
Open

[Design and Implementation] Baseline Solutions #11

alpaylan opened this issue Jul 13, 2022 · 1 comment

Comments

@alpaylan
Copy link
Contributor

We need a naive baseline solution for testing our system and designing a nice cost function. @mkaynarca and @GoktugEk will be separately working on their own implementations. You can discuss algorithmic ideas here and come up with separate implementations of course.

@mkaynarca
Copy link

Hi, I'm the naive solution guy. Before I start to explain my solution, I want to mention that I am not an actual CENG guy, thus I might label/name/mention some terms wrong. In that case please feel free to correct me. Moreover, as a person, I am not a fan of formal writings nor that I can not write properly in any formal way, thus sometimes I can be interpreted as not taking it seriously. I guarantee that this is not the case.

The base of my solution can be defined as "every painting is made of areas of same or approximately equal colors". First we have to divide the picture to areas, then we have to color them as long as the cost is less than the outcome.

How do we define the areas?

Let's say that we have a picture and canvas that is length L and width W. Thus we have LxW pixels. Every pixel has a value in between 0 and 255 for Red, Green and Blue channels. If we think every color as a dimension, we can say that every pixel is a vector in 3D, which makes a picture a vector field contains LxW vectors. If we take the gradient of this vector field for each channel, the outcome would be another vector field that shows the change of the color in each channel.
enter image description here
If we define a threshold value to determine whether the change in that pixel would be enough to consider as an area border, we can define the areas in that picture. Notice that higher threshold defines the change between let's say red and blue while lower threshold defines the change between light and dark blue. Thus threshold controls the fine tuning for defining areas.

How do we pick the color for the area?

As I said before I am the naive solution guy. Just take the average of the pixels.

Solution
Our canvas is blank.
Define the areas with predetermined threshold value, cut the areas and color them.
Focus on the first area and lower the threshold.
If it is dividable and worth of the cut and color cost, divide again and focus on each one individually while lowering the threshold, color again.
If not, move on to the next area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants