-2

I have datasets with 9081 256x256 RGB images containing 5 peoples with three possible actions: forward/backward, wave hands, and forward bend.

Based on my application, I want to convert different human bodies into human pose template to achieve something like this: Transformation

(web: https://reurl.cc/Y9LvRD)

Namely, I don't need too many features such as colors and face, which will affect my neural network.

May i have some suggestions? Any help is much appreciated:)

Some sample of my RGB images: enter image description here enter image description here

Yi-Cheng
  • 19
  • 5
  • Can you share some of your sample RGB images? – Rahul Kedia Apr 08 '22 at 07:31
  • "Human pose estimation" would be the right keyword. Also have a look at [this link](https://www.v7labs.com/blog/human-pose-estimation-guide) – Jeru Luke Apr 08 '22 at 07:45
  • If your goal is just to get the image on the right, you can just convert the image to grayscale and apply a binary threshold at a high value (250 for example if your background is white) and set the pixels below that to a gray value as the right image. – erik7854 Apr 08 '22 at 08:22
  • Hi, @Rahul Kedia, I upload some examples on my issue. – Yi-Cheng Apr 08 '22 at 11:13
  • Hi, @Jeru Luke, thank you for your reply:) I will try to understand it. – Yi-Cheng Apr 08 '22 at 11:19

1 Answers1

1

EDIT :This only works for the example that was shown in the original post, the edited post is much more challenging than that !

You can select the area that is not white and set it to gray this way :

import skimage.io
import numpy as np


img = skimage.io.imread('themaninred.png')
tol= 50 #tolerance for the whiteness of white
img[np.sum(img, axis = 2) <255*3-tol] = [128,128,128]

skimage.io.imsave('themaninredbutgray.png', img )

enter image description here

endive1783
  • 827
  • 1
  • 8
  • 18
  • Hi, thank you for your reply:) I use your code to test, but the result is poor. I have tried different tolerances but I can't get similar effect like you show. – Yi-Cheng Apr 08 '22 at 11:38
  • This very simple approach assumes that the background is white ! I saw on your update that you have a background that is a lot messier than the first image you gave ! – endive1783 Apr 08 '22 at 11:53
  • For the RGB images that you show, you will need to use some Deep Learning solutions – endive1783 Apr 08 '22 at 11:56
  • OK, I will find some methods. I use the first image as example because I can segment human from the background. But if I can use my datasets directly, it would be more suitable for my application. – Yi-Cheng Apr 10 '22 at 15:08
  • Is your background always the same or do you move the camera ? – endive1783 Apr 11 '22 at 03:46
  • Yes, the background is same and camera is fixed in front of people. The detection range is 3~5 meters. – Yi-Cheng Apr 12 '22 at 01:50