Borrar filtros
Borrar filtros

How to get normalized silhouette image from video

2 visualizaciones (últimos 30 días)
Kong
Kong el 10 de Mzo. de 2020
Comentada: Kong el 10 de Mzo. de 2020
I want to get normalized silhouette image.
However, I got this images when I use the below code.
Figure 1 Figure 2
Figure 3 (I want to get this image that normalized at the center of the image)
function Y=normalize8(X)
%% Init. operations
X=double(X);
[a,b]=size(X);
%% Adjust the dynamic range to the 8-bit interval
max_v_x = max(max(X));
min_v_x = min(min(X));
Y=ceil(((X - min_v_x*ones(a,b))./(max_v_x*(ones(a,b))-min_v_x*(ones(a,b))))*255);
end
clear all
close all
RGB = imread('weighted17.jpg');
I = rgb2gray(RGB);
figure
imshow(I)
Y=normalize8(I)
figure
imshow(Y)

Respuesta aceptada

Image Analyst
Image Analyst el 10 de Mzo. de 2020
Editada: Image Analyst el 10 de Mzo. de 2020
Use
mask = bwareafilt(mask, 1);
to extract the largest blob.
Or take blobs just 64 pixels and bigger with this:
mask = bwareafilt(mask, [64, inf]);
But the BIG problem is that the image seems to be either an indexed or dithered image, or an image that had all the quality JPEG'ed out of it. NEVER use JPG images for image analysis. See if you can get the full resolution, uncompressed version of the image somehow. This image is virtually useless.
  3 comentarios
Image Analyst
Image Analyst el 10 de Mzo. de 2020
Your BW is probably an RGB image. Since it's a JPG image, I'm almost certain it's a color image. Try taking just the red channel
BW = BW(:, :, 1) > 127; % Binarize the red channel
Kong
Kong el 10 de Mzo. de 2020
Thank you so much!
I did it successfully!
Can I move the human silhouette to the center of image?

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by