Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
11Activity
0 of .
Results for:
No results containing your search query
P. 1
Advance image processing

Advance image processing

Ratings: (0)|Views: 195|Likes:
Published by TuxDip
Implementation of major and common image processing operations with code snippets as well as snaps etc For complete and free source code please make a request on email address mentioned in the document.
Implementation of major and common image processing operations with code snippets as well as snaps etc For complete and free source code please make a request on email address mentioned in the document.

More info:

Categories:Types, Research, Science
Published by: TuxDip on Sep 28, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/16/2013

pdf

text

original

 
/** Image.h** Copyright (C) 2008, Dipak Chirmade* Student, HD SE.* dipak(dot)chirmade(at)gmail(dot)com ** THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.* YOU ARE ALLOWED TO USE THIS CODE FOR PERSONAL OR PROFESSIONAL USE* AND IS TOTALLY FREE!** This file defines the functions to deal with image processing.* Few selective snapshots of processed images are also added.**/#ifndef _IMAGE_H_ #define _IMAGE_H_ /*Include files in relevance to image processing functions*/#include "version.h"#include "Bmp.h"#include <GL/glut.h>#include "Randomin.h"#include <math.h>#include "noise.h"/*All functions are implemented in generic orderas shown in menu options*//*Description: Displays the image pixel by pixelArguments : r,g,b attributes of an imageReturns : Nothing*/void showImage(image rAttr, image gAttr, image bAttr){if((r!=NULL)&&(g!=NULL)&&(b!=NULL)){UINT iRow,jCol;for( iRow=0;iRow<screenHeight;iRow++)for(jCol=0;jCol<screenWidth;jCol++){glBegin(GL_POINTS);glColor3f(float(rAttr[iRow][jCol]/256.0),float(gAttr[iRow][jCol]/256.0),float(bAttr[iRow][jCol]/256.0));
 
glVertex2i(jCol,screenHeight-iRow-1);glEnd();}}}/*Description: Sets white background and plot black points on itOnly one point at a time can be plottedArguments : Image in 'image' struct link listReturns : Nothing*/void ShowHistogram(image Gray){UINT Height,Width;/*glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);*/glPointSize(1.0);
 
glBegin(GL_POINTS);for(Width=0;Width<screenWidth;Width++)for(Height=0;Height<screenHeight;Height++){if(Gray[Height][Width]!=0)glColor3f(0.0,0.0,0.0);else glColor3f(1.0,1.0,1.0);glVertex2f(Height,Width);}glEnd();}/*Description: Colored image to Gray image conversionFormula: 0.5*red+0.3*green+0.2*blue=GrayScaleValueForR=G=BArguments : R,G,B values which one want to convert.Returns : Float value after conversion*/float ColorToGrayConversion(float Red,float Green,float Blue){return (0.5*Red)+(0.3*Green)+(0.2*Blue);}/*Description: Contrast correction either from low to high or vice versaArguments : Boolen value to toggle from low to high or vice versaReturns : Nothing*/void GetMinmumGrayValue(void);void ContrastCorrection(int IsPlus=0){GetMinmumGrayValue();if(IsPlus)cout<<endl<<"+";elsecout<<endl<<"-";}/*Description: Shifts the histogram to right or left which will change thebrightness of the resultantArguments : Boolen value to toggle from low to high or vice versaReturns : Nothing*/void BrightnessCorrection(int IsPlus=0){if(IsPlus)for(int HWidth=0;HWidth<screenWidth;HWidth++)for(int HHight=0;HHight<screenHeight;HHight++){ /*towards white*/

Activity (11)

You've already reviewed this. Edit your review.
1 hundred reads
Chandan Kumar liked this
Basuki Rachmad liked this
Jatin Gaur liked this
Chia-Yu Yao liked this
Girish Sahare liked this
NOORYADI liked this
AmiMoloy liked this
adnkam liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->