PROJECTION_CVIP

projection_cvip() - extracts horizontal and vertical projections of a binary object.

Contents

SYNTAX

[ B_h, B_w ] = projection_cvip( lab_image, gray_level, normWidth, normHeight )

DESCRIPTION

This functions scales the object with gray_level in the labeled image lab_image to a box of width and height equal to normWidth and normHeight,and then projects the object to each side (x-axis and y-axis) and returns the values in two row vectors B_h and B_w.

REFERENCE

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

EXAMPLE

% Read image

 I = imread('Shapes.bmp');

% Label image

 lab_image = label_cvip(I);

% width

 normWidth = 13;

% Height

 normHeight = 26;

% Calling function

 [ B_h, B_w ] = projection_cvip( lab_image, 6, normWidth, normHeight)
B_h =

  Columns 1 through 13

     0     0     0     0     0     0     0     1     7     9    10    11    11

  Columns 14 through 26

    12    11    11    10     9     5     0     0     0     0     0     0     0


B_w =

     1     7     9    10    11    11    12    11    11    10     9     5     0

CREDITS

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