Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

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 either a 3-by-2 referencing matrix defining a two-dimensional affine transformation from intrinsic pixel coordinates to map coordinates, or a map raster reference object. 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.

Examples

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

Introduced before R2006a

Was this topic helpful?