imagematrix              package:rimage              R Documentation

_G_e_n_e_r_a_t_e _a_n _i_m_a_g_e_m_a_t_r_i_x, _i._e. _p_r_i_m_a_r_y _d_a_t_a _s_t_r_u_c_t_u_r_e _o_f _r_i_m_a_g_e

_D_e_s_c_r_i_p_t_i_o_n:

     This function makes an imagematrix object from a matrix. This data
     structure is primary data structure to represent image in rimage
     package.

_U_s_a_g_e:

     imagematrix(mat, type=NULL,
              ncol=dim(mat)[1], nrow=dim(mat)[2], noclipping=FALSE)

_A_r_g_u_m_e_n_t_s:

     mat: array, matrix or vector

    type: "rgb" or "grey"

    ncol: width of image

    nrow: height of image

noclipping: TRUE if you disable automatic clipping. See details.

_D_e_t_a_i_l_s:

     For grey scale image, matrix should be given in the form of 2
     dimensional matrix. First dimension is row, and second dimension
     is column.

     For rgb image, matrix should be given in the form of 3 dimensional
     array (row, column, channel). mat[,,1], mat[,,2], mat[,,3] are red
     plane, green plane and blue plane, respectively.

     You can omit 'type' specification if you give a proper array or
     matrix. Also, if you give a rgb image matrix and specify "grey" as
     type, the rgb image matrix is automatically converted to a grey
     scale image.

     This function automatically clips the pixel values which are less
     than 0 or greater than 1. If you want to disable this behavior,
     give 'noclipiing=TRUE'.

     The major difference between imagematrix and pixmap is 
     representation method. pixmap (>0.3) uses OOP class. On the other
     hand, rimage uses traditional S class. The advantage of
     traditional S class in representing image is that one can deal
     with the data structure as an ordinary matrix.

     The minor difference between imagematrix and pixmap is automatic
     data conversion behavior. pixmap normalizes a given matrix
     automatically if any element of the matrix is out of range between
     0 and 1. On the other hand, imagematrix clips the matrix, which
     means that the pixels which have lower value than 0 are replaced
     to 0 and the pixels have greater value than 1 are replaced to 1.

_V_a_l_u_e:

     return an imagematrix object

_S_e_e _A_l_s_o:

     'plot.imagematrix','print.imagematrix','clipping','normalize'

_E_x_a_m_p_l_e_s:

       p <- q <- seq(-1, 1, length=20)
       r <- 1 - outer(p^2, q^2, "+") / 2
       plot(imagematrix(r))

