You are on page 1of 235

ASSIGNMENT NO :1

NAME : GAURAV KISHOR DESHMUKH


DATE : 09/27/2014
COSC 5356.001
COMPUTER VISION

/*
GAURAV DESHMUKH
COSC 5356 COMPUTER VISION
ASSIGNMENT #1
*** A PROGRAM TO READ PGM FILE
* TO DO FOLOWING:
* 1. CREATE HISTOGRAM
* 2. PERFORM LINEAR STRECHING TRANSFORMATION
* 3. PERFORM HISTOGRAM EQUALIZATION ***
*/
/*Includes*/
#include <stdio.h>
#include <stdlib.h>
#include <cctype>
#include <string.h>
/*bitwise operations macro*/
#define HI(num) (((num) & 0x0000FF00) >> 8)
#define LO(num) ((num) & 0x000000FF)
/*Structure to store PGM file*/
typedef struct _PGMData {
int row;
int col;
int max_gray;
int **matrix;
} PGMData;
/*Structure to store Histogram*/
int Histogram[255]={0};
/*Global variables*/
int minGreyVal=0,maxGreyVal=255;
int numofpixels = 0;
/*function to allocate dyanamic matrix*/
int **allocate_dynamic_matrix(int row, int col)
{
int **ret_val;
int i;
/*allocate dynamic memory for rows*/
ret_val = (int **)malloc(sizeof(int *) * row);
if (ret_val == NULL) {
perror("memory allocation failure");
exit(EXIT_FAILURE);
}
/*allocate dynamic memory for columns*/
for (i = 0; i < row; ++i) {
ret_val[i] = (int *)malloc(sizeof(int) * col);
if (ret_val[i] == NULL) {
perror("memory allocation failure");
exit(EXIT_FAILURE);
}
}

return ret_val;

/*function to de-allocate dynamic matrix */


void deallocate_dynamic_matrix(int **matrix, int row)
{
int i;
/*de-allocate dynamic memory for whole matrix*/
for (i = 0; i < row; ++i)
free(matrix[i]);
free(matrix);
}
/*function to skip comments and spaces*/
void SkipComments(FILE *fp)
{
int ch;
char line[100];
/*check for EOF and Space to skip*/
while ((ch = fgetc(fp)) != EOF && isspace(ch))
;
/*All comments start with '#' , if found skip line*/
if (ch == '#') {
fgets(line, sizeof(line), fp);
SkipComments(fp);
} else
fseek(fp, -1, SEEK_CUR);
}
/*function to read PGM file*/
PGMData* readPGM(const char *file_name, PGMData *data)
{
FILE *pgmFile;
char version[3];
int i, j;
int lo, hi;
/*open a input file to read*/
pgmFile = fopen(file_name, "rb");
if (pgmFile == NULL) {
perror("cannot open file to read");
getchar();
exit(EXIT_FAILURE);
}
/*check for P5 version*/
fgets(version, sizeof(version), pgmFile);
if (strcmp(version, "P5")) {
fprintf(stderr, "Wrong file type!\n");
getchar();
exit(EXIT_FAILURE);
}
/*store values of column , row and maxgrey in structures*/
SkipComments(pgmFile);
fscanf(pgmFile, "%d", &data->col);
SkipComments(pgmFile);
fscanf(pgmFile, "%d", &data->row);
SkipComments(pgmFile);
fscanf(pgmFile, "%d", &data->max_gray);
fgetc(pgmFile);

/*store the higher byte in dynamic matrix*/


data->matrix = allocate_dynamic_matrix(data->row, data->col);
if (data->max_gray > 255)
for (i = 0; i < data->row; ++i)
for (j = 0; j < data->col; ++j) {
hi = fgetc(pgmFile);
lo = fgetc(pgmFile);
data->matrix[i][j] = (hi << 8) + lo;
}
else
/*store the lower byte in dynamic matrix*/
for (i = 0; i < data->row; ++i)
for (j = 0; j < data->col; ++j) {
lo = fgetc(pgmFile);
data->matrix[i][j] = lo;
}
/*close and return*/
fclose(pgmFile);
return data;
}
/*function to read PGM file*/
void writePGM(const char *filename, const PGMData *data)
{
FILE *pgmFile;
int i, j;
int hi, lo;
/*open a output file to write*/
pgmFile = fopen(filename, "wb");
if (pgmFile == NULL) {
perror("cannot open file to write");
getchar();
getchar();
exit(EXIT_FAILURE);
}
/*print version,column,row and maxgray values to output file*/
fprintf(pgmFile, "P5\n ");
fprintf(pgmFile, "%d %d\n ", data->col, data->row);
fprintf(pgmFile, "%d \n", data->max_gray);
/*print matrix values to file*/
if (data->max_gray > 255) {
for (i = 0; i < data->row; ++i) {
for (j = 0; j < data->col; ++j) {
hi = HI(data->matrix[i][j]);
lo = LO(data->matrix[i][j]);
fputc(hi, pgmFile);
fputc(lo, pgmFile);
}
}
} else {
for (i = 0; i < data->row; ++i)

for (j = 0; j < data->col; ++j) {


lo = LO(data->matrix[i][j]);
fputc(lo, pgmFile);
}
}
/*close and free memory*/
fclose(pgmFile);
deallocate_dynamic_matrix(data->matrix, data->row);
}
/*function to create Histogram out of PGM data*/
void createHistogram(const PGMData *data)
{
int i,j,greyVal=0,freq=0;
/*create histogram by counting frequency of each grey value from input matrix*/
for (i = 0; i < data->col; ++i)
for (j = 0; j < data->row; ++j)
{
for(greyVal=0; greyVal < 256; greyVal++)
{
if(data->matrix[i][j] == greyVal)
{
Histogram[greyVal]=Histogram[greyVal]+1;
}
}
}

/*function to display histogram*/


void showHistogram()
{
int i,j=0;
printf("\nGrayValue\tFrequency\n");
for(i=0;i<256;i++)
{
printf("%d\t\t%d\t",i,Histogram[i]);
if(Histogram[i] < 55)
{
for(j=Histogram[i]; j > 0; j--)
printf("*");
}
else
{
for(j = 0 ;j < 55;j++)
printf("*");
}
printf("\n");
}
}
/*function to get minimum and maximum value*/
void getMinMax(int array[255])
{
int i,cnt=0,maxcnt=0;
for(i=0;i<256;i++)
{

if(array[i] != 0 && cnt == 0)


{
minGreyVal=i;
cnt++;
}

for(i=0;i<255;i++)
{
if(array[i] != 0)
{
maxcnt=i;
}
}
maxGreyVal=maxcnt;

/*function to perform linear streching*/


void linearstrech(PGMData *data)
{
int i,j,Omin=0,Omax=0;
float y=0,m=0,c=0,diff=0;
int choice;
printf("\n\tLinear Streching");
printf("\n\t\t1.Darkness Streching");
printf("\n\t\t2.Brightness Streching");
printf("\n\t\t3.Mid-Range Streching");
printf("\nEnter your choice");
scanf("%d",&choice);
switch(choice)
{
case 1: printf("\nInput desired Maximum Grey Value:");
scanf("%d",&Omax);
if(Omax >= maxGreyVal)
{
printf("\nValue greater than input maximum");
printf("Setting value to input maximum ... for optimum
performance");
Omax = maxGreyVal;
}
break;
case 2: printf("\nInput desired Minimum Grey Value:");
scanf("%d",&Omin);
if(Omin <= maxGreyVal)
{
printf("\nValue lesser than input maximum");
printf("Setting value to input maximum ... for optimum
performance");
Omin = maxGreyVal+1;
Omax = 255;
}
break;
case 3: printf("\nInput desired Minimum Grey Value:");
scanf("%d",&Omin);
printf("\nInput desired Maximum Grey Value:");
scanf("%d",&Omax);

break;
default: printf("Invaild choice\n Exiting program...");
exit(1);
break;
}
/*Linear streching using y=mx+c*/
m = labs((Omax - Omin) / (maxGreyVal - minGreyVal));
c = labs(Omin - (m*minGreyVal));
for (i = 0; i < data->col; i++)
for (j = 0; j < data->row; j++)
{
if(data->matrix[i][j] <= minGreyVal)
{
y = Omin;
data->matrix[i][j]=int(y);
}
else if(data->matrix[i][j] > maxGreyVal)
{
y = Omax;
}
else
{
y = labs((m * data->matrix[i][j]) + c);
data->matrix[i][j]=int(y);
}
}
}
/*function to clear histogram*/
void flushistogram(){
for (int i=0; i<=255; i++)
{
Histogram[i]=0;
}
}
/*function for histogram equalization*/
void histogramequalizer(PGMData *image)
{
int i=0,j=0,greyVal=0;
double numofpixels=0;
for(i=0;i<256;i++)
numofpixels=numofpixels+Histogram[i];
//Probability Mass function table
double prt[256]={0};
prt[0]=(Histogram[0]/numofpixels);
for(i=1;i<256;i++)
prt[i]=prt[i]+(Histogram[i]/numofpixels);
//CumulativeDistributionFunction
double cdf[256]={0};

cdf[0] = prt[0];
for(i=1;i<256;i++)
{
cdf[i]=cdf[i]+(prt[i]+cdf[i-1]);
}
/*rewriting values to matrix according to distribution calculated*/
for (i = 0; i < image->col; i++)
for (j = 0; j < image->row; j++)
{
for(greyVal=0; greyVal < 256; greyVal++)
{
if(image->matrix[i][j] == greyVal)
{
image->matrix[i][j]=cdf[greyVal]*(maxGreyVal-1);
}
}
}
flushistogram();
createHistogram(image);
showHistogram();
}
/*Main program*/
void main()
{
char filename[100],ch;
int selection;
const char * source_fileName;
const char * modified_fileName = "output.pgm";
PGMData pgm_image, pgm_orig;
PGMData * data = &pgm_image;
PGMData * orig = &pgm_orig;
do
{
printf("\n************WELCOME***************");
printf("\nEnter image file to read(pgm format) : ");
scanf("%s",&filename);
source_fileName=filename;
printf("Reading image \"%s\" ...\n", source_fileName);

data = readPGM(source_fileName, data);


orig = readPGM(source_fileName, orig);
createHistogram(orig);
showHistogram();
getMinMax(Histogram);
printf("\nMinGreyVal = %d",minGreyVal);
printf("\nMaxGreyVal = %d",maxGreyVal);
printf("\n*********Image Transformation Options*************");
printf("\n\t1.Linear Streching");

printf("\n\t2.Histogram Equalization");
printf("\nEnter your selection here:");
scanf("%d",&selection);
switch (selection)
{
case 1: linearstrech(data);
flushistogram();
createHistogram(data);
showHistogram();
break;
case 2: histogramequalizer(data);
break;

default: printf("Invaild choice\n Exiting program...");


exit(1);
break;

writePGM(modified_fileName,data);
printf("\nFile Writing complete");
printf("\nopening outputfile......");
/***** open a output file in openseeit ****/
char program[100] = "OpenSeeIt.exe ";
char *openme;
openme= strcat(program,modified_fileName);
system(openme);
printf("\nDo you want to continue?(Y/N)\nEnter your answer here:");
getchar();
ch=getchar();
}while(ch=='Y' || ch=='y');
}

OUTPUT

************WELCOME***************
Enter image file to read(pgm format) : "babon.pgm"
Reading image...

GrayValue

Frequency

51

***************************************************

79

*******************************************************

10

83

*******************************************************

11

31

*******************************

12

26

**************************

13

58

*******************************************************

14

86

*******************************************************

15

161

*******************************************************

16

228

*******************************************************

17

239

*******************************************************

18

241

*******************************************************

19

290

*******************************************************

20

382

*******************************************************

21

465

*******************************************************

22

568

*******************************************************

23

648

*******************************************************

24

751

*******************************************************

25

917

*******************************************************

26

954

*******************************************************

27

1178 *******************************************************

28

1363 *******************************************************

29

1348 *******************************************************

30

1610 *******************************************************

31

1671 *******************************************************

32

1829 *******************************************************

33

1980 *******************************************************

34

2051 *******************************************************

35

2144 *******************************************************

36

2222 *******************************************************

37

2275 *******************************************************

38

2309 *******************************************************

39

2436 *******************************************************

40

2638 *******************************************************

41

2641 *******************************************************

42

2794 *******************************************************

43

2842 *******************************************************

44

3035 *******************************************************

45

3080 *******************************************************

46

3125 *******************************************************

47

3254 *******************************************************

48

3223 *******************************************************

49

3345 *******************************************************

50

3400 *******************************************************

51

3482 *******************************************************

52

3594 *******************************************************

53

3761 *******************************************************

54

3988 *******************************************************

55

4354 *******************************************************

56

4917 *******************************************************

57

5473 *******************************************************

58

5916 *******************************************************

59

6199 *******************************************************

60

6334 *******************************************************

61

6198 *******************************************************

62

5916 *******************************************************

63

8199 *******************************************************

64

5182 *******************************************************

65

4962 *******************************************************

66

4750 *******************************************************

67

4605 *******************************************************

68

4528 *******************************************************

69

4292 *******************************************************

70

4296 *******************************************************

71

4242 *******************************************************

72

4160 *******************************************************

73

3996 *******************************************************

74

4117 *******************************************************

75

4114 *******************************************************

76

4132 *******************************************************

77

4128 *******************************************************

78

4247 *******************************************************

79

4329 *******************************************************

80

4423 *******************************************************

81

4743 *******************************************************

82

4866 *******************************************************

83

4992 *******************************************************

84

5095 *******************************************************

85

5330 *******************************************************

86

5102 *******************************************************

87

4816 *******************************************************

88

4262 *******************************************************

89

3559 *******************************************************

90

2894 *******************************************************

91

2411 *******************************************************

92

1989 *******************************************************

93

1655 *******************************************************

94

1299 *******************************************************

95

892

*******************************************************

96

654

*******************************************************

97

356

*******************************************************

98

162

*******************************************************

99

98

*******************************************************

100

37

*************************************

101

29

*****************************

102

13

*************

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

****

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

MinGreyVal = 8

MaxGreyVal = 106
*********Image Transformation Options*************
1.Linear Streching
2.Histogram Equalization
Enter your selection here: 1
Linear Streching
1.Darkness Streching
2.Brightness Streching
3.Mid-Range Streching
Enter your choice: 1
Input desired Maximum Grey Value: 105
GrayValue

Frequency

51

10

11

12

13

14

15

16

17

79

*******************************************************

18

83

*******************************************************

***************************************************

19

31

*******************************

20

26

**************************

21

58

*******************************************************

22

86

*******************************************************

23

161

*******************************************************

24

228

*******************************************************

25

239

*******************************************************

26

241

*******************************************************

27

290

*******************************************************

28

382

*******************************************************

29

465

*******************************************************

30

568

*******************************************************

31

648

*******************************************************

32

751

*******************************************************

33

917

*******************************************************

34

954

*******************************************************

35

1178 *******************************************************

36

1363 *******************************************************

37

1348 *******************************************************

38

1610 *******************************************************

39

1671 *******************************************************

40

1829 *******************************************************

41

1980 *******************************************************

42

2051 *******************************************************

43

2144 *******************************************************

44

2222 *******************************************************

45

2275 *******************************************************

46

2309 *******************************************************

47

2436 *******************************************************

48

2638 *******************************************************

49

2641 *******************************************************

50

2794 *******************************************************

51

2842 *******************************************************

52

3035 *******************************************************

53

3080 *******************************************************

54

3125 *******************************************************

55

3254 *******************************************************

56

3223 *******************************************************

57

3345 *******************************************************

58

3400 *******************************************************

59

3482 *******************************************************

60

3594 *******************************************************

61

3761 *******************************************************

62

3988 *******************************************************

63

4354 *******************************************************

64

4917 *******************************************************

65

5473 *******************************************************

66

5916 *******************************************************

67

6199 *******************************************************

68

6334 *******************************************************

69

6198 *******************************************************

70

5916 *******************************************************

71

8199 *******************************************************

72

5182 *******************************************************

73

4962 *******************************************************

74

4750 *******************************************************

75

4605 *******************************************************

76

4528 *******************************************************

77

4292 *******************************************************

78

4296 *******************************************************

79

4242 *******************************************************

80

4160 *******************************************************

81

3996 *******************************************************

82

4117 *******************************************************

83

4114 *******************************************************

84

4132 *******************************************************

85

4128 *******************************************************

86

4247 *******************************************************

87

4329 *******************************************************

88

4423 *******************************************************

89

4743 *******************************************************

90

4866 *******************************************************

91

4992 *******************************************************

92

5095 *******************************************************

93

5330 *******************************************************

94

5102 *******************************************************

95

4816 *******************************************************

96

4262 *******************************************************

97

3559 *******************************************************

98

2894 *******************************************************

99

2411 *******************************************************

100

1989 *******************************************************

101

1655 *******************************************************

102

1299 *******************************************************

103

892

*******************************************************

104

654

*******************************************************

105

356

*******************************************************

106

162

*******************************************************

107

98

*******************************************************

108

37

*************************************

109

29

*****************************

110

13

*************

111

****

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

File Writing complete


opening outputfile......

Do you want to continue?(Y/N)


Enter your answer here: y

************WELCOME***************
Enter image file to read(pgm format) : "babon.pgm"
Reading image...

GrayValue

Frequency

51

***************************************************

79

*******************************************************

10

83

*******************************************************

11

31

*******************************

12

26

**************************

13

58

*******************************************************

14

86

*******************************************************

15

161

*******************************************************

16

228

*******************************************************

17

239

*******************************************************

18

241

*******************************************************

19

290

*******************************************************

20

382

*******************************************************

21

465

*******************************************************

22

568

*******************************************************

23

648

*******************************************************

24

751

*******************************************************

25

917

*******************************************************

26

954

*******************************************************

27

1178 *******************************************************

28

1363 *******************************************************

29

1348 *******************************************************

30

1610 *******************************************************

31

1671 *******************************************************

32

1829 *******************************************************

33

1980 *******************************************************

34

2051 *******************************************************

35

2144 *******************************************************

36

2222 *******************************************************

37

2275 *******************************************************

38

2309 *******************************************************

39

2436 *******************************************************

40

2638 *******************************************************

41

2641 *******************************************************

42

2794 *******************************************************

43

2842 *******************************************************

44

3035 *******************************************************

45

3080 *******************************************************

46

3125 *******************************************************

47

3254 *******************************************************

48

3223 *******************************************************

49

3345 *******************************************************

50

3400 *******************************************************

51

3482 *******************************************************

52

3594 *******************************************************

53

3761 *******************************************************

54

3988 *******************************************************

55

4354 *******************************************************

56

4917 *******************************************************

57

5473 *******************************************************

58

5916 *******************************************************

59

6199 *******************************************************

60

6334 *******************************************************

61

6198 *******************************************************

62

5916 *******************************************************

63

8199 *******************************************************

64

5182 *******************************************************

65

4962 *******************************************************

66

4750 *******************************************************

67

4605 *******************************************************

68

4528 *******************************************************

69

4292 *******************************************************

70

4296 *******************************************************

71

4242 *******************************************************

72

4160 *******************************************************

73

3996 *******************************************************

74

4117 *******************************************************

75

4114 *******************************************************

76

4132 *******************************************************

77

4128 *******************************************************

78

4247 *******************************************************

79

4329 *******************************************************

80

4423 *******************************************************

81

4743 *******************************************************

82

4866 *******************************************************

83

4992 *******************************************************

84

5095 *******************************************************

85

5330 *******************************************************

86

5102 *******************************************************

87

4816 *******************************************************

88

4262 *******************************************************

89

3559 *******************************************************

90

2894 *******************************************************

91

2411 *******************************************************

92

1989 *******************************************************

93

1655 *******************************************************

94

1299 *******************************************************

95

892

*******************************************************

96

654

*******************************************************

97

356

*******************************************************

98

162

*******************************************************

99

98

*******************************************************

100

37

*************************************

101

29

*****************************

102

13

*************

103

****

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

MinGreyVal = 8
MaxGreyVal = 106
*********Image Transformation Options*************
1.Linear Streching

2.Histogram Equalization
Enter your selection here: 1
Linear Streching
1.Darkness Streching
2.Brightness Streching
3.Mid-Range Streching
Enter your choice: 2
Input desired Minimum Grey Value: 120
GrayValue

Frequency

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

117

118

119

120

51

***************************************************

121

79

*******************************************************

122

83

*******************************************************

123

31

*******************************

124

26

**************************

125

58

*******************************************************

126

86

*******************************************************

127

161

*******************************************************

128

228

*******************************************************

129

239

*******************************************************

130

241

*******************************************************

131

290

*******************************************************

132

382

*******************************************************

133

465

*******************************************************

134

568

*******************************************************

135

648

*******************************************************

136

751

*******************************************************

137

917

*******************************************************

138

954

*******************************************************

139

1178 *******************************************************

140

1363 *******************************************************

141

1348 *******************************************************

142

1610 *******************************************************

143

1671 *******************************************************

144

1829 *******************************************************

145

1980 *******************************************************

146

2051 *******************************************************

147

2144 *******************************************************

148

2222 *******************************************************

149

2275 *******************************************************

150

2309 *******************************************************

151

2436 *******************************************************

152

2638 *******************************************************

153

2641 *******************************************************

154

2794 *******************************************************

155

2842 *******************************************************

156

3035 *******************************************************

157

3080 *******************************************************

158

3125 *******************************************************

159

3254 *******************************************************

160

3223 *******************************************************

161

3345 *******************************************************

162

3400 *******************************************************

163

3482 *******************************************************

164

3594 *******************************************************

165

3761 *******************************************************

166

3988 *******************************************************

167

4354 *******************************************************

168

4917 *******************************************************

169

5473 *******************************************************

170

5916 *******************************************************

171

6199 *******************************************************

172

6334 *******************************************************

173

6198 *******************************************************

174

5916 *******************************************************

175

8199 *******************************************************

176

5182 *******************************************************

177

4962 *******************************************************

178

4750 *******************************************************

179

4605 *******************************************************

180

4528 *******************************************************

181

4292 *******************************************************

182

4296 *******************************************************

183

4242 *******************************************************

184

4160 *******************************************************

185

3996 *******************************************************

186

4117 *******************************************************

187

4114 *******************************************************

188

4132 *******************************************************

189

4128 *******************************************************

190

4247 *******************************************************

191

4329 *******************************************************

192

4423 *******************************************************

193

4743 *******************************************************

194

4866 *******************************************************

195

4992 *******************************************************

196

5095 *******************************************************

197

5330 *******************************************************

198

5102 *******************************************************

199

4816 *******************************************************

200

4262 *******************************************************

201

3559 *******************************************************

202

2894 *******************************************************

203

2411 *******************************************************

204

1989 *******************************************************

205

1655 *******************************************************

206

1299 *******************************************************

207

892

*******************************************************

208

654

*******************************************************

209

356

*******************************************************

210

162

*******************************************************

211

98

*******************************************************

212

37

*************************************

213

29

*****************************

214

13

*************

215

****

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

File Writing complete


opening outputfile......

Do you want to continue?(Y/N)


Enter your answer here: y

************WELCOME***************

Enter image file to read(pgm format) : "babon.pgm"


Reading image...

GrayValue

Frequency

51

***************************************************

79

*******************************************************

10

83

*******************************************************

11

31

*******************************

12

26

**************************

13

58

*******************************************************

14

86

*******************************************************

15

161

*******************************************************

16

228

*******************************************************

17

239

*******************************************************

18

241

*******************************************************

19

290

*******************************************************

20

382

*******************************************************

21

465

*******************************************************

22

568

*******************************************************

23

648

*******************************************************

24

751

*******************************************************

25

917

*******************************************************

26

954

*******************************************************

27

1178 *******************************************************

28

1363 *******************************************************

29

1348 *******************************************************

30

1610 *******************************************************

31

1671 *******************************************************

32

1829 *******************************************************

33

1980 *******************************************************

34

2051 *******************************************************

35

2144 *******************************************************

36

2222 *******************************************************

37

2275 *******************************************************

38

2309 *******************************************************

39

2436 *******************************************************

40

2638 *******************************************************

41

2641 *******************************************************

42

2794 *******************************************************

43

2842 *******************************************************

44

3035 *******************************************************

45

3080 *******************************************************

46

3125 *******************************************************

47

3254 *******************************************************

48

3223 *******************************************************

49

3345 *******************************************************

50

3400 *******************************************************

51

3482 *******************************************************

52

3594 *******************************************************

53

3761 *******************************************************

54

3988 *******************************************************

55

4354 *******************************************************

56

4917 *******************************************************

57

5473 *******************************************************

58

5916 *******************************************************

59

6199 *******************************************************

60

6334 *******************************************************

61

6198 *******************************************************

62

5916 *******************************************************

63

8199 *******************************************************

64

5182 *******************************************************

65

4962 *******************************************************

66

4750 *******************************************************

67

4605 *******************************************************

68

4528 *******************************************************

69

4292 *******************************************************

70

4296 *******************************************************

71

4242 *******************************************************

72

4160 *******************************************************

73

3996 *******************************************************

74

4117 *******************************************************

75

4114 *******************************************************

76

4132 *******************************************************

77

4128 *******************************************************

78

4247 *******************************************************

79

4329 *******************************************************

80

4423 *******************************************************

81

4743 *******************************************************

82

4866 *******************************************************

83

4992 *******************************************************

84

5095 *******************************************************

85

5330 *******************************************************

86

5102 *******************************************************

87

4816 *******************************************************

88

4262 *******************************************************

89

3559 *******************************************************

90

2894 *******************************************************

91

2411 *******************************************************

92

1989 *******************************************************

93

1655 *******************************************************

94

1299 *******************************************************

95

892

*******************************************************

96

654

*******************************************************

97

356

*******************************************************

98

162

*******************************************************

99

98

*******************************************************

100

37

*************************************

101

29

*****************************

102

13

*************

103

****

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

MinGreyVal = 8
MaxGreyVal = 106
*********Image Transformation Options*************

1.Linear Streching
2.Histogram Equalization
Enter your selection here: 1
Linear Streching
1.Darkness Streching
2.Brightness Streching
3.Mid-Range Streching
Enter your choice: 3
Input desired Minimum Grey Value: 108
Input desired Maximum Grey Value: 206
GrayValue

Frequency

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

51

***************************************************

109

79

*******************************************************

110

83

*******************************************************

111

31

*******************************

112

26

**************************

113

58

*******************************************************

114

86

*******************************************************

115

161

*******************************************************

116

228

*******************************************************

117

239

*******************************************************

118

241

*******************************************************

119

290

*******************************************************

120

382

*******************************************************

121

465

*******************************************************

122

568

*******************************************************

123

648

*******************************************************

124

751

*******************************************************

125

917

*******************************************************

126

954

*******************************************************

127

1178 *******************************************************

128

1363 *******************************************************

129

1348 *******************************************************

130

1610 *******************************************************

131

1671 *******************************************************

132

1829 *******************************************************

133

1980 *******************************************************

134

2051 *******************************************************

135

2144 *******************************************************

136

2222 *******************************************************

137

2275 *******************************************************

138

2309 *******************************************************

139

2436 *******************************************************

140

2638 *******************************************************

141

2641 *******************************************************

142

2794 *******************************************************

143

2842 *******************************************************

144

3035 *******************************************************

145

3080 *******************************************************

146

3125 *******************************************************

147

3254 *******************************************************

148

3223 *******************************************************

149

3345 *******************************************************

150

3400 *******************************************************

151

3482 *******************************************************

152

3594 *******************************************************

153

3761 *******************************************************

154

3988 *******************************************************

155

4354 *******************************************************

156

4917 *******************************************************

157

5473 *******************************************************

158

5916 *******************************************************

159

6199 *******************************************************

160

6334 *******************************************************

161

6198 *******************************************************

162

5916 *******************************************************

163

8199 *******************************************************

164

5182 *******************************************************

165

4962 *******************************************************

166

4750 *******************************************************

167

4605 *******************************************************

168

4528 *******************************************************

169

4292 *******************************************************

170

4296 *******************************************************

171

4242 *******************************************************

172

4160 *******************************************************

173

3996 *******************************************************

174

4117 *******************************************************

175

4114 *******************************************************

176

4132 *******************************************************

177

4128 *******************************************************

178

4247 *******************************************************

179

4329 *******************************************************

180

4423 *******************************************************

181

4743 *******************************************************

182

4866 *******************************************************

183

4992 *******************************************************

184

5095 *******************************************************

185

5330 *******************************************************

186

5102 *******************************************************

187

4816 *******************************************************

188

4262 *******************************************************

189

3559 *******************************************************

190

2894 *******************************************************

191

2411 *******************************************************

192

1989 *******************************************************

193

1655 *******************************************************

194

1299 *******************************************************

195

892

*******************************************************

196

654

*******************************************************

197

356

*******************************************************

198

162

*******************************************************

199

98

*******************************************************

200

37

*************************************

201

29

*****************************

202

13

*************

203

****

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

File Writing complete


opening outputfile......

Do you want to continue?(Y/N)


Enter your answer here: y

************WELCOME***************
Enter image file to read(pgm format) : "babon.pgm"
Reading image...

GrayValue

Frequency

51

***************************************************

79

*******************************************************

10

83

*******************************************************

11

31

*******************************

12

26

**************************

13

58

*******************************************************

14

86

*******************************************************

15

161

*******************************************************

16

228

*******************************************************

17

239

*******************************************************

18

241

*******************************************************

19

290

*******************************************************

20

382

*******************************************************

21

465

*******************************************************

22

568

*******************************************************

23

648

*******************************************************

24

751

*******************************************************

25

917

*******************************************************

26

954

*******************************************************

27

1178 *******************************************************

28

1363 *******************************************************

29

1348 *******************************************************

30

1610 *******************************************************

31

1671 *******************************************************

32

1829 *******************************************************

33

1980 *******************************************************

34

2051 *******************************************************

35

2144 *******************************************************

36

2222 *******************************************************

37

2275 *******************************************************

38

2309 *******************************************************

39

2436 *******************************************************

40

2638 *******************************************************

41

2641 *******************************************************

42

2794 *******************************************************

43

2842 *******************************************************

44

3035 *******************************************************

45

3080 *******************************************************

46

3125 *******************************************************

47

3254 *******************************************************

48

3223 *******************************************************

49

3345 *******************************************************

50

3400 *******************************************************

51

3482 *******************************************************

52

3594 *******************************************************

53

3761 *******************************************************

54

3988 *******************************************************

55

4354 *******************************************************

56

4917 *******************************************************

57

5473 *******************************************************

58

5916 *******************************************************

59

6199 *******************************************************

60

6334 *******************************************************

61

6198 *******************************************************

62

5916 *******************************************************

63

8199 *******************************************************

64

5182 *******************************************************

65

4962 *******************************************************

66

4750 *******************************************************

67

4605 *******************************************************

68

4528 *******************************************************

69

4292 *******************************************************

70

4296 *******************************************************

71

4242 *******************************************************

72

4160 *******************************************************

73

3996 *******************************************************

74

4117 *******************************************************

75

4114 *******************************************************

76

4132 *******************************************************

77

4128 *******************************************************

78

4247 *******************************************************

79

4329 *******************************************************

80

4423 *******************************************************

81

4743 *******************************************************

82

4866 *******************************************************

83

4992 *******************************************************

84

5095 *******************************************************

85

5330 *******************************************************

86

5102 *******************************************************

87

4816 *******************************************************

88

4262 *******************************************************

89

3559 *******************************************************

90

2894 *******************************************************

91

2411 *******************************************************

92

1989 *******************************************************

93

1655 *******************************************************

94

1299 *******************************************************

95

892

*******************************************************

96

654

*******************************************************

97

356

*******************************************************

98

162

*******************************************************

99

98

*******************************************************

100

37

*************************************

101

29

*****************************

102

13

*************

103

****

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

MinGreyVal = 8
MaxGreyVal = 106
*********Image Transformation Options*************
1.Linear Streching
2.Histogram Equalization
Enter your selection here: 2

GrayValue

Frequency

2420 *******************************************************

1967 *******************************************************

3049 *******************************************************

1363 *******************************************************

2958 *******************************************************

1671 *******************************************************

3809 *******************************************************

2051 *******************************************************

2144 *******************************************************

2222 *******************************************************

10

2275 *******************************************************

11

2309 *******************************************************

12

2436 *******************************************************

13

2638 *******************************************************

14

2641 *******************************************************

15

2794 *******************************************************

16

2842 *******************************************************

17

3035 *******************************************************

18

19

3080 *******************************************************

20

3125 *******************************************************

21

3254 *******************************************************

22

3223 *******************************************************

23

24

3345 *******************************************************

25

3400 *******************************************************

26

27

3482 *******************************************************

28

3594 *******************************************************

29

3761 *******************************************************

30

31

3988 *******************************************************

32

33

4354 *******************************************************

34

35

4917 *******************************************************

36

37

5473 *******************************************************

38

39

5916 *******************************************************

40

41

42

6199 *******************************************************

43

44

6334 *******************************************************

45

46

47

6198 *******************************************************

48

49

5916 *******************************************************

50

51

52

53

8199 *******************************************************

54

55

5182 *******************************************************

56

57

4962 *******************************************************

58

4750 *******************************************************

59

60

4605 *******************************************************

61

62

4528 *******************************************************

63

64

4292 *******************************************************

65

66

4296 *******************************************************

67

4242 *******************************************************

68

69

4160 *******************************************************

70

71

3996 *******************************************************

72

4117 *******************************************************

73

74

4114 *******************************************************

75

76

4132 *******************************************************

77

4128 *******************************************************

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

68258*******************************************************

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

File Writing complete


opening outputfile......

Do you want to continue?(Y/N)


Enter your answer here: n

************WELCOME***************
Enter image file to read(pgm format) : "lena.pgm"
Reading image...

GrayValue

Frequency

10

11

12

13

29

*****************************

14

91

*******************************************************

15

228

*******************************************************

16

401

*******************************************************

17

725

*******************************************************

18

1115 *******************************************************

19

1700 *******************************************************

20

2361 *******************************************************

21

3070 *******************************************************

22

3604 *******************************************************

23

4096 *******************************************************

24

4076 *******************************************************

25

4099 *******************************************************

26

3810 *******************************************************

27

3419 *******************************************************

28

3044 *******************************************************

29

2544 *******************************************************

30

2225 *******************************************************

31

1913 *******************************************************

32

1780 *******************************************************

33

1593 *******************************************************

34

1544 *******************************************************

35

1661 *******************************************************

36

1625 *******************************************************

37

1783 *******************************************************

38

1733 *******************************************************

39

1871 *******************************************************

40

1840 *******************************************************

41

1801 *******************************************************

42

1902 *******************************************************

43

2010 *******************************************************

44

2183 *******************************************************

45

2345 *******************************************************

46

2546 *******************************************************

47

2966 *******************************************************

48

3417 *******************************************************

49

3958 *******************************************************

50

3827 *******************************************************

51

3780 *******************************************************

52

3498 *******************************************************

53

3085 *******************************************************

54

2798 *******************************************************

55

2758 *******************************************************

56

2804 *******************************************************

57

2719 *******************************************************

58

2874 *******************************************************

59

3060 *******************************************************

60

3413 *******************************************************

61

3670 *******************************************************

62

4159 *******************************************************

63

7002 *******************************************************

64

4870 *******************************************************

65

4498 *******************************************************

66

4103 *******************************************************

67

3790 *******************************************************

68

3932 *******************************************************

69

4397 *******************************************************

70

4611 *******************************************************

71

4899 *******************************************************

72

4630 *******************************************************

73

4630 *******************************************************

74

4510 *******************************************************

75

4700 *******************************************************

76

5327 *******************************************************

77

5363 *******************************************************

78

4883 *******************************************************

79

4347 *******************************************************

80

3610 *******************************************************

81

3081 *******************************************************

82

2772 *******************************************************

83

2450 *******************************************************

84

2379 *******************************************************

85

2539 *******************************************************

86

2465 *******************************************************

87

2374 *******************************************************

88

2339 *******************************************************

89

1870 *******************************************************

90

1612 *******************************************************

91

1308 *******************************************************

92

1261 *******************************************************

93

1337 *******************************************************

94

1390 *******************************************************

95

1641 *******************************************************

96

1838 *******************************************************

97

1891 *******************************************************

98

1774 *******************************************************

99

1668 *******************************************************

100

1759 *******************************************************

101

1772 *******************************************************

102

1935 *******************************************************

103

2161 *******************************************************

104

1967 *******************************************************

105

1983 *******************************************************

106

1504 *******************************************************

107

1061 *******************************************************

108

758

*******************************************************

109

526

*******************************************************

110

444

*******************************************************

111

294

*******************************************************

112

147

*******************************************************

113

110

*******************************************************

114

42

******************************************

115

15

***************

116

14

**************

117

118

119

120

**

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

MinGreyVal = 10
MaxGreyVal = 122
*********Image Transformation Options*************
1.Linear Streching
2.Histogram Equalization
Enter your selection here: 1
Linear Streching
1.Darkness Streching
2.Brightness Streching
3.Mid-Range Streching
Enter your choice: 1
Input desired Maximum Grey Value: 112
GrayValue

Frequency

10

11

12

13

14

15

16

17

18

19

20

21

22

23

29

*****************************

24

91

*******************************************************

25

228

*******************************************************

26

401

*******************************************************

27

725

*******************************************************

28

1115 *******************************************************

29

1700 *******************************************************

30

2361 *******************************************************

31

3070 *******************************************************

32

3604 *******************************************************

33

4096 *******************************************************

34

4076 *******************************************************

35

4099 *******************************************************

36

3810 *******************************************************

37

3419 *******************************************************

38

3044 *******************************************************

39

2544 *******************************************************

40

2225 *******************************************************

41

1913 *******************************************************

42

1780 *******************************************************

43

1593 *******************************************************

44

1544 *******************************************************

45

1661 *******************************************************

46

1625 *******************************************************

47

1783 *******************************************************

48

1733 *******************************************************

49

1871 *******************************************************

50

1840 *******************************************************

51

1801 *******************************************************

52

1902 *******************************************************

53

2010 *******************************************************

54

2183 *******************************************************

55

2345 *******************************************************

56

2546 *******************************************************

57

2966 *******************************************************

58

3417 *******************************************************

59

3958 *******************************************************

60

3827 *******************************************************

61

3780 *******************************************************

62

3498 *******************************************************

63

3085 *******************************************************

64

2798 *******************************************************

65

2758 *******************************************************

66

2804 *******************************************************

67

2719 *******************************************************

68

2874 *******************************************************

69

3060 *******************************************************

70

3413 *******************************************************

71

3670 *******************************************************

72

4159 *******************************************************

73

7002 *******************************************************

74

4870 *******************************************************

75

4498 *******************************************************

76

4103 *******************************************************

77

3790 *******************************************************

78

3932 *******************************************************

79

4397 *******************************************************

80

4611 *******************************************************

81

4899 *******************************************************

82

4630 *******************************************************

83

4630 *******************************************************

84

4510 *******************************************************

85

4700 *******************************************************

86

5327 *******************************************************

87

5363 *******************************************************

88

4883 *******************************************************

89

4347 *******************************************************

90

3610 *******************************************************

91

3081 *******************************************************

92

2772 *******************************************************

93

2450 *******************************************************

94

2379 *******************************************************

95

2539 *******************************************************

96

2465 *******************************************************

97

2374 *******************************************************

98

2339 *******************************************************

99

1870 *******************************************************

100

1612 *******************************************************

101

1308 *******************************************************

102

1261 *******************************************************

103

1337 *******************************************************

104

1390 *******************************************************

105

1641 *******************************************************

106

1838 *******************************************************

107

1891 *******************************************************

108

1774 *******************************************************

109

1668 *******************************************************

110

1759 *******************************************************

111

1772 *******************************************************

112

1935 *******************************************************

113

2161 *******************************************************

114

1967 *******************************************************

115

1983 *******************************************************

116

1504 *******************************************************

117

1061 *******************************************************

118

758

*******************************************************

119

526

*******************************************************

120

444

*******************************************************

121

294

*******************************************************

122

147

*******************************************************

123

110

*******************************************************

124

42

******************************************

125

15

***************

126

14

**************

127

128

129

130

**

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

File Writing complete


opening outputfile......

Do you want to continue?(Y/N)


Enter your answer here: y

************WELCOME***************
Enter image file to read(pgm format) : "lena.pgm"
Reading image...

GrayValue

Frequency

10

11

12

13

29

*****************************

14

91

*******************************************************

15

228

*******************************************************

16

401

*******************************************************

17

725

*******************************************************

18

1115 *******************************************************

19

1700 *******************************************************

20

2361 *******************************************************

21

3070 *******************************************************

22

3604 *******************************************************

23

4096 *******************************************************

24

4076 *******************************************************

25

4099 *******************************************************

26

3810 *******************************************************

27

3419 *******************************************************

28

3044 *******************************************************

29

2544 *******************************************************

30

2225 *******************************************************

31

1913 *******************************************************

32

1780 *******************************************************

33

1593 *******************************************************

34

1544 *******************************************************

35

1661 *******************************************************

36

1625 *******************************************************

37

1783 *******************************************************

38

1733 *******************************************************

39

1871 *******************************************************

40

1840 *******************************************************

41

1801 *******************************************************

42

1902 *******************************************************

43

2010 *******************************************************

44

2183 *******************************************************

45

2345 *******************************************************

46

2546 *******************************************************

47

2966 *******************************************************

48

3417 *******************************************************

49

3958 *******************************************************

50

3827 *******************************************************

51

3780 *******************************************************

52

3498 *******************************************************

53

3085 *******************************************************

54

2798 *******************************************************

55

2758 *******************************************************

56

2804 *******************************************************

57

2719 *******************************************************

58

2874 *******************************************************

59

3060 *******************************************************

60

3413 *******************************************************

61

3670 *******************************************************

62

4159 *******************************************************

63

7002 *******************************************************

64

4870 *******************************************************

65

4498 *******************************************************

66

4103 *******************************************************

67

3790 *******************************************************

68

3932 *******************************************************

69

4397 *******************************************************

70

4611 *******************************************************

71

4899 *******************************************************

72

4630 *******************************************************

73

4630 *******************************************************

74

4510 *******************************************************

75

4700 *******************************************************

76

5327 *******************************************************

77

5363 *******************************************************

78

4883 *******************************************************

79

4347 *******************************************************

80

3610 *******************************************************

81

3081 *******************************************************

82

2772 *******************************************************

83

2450 *******************************************************

84

2379 *******************************************************

85

2539 *******************************************************

86

2465 *******************************************************

87

2374 *******************************************************

88

2339 *******************************************************

89

1870 *******************************************************

90

1612 *******************************************************

91

1308 *******************************************************

92

1261 *******************************************************

93

1337 *******************************************************

94

1390 *******************************************************

95

1641 *******************************************************

96

1838 *******************************************************

97

1891 *******************************************************

98

1774 *******************************************************

99

1668 *******************************************************

100

1759 *******************************************************

101

1772 *******************************************************

102

1935 *******************************************************

103

2161 *******************************************************

104

1967 *******************************************************

105

1983 *******************************************************

106

1504 *******************************************************

107

1061 *******************************************************

108

758

*******************************************************

109

526

*******************************************************

110

444

*******************************************************

111

294

*******************************************************

112

147

*******************************************************

113

110

*******************************************************

114

42

******************************************

115

15

***************

116

14

**************

117

118

119

120

**

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

MinGreyVal = 10
MaxGreyVal = 122
*********Image Transformation Options*************
1.Linear Streching
2.Histogram Equalization

Enter your selection here: 1


Linear Streching
1.Darkness Streching
2.Brightness Streching
3.Mid-Range Streching
Enter your choice: 2
Input desired Minimum Grey Value: 150
GrayValue

Frequency

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

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

29

*****************************

154

91

*******************************************************

155

228

*******************************************************

156

401

*******************************************************

157

725

*******************************************************

158

1115 *******************************************************

159

1700 *******************************************************

160

2361 *******************************************************

161

3070 *******************************************************

162

3604 *******************************************************

163

4096 *******************************************************

164

4076 *******************************************************

165

4099 *******************************************************

166

3810 *******************************************************

167

3419 *******************************************************

168

3044 *******************************************************

169

2544 *******************************************************

170

2225 *******************************************************

171

1913 *******************************************************

172

1780 *******************************************************

173

1593 *******************************************************

174

1544 *******************************************************

175

1661 *******************************************************

176

1625 *******************************************************

177

1783 *******************************************************

178

1733 *******************************************************

179

1871 *******************************************************

180

1840 *******************************************************

181

1801 *******************************************************

182

1902 *******************************************************

183

2010 *******************************************************

184

2183 *******************************************************

185

2345 *******************************************************

186

2546 *******************************************************

187

2966 *******************************************************

188

3417 *******************************************************

189

3958 *******************************************************

190

3827 *******************************************************

191

3780 *******************************************************

192

3498 *******************************************************

193

3085 *******************************************************

194

2798 *******************************************************

195

2758 *******************************************************

196

2804 *******************************************************

197

2719 *******************************************************

198

2874 *******************************************************

199

3060 *******************************************************

200

3413 *******************************************************

201

3670 *******************************************************

202

4159 *******************************************************

203

7002 *******************************************************

204

4870 *******************************************************

205

4498 *******************************************************

206

4103 *******************************************************

207

3790 *******************************************************

208

3932 *******************************************************

209

4397 *******************************************************

210

4611 *******************************************************

211

4899 *******************************************************

212

4630 *******************************************************

213

4630 *******************************************************

214

4510 *******************************************************

215

4700 *******************************************************

216

5327 *******************************************************

217

5363 *******************************************************

218

4883 *******************************************************

219

4347 *******************************************************

220

3610 *******************************************************

221

3081 *******************************************************

222

2772 *******************************************************

223

2450 *******************************************************

224

2379 *******************************************************

225

2539 *******************************************************

226

2465 *******************************************************

227

2374 *******************************************************

228

2339 *******************************************************

229

1870 *******************************************************

230

1612 *******************************************************

231

1308 *******************************************************

232

1261 *******************************************************

233

1337 *******************************************************

234

1390 *******************************************************

235

1641 *******************************************************

236

1838 *******************************************************

237

1891 *******************************************************

238

1774 *******************************************************

239

1668 *******************************************************

240

1759 *******************************************************

241

1772 *******************************************************

242

1935 *******************************************************

243

2161 *******************************************************

244

1967 *******************************************************

245

1983 *******************************************************

246

1504 *******************************************************

247

1061 *******************************************************

248

758

*******************************************************

249

526

*******************************************************

250

444

*******************************************************

251

294

*******************************************************

252

147

*******************************************************

253

110

*******************************************************

254

42

******************************************

255

15

***************

File Writing complete


opening outputfile......

Do you want to continue?(Y/N)


Enter your answer here: y

************WELCOME***************
Enter image file to read(pgm format) : "lena.pgm"
Reading image...

GrayValue

Frequency

10

11

12

13

29

*****************************

14

91

*******************************************************

15

228

*******************************************************

16

401

*******************************************************

17

725

*******************************************************

18

1115 *******************************************************

19

1700 *******************************************************

20

2361 *******************************************************

21

3070 *******************************************************

22

3604 *******************************************************

23

4096 *******************************************************

24

4076 *******************************************************

25

4099 *******************************************************

26

3810 *******************************************************

27

3419 *******************************************************

28

3044 *******************************************************

29

2544 *******************************************************

30

2225 *******************************************************

31

1913 *******************************************************

32

1780 *******************************************************

33

1593 *******************************************************

34

1544 *******************************************************

35

1661 *******************************************************

36

1625 *******************************************************

37

1783 *******************************************************

38

1733 *******************************************************

39

1871 *******************************************************

40

1840 *******************************************************

41

1801 *******************************************************

42

1902 *******************************************************

43

2010 *******************************************************

44

2183 *******************************************************

45

2345 *******************************************************

46

2546 *******************************************************

47

2966 *******************************************************

48

3417 *******************************************************

49

3958 *******************************************************

50

3827 *******************************************************

51

3780 *******************************************************

52

3498 *******************************************************

53

3085 *******************************************************

54

2798 *******************************************************

55

2758 *******************************************************

56

2804 *******************************************************

57

2719 *******************************************************

58

2874 *******************************************************

59

3060 *******************************************************

60

3413 *******************************************************

61

3670 *******************************************************

62

4159 *******************************************************

63

7002 *******************************************************

64

4870 *******************************************************

65

4498 *******************************************************

66

4103 *******************************************************

67

3790 *******************************************************

68

3932 *******************************************************

69

4397 *******************************************************

70

4611 *******************************************************

71

4899 *******************************************************

72

4630 *******************************************************

73

4630 *******************************************************

74

4510 *******************************************************

75

4700 *******************************************************

76

5327 *******************************************************

77

5363 *******************************************************

78

4883 *******************************************************

79

4347 *******************************************************

80

3610 *******************************************************

81

3081 *******************************************************

82

2772 *******************************************************

83

2450 *******************************************************

84

2379 *******************************************************

85

2539 *******************************************************

86

2465 *******************************************************

87

2374 *******************************************************

88

2339 *******************************************************

89

1870 *******************************************************

90

1612 *******************************************************

91

1308 *******************************************************

92

1261 *******************************************************

93

1337 *******************************************************

94

1390 *******************************************************

95

1641 *******************************************************

96

1838 *******************************************************

97

1891 *******************************************************

98

1774 *******************************************************

99

1668 *******************************************************

100

1759 *******************************************************

101

1772 *******************************************************

102

1935 *******************************************************

103

2161 *******************************************************

104

1967 *******************************************************

105

1983 *******************************************************

106

1504 *******************************************************

107

1061 *******************************************************

108

758

*******************************************************

109

526

*******************************************************

110

444

*******************************************************

111

294

*******************************************************

112

147

*******************************************************

113

110

*******************************************************

114

42

******************************************

115

15

***************

116

14

**************

117

118

119

120

**

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

MinGreyVal = 10
MaxGreyVal = 122
*********Image Transformation Options*************
1.Linear Streching
2.Histogram Equalization

Enter your selection here: 1


Linear Streching
1.Darkness Streching
2.Brightness Streching
3.Mid-Range Streching
Enter your choice: 3
Input desired Minimum Grey Value: 112
Input desired Maximum Grey Value: 245
GrayValue

Frequency

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

29

*****************************

116

91

*******************************************************

117

228

*******************************************************

118

401

*******************************************************

119

725

*******************************************************

120

1115 *******************************************************

121

1700 *******************************************************

122

2361 *******************************************************

123

3070 *******************************************************

124

3604 *******************************************************

125

4096 *******************************************************

126

4076 *******************************************************

127

4099 *******************************************************

128

3810 *******************************************************

129

3419 *******************************************************

130

3044 *******************************************************

131

2544 *******************************************************

132

2225 *******************************************************

133

1913 *******************************************************

134

1780 *******************************************************

135

1593 *******************************************************

136

1544 *******************************************************

137

1661 *******************************************************

138

1625 *******************************************************

139

1783 *******************************************************

140

1733 *******************************************************

141

1871 *******************************************************

142

1840 *******************************************************

143

1801 *******************************************************

144

1902 *******************************************************

145

2010 *******************************************************

146

2183 *******************************************************

147

2345 *******************************************************

148

2546 *******************************************************

149

2966 *******************************************************

150

3417 *******************************************************

151

3958 *******************************************************

152

3827 *******************************************************

153

3780 *******************************************************

154

3498 *******************************************************

155

3085 *******************************************************

156

2798 *******************************************************

157

2758 *******************************************************

158

2804 *******************************************************

159

2719 *******************************************************

160

2874 *******************************************************

161

3060 *******************************************************

162

3413 *******************************************************

163

3670 *******************************************************

164

4159 *******************************************************

165

7002 *******************************************************

166

4870 *******************************************************

167

4498 *******************************************************

168

4103 *******************************************************

169

3790 *******************************************************

170

3932 *******************************************************

171

4397 *******************************************************

172

4611 *******************************************************

173

4899 *******************************************************

174

4630 *******************************************************

175

4630 *******************************************************

176

4510 *******************************************************

177

4700 *******************************************************

178

5327 *******************************************************

179

5363 *******************************************************

180

4883 *******************************************************

181

4347 *******************************************************

182

3610 *******************************************************

183

3081 *******************************************************

184

2772 *******************************************************

185

2450 *******************************************************

186

2379 *******************************************************

187

2539 *******************************************************

188

2465 *******************************************************

189

2374 *******************************************************

190

2339 *******************************************************

191

1870 *******************************************************

192

1612 *******************************************************

193

1308 *******************************************************

194

1261 *******************************************************

195

1337 *******************************************************

196

1390 *******************************************************

197

1641 *******************************************************

198

1838 *******************************************************

199

1891 *******************************************************

200

1774 *******************************************************

201

1668 *******************************************************

202

1759 *******************************************************

203

1772 *******************************************************

204

1935 *******************************************************

205

2161 *******************************************************

206

1967 *******************************************************

207

1983 *******************************************************

208

1504 *******************************************************

209

1061 *******************************************************

210

758

*******************************************************

211

526

*******************************************************

212

444

*******************************************************

213

294

*******************************************************

214

147

*******************************************************

215

110

*******************************************************

216

42

******************************************

217

15

***************

218

14

**************

219

220

221

222

**

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

File Writing complete


opening outputfile......

Do you want to continue?(Y/N)


Enter your answer here: y

************WELCOME***************
Enter image file to read(pgm format) : "lena.pgm"
Reading image...

GrayValue

Frequency

10

11

12

13

29

*****************************

14

91

*******************************************************

15

228

*******************************************************

16

401

*******************************************************

17

725

*******************************************************

18

1115 *******************************************************

19

1700 *******************************************************

20

2361 *******************************************************

21

3070 *******************************************************

22

3604 *******************************************************

23

4096 *******************************************************

24

4076 *******************************************************

25

4099 *******************************************************

26

3810 *******************************************************

27

3419 *******************************************************

28

3044 *******************************************************

29

2544 *******************************************************

30

2225 *******************************************************

31

1913 *******************************************************

32

1780 *******************************************************

33

1593 *******************************************************

34

1544 *******************************************************

35

1661 *******************************************************

36

1625 *******************************************************

37

1783 *******************************************************

38

1733 *******************************************************

39

1871 *******************************************************

40

1840 *******************************************************

41

1801 *******************************************************

42

1902 *******************************************************

43

2010 *******************************************************

44

2183 *******************************************************

45

2345 *******************************************************

46

2546 *******************************************************

47

2966 *******************************************************

48

3417 *******************************************************

49

3958 *******************************************************

50

3827 *******************************************************

51

3780 *******************************************************

52

3498 *******************************************************

53

3085 *******************************************************

54

2798 *******************************************************

55

2758 *******************************************************

56

2804 *******************************************************

57

2719 *******************************************************

58

2874 *******************************************************

59

3060 *******************************************************

60

3413 *******************************************************

61

3670 *******************************************************

62

4159 *******************************************************

63

7002 *******************************************************

64

4870 *******************************************************

65

4498 *******************************************************

66

4103 *******************************************************

67

3790 *******************************************************

68

3932 *******************************************************

69

4397 *******************************************************

70

4611 *******************************************************

71

4899 *******************************************************

72

4630 *******************************************************

73

4630 *******************************************************

74

4510 *******************************************************

75

4700 *******************************************************

76

5327 *******************************************************

77

5363 *******************************************************

78

4883 *******************************************************

79

4347 *******************************************************

80

3610 *******************************************************

81

3081 *******************************************************

82

2772 *******************************************************

83

2450 *******************************************************

84

2379 *******************************************************

85

2539 *******************************************************

86

2465 *******************************************************

87

2374 *******************************************************

88

2339 *******************************************************

89

1870 *******************************************************

90

1612 *******************************************************

91

1308 *******************************************************

92

1261 *******************************************************

93

1337 *******************************************************

94

1390 *******************************************************

95

1641 *******************************************************

96

1838 *******************************************************

97

1891 *******************************************************

98

1774 *******************************************************

99

1668 *******************************************************

100

1759 *******************************************************

101

1772 *******************************************************

102

1935 *******************************************************

103

2161 *******************************************************

104

1967 *******************************************************

105

1983 *******************************************************

106

1504 *******************************************************

107

1061 *******************************************************

108

758

*******************************************************

109

526

*******************************************************

110

444

*******************************************************

111

294

*******************************************************

112

147

*******************************************************

113

110

*******************************************************

114

42

******************************************

115

15

***************

116

14

**************

117

118

119

120

**

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

MinGreyVal = 10
MaxGreyVal = 122
*********Image Transformation Options*************
1.Linear Streching
2.Histogram Equalization

Enter your selection here: 2


GrayValue

Frequency

1476 *******************************************************

2815 *******************************************************

2361 *******************************************************

3070 *******************************************************

3604 *******************************************************

4096 *******************************************************

4076 *******************************************************

10

11

4099 *******************************************************

12

13

3810 *******************************************************

14

15

3419 *******************************************************

16

3044 *******************************************************

17

2544 *******************************************************

18

2225 *******************************************************

19

1913 *******************************************************

20

1780 *******************************************************

21

3137 *******************************************************

22

1661 *******************************************************

23

1625 *******************************************************

24

1783 *******************************************************

25

3604 *******************************************************

26

1840 *******************************************************

27

1801 *******************************************************

28

1902 *******************************************************

29

2010 *******************************************************

30

2183 *******************************************************

31

2345 *******************************************************

32

2546 *******************************************************

33

34

2966 *******************************************************

35

3417 *******************************************************

36

37

3958 *******************************************************

38

39

3827 *******************************************************

40

3780 *******************************************************

41

42

3498 *******************************************************

43

3085 *******************************************************

44

45

2798 *******************************************************

46

2758 *******************************************************

47

2804 *******************************************************

48

49

2719 *******************************************************

50

2874 *******************************************************

51

3060 *******************************************************

52

53

3413 *******************************************************

54

55

3670 *******************************************************

56

57

4159 *******************************************************

58

59

60

7002 *******************************************************

61

62

4870 *******************************************************

63

64

4498 *******************************************************

65

66

4103 *******************************************************

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

117

118

119

120

118116

121

*******************************************************

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

File Writing complete


opening outputfile......

Do you want to continue?(Y/N)


Enter your answer here: n

************WELCOME***************
Enter image file to read(pgm format) : "band4.pgm"
Reading image...

GrayValue

Frequency

**

********

10

**********

49

*************************************************

502

*******************************************************

1836 *******************************************************

10

1537 *******************************************************

11

1708 *******************************************************

12

2890 *******************************************************

13

11363*******************************************************

14

20225*******************************************************

15

11861*******************************************************

16

3977 *******************************************************

17

5159 *******************************************************

18

6855 *******************************************************

19

6475 *******************************************************

20

8894 *******************************************************

21

12067*******************************************************

22

12131*******************************************************

23

12386*******************************************************

24

12868*******************************************************

25

14543*******************************************************

26

14309*******************************************************

27

14439*******************************************************

28

11621*******************************************************

29

10258*******************************************************

30

10110*******************************************************

31

6561 *******************************************************

32

5079 *******************************************************

33

4772 *******************************************************

34

4389 *******************************************************

35

3778 *******************************************************

36

3123 *******************************************************

37

2661 *******************************************************

38

2778 *******************************************************

39

2692 *******************************************************

40

2291 *******************************************************

41

1995 *******************************************************

42

1984 *******************************************************

43

1956 *******************************************************

44

1799 *******************************************************

45

1459 *******************************************************

46

1164 *******************************************************

47

1102 *******************************************************

48

952

*******************************************************

49

734

*******************************************************

50

539

*******************************************************

51

438

*******************************************************

52

345

*******************************************************

53

313

*******************************************************

54

236

*******************************************************

55

181

*******************************************************

56

137

*******************************************************

57

114

*******************************************************

58

102

*******************************************************

59

79

*******************************************************

60

60

*******************************************************

61

53

*****************************************************

62

49

*************************************************

63

26

**************************

64

24

************************

65

19

*******************

66

15

***************

67

10

**********

68

*******

69

*******

70

********

71

12

************

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

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

MinGreyVal = 4
MaxGreyVal = 79
*********Image Transformation Options*************
1.Linear Streching
2.Histogram Equalization
Enter your selection here: 1
Linear Streching
1.Darkness Streching
2.Brightness Streching
3.Mid-Range Streching
Enter your choice: 1
Input desired Maximum Grey Value: 75
GrayValue

Frequency

**

********

10

10

**********

11

49

*************************************************

12

502

*******************************************************

13

1836 *******************************************************

14

1537 *******************************************************

15

1708 *******************************************************

16

2890 *******************************************************

17

11363*******************************************************

18

20225*******************************************************

19

11861*******************************************************

20

3977 *******************************************************

21

5159 *******************************************************

22

6855 *******************************************************

23

6475 *******************************************************

24

8894 *******************************************************

25

12067*******************************************************

26

12131*******************************************************

27

12386*******************************************************

28

12868*******************************************************

29

14543*******************************************************

30

14309*******************************************************

31

14439*******************************************************

32

11621*******************************************************

33

10258*******************************************************

34

10110*******************************************************

35

6561 *******************************************************

36

5079 *******************************************************

37

4772 *******************************************************

38

4389 *******************************************************

39

3778 *******************************************************

40

3123 *******************************************************

41

2661 *******************************************************

42

2778 *******************************************************

43

2692 *******************************************************

44

2291 *******************************************************

45

1995 *******************************************************

46

1984 *******************************************************

47

1956 *******************************************************

48

1799 *******************************************************

49

1459 *******************************************************

50

1164 *******************************************************

51

1102 *******************************************************

52

952

*******************************************************

53

734

*******************************************************

54

539

*******************************************************

55

438

*******************************************************

56

345

*******************************************************

57

313

*******************************************************

58

236

*******************************************************

59

181

*******************************************************

60

137

*******************************************************

61

114

*******************************************************

62

102

*******************************************************

63

79

*******************************************************

64

60

*******************************************************

65

53

*****************************************************

66

49

*************************************************

67

26

**************************

68

24

************************

69

19

*******************

70

15

***************

71

10

**********

72

*******

73

*******

74

********

75

12

************

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

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

File Writing complete


opening outputfile......

Do you want to continue?(Y/N)


Enter your answer here: y

************WELCOME***************
Enter image file to read(pgm format) : "band4.pgm"
Reading image...

GrayValue

Frequency

**

********

10

**********

49

*************************************************

502

*******************************************************

1836 *******************************************************

10

1537 *******************************************************

11

1708 *******************************************************

12

2890 *******************************************************

13

11363*******************************************************

14

20225*******************************************************

15

11861*******************************************************

16

3977 *******************************************************

17

5159 *******************************************************

18

6855 *******************************************************

19

6475 *******************************************************

20

8894 *******************************************************

21

12067*******************************************************

22

12131*******************************************************

23

12386*******************************************************

24

12868*******************************************************

25

14543*******************************************************

26

14309*******************************************************

27

14439*******************************************************

28

11621*******************************************************

29

10258*******************************************************

30

10110*******************************************************

31

6561 *******************************************************

32

5079 *******************************************************

33

4772 *******************************************************

34

4389 *******************************************************

35

3778 *******************************************************

36

3123 *******************************************************

37

2661 *******************************************************

38

2778 *******************************************************

39

2692 *******************************************************

40

2291 *******************************************************

41

1995 *******************************************************

42

1984 *******************************************************

43

1956 *******************************************************

44

1799 *******************************************************

45

1459 *******************************************************

46

1164 *******************************************************

47

1102 *******************************************************

48

952

*******************************************************

49

734

*******************************************************

50

539

*******************************************************

51

438

*******************************************************

52

345

*******************************************************

53

313

*******************************************************

54

236

*******************************************************

55

181

*******************************************************

56

137

*******************************************************

57

114

*******************************************************

58

102

*******************************************************

59

79

*******************************************************

60

60

*******************************************************

61

53

*****************************************************

62

49

*************************************************

63

26

**************************

64

24

************************

65

19

*******************

66

15

***************

67

10

**********

68

*******

69

*******

70

********

71

12

************

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

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

MinGreyVal = 4
MaxGreyVal = 79
*********Image Transformation Options*************
1.Linear Streching
2.Histogram Equalization

Enter your selection here: 1


Linear Streching
1.Darkness Streching
2.Brightness Streching
3.Mid-Range Streching
Enter your choice: 2
Input desired Minimum Grey Value: 150
GrayValue

Frequency

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

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

10

155

156

49

157

158

502

159

160

1836 *******************************************************

161

162

1537 *******************************************************

163

164

1708 *******************************************************

165

166

2890 *******************************************************

167

168

11363*******************************************************

169

170

20225*******************************************************

171

172

11861*******************************************************

173

174

3977 *******************************************************

175

176

5159 *******************************************************

177

**

********

**********

*************************************************

*******************************************************

178

6855 *******************************************************

179

180

6475 *******************************************************

181

182

8894 *******************************************************

183

184

12067*******************************************************

185

186

12131*******************************************************

187

188

12386*******************************************************

189

190

12868*******************************************************

191

192

14543*******************************************************

193

194

14309*******************************************************

195

196

14439*******************************************************

197

198

11621*******************************************************

199

200

10258*******************************************************

201

202

10110*******************************************************

203

204

6561 *******************************************************

205

206

5079 *******************************************************

207

208

4772 *******************************************************

209

210

4389 *******************************************************

211

212

3778 *******************************************************

213

214

3123 *******************************************************

215

216

2661 *******************************************************

217

218

2778 *******************************************************

219

220

2692 *******************************************************

221

222

2291 *******************************************************

223

224

1995 *******************************************************

225

226

1984 *******************************************************

227

228

1956 *******************************************************

229

230

1799 *******************************************************

231

232

1459 *******************************************************

233

234

1164 *******************************************************

235

236

1102 *******************************************************

237

238

952

239

*******************************************************

240

734

241

242

539

243

244

438

245

246

345

247

248

313

249

250

236

251

252

181

253

254

137

255

*******************************************************

*******************************************************

*******************************************************

*******************************************************

*******************************************************

*******************************************************

*******************************************************

*******************************************************

File Writing complete


opening outputfile......

Do you want to continue?(Y/N)


Enter your answer here: y

************WELCOME***************
Enter image file to read(pgm format) : "band4.pgm"
Reading image...

GrayValue

Frequency

**

********

10

**********

49

*************************************************

502

*******************************************************

1836 *******************************************************

10

1537 *******************************************************

11

1708 *******************************************************

12

2890 *******************************************************

13

11363*******************************************************

14

20225*******************************************************

15

11861*******************************************************

16

3977 *******************************************************

17

5159 *******************************************************

18

6855 *******************************************************

19

6475 *******************************************************

20

8894 *******************************************************

21

12067*******************************************************

22

12131*******************************************************

23

12386*******************************************************

24

12868*******************************************************

25

14543*******************************************************

26

14309*******************************************************

27

14439*******************************************************

28

11621*******************************************************

29

10258*******************************************************

30

10110*******************************************************

31

6561 *******************************************************

32

5079 *******************************************************

33

4772 *******************************************************

34

4389 *******************************************************

35

3778 *******************************************************

36

3123 *******************************************************

37

2661 *******************************************************

38

2778 *******************************************************

39

2692 *******************************************************

40

2291 *******************************************************

41

1995 *******************************************************

42

1984 *******************************************************

43

1956 *******************************************************

44

1799 *******************************************************

45

1459 *******************************************************

46

1164 *******************************************************

47

1102 *******************************************************

48

952

*******************************************************

49

734

*******************************************************

50

539

*******************************************************

51

438

*******************************************************

52

345

*******************************************************

53

313

*******************************************************

54

236

*******************************************************

55

181

*******************************************************

56

137

*******************************************************

57

114

*******************************************************

58

102

*******************************************************

59

79

*******************************************************

60

60

*******************************************************

61

53

*****************************************************

62

49

*************************************************

63

26

**************************

64

24

************************

65

19

*******************

66

15

***************

67

10

**********

68

*******

69

*******

70

********

71

12

************

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

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

MinGreyVal = 4
MaxGreyVal = 79
*********Image Transformation Options*************
1.Linear Streching
2.Histogram Equalization

Enter your selection here: 1


Linear Streching
1.Darkness Streching
2.Brightness Streching
3.Mid-Range Streching
Enter your choice: 3
Input desired Minimum Grey Value: 100
Input desired Maximum Grey Value: 200
GrayValue

Frequency

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

10

**********

103

49

*************************************************

104

502

*******************************************************

105

1836 *******************************************************

106

1537 *******************************************************

107

1708 *******************************************************

108

2890 *******************************************************

109

11363*******************************************************

110

20225*******************************************************

111

11861*******************************************************

112

3977 *******************************************************

113

5159 *******************************************************

114

6855 *******************************************************

115

6475 *******************************************************

116

8894 *******************************************************

117

12067*******************************************************

118

12131*******************************************************

119

12386*******************************************************

120

12868*******************************************************

121

14543*******************************************************

122

14309*******************************************************

123

14439*******************************************************

124

11621*******************************************************

125

10258*******************************************************

126

10110*******************************************************

127

6561 *******************************************************

128

5079 *******************************************************

129

4772 *******************************************************

130

4389 *******************************************************

131

3778 *******************************************************

132

3123 *******************************************************

133

2661 *******************************************************

134

2778 *******************************************************

135

2692 *******************************************************

136

2291 *******************************************************

137

1995 *******************************************************

138

1984 *******************************************************

139

1956 *******************************************************

140

1799 *******************************************************

141

1459 *******************************************************

142

1164 *******************************************************

143

1102 *******************************************************

144

952

*******************************************************

145

734

*******************************************************

146

539

*******************************************************

147

438

*******************************************************

148

345

*******************************************************

149

313

*******************************************************

150

236

*******************************************************

151

181

*******************************************************

152

137

*******************************************************

153

114

*******************************************************

154

102

*******************************************************

155

79

*******************************************************

156

60

*******************************************************

157

53

*****************************************************

158

49

*************************************************

159

26

**************************

160

24

************************

161

19

*******************

162

15

***************

163

10

**********

164

*******

165

*******

166

********

167

12

************

168

**

169

170

****

171

**

172

*****

173

174

**

175

**

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

File Writing complete


opening outputfile......

Do you want to continue?(Y/N)


Enter your answer here: y

************WELCOME***************
Enter image file to read(pgm format) : "band4.pgm"
Reading image...

GrayValue

Frequency

**

********

10

**********

49

*************************************************

502

*******************************************************

1836 *******************************************************

10

1537 *******************************************************

11

1708 *******************************************************

12

2890 *******************************************************

13

11363*******************************************************

14

20225*******************************************************

15

11861*******************************************************

16

3977 *******************************************************

17

5159 *******************************************************

18

6855 *******************************************************

19

6475 *******************************************************

20

8894 *******************************************************

21

12067*******************************************************

22

12131*******************************************************

23

12386*******************************************************

24

12868*******************************************************

25

14543*******************************************************

26

14309*******************************************************

27

14439*******************************************************

28

11621*******************************************************

29

10258*******************************************************

30

10110*******************************************************

31

6561 *******************************************************

32

5079 *******************************************************

33

4772 *******************************************************

34

4389 *******************************************************

35

3778 *******************************************************

36

3123 *******************************************************

37

2661 *******************************************************

38

2778 *******************************************************

39

2692 *******************************************************

40

2291 *******************************************************

41

1995 *******************************************************

42

1984 *******************************************************

43

1956 *******************************************************

44

1799 *******************************************************

45

1459 *******************************************************

46

1164 *******************************************************

47

1102 *******************************************************

48

952

*******************************************************

49

734

*******************************************************

50

539

*******************************************************

51

438

*******************************************************

52

345

*******************************************************

53

313

*******************************************************

54

236

*******************************************************

55

181

*******************************************************

56

137

*******************************************************

57

114

*******************************************************

58

102

*******************************************************

59

79

*******************************************************

60

60

*******************************************************

61

53

*****************************************************

62

49

*************************************************

63

26

**************************

64

24

************************

65

19

*******************

66

15

***************

67

10

**********

68

*******

69

*******

70

********

71

12

************

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

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

MinGreyVal = 4
MaxGreyVal = 79
*********Image Transformation Options*************
1.Linear Streching

2.Histogram Equalization
Enter your selection here: 2
GrayValue

Frequency

2407 *******************************************************

3245 *******************************************************

2890 *******************************************************

11363*******************************************************

10

11

20225*******************************************************

12

13

14

15

11861*******************************************************

16

3977 *******************************************************

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

206176

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

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

File Writing complete


opening outputfile......

Do you want to continue?(Y/N)

Enter your answer here: n

You might also like