How to or can we use Hu moment output or 7 points to change the style , position ,width and height of object


I am using face_landmark_dtection model to find the different landmarks of the face. i successfully find the all landmarks and exact location of the landmarks.

Now i want to change the lips position like i want to open the lips for this purpose i store the the upper lips and lower lips landmark position in a list and using this list i get the centroid of both lips using

M = cv2.moments(thresh)

and pass the points to the huMoments = cv2.HuMoments(M) to get the hu moments 7 points. i want to use these 7 points to change the lips style and position like for open mouth and close mouth can it possible or if possible how i use these points to change lips shape or there is another option for this purpose.

Thanks in advance …

what exactly do you want to do with the HuMoments ? please explain a bit more.

those are not points at all, more features like ratios, angles and dimensions

also, what is inside your tresholded image ? note, that HuMoments only can process a single blob or contour

i am trying to make lip sync. application in which user select a song and picture application move the lips according to the voice .

in my Humoment i pass the all land mark points or lips area as a picture .

@berak can we use these 7 feature like ratios,angles and dimensions to change object shape??

you can use them to measure your shape.

to change the object shape, you have to move e.g the mouth keypoints

if you want to move actual image pixels, you’d need something far more advanced, like a voronoi renderer, like here or some tps/remap op or move the whole drawing to opengl, maybe

hmm, maybe you can use the moments for spline or animation controllers, who knows :wink: