SCT_SPLIT_CVIP

sct_split_cvip() - Sphere Coordinate Transform/Center color segmenation.

Contents

SYNTAX

outImage = sct_split_cvip(inImage, nColorsA, nColorsB, option)

Input Parameters include:

Output Parameter includes :

DESCRIPTION

The function performs the image segmentation using spherical coordinate transform(SCT) method (also termed as Center sgmentation). The algorithm performs the Spherical Coordinate Transform, and divides the color space by splitting the 2-D space created by angles A and B. This division is done by a simple center split - that is, evenly divided along each angle axis based on the numbers specified. Note that only the subspace contained in the image is used (this means the maximums and minimums are found along each axis and these limit the subspace used for the division). After this is done, we implemented two methods to map original color vectors to new colors. In first method, i.e. option = 1, it finds the pixels that belong to each subspace, finds the RGB color vectors associated to those pixels, computes the mean of color vectors, and assigns the average color to all pixels that belong to the subspace. In second method, i.e. option = 2, it computes the average color in SCT domain. The average is found for each color in each subdivision, assigns each average color to corresponding subspace, and performs the inverse-SCT.

REFERENCE

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

EXAMPLE

% Read image

 I = imread('butterfly.tif');

% Calling function with default parameters

 O1 = sct_split_cvip(I);

% number of colors along axis A

 nA = 4;

% number of colors along axis B

 nB = 6;

% Calling function with option as default

 O2 = sct_split_cvip(I,nA,nB);

% Calling function with user defined parameters

 O3 = sct_split_cvip(I,nA,nB,2);

% Display input image

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

% Display output image

 figure;imshow( O1,[]);title('Output Image with default parameters');

 figure;imshow( O2,[]);title('Output Image with default parameters');

 figure;imshow( O3,[]);title('Output image with user defined parameters');

CREDITS

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