Mobile app version of vmapp.org
Login or Join
Dunderdale640

: Transform or filter which selects similarly colored regions? Is there any transform, which "looks" at any region of a picture and then compares it with neighbor region, and if two regions are

@Dunderdale640

Posted in: #Filter #Gradient #Transform

Is there any transform, which "looks" at any region of a picture and then compares it with neighbor region, and if two regions are similarly colored, then unifies two regions in one and colors it with average color.

Finally, this transform will distinguish "paper" from "writing" on it.

It will color with constant value any gradient fields or dimmed pictures, while remain uncolored any area with frequently changed colors, like in writings.

Key idea is that this transform should unify any big color change if it is gradual.

Below is my manual example



Here background is unified to gray since it is average color of gradually changing background region, while rectangle is colored with dirty green because it is it's average color. Two regions are separated with high gradient margin.

UPDATE ABOUT SIMILARITY

There is a notion of color difference, for example in Lab color space it can be defined as . So, with this value one can calculate gradient, i.e. this value per pixel step. Also one may introduce threshold, separating "big" gradient from "small" one. So, pixels with small gradient can be merged together and colored with average color.

This is one rough approach coming to mind.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Dunderdale640

2 Comments

Sorted by latest first Latest Oldest Best

 

@Ravi4787994

For the example you provide a better technique would be to select the region you want to average. The system would sample the spectrum of selected colors and find the midpoint. Or, more crudely, you could manually apply a blur to "mix" the colors yourself.

Alternatively, you would have to provide the system with input on what you consider "similar". Presumably, your example distinguishes between the red/green and white/black gradients based solely on saturation, since neither hue nor value would compare well. Even within saturation you're looking at a broad range. Of course, you could apply the parameters with Lab if you prefer.

The only tool that comes to mind for this kind of analysis is Mathematica.


Mathematica provides broad and deep built-in support for both
programmatic and interactive modern industrial-strength image
processing—fully integrated with Mathematica's powerful mathematical
and algorithmic capabilities. Mathematica's unique symbolic
architecture and notebook paradigm allow images in visual form to be
included and manipulated directly, both interactively and in programs.

10% popularity Vote Up Vote Down


 

@Sims5801359

I think there's a fundamental problem with this. You say transform/merge similarly colored regions but there is nothing at all similar about red and green as you used in your example. So no it doesn't exist.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme