Module 6
Assignment
1. Create your own rule
You would have noticed from the density plots, that the rules can be
derived just by carefully observing the yellowish region and the axes.
Try to come up with suitable rules by observing the density plots for other
color spaces and
compare the performance with the one given in the paper. You might be
able to publish your own rule!
The rules in the paper “Module-6.2-Facial-Skin-Detection.pdf” are:
rule1 = r > 95; // R>95
rule2 = g > 40; // G > 40
rule3 = b > 20; // B > 20
rule4 = r > g; // R > G
rule5 = r > b; // R > B
rule6 = abs(r - g) > 15; // |R-G| > 15
// max{R, G, B} -
min{R, G, B} > 15
rule7 = (max(max(b,
g), r) - min(min(b, g), r)) > 15;
I tried these rules on the images of Obama and Hillary Clinton
From the density plots on RGB color space I deducted the next rules:
rule1 = g > b; // g > b
rule2 = g < b + 60; // g < b + 60
rule3 = r > g; // r > g
rule4 = r < g +
100; // r < g + 100
rule5 = b > r - 135; // b > r - 135
rule6 = b < r - 50; // b < r - 50
I tried these rules on the images of Obama and Hillary Clinton
From the density plots on YcrCB color space I deducted the next rules:
rule1 = Cr > 125; // Cr > 125
rule2
= Cr < 175; // Cr < 175
rule3 = Y > 80; // Y > 50
rule4 = Y <
230; // Y < 230
rule5 = Cb > 80; // Cb > 80
rule6
= Cb < 120; // Cb < 120
I tried these rules on YcrCB color space with the images of Obama and
Hillary Clinton
From the density plots on Lab color space I deducted the next rules:
rule1 = L > 70; // L > 70
rule2
= L < 250; // L < 250
rule3
= a > 125; // a > 125
rule4
= a < 160; // a < 160
rule5 = b > 130; // b > 130
rule6 = b < 165; // b < 165
I tried these rules on Lab color space with the images of Obama and
Hillary Clinton
From the density plots on HSV color space I deducted the next rules:
rule1 = H > 0; // H > 0
rule2
= H < 22; // H < 22
rule3
= S > 10; // S > 10
rule4
= S < 255; // S < 255
rule5 = V > 40; // V > 40
rule6 = V < 255; // V < 255
I tried these rules on HSV color space with the images of Obama and
Hillary Clinton
2. Wrinkle Removal
Try to run Blemish removal code on hillary clinton’s image and try to
remove the wrinkles by clicking on them. It works to an extent but not very
well.
Try to write your own program to remove wrinkles from the face. You might
end up making an awesome app!
I modified the program “removeBlemish.cpp” this way:
You push ctrl-key simoultanealy with the left mouse button and move the
mouse along one wrinkle from begin to end, all the positions are saved, after
that you click the right mouse button and that wrinkle is removed, then choose
another wrinkle, when you have finished push the s key to save the image. The
routine “Blemish removal” spend 0.3 seconds in my machine with a radius of 10 in each
position, and one wrinkle path use between 150 to 200 positions, that is almost
one minute per wrinkle, to diminish the time waiting, one routine of this
program remove some positions of the mouse path leaving around 10% of the
positions saved, separated a constant distance, then the routine blemish
removal, remove the wrinkle in those new positions.
I tried this program with the images of Obama and Hillary Clinton.
BTW, In spite of the image is adapted to the window size and the image showed is deformed, in the program remove wrinkles, the coordinates of the positions of the wrinkles are the coordinates on the image, not on the window.
No hay comentarios:
Publicar un comentario