face-landmarking-ios icon indicating copy to clipboard operation
face-landmarking-ios copied to clipboard

filling the color ?

Open saturngod opened this issue 7 years ago • 6 comments

How can I fill the color ? I try to use with uibezierpath and Point position are not same. I cloudn't find a way to draw polygon with dlib.

Is it possible to draw line and fill like uibezierpath in dlib or I need to recalculate the pixel ?

saturngod avatar Jun 08 '17 10:06 saturngod

Any update on this? @saturngod

blackshrub avatar Jul 28 '17 04:07 blackshrub

There is a function in Dlib called draw_solid_convex_polygon. This might work for your needs.

You would use this with all points from the detector I guess instead of this code:

    // and draw them into the image (samplebuffer)
    for (unsigned long k = 0; k < shape.num_parts(); k++) {
        dlib::point p = shape.part(k);
        draw_solid_circle(img, p, 3, dlib::rgb_pixel(0, 255, 255));
    }

zweigraf avatar Jul 29 '17 14:07 zweigraf

I found a fork for this: https://github.com/stanchiang/face-landmarking-ios

He use SpriteKit to draw from swift, it's faster than draw it with uibezierpath and use it as sublayer, maybe you need to modify some of the code at:

GameScene.swift

and also you need to modify which node you need to draw at: https://github.com/stanchiang/face-landmarking-ios/blob/master/DisplayLiveSamples/DlibWrapper.mm#L110

because in his case, he only extract inside mouth part

Note: you need to fix the center part, maybe there's miscalculation for this part:

var center

momoohidayat avatar Aug 03 '17 11:08 momoohidayat

@zweigraf draw_solid_convex_polygon doesn't support in mobile version. It's under gui library.

@seebeb we cannot use that code because the point is missing base on the phone. Example not working well iPhone 7 and iPad.

saturngod avatar Oct 24 '17 19:10 saturngod

@saturngod Have you found a way to draw a polygon using the facial landmark points? I am also looking for a way to accomplish this. I'll let you know if I find anything as well.

hipsterreed avatar Nov 01 '17 21:11 hipsterreed

@saturngod can you help out with this?

nehayadav94 avatar Mar 20 '19 07:03 nehayadav94