<< rectangle Utilities and Interactive Tools Video Handling >>

IPCV >> Utilities and Interactive Tools > sub2cart

sub2cart

Convert from matrix subscript notation to cartesian coordinate in pixel mode

Syntax

[cart_x,cart_y] = sub2cart(dim, sub_r,sub_c)

Parameters

dim :

Dimention of the Scilab matrix (first 2 dim of the matrix) in row and column format.

varargin :

Input could be in sub_r and sub_c pairs (each in m x 1 matrix), or in m x 2 matrix which consist of [sub_r sub_c]

sub_r :

Row index ins ubscript notation

sub_c :

Column index ins ubscript notation

varargout :

Output in cart_x and cart_y pairs or matrix of [cart_x cart_y] following in the input format

cart_x :

X in cartesian coordinate system

cart_y :

Y in cartesian coordinate system

Description

This function used to convert from matrix subscript notation to cartesian coordinate in pixel mode.

Examples

S = rand(10,10);
S2 = repmat(S,[1,1,3]);
S2(3,4,:) = [1,0,0];
imshow(S2);
sub_r = 3; sub_c = 4;
[cart_x,cart_y] = sub2cart([10 10], sub_r,sub_c)
plot(cart_x,cart_y, 'bx');

See also

Authors


Report an issue
<< rectangle Utilities and Interactive Tools Video Handling >>