Lakshmi Narayanan
Lakshmi Narayanan

Reputation: 5342

3D image in MATLAB using different images

I have a set of images of a scene at different angles and the camera intrinsic parameters. I was able to generate the 3D points using point correspondences and triangulation. Is there a built-in method or a way to produce 3D images in MATLAB? From the given set of images, a 3D image as such? By 3D image, I mean a 3D view of the scene based on the colors, depth, etc.?

Upvotes: 1

Views: 1807

Answers (3)

Dima
Dima

Reputation: 39389

The Computer Vision System Toolbox for MATLAB includes a function called estimateUncalibratedRectification, which you can use to rectify a pair of stereo images. Check out this example of how to create a 3-D image, which can be viewed with a pair of red-cyan stereo glasses.

Upvotes: 1

chappjc
chappjc

Reputation: 30579

There was a recent MathWorks blog post on 3D surface rendering, which showed methods using built-in functions and using contributed code.

The built-in method uses isosurface and patch. To display multiple surfaces, the trick is to set the 'FaceAlpha' patch property to get transparency.

The post also highlighted the "vol_3d v2" File Exchange submission, which provides the vol3d function to render the surface. It allows explicit definition of voxel colors and alpha values.

Upvotes: 3

lennon310
lennon310

Reputation: 12689

Some file exchange from mathworks: 3D CT/MRI images interactive sliding viewer, 3D imshow, image3, and viewer3D.

If your images matrix I has the dimension of x*y*z, you can try surface as well:

[X,Y] = meshgrid(1:size(I,2), 1:size(I,1));
Z = ones(size(I,1),size(I,2));
for z=1:size(I,3)
   k=z*sliceInterval;
   surface('XData',X, 'YData',Y, 'ZData',Z*k,'CData',I(:,:,z), 'CDataMapping','direct', 'EdgeColor','none', 'FaceColor','texturemap')
end

Upvotes: 1

Related Questions