GRAYCODE2BIN Conversion

graycode2bin_cvip() - Performs gray code to binary code conversion on an input image.

Contents

SYNTAX

outputImage = graycode2bin_cvip(inputImage);

Input parameters include:

Output parameters include:

DESCRIPTION

This function performs a gray code to binary conversion on an input image. Gray code is binary numerical system where two consecutive values differ in only one bit. Gray code is also known as Reflected binary code.

Reference

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

EXAMPLE

% Read Image

  ipImage1=imread('cam.bmp'); % gray scale image
  ipImage2 =imread('Car.bmp'); % 3 band image

% Call function

  GrayCodeImage1=bin2graycode_cvip( ipImage1);
  GrayCodeImage2=bin2graycode_cvip( ipImage2);
  BinImage1 = graycode2bin_cvip(GrayCodeImage1);
  BinImage2 = graycode2bin_cvip(GrayCodeImage2);

% Display Input Images, intermediate images and output images

  figure;imshow(ipImage1);title('Input Image 1');
  figure;imshow(GrayCodeImage1);title('GrayCode Image 1');
  figure;imshow(BinImage1,[]);title('Output Image 1');
  figure;imshow(ipImage2);title('Input Image 2');
  figure;imshow(GrayCodeImage2);title('GrayCode Image 2');
  figure;imshow(BinImage2,[]);title('Output Image 2');

CREDITS

Author: Deependra Mishra, October 2017
Copyright © 2017-2018 Scott E Umbaugh
For updates visit CVIP Toolbox Website