HALFTONE_CVIP
halftone_cvip() - converts image to binary with halftone technique.
Contents
SYNTAX
[ out_img ] = halftone_cvip( input_img, method , varargin)
Input Parameters include:
- input_img - The input image. Can be multi band.
- method - an integer between 1 and 4 corresponsing to FS, Bayer, Cluster, and simple threshold methods.
- varargin - An extra input which is used only when method is simple threshold (4). This value is the threshold level and is a rational number between [0,1];
Output Parameter include:
- Output - Output Image.
DESCRIPTION
This function converts the image to binary using one of the following halftoning techniques:
- Floyd–steinberg dithering
- Bayer's ordered dither
- Clustered-dot-ordered
- 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