From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 3176/CH6/EX6.4/Ex6_4.sce | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 3176/CH6/EX6.4/Ex6_4.sce (limited to '3176/CH6/EX6.4') diff --git a/3176/CH6/EX6.4/Ex6_4.sce b/3176/CH6/EX6.4/Ex6_4.sce new file mode 100644 index 000000000..1fb544773 --- /dev/null +++ b/3176/CH6/EX6.4/Ex6_4.sce @@ -0,0 +1,41 @@ +//Ex6_4 : +//Use of Color to Highlight Rainfall Levels + +// Version : Scilab 5.4.1 +// Operating System : Window-xp, Window-7 +//Toolbox: Image Processing Design 8.3.1-1 +//Toolbox: SIVP 0.5.3.1-2 +//Reference book name : Digital Image Processing +//book author: Rafael C. Gonzalez and Richard E. Woods + +clc; +close; +clear; +xdel(winsid())//to close all currently open figure(s). +gray=imread("Ex6_4.tif"); +gray=imresize(gray,0.25); +[nr nc]=size(gray); + +figure,ShowImage(gray,'Gray Image'); +title('Original Image'); +min_image=min(gray); // Find Minimum Intensity value +max_image=max(gray); // Find Maximum Intensity value + +color_RED=[0 255 0 0 0 255 255 255]; // RED Component Value of the Pseudo Color +color_GREEN=[0 0 0 255 255 255 0 255]; // GREEN Component Value of the Pseudo Color +color_BLUE=[0 255 255 255 0 0 0 255]; // BLUE Component Value of the Pseudo Color +k=8; +Slice_Image=[]; +for y=1:k // Decide Total No. of Level +for i=1:nr + for j=1:nc + if(gray(i,j)>=((max_image/k)*(y-1)) & gray(i,j)<((max_image/k)*y)) + Slice_Image(i,j,1)=color_RED(y); + Slice_Image(i,j,2)=color_GREEN(y); + Slice_Image(i,j,3)=color_BLUE(y); + end + end +end +end +imshow(Slice_Image);//,'Intensity Slicing'); +//title('Image After Intensity Slicing'); -- cgit