package bimage

  1. Overview
  2. Docs

Module Bimage.KernelSource

Convolution kernels

Sourcetype t = float array array
Sourceval v : rows:int -> cols:int -> t

v ~rows ~cols makes a new Kernel with the given dimensions

Sourceval rows : t -> int

Returns the number of rows in a kernel

Sourceval cols : t -> int

Returns the number of columns in a kernel

Sourceval combine : (float -> float -> float) -> t -> t -> t

Joins two kernels using the given operation

Sourceval of_array : ?norm:bool -> float array array -> t

Create a kernel from an existing 2-dimensional float array. When norm is true, the kernel will be normalized

Sourceval to_array : t -> float array array

Convert a kernel to a 2-dimensional float array

Sourceval get : t -> int -> int -> float

get kernel y x gets the value at (x, y)

Sourceval set : t -> int -> int -> float -> unit

set kernel y x v sets the value at (x, y)

Sourceval sum : t -> float

Get the sum of each value of a kernel

Sourceval normalize : t -> t

normalize kernel returns a kernel where each element has been divided by the sum of all elements

Sourceval sobel_x : t

Sobel kernel in the X direction onlu

Sourceval sobel_y : t

Sobel kernel in the Y direction only

Sourceval gaussian : ?std:float -> int -> t

gassian n generates a new nxn gaussian kernel

Sourcemodule Infix : sig ... end
OCaml

Innovation. Community. Security.