image thumbnail

Draw Camera View

version (6.64 KB) by Adina Stoica
Draw the 3D frustum of a camera with an image in it


Updated 28 Mar 2014

View License

drawCameraView(img,frust3DPoints): draw a camera frustum and an image into it
* img is the image we want to view
* frust3DPoints are the 3D coordinates of the image plane in the frustum

Run as:
[H,W,~] = size(img);
% Need to know the camera focal length, pan, tilt and roll, optionally can use
% [tilt,roll]=computeTiltAndRoll(imname,flen);
T = findTransformMatrix(W,H,flen,pan,tilt,roll);
frust3DPoints = findFrust3DPoints(W,H,T);
h = drawCameraView(img,frust3DPoints);
% To put the view in a cardinal coordinate system, run:

Cite As

Adina Stoica (2022). Draw Camera View (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: plot3axisatorigin

Community Treasure Hunt

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

Start Hunting!