HALFTONE_CVIP

halftone_cvip() - converts image to binary with halftone technique.

Contents

SYNTAX

[ out_img ] = halftone_cvip( input_img, method , varargin)

Input Parameters include:

Output Parameter include:

DESCRIPTION

This function converts the image to binary using one of the following halftoning techniques:

  1. Floyd–steinberg dithering
  2. Bayer's ordered dither
  3. Clustered-dot-ordered
  4. Simple threshold

Method 4 (simple threshold) needs an extra argument, a number between 0 and 1, which determines the threshold level. Based on the data type of the input image, this number is multiplied to the full range of the image to find the threshold level.

Regardless of the method used, the full range of the image is reported in the commmand window as the value of the variable max_val.

REFERENCE

1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.

EXAMPLE

 %Read image

 img = imread('Butterfly.tif');

% Call function

 [ out_img ] = halftone_cvip( img ,1);

% Display input image

 figure; imshow(img);title('Input Image');

% Display output image

 figure; imshow(out_img);title('Output Image');
max_val =

   255

CREDITS

Author: Mehrdad Alvandipour, July 2017
Copyright © 2017-2018 Scott E Umbaugh
For updates visit CVIP Toolbox Website