
How can I segment depth image?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ajith Kumar Rajendra
le 23 Déc 2020
Commenté : Image Analyst
le 24 Déc 2020
I have a depth image data obtained from kinect sensor in form of 424x512 unit 16 which contains an object. I want to segment only the object from the depth image. I have tried using pcfitplane using the coressponding point cloud data of the depth image but I was able to segment one plane. Could anyone please suggest me a way to segment only the object(a box) from the depth image?
0 commentaires
Réponse acceptée
Image Analyst
le 23 Déc 2020
Try this:
clc; % Clear the command window.
clear all;
close all;
workspace; % Make sure the workspace panel is showing.
format short g;
format compact;
fontSize = 15;
fprintf('Beginning to run %s.m ...\n', mfilename);
rgbImage = imread('color_image.png');
subplot(2, 2, 1);
imshow(rgbImage);
axis('on', 'image');
title('Original RGB Image');
s = load('meta_data.mat')
imgDepth = s.imgDepth;
subplot(2, 2, 2);
imshow(imgDepth, []);
impixelinfo
title('Depth Image');
subplot(2, 2, 3);
histogram(imgDepth);
grid on;
title('Histogram of Depth Image');
binaryImage = imgDepth > 1025 & imgDepth < 1050;
% Fill holes
binaryImage = imfill(binaryImage, 'holes');
% Take largest blob.
binaryImage = bwareafilt(binaryImage, 1);
subplot(2, 2, 4);
imshow(binaryImage, []);
impixelinfo
title('Binary Image');
fprintf('Done running %s.m ...\n', mfilename);

6 commentaires
Image Analyst
le 24 Déc 2020
You can either find the bounding box or find the centroid and the boundary and the distance of the centroid to all the boundary pixels, then use findpeaks() to find the 4 corners. I'm attaching shape recognition demos.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Kinect For Windows Sensor dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!