ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Skin tone detection

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
sandy771 Posted - Mar 19 2013 : 01:29:24
Has anyone used IE for skin tone detection? are there any built in functions that can help?

Thx.
2   L A T E S T    R E P L I E S    (Newest First)
fab Posted - Mar 27 2013 : 03:56:29
I don't like skin tone detection. Anyway here is an example based (actually I just translated formulas to code...) on the paper at http://cat.hfu.edu.tw/~b8403009/TD-006386.pdf
This example loads input.jpg, and sets Not skin pixels to black.

procedure processPixel(rgb: PRGB);
var
  d, r, g: double;
  F1, F2: double;
  w: double;
  isSkin: boolean;
  h, s, l: integer;
begin
  d := (rgb^.r + rgb^.g + rgb^.b);
  if d > 0 then
  begin
    r := rgb^.r / d;
    g := rgb^.g / d;
  end
  else
  begin
    r := 0;
    g := 0;
  end;
  F1 := -1.376 * sqr(r) +1.0743 * r + 0.2;
  F2 := -0.776 * sqr(r) +0.5601 * r + 0.18;
  w := sqr(r - 0.33) + sqr(g - 0.33);
  isSkin := (g < F1) and (g > F2) and (w > 0.001);

  RGB2HSV(rgb^, h, s, l);

  isSkin := isSkin and ((h > 240) or (h <= 50));  

  if not isSkin then
    rgb^ := CreateRGB(0, 0, 0);
end;

procedure TForm1.Button22Click(Sender: TObject);
var
  i, j: integer;
begin
  ImageEnView1.IO.LoadFromFile('input.jpg');

  for i := 0 to ImageEnView1.IEBitmap.Height - 1 do
    for j := 0 to ImageEnView1.IEBitmap.Width - 1 do
      processPixel( ImageEnView1.IEBitmap.PPixels_ie24RGB[j, i] );

  ImageEnView1.Update();
end;
ehkhalid Posted - Mar 20 2013 : 03:28:33
Hi,
you can filter skil color with thresholding fuction in imageen, you can get all skin color from this link http://en.wikipedia.org/wiki/File:Felix_von_Luschan_Skin_Color_chart.svg, for each color you get the hsv value (using any image editor) and then use this value in your threshold function in imageen.

Hope this help