1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 1: Introduction to Image Processing System"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.13: False_contouring_Scilab_code.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"//Caption: False contouring Scilab code\n",
"//Fig1.13\n",
"//page 13\n",
"clc;\n",
"close;\n",
"a =ReadImage('E:\DIP_JAYARAMAN\Chapter1\tigerpub.jpg');\n",
"a = uint8(a);\n",
"figure\n",
"imshow(a)\n",
"title('Original image');\n",
"//using 128 gray levels\n",
"figure\n",
"a_128 = grayslice(a,128);\n",
"gray_128 = gray(128);\n",
"ShowImage(a_128,'Image with 128 gray levels',gray_128); \n",
"//using 64 gray levels\n",
"figure\n",
"a_64 = grayslice(a,64);\n",
"gray_64 = gray(64);\n",
"ShowImage(a_64,'Image with 64 gray levels',gray_64); \n",
"//using 32 gray levels\n",
"figure\n",
"a_32 = grayslice(a,32);\n",
"gray_32 = gray(32);\n",
"ShowImage(a_32,'Image with 32 gray levels',gray_32);\n",
"//using 16 gray levels\n",
"figure\n",
"a_16 = grayslice(a,16);\n",
"gray_16 = gray(16);\n",
"ShowImage(a_16,'Image with 16 gray levels',gray_16);\n",
"//using 8 gray levels\n",
"a_8 = grayslice(a,8);\n",
"gray_8 = gray(8);\n",
"ShowImage(a_8,'Image with 8 gray levels',gray_8); "
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.3: Program_to_calculate_number_of_samples_required_for_an_image.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"//Caption:Program to calculate number of samples required for an image\n",
"//Example1.3\n",
"//page 12\n",
"clc;\n",
"close;\n",
"//dimension of the image in inches\n",
"m = 4;\n",
"n = 6;\n",
"N = 400; //number of dots per inch in each direction\n",
"N2 = 2*N; //number of dots per inch in both horizontal & vertical\n",
"Fs = m*N2*n*N2;\n",
"disp(Fs,'Number of samples reuqired to preserve the information in the image=')\n",
"//Result\n",
"//Number of samples reuqired to preserve the information in the image= \n",
"//15360000."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Scilab",
"language": "scilab",
"name": "scilab"
},
"language_info": {
"file_extension": ".sce",
"help_links": [
{
"text": "MetaKernel Magics",
"url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
}
],
"mimetype": "text/x-octave",
"name": "scilab",
"version": "0.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|