資源簡介
數字圖像處理程序,包括:
① BMP的讀取和顯示。
② BMP圖像轉RAW灰度圖像。
③ 圖像的特效顯示。
④ 圖像的直方圖均衡化。
⑤ 圖像的均值濾波,高斯濾波,最大值濾波,最小值濾波。
⑥ 圖像的拉普拉斯邊緣檢測算法。
⑦ 圖像的旋轉,放大,縮小。

代碼片段和文件信息
//?ImageProcessing.cpp?:?Defines?the?entry?point?for?the?application.
//
#include?“stdafx.h“
#include?“resource.h“
#include
#include
#include
#include
using?namespace?std;
#define?MAX_LOADSTRING?100
HDC??hWinDC; //圖像顯示區域
char?OrgImage[1024*1024]; //圖像數據
unsigned?long?wImagehImage;
#define?XPOS 50 //默認圖像顯示位置
#define?YPOS 50
#define?PauseTime???100
#define?HISTOGRAMHIEGHT 150
unsigned?long?biSizeImage;//用于存儲實際的位圖數據所占用的字節數
unsigned?long?BitRowBitTheRowBlackBlock;//BitRow:每一行占用的字節,BitTheRow指定行的起點下標
int?**Image;??//溶解所用的隨機坐標
bool?isBMP;
HWND?hWnd;
#define?SHUTTERNUM?10??//百葉窗數量
#define?CHESSBOARDNUM??7//棋盤幾乘幾
//#define?ceil(xy)?x%y==0?x/y:x/y+1//上取整
double?pi=3.14159;//π
char?ImgDlgFileName[]={“D:\\tree1.bmp“};//圖片路徑的位置
struct?RGB{
BYTE?R;
BYTE?G;
BYTE?B;
BYTE?RC;//255-R
BYTE?GC;//255-G
BYTE?BC;//255-C
};
/**
?*?RGB_INT
?*?旋轉圖像的時候用于
?*?給背景賦值256
?*?BYTE的值只能在0-255
?*?這樣/8均值濾波的時候
?*?會毀掉一些色塊
?*/
struct?RGB_INT{
int?R;
int?G;
int?B;
int?RC;//255-R
int?GC;//255-G
int?BC;//255-C
};
RGB?**Imagebyte;
RGB?**nImage;
/**
?*?坐標點類,保存一個坐標
?*/
class?Position{
public:
double?ax;
double?ay;
int?x;//?H
int?y;//?W
Position(int?xint?y){
this->x?=?x;
this->y?=?y;
}
void?set(){
x=(int)ax;
y=(int)ay;
}
};
class?Vector{
public:
int?x;
int?y;
Vector(int?xint?y){
this->x=x;
this->y=y;
}
Vector(Position?aPosition?b){
this->x=a.x-b.x;
this->y=a.y-b.y;
}
double?getabs(){
return?sqrt(x*x+y*y);
}
};
void?ShowImage(RGB?**xint?hImageint?wImageint?xPosint?yPos);
void?ShowImage(RGB_INT?**xint?Hint?Wint?xPosint?yPosPosition?*p);
void?ShowImage(int?xPosint?yPos);
void?ShowImage(unsigned?char?Image[]int?hImageint?wImageint?xPosint?yPos);
//?Global?Variables:
HINSTANCE?hInst; //?current?instance
TCHAR?sztitle[MAX_LOADSTRING]; //?The?title?bar?text
TCHAR?szWindowClass[MAX_LOADSTRING]; //?The?title?bar?text
//?Foward?declarations?of?functions?included?in?this?code?module:
ATOM MyRegisterClass(HINSTANCE?hInstance);
BOOL InitInstance(HINSTANCE?int);
LRESULT?CALLBACK WndProc(HWND?UINT?WPARAM?LPARAM);
LRESULT?CALLBACK About(HWND?UINT?WPARAM?LPARAM);
int?APIENTRY?WinMain(HINSTANCE?hInstance
?????????????????????HINSTANCE?hPrevInstance
?????????????????????LPSTR?????lpCmdLine
?????????????????????int???????nCmdShow)
{
? //?TODO:?Place?code?here.
MSG?msg;
HACCEL?hAccelTable;
//?Initialize?global?strings
LoadString(hInstance?IDS_APP_title?sztitle?MAX_LOADSTRING);
LoadString(hInstance?IDC_IMAGEPROCESSING?szWindowClass?MAX_LOADSTRING);
MyRegisterClass(hInstance);
//?Perform?application?initialization:
if?(!InitInstance?(hInstance?nCmdShow))?
{
return?FALSE;
}
hAccelTable?=?LoadAccelerators(hInstance?(LPCTSTR)IDC_IMAGEPROCESSING);
//?Main?message?loop:
while?(GetMessage(&msg?NULL?0?0))?
{
if?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-07-07?16:55??數字圖像匯總\
?????目錄???????????0??2015-07-07?16:56??數字圖像匯總\ImageProcessing\
?????目錄???????????0??2015-07-07?16:55??數字圖像匯總\ImageProcessing\Debug\
?????文件??????270431??2015-07-07?16:56??數字圖像匯總\ImageProcessing\Debug\ImageProcessing.exe
?????文件??????579124??2015-07-07?16:56??數字圖像匯總\ImageProcessing\Debug\ImageProcessing.ilk
?????文件??????100363??2015-07-07?16:55??數字圖像匯總\ImageProcessing\Debug\ImageProcessing.obj
?????文件?????1951108??2015-05-26?15:38??數字圖像匯總\ImageProcessing\Debug\ImageProcessing.pch
?????文件?????1123328??2015-07-07?16:56??數字圖像匯總\ImageProcessing\Debug\ImageProcessing.pdb
?????文件????????3396??2015-05-30?16:20??數字圖像匯總\ImageProcessing\Debug\ImageProcessing.res
?????文件???????55217??2015-05-26?15:38??數字圖像匯總\ImageProcessing\Debug\StdAfx.obj
?????文件??????140288??2015-07-07?16:56??數字圖像匯總\ImageProcessing\Debug\vc60.idb
?????文件??????249856??2015-07-07?16:55??數字圖像匯總\ImageProcessing\Debug\vc60.pdb
?????文件????????8792??2015-06-08?12:49??數字圖像匯總\ImageProcessing\ImageProcessing.aps
?????文件???????46556??2015-07-07?16:54??數字圖像匯總\ImageProcessing\ImageProcessing.cpp
?????文件????????4616??2015-04-23?09:44??數字圖像匯總\ImageProcessing\ImageProcessing.dsp
?????文件?????????538??2015-03-16?16:01??數字圖像匯總\ImageProcessing\ImageProcessing.dsw
?????文件?????????353??2015-03-16?16:01??數字圖像匯總\ImageProcessing\ImageProcessing.h
?????文件????????1078??2015-03-16?16:01??數字圖像匯總\ImageProcessing\ImageProcessing.ico
?????文件??????181248??2015-07-07?16:56??數字圖像匯總\ImageProcessing\ImageProcessing.ncb
?????文件???????52736??2015-07-07?16:56??數字圖像匯總\ImageProcessing\ImageProcessing.opt
?????文件?????????846??2015-07-07?16:56??數字圖像匯總\ImageProcessing\ImageProcessing.plg
?????文件????????8073??2015-05-30?16:05??數字圖像匯總\ImageProcessing\ImageProcessing.rc
?????文件?????????351??2015-04-09?16:32??數字圖像匯總\ImageProcessing\ImageProcessing.sln
?????文件????????8704??2015-05-25?14:59??數字圖像匯總\ImageProcessing\ImageProcessing.suo
?????文件????????2155??2015-03-16?16:01??數字圖像匯總\ImageProcessing\ReadMe.txt
?????文件?????????302??2015-03-16?16:01??數字圖像匯總\ImageProcessing\StdAfx.cpp
?????文件?????????936??2015-03-16?16:01??數字圖像匯總\ImageProcessing\StdAfx.h
?????文件????????3383??2015-05-30?16:05??數字圖像匯總\ImageProcessing\resource.h
?????文件?????????318??2015-03-16?16:01??數字圖像匯總\ImageProcessing\small.ico
?????文件???????15204??2015-07-07?16:55??數字圖像匯總\說明.docx
評論
共有 條評論