imgcv.filters.non_linear

Functions

check_image(image)

Check if the input is a numpy array

min_filter(img, filter_size)

Apply min filter to the image.It takes the minimum value of the pixels in the window.

max_filter(img, filter_size)

Apply max filter to the image.It takes the maximum value of the pixels in the window.

median_filter(img, filter_size)

Apply median filter to the image.It takes the median value of the pixels in the window.

Module Contents

imgcv.filters.non_linear.check_image(image)

Check if the input is a numpy array

Parameters:

image (np.ndarray) – Input image to be transformed

Raises:
  • TypeError – If the input is not a numpy array

  • ValueError – If the input is not a grayscale or color image

imgcv.filters.non_linear.min_filter(img, filter_size)

Apply min filter to the image.It takes the minimum value of the pixels in the window.

Parameters:
  • img (np.ndarray) – Input Image array

  • filter_size (Tuple[int, int]) – Size of the filter

Raises:

ValueError – If filter_size is not a tuple.

Returns:

Filtered image array.

Return type:

np.ndarray

imgcv.filters.non_linear.max_filter(img, filter_size)

Apply max filter to the image.It takes the maximum value of the pixels in the window.

Parameters:
  • img (np.ndarray) – Input Image array

  • filter_size (Tuple[int,int]) – Size of the filter

Raises:

ValueError – If filter_size is not a tuple.

Returns:

Filtered image array.

Return type:

np.ndarray

imgcv.filters.non_linear.median_filter(img, filter_size)

Apply median filter to the image.It takes the median value of the pixels in the window.

Parameters:
  • img (np.ndarray) – Input Image array

  • filter_size (Tuple[int,int]) – Size of the filter

Raises:

ValueError – If filter_size is not a tuple.

Returns:

Filtered image array.

Return type:

np.ndarray