module Picture:sig
..end
type
picture = {
|
r : |
|
g : |
|
b : |
val dimx : picture -> int
val dimy : picture -> int
val read_pic : string -> picture
val fprint_ppm : Format.formatter -> picture -> unit
val sprint_ppm : picture -> string
val flip : picture -> picture
val brightness : picture -> Matrix.F.t
0..1
.
Convert to Graphics
-friendly format.
val image : picture -> int array array
val monochrome : Matrix.F.t -> picture
val black_n_white : Matrix.B.t -> picture
val colorful : Matrix.I.t -> picture
val convolution : filter:Matrix.F.t -> image:Matrix.F.t -> Matrix.F.t
image
, sum all elements
of the product of filter
and corresponding image
elements.val normalize : Matrix.F.t -> Matrix.F.t
val sobel_x : Matrix.F.t
val sobel_y : Matrix.F.t
val scharr_x : Matrix.F.t
val scharr_y : Matrix.F.t
val gaussian : Matrix.F.t
val canny : hi_thr:float -> lo_thr:float -> picture -> Matrix.B.t
hi_thr
how insensitive to new edges,
lo_thr
how insensitive to edge continuations,
extend
how many pixels to prolong existing edge.val super_canny : extend:int -> hi_thr:float -> lo_thr:float -> picture -> Matrix.B.t
val regions : Matrix.B.t -> Matrix.I.t
val regcolors : picture -> Matrix.I.t -> int array * int array * int array
val colorcode : Matrix.I.t -> int array * int array * int array -> picture