The artifacts at the edges caused by the background texture. Image in right is the result after using textures.
0 Comments
perturb ; // small value to add/subtract from Saturation
hsl.val[1] = (hsl.val[2] <= 0.5) ? (delta / (max + min))+perturb : (delta / (2 - max - min)); // Saturation There are empty regions in background layer. We find connected components of such regions. and assign regionId to each CC.
Red-noise used for the background texture. Color Perturbation for regions with less contrastGreen regions are regions that have small difference with their background.
The region need to be perturb if: || A - B || < e , e = 1.0; Just part of the regions that have visibility will be colored; by average color of visible pixels of the region.
Each region stores pixels and the region_Id once the growth of the region stopped. When all regions are generated, we check the visibility of each pixel within the region; if the pixel within the region have the same region id as the final region id of that pixel, it is visible otherwise it's covered by other regions. Pixels within each region recolored based on weighted average color of two colors (chose by Kmeans; k=2 )
weights are based on Euclidian distance : w=exp(- dist) Revised: I exclude the contours from color selection before applying Kmeans. The revised results are in the middle column. Left: Regions generated based on initial regionsize.
Right: Region size modified after expansion/shrinking of the boundary. Unfortunately, in many cases, the edges of the image cover by regions expansion. This part needs more work. |
Categories |