Products & Services Solutions Academia Support User Community Company

Learn more about Mapping Toolbox   

pix2map - Convert pixel coordinates to map coordinates

Syntax

[x,y] = pix2map(R,row,col)
s = pix2map(R,row,col)
[...] = pix2map(R,p)

Description

[x,y] = pix2map(R,row,col) calculates map coordinates x,y from pixel coordinates row,col. R is a 3-by-2 referencing matrix defining a two-dimensional affine transformation from pixel coordinates to spatial coordinates. row and col are vectors or arrays of matching size. The outputs x and y have the same size as row and col.

s = pix2map(R,row,col) combines X and Y into a single array s. If row and col are column vectors of length n, then s is an n-by-2 matrix and each row (s(k,:)) specifies the map coordinates of a single point. Otherwise, s has size [size(row) 2], and s(k1,k2,...,kn,:) contains the map coordinates of a single point.

[...] = pix2map(R,p) combines row and col into a single array p. If row and col are column vectors of length n, then p should be an n-by-2 matrix such that each row (p(k,:)) specifies the pixel coordinates of a single point. Otherwise, p should have size [size(row) 2], and p(k1,k2,...,kn,:) should contain the pixel coordinates of a single point.

Example

% Find the map coordinates for the pixel at (100,50).
R = worldfileread('concord_ortho_w.tfw');
[x,y] = pix2map(R,100,50)

x =
        2.070495000000000e+005
y =
        9.129005000000000e+005

See Also

makerefmat, map2pix, pix2latlon, worldfileread

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS