PsiLAB Help Manual Page

Section: Image processing functions

Name: of_image

Convert an image to a gray level float or integer matrix. The RGB values are equally weighted and converted to a gray value:

G <- (R+G+B)/3

The functions expect an abstract image of type Image.t and an already allocated matrix of appropiate size:

of_image ?fmat:(float, 'a, 'b) Matrix.t list
?imat:(int, 'a, 'b) Matrix.t list
?img:Image.t list -> unit

Example:

[] let im = load "test.bmp" [] ;; 
[] size im ;; 
- : int * int = 752, 572 
[] let f = fmatrix ~dim:[572;752] () ;; 
- : (float, '_a, '_b) Matrix.t = <abstr> 
[] of_image ~img:[im] ~fmat:[f] () ;; 

Printed by PsiLAB