R0 method recolors region once they popped put of the queue. R1 method recolors region before they pushed to the queue. Both methods use closest pair from palette. lum refers to luminance direction being applied when finding the closest pair, and mindif just considers closes pairs. Random method on the last table returns one color from palette that is closest to the region color. average colors R0_lum :cmc R1_lum:cmc R0_mindif:cmcaverage colors R0_lum :cmc R1_lum:cmc R0_lum:Euclid R1_lum:Euclid R0_mindif:EuclidReduced colors from sunset color palette from 10 to 5 |
Order of regions process |
Color assignments to a region |
Distance metrics |
Shortest path |
a) Relative luminance and minimum color difference b) Closest color to regions |
Euclidean, CMC, CIE (76,94,2000) |
Edge weights |
a) Relative luminance and minimum color difference b) Closest color to region |
Euclidean, CMC, CIE (76,94,2000) |
Path free (random coloring) |
a) Closest color to region and minimum color difference b) relative luminance |
Euclidean, CMC, CIE (76,94,2000) |
Symbols
Direction of luminance changes: |
Diff = abs(EdgeWeight - diffcolorPal ) |
distance between pairs |
if (A_lum >=B_lum) signr = true else signr = false |
diffcolorPal = colorDifferance(palette[i], palette[j]) |
palette color difference |
if (Pi_lum >= Pj_lum) signp= true else signp = false |
EdgeWeight = edge->weight |
regions color difference |
Condition Symbols |
Description |
Min_colorDiff (Pj) |
return a color Pj that minimizes Diff |
Min_colorDiff (Pi, Pj) |
return a pair (Pj,Pj) that minimizes Diff |
Lum_check(Pj, palette[a], A, B) |
Checks if signs of the luminance directions of the pairs and edge weights are the same |
Color assignment methods
Possible methods |
Region A is colored with palette [a] and B is not colored |
Both regions are not colored |
What problems will be addressed |
M1 |
case1: For each color (j) in the palette: if ( Min_colorDiff (Pj) AND Lum_check ) returns (Pj) /*****if there is no match from the palette with case 1*****/ case2 : For each color in the palette: if ( Min_colorDiff (Pj) ) return (Pj) |
For each pairs of colors (i,j) from palette: if (Min_colorDiff (Pi,Pj)) return (Pi,Pj) Colors will be assigned to each region with respect to the luminance directions. |
Pros: Compare to M2 more contrast and detail preservation Cons: case 2 enforcing contrast preservation that can cause miscoloring |
M2 |
case1: For each color (j) in the palette: if ( Min_colorDiff (Pj) AND Lum_check ) returns (Pj) /****if there is no match from the palette with case 1*****/ case2 : If (B_lum >= A_lum ) For each color (j) in the palette: if(Pj_lum >= palette[a]_lum AND Min_colorDiff(Pj)) return (Pj) If (B_lum < A_lum ) if(Pj_lum <= palette[a]_lum AND Min_colorDiff(Pj)) return (Pj) |
same as above |
Pros: Uniformity in color change Cons: not proper color transitions, can trap in a color and reduce overall contrast |
M3 |
case1: For each color (j) in the palette: if ( Min_colorDiff (Pj) AND Lum_check ) returns Pj /*****if there is no match from the palette with case 1*****/ case2 : For each pairs of colors (i,j) from palette: if (Min_colorDiff (Pi,Pj)) return (Pi,Pj) Update the colored region with new color Note: colors will be assigned to each region with respect to the luminance directions. |
same as above |
Pros: Contrast and details preservation Cons: not proper color transitions, new pairs can cause many miscolorings |
M4 |
For each color (j) in the palette: if (Lum_check ) then return Min_colorDiff (Pj) (first consider just luminance of signs, then closeness) if there is no match from the palette with this case, the region will be push back to the queue but the path cost won't be updated and the parent won't be set. |
same as above |
Pros: detail and contrast preservation. Better color transitions Cons: |
Second pass |
Once the Q is empty , we check the regions flags for being recolored or not. We use the same function depends on the design to recolor the uncolored regions. |
- |
recolor the regions didn't recolored by shortest path |
If there wasn't any match between the pairs when signs are the same, the color will be return with the same index as the parent.
average color start by region 0 start by region (mid) region (mid) same index cmc closest color
average colors mid region: same index if not matched closest color
Apparently, there isn't much difference to use shortest path for the naïve recoloring.
Average colors Free of path with shortest path
That is correct that sometimes colors can be trapped in one palette. The metric is Euclidean distance using shortest path method. It's obvious in bird image, where there is a division between colors in right and left side of the image.
Euclidean distance
I have got results in the bottom by changing the lightness formula, from intensity to relative luminance and using the look up table when extracting the edge weights to calculate the distance to the palette pairs.
Euclidean distance
CMC
Euclidean CMC CIE2000
cmc: good detail preservation- keep strong and weak edges
CIE94: keep weak edges as well as strong ones
CIE76: just strong edges are kept - details and textures are not preserved
CIE2000: less detail preservation - color assignments are inharmonic to image contrast
Eclidean: keeps strong edges
CIE94: keep weak edges as well as strong ones
CIE76: just strong edges are kept - details and textures are not preserved
CIE2000: less detail preservation - color assignments are inharmonic to image contrast
Eclidean: keeps strong edges
CIE1976 CIE94 CIE2000 CMC Euclidean Original
![](http://www.weebly.com/weebly/images/file_icons/mpg.png)
live-cc-all.avi | |
File Size: | 9512 kb |
File Type: | avi |
![](http://www.weebly.com/weebly/images/file_icons/mpg.png)
live-pd-30fps.avi | |
File Size: | 10301 kb |
File Type: | avi |
A new term added to the error calculation before being distributed to the neighbor regions.
A) Before applying edge weight and neighbour region size
w_n = I_neighbor / (totalw) //(err>0)
error = (w_n * error) / (up->regionPix.size())
B) After applying edge weight and neighbour region size
w_n = I_neighbor / neighbor _regionsize // (err>0)
w_n = w_n / totalw
error = (w_n * error) * (up->edges[n]->weight / totEdgeW) / (up->regionPix.size())
A) Before applying edge weight and neighbour region size
w_n = I_neighbor / (totalw) //(err>0)
error = (w_n * error) / (up->regionPix.size())
B) After applying edge weight and neighbour region size
w_n = I_neighbor / neighbor _regionsize // (err>0)
w_n = w_n / totalw
error = (w_n * error) * (up->edges[n]->weight / totEdgeW) / (up->regionPix.size())