4.25

4.2 | 4 ratings Rate this file 127 downloads (last 30 days) File Size: 1.79 KB File ID: #3777

tcolor (a fast pcolor that likes RGB images)

by Aslak Grinsted

 

23 Jul 2003 (Updated 25 Jul 2003)

No BSD License  

Draws an image as a texture to a plane.

Download Now | Watch this File

File Information
Description

For use like pcolor but with c as a true color matrix (uses texturemap for speed)...
 
  H=tcolor(x,y,c[,method])
 
  valid methods are: 'corners','normal','triangles'
 
  The normal method is texture mapping unto the plane given by x and y (which may be distorted arbitrarily)
 
  The 'corners' method is the fastest way to draw. However it requires that the area is non-distorted... E.g. that the box defined by the corners defines the area.
 
  The slowest method is 'triangles'... (sort of like pcolor). But shading interp works with it.
 
  c=imread('C:\Projects\My Pictures\peppermint_girl.jpg');
  [x,y] = meshgrid(1:size(im,2),1:size(im,1));
  x=x+y/10; %skew the image
  H=tcolor(x,y,c,'corners')
 
  Aslak Grinsted - July 2003

MATLAB release MATLAB 6.1 (R12.1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
18 Aug 2003 Mark Harper  
11 Feb 2005 Kartika Munir  
29 Mar 2005 Aslak Grinsted

Please leave a comment when you give such a low rating. If you report a specific problem then i'm sure i could fix it.

29 Jun 2005 Bjorn Gustavsson

Works. Usefull function that fills a gap in matlabs plot functions.

16 Jun 2009 IOCAS Shen

Great! It is indeed fast and most important of all it can be used for rgb color image, good job!

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
specialized Aslak Grinsted 22 Oct 2008 07:05:19
plotting Aslak Grinsted 22 Oct 2008 07:05:19
pcolor Aslak Grinsted 22 Oct 2008 07:05:19
image Aslak Grinsted 22 Oct 2008 07:05:19
rotated Aslak Grinsted 22 Oct 2008 07:05:19
warp Aslak Grinsted 22 Oct 2008 07:05:19
surface Aslak Grinsted 22 Oct 2008 07:05:19
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com