You are on page 1of 1

function voutputimage = auto (a) %clc; %clear all; %close all; %To clear previous output %a=imread('t09.

png'); %tic; %Reading image %a=rgb2gray(a); %Used where input image is 3D otherwise this statement %will kept in comments %a=a1; % Saving image into other variable aree=a;% Saving image into other variable [n m]=size(a); %n contains number of rows and m contains number of columns G=255; % G contains maximum Gray levels z=10; % z contains Gray levels g=quantiz(a,n,m,z,G); % quantize(...) function is called, where a contains image, n contains %number of rows, m contains number of columns,z contains Gray levels and %G contains maximum Gray levels and g containes quantized image [c,h]=sampling(g,n,m); %sampling(...) function is called,where c and h contains strips's array and %number of strips respectively s1=calculate_weight(G,c,h,m); %calculate_weight(...) function is called where each strip weight is %calculated outputimage=roi_strips(s1,aree,h,m); %ROI is defined in this function , outputimage contains Horizontal's ROI %region figure,imshow(aree);%Displaying Original Image %figure,imshow(outputimage);%Output after finding ROI Horizontally vertical=outputimage'; % Taking transpose of Output image for finding %ROI vertically varee=vertical; % Saving image into other variable [vn vm]=size(vertical); % Saving image into other variable g=quantiz(vertical,vn,vm,z,G); % quantize(...) function is called, where vertical contains image, vn %contains number of rows, vm contains number of columns,z contains Gray %levels and G contains maximum Gray levels and g containes quantized image [c,h]=sampling2(g,vn,vm); %sampling(...) function is called,where c and h contains strips's array and %number of strips respectively s1=calculate_weight(G,c,h,vm); %calculate_weight(...) function is called where each strip weight is %calculated voutputimage=roi_strips(s1,varee,h,vm); %ROI is defined in this function , outputimage contains Horizontal's ROI %region voutputimage=voutputimage'; %Again transpose is taken of output image, This will produce original image %figure,imshow(varee'); %Displaying Horizontally divided image %figure,imshow(voutputimage); %Final Output .................ROI is detected %imwrite(voutputimage,'ot09.png');

You might also like