creating a surface stl from 2d images

I need to create a 3D model out of ~300 CT images converted to jpg
This is what I have so far
folder = 'C:\Users\Suraj\Desktop\images\Results';
for i = 109 : 433
% since a few numbers are missing between 109 and 433
try
images{i} = imread( fullfile(folder, sprintf('000%d.jpg', i) ) );
catch
continue;
end
if ndims(images{i}) > 2
I{i} = rgb2gray(images{i});
else
I{i} = images{i};
end
end
I = cat(3, I{:});
imshow(I{i});
view(3);
but i keep getting this error
Brace indexing is not supported for variables of this type.
Error in test2_3D (line 15)
imshow(I{i});
Here's a couple of sample images

댓글 수: 8

darova
darova 2020년 4월 15일
If you concantenate images in 3d dimension it wil be volume. Or am i wrong?
Adithya Vasudevan
Adithya Vasudevan 2020년 4월 16일
Yeah, thats what I tried doing, but cant seem to get rid of this error
KSSV
KSSV 2020년 4월 16일
What is size of I?
Adithya Vasudevan
Adithya Vasudevan 2020년 4월 16일
(433-109+1)= 325 but due to missing images on certain indices actual number of images are 229 hence the try catch
MaryD
MaryD 2020년 4월 16일
I'm not sure but using I = cat(3, I{:}); you're making I a 3 dimension matrix and in Imshow(I{i}), with {} you are refering to I as to a cell array.
darova
darova 2020년 4월 18일
Is this question solved?
Adithya Vasudevan
Adithya Vasudevan 2020년 5월 24일
MaryD, So how would i display the 3D matrix as a surface rendering
Is this problem solved?I am facing exactly the same so if it ia possiple let me know the appropriate code for solving it.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

질문:

2020년 4월 14일

댓글:

2020년 9월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by