フィルターのクリア

How to find depth map image by using a single image......?????

13 ビュー (過去 30 日間)
priyanka kadam
priyanka kadam 2017 年 4 月 8 日
回答済み: Image Analyst 2024 年 1 月 23 日
We did till this ... but we are not getting how to produce depth map image ...
close all;
clear all;
clc;
a=imread('cameraman.jpg');
a=imresize(a,[255 255])
a=double(a);
[row col dim]=size(a);
red=a(:,:,1);
[row col]=size(red);
green=a(:,:,2);
blue=a(:,:,3);
numer=0.5*((red-green)+(red-blue));
deno=sqrt((red-green).^2+(red-blue).*(green-blue));
theta=acos(numer./(deno+eps));
%for computing HUE
for x=1:1:row
for y=1:1:col
if green(x,y)<blue(x,y);
H(x,y)=(2*pi)-theta(x,y);
else
H(x,y)=theta(x,y);
end
end
end
%computing SATURATION & INTENSITY
numer=min(min(red,green),blue);
deno=red+green+blue;
deno(deno==0)=eps;
S=1-(3.*numer./deno);
I=(red+green+blue)/3;
z=edge(I,'canny');
y=imfill(z,'holes');
subplot(2,3,1);
imshow(uint8(a));
colormap(gray);
title('original image');
subplot(2,3,2);
imagesc(H);
colormap(gray);
title('HUE');
subplot(2,3,3);
imagesc(S);
colormap(gray);
title('SATURATION');
subplot(2,3,4);
imagesc(I)
colormap(gray);
title('INTENSITY');
subplot(2,3,5);
imshow(z);
title('edge detection');
subplot(2,3,6);
imshow(y);
title('HOLE FILLING');
figure;
imshow(z);
figure;
imshow(y);

回答 (3 件)

Image Analyst
Image Analyst 2017 年 4 月 8 日
編集済み: Image Analyst 2017 年 4 月 8 日
I don't think you can. Why do you think you can get a depth (range) image from a single color optical photo?
Attach your color cameraman.jpg photo. The standard one that ships with MATLAB is a tiff image and it's monochrome/grayscale, not color. I see no reason why doing edge detection and hole filling would/could get you the distance from the sensor to the subject unless you're somehow hoping that there will be some lateral chromatic aberration.
  2 件のコメント
Mohammad Shafivulla
Mohammad Shafivulla 2020 年 1 月 12 日
sir, can you please give the code for this question.
Image Analyst
Image Analyst 2020 年 1 月 13 日
Like I said, I don't think it can be done, so there is not code for it.

サインインしてコメントする。


George Abrahams
George Abrahams 2024 年 1 月 23 日
This task is called "monocular depth estimation" and it is a heavily researched field.
For a still image, the most common, traditional method would be shape from shading, but these days deep neural networks are most commonly used. There are many CNNs pretrained for different types of environment freely available.
The only code I can find for MATLAB is this repository on File Exchange for indoor environments.

Image Analyst
Image Analyst 2024 年 1 月 23 日

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by