IM: Threshold Operations

IM - An Imaging Tool

Threshold Operations
[Image Processing]


Detailed Description

Operations that converts a usually IM_GRAY/IM_BYTE image into a IM_BINARY image using several threshold techniques.
See im_process_pon.h


Functions

int imProcessRangeContrastThreshold (const imImage *src_image, imImage *dst_image, int kernel_size, int min_range)
int imProcessLocalMaxThreshold (const imImage *src_image, imImage *dst_image, int kernel_size, int min_thres)
void imProcessThreshold (const imImage *src_image, imImage *dst_image, int level, int value)
void imProcessThresholdByDiff (const imImage *src_image1, const imImage *src_image2, imImage *dst_image)
void imProcessHysteresisThreshold (const imImage *src_image, imImage *dst_image, int low_thres, int high_thres)
void imProcessHysteresisThresEstimate (const imImage *src_image, int *low_thres, int *high_thres)
int imProcessUniformErrThreshold (const imImage *src_image, imImage *dst_image)
void imProcessDifusionErrThreshold (const imImage *src_image, imImage *dst_image, int level)
int imProcessPercentThreshold (const imImage *src_image, imImage *dst_image, float percent)
int imProcessOtsuThreshold (const imImage *src_image, imImage *dst_image)
int imProcessMinMaxThreshold (const imImage *src_image, imImage *dst_image)
void imProcessLocalMaxThresEstimate (const imImage *src_image, int *thres)
void imProcessSliceThreshold (const imImage *src_image, imImage *dst_image, int start_level, int end_level)

Function Documentation

int imProcessRangeContrastThreshold const imImage src_image,
imImage dst_image,
int  kernel_size,
int  min_range
 

Threshold using a rank convolution with a range contrast function.
Supports all integer IM_GRAY images as source, and IM_BINARY as destiny.
Local variable threshold by the method of Bernsen.
Extracted from XITE, Copyright 1991, Blab, UiO
http://www.ifi.uio.no/~blab/Software/Xite/

  Reference:	
    Bernsen, J: "Dynamic thresholding of grey-level images"
		Proc. of the 8th ICPR, Paris, Oct 1986, 1251-1255.
  Author:     Oivind Due Trier
Returns zero if the counter aborted.

int imProcessLocalMaxThreshold const imImage src_image,
imImage dst_image,
int  kernel_size,
int  min_thres
 

Threshold using a rank convolution with a local max function.
Returns zero if the counter aborted.
Supports all integer IM_GRAY images as source, and IM_BINARY as destiny.

void imProcessThreshold const imImage src_image,
imImage dst_image,
int  level,
int  value
 

Apply a manual threshold.
threshold = a <= level ? 0: value
Normal value is 1 but another common value is 255. Can be done in place for IM_BYTE source.
Supports all integer IM_GRAY images as source, and IM_BINARY as destiny.

void imProcessThresholdByDiff const imImage src_image1,
const imImage src_image2,
imImage dst_image
 

Apply a threshold by the difference of two images.
threshold = a1 <= a2 ? 0: 1
Can be done in place.

void imProcessHysteresisThreshold const imImage src_image,
imImage dst_image,
int  low_thres,
int  high_thres
 

Apply a threshold by the Hysteresis method.
Hysteresis thersholding of edge pixels. Starting at pixels with a value greater than the HIGH threshold, trace a connected sequence of pixels that have a value greater than the LOW threhsold.
Note: could not find the original source code author name.

void imProcessHysteresisThresEstimate const imImage src_image,
int *  low_thres,
int *  high_thres
 

Estimates hysteresis low and high threshold levels.

int imProcessUniformErrThreshold const imImage src_image,
imImage dst_image
 

Calculates the threshold level for manual threshold using an uniform error approach.
Extracted from XITE, Copyright 1991, Blab, UiO
http://www.ifi.uio.no/~blab/Software/Xite/

  Reference:
    S. M. Dunn & D. Harwood & L. S. Davis:
    "Local Estimation of the Uniform Error Threshold"
    IEEE Trans. on PAMI, Vol PAMI-6, No 6, Nov 1984.
  Comments: It only works well on images whith large objects.
  Author: Olav Borgli, BLAB, ifi, UiO
  Image processing lab, Department of Informatics, University of Oslo
Returns the used level.

void imProcessDifusionErrThreshold const imImage src_image,
imImage dst_image,
int  level
 

Apply a dithering on each image channel by using a difusion error method.
It can be applied on any IM_BYTE images. It will "threshold" each channel indivudually, so source and destiny must be of the same depth.

int imProcessPercentThreshold const imImage src_image,
imImage dst_image,
float  percent
 

Calculates the threshold level for manual threshold using a percentage of pixels that should stay bellow the threshold.
Returns the used level.

int imProcessOtsuThreshold const imImage src_image,
imImage dst_image
 

Calculates the threshold level for manual threshold using the Otsu approach.
Returns the used level.
Original implementation by Flavio Szenberg.

int imProcessMinMaxThreshold const imImage src_image,
imImage dst_image
 

Calculates the threshold level for manual threshold using (max-min)/2.
Returns the used level.
Supports all integer IM_GRAY images as source, and IM_BINARY as destiny.

void imProcessLocalMaxThresEstimate const imImage src_image,
int *  thres
 

Estimates Local Max threshold level for IM_BYTE images.

void imProcessSliceThreshold const imImage src_image,
imImage dst_image,
int  start_level,
int  end_level
 

Apply a manual threshold using an interval.
threshold = start_level <= a <= end_level ? 1: 0
Normal value is 1 but another common value is 255. Can be done in place for IM_BYTE source.
Supports all integer IM_GRAY images as source, and IM_BINARY as destiny.