posterization Module


Functions

public pure function make_histogram(layer, maximum) result(hist)

Make histogram

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: layer(:,:)

The layer of image.

integer, intent(in) :: maximum

Max value of pixels.

Return Value integer, (0:maximum)

Histgram array.

public pure function to_binary(img, threshold) result(rst)

Apply binarization

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: img(:,:,:)

Image array that has pixel values.

integer, intent(in) :: threshold

Threshold

Return Value integer, allocatable, (:,:,:)

Image array that applied binarization.

public pure function otsu(img, maximum) result(rst)

Applie binarization with ostu's method.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: img(:,:,:)

Image array that has pixel values.

integer, intent(in) :: maximum

Max pixel value.

Return Value integer, allocatable, (:,:,:)

Image Array that applied binarization.

public pure function adaptive_threshold(img, maximum, kernel_size) result(rst)

Applie adaptive threshold

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: img(:,:,:)

Image array that has pixel values.

integer, intent(in) :: maximum

Max pixel value.

integer, intent(in), optional :: kernel_size

Size of kernel.

Return Value integer, allocatable, (:,:,:)

Image array that applied adaptive threshold.

public pure function quantize(img, n_split, maximum) result(rst)

Apply quantize

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: img(:,:,:)

Image array that has pixel values.

integer, intent(in) :: n_split

Number of split.

integer, intent(in), optional :: maximum

Max value of pixels.

Return Value integer, allocatable, (:,:,:)

Image array that applied quantize.

public pure function dither(img, maximum) result(rst)

Apply dither translation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: img(:,:,:)

Image array that has pixel values.

integer, intent(in) :: maximum

Max value of pixels.

Return Value integer, allocatable, (:,:,:)

Image array that applied dither.

public pure function error_diffusion(img, maximum) result(rst)

Apply error diffusion

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: img(:,:,:)

Image array that has pixel values.

integer, intent(in) :: maximum

Max value of pixels.

Return Value integer, allocatable, (:,:,:)

Image array that applied error diffusion.

public pure function rgb_to_gray(img) result(rst)

Translate rbg image to grayscale image

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: img(:,:,:)

Image array that has pixel values.

Return Value integer, allocatable, (:,:,:)

Translate image array.