필터 지우기
필터 지우기

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

조회 수: 14 (최근 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 CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by