“數(shù)字圖像處理”類的基本要求_第1頁(yè)
“數(shù)字圖像處理”類的基本要求_第2頁(yè)
“數(shù)字圖像處理”類的基本要求_第3頁(yè)
“數(shù)字圖像處理”類的基本要求_第4頁(yè)
“數(shù)字圖像處理”類的基本要求_第5頁(yè)
已閱讀5頁(yè),還剩2頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、2 15 日前提交)1編制一個(gè)具有 Winows 圖形界面的應(yīng)用程序( VB.Net, or Ctt, or C+)2、針關(guān)于數(shù)字圖像處理的基本功能,設(shè)計(jì)并且實(shí)現(xiàn)一個(gè)圖像類,把圖像文件操作、數(shù)據(jù)存儲(chǔ)及管理、基本的圖像處理 功能包含在該類中,能處理 8 位灰度圖像、8 位索引彩色圖像、24 位真彩色圖像等。VB.NET 環(huán)境下的基本內(nèi)容: 部分成員變量Private BMap As Bitmap 1 Bitmap VB.NET C#中處理圖像的基礎(chǔ)類,用于處理由像素?cái)?shù)據(jù)怎義的圖像的關(guān)于象Private mlmageName As String 1 記錄打開圖像的文件Private mPixels

2、 As Long, mSize As Long 記錄圖像的像素個(gè)數(shù)及存儲(chǔ)數(shù)據(jù)的內(nèi)存大小(以字肖為單位) Private mWith As Long, mHeight As Long 1 圖像寬度、高度Private lmageB() As Byte 存儲(chǔ)灰度圖像數(shù)據(jù),一維數(shù)組存儲(chǔ)。關(guān)于于 8 位圖像,一個(gè)像素即是一個(gè)字節(jié)。每行存儲(chǔ)的字節(jié)數(shù)必需是 4 的整倍數(shù),需要時(shí)添加適當(dāng)字節(jié)。與文件中記錄的內(nèi)容完全一致部分成員函數(shù)Public Function RealmageFile(Optional By Vai FileName As String = ,M) AsInteger If FileNam

3、e = 1,11 Or ir(FileName) = ,H, ThenIf mlmageName = n, Then Exit Function En IfBMap 是一個(gè) Bitmap 關(guān)于象,im BMap as BitmapIf Not BMap Is Nothing Then BMap.ispose()如果圖像關(guān)于象已經(jīng)存在,淸除關(guān)于象BMap = New Bitmap(FileName)1由圖像文件創(chuàng)建 Bitmap 關(guān)于象getBitMapataf)讀取 BMap 關(guān)于象中的圖像數(shù)據(jù)到數(shù)組1 putBitMapata()xWmin =0yWmin =0 xWmaxBMap.With

4、11 pictureBox在容器中的寬度yWmax=BMap.Height-l pictureBox在容器中的高度mlmageNameFileNameRaise Eve nt lmageataChange() En FunctionPrivate Function getBitMapataf) As Boolean從 BitMap 關(guān)于象里獲取圖像數(shù)據(jù)*在實(shí)際處理程序中一般不采用拷貝備份的做法,可以經(jīng)過(guò)獲得的數(shù)據(jù)指針,直接操作就可以了。1進(jìn)程是:鎖泄內(nèi)存,獲取數(shù)據(jù)的起始地址,根據(jù)圖像類型操作數(shù)據(jù),結(jié)束鎖左If BMap Is Nothing Then Return False 圖像關(guān)于象必需存

5、在,完成實(shí)例化im i As Integerim rect AsNewRectangle(O0BMap.WithBMap.Height)1 設(shè)置鎖定圖像范圍的矩形zim bmpata As SystemrawingmagingBitmapataBMap ockBits(rect_ rawing.lmaging.lmageLockMoe.ReaonlyBMap.PixelFormat)1 鎖定圖像數(shù)據(jù)1 Get the aress of the first lineim ptr As IntPtr = bmpata.ScanO 1 獲得圖像數(shù)據(jù)的起始地址If BMap.PixelFormat =

6、 ImagingPixelFormatFormat8bpplnexe Then如果圖像是 8 位索引圖像,256 彩色,256 灰度圖像m WithBMap.With獲得圖像寬度mHeightBMap.Height獲得圖像髙度mFwith = (mWith + 3) 4) * 由于圖像數(shù)據(jù)是每行的記錄字節(jié)數(shù)為 4 的整倍數(shù),估作此調(diào)整訃算 mWith+ 3 mFwith = mWithmSize = mFwith * mHeight 圖像數(shù)據(jù)的大小mPixels = mWith * mHeight1 圖像總像素個(gè)數(shù)ReimlmageB(mSize-1)眾義一個(gè)一維數(shù)組,保存圖像數(shù)據(jù),用于圖像數(shù)

7、據(jù)操作System.Runtime.InteropServices.Marshal.Copy(ptrImageB,0,mSize)1 拷 貝數(shù)據(jù)zmPalette = BMap.Palette 獲得圖像的調(diào)色板數(shù)據(jù) mlmageType = 0 Elself BMap.PixelFormat = Imaging.PixelFormat.Format24bppRgb ThenmWith = BMap.With mHeight =BMap.HeightmCWith = (mWith *3 +3)4)*4 CSize = mCWith * mHeight mPixels = mWith * mHei

8、ght Reim lmageC(CSize-1)1 Copy the RGB values into the array. System.RuntimeteropServices.Marshal.Copyfptr, ImageC, 0, CSize) mlmageType = 1Reim Cpos(mHeight -1) For i = 0 To mHeight -1Cpos(i) = i *mCWith Nexti1 Cpos 數(shù)組紀(jì)錄每行在 ImageC 中的起始位置Elself BMap.PixelFormat = ImagingPixelFormatFormat32bppArgb Th

9、en mWith = BMap.WithmHeight =BMap.HeightCSize = mWith * mHeight *4 mCWith = mWith * 4 mPixels = mWith * mHeight Reim lmageC(CSize-1)1 Copy the RGB values into the array. System.RuntimeteropServices.Marshal.Copyfptr, ImageC, 0, CSize) mlmageType = 2En IfBMap.UnlockBits(bmpata)1 解鎖鎖泄的位圖數(shù)據(jù)mStatus = Tru

10、e Return TrueEn FunctionPrivate Function putBitMapata() AsBoolean If BMap Is Nothing Then Return Falseim rect As New Rectangle(0, 0, BMap.With, BMap.Height)im bmpata As System .rawingmagingBitmapata = BMap 丄 ockBits(rect, _ rawing.lmaging.lmageLockMoe.WriteOnly, BMap.PixelFormat)1 Get the aress of t

11、he first lineim ptr As IntPtr = bmpata.ScanOIf BMap.PixelFormat = Imaging PixelFormat Format8bpplnexe Then mSize = mFwith * mHeight System.RuntimeteropServices.MarshaLCopy(lmageB0ptrmSizeElself BMap.PixelFormatImaging PixelFormatFormat24bppRgb ThenCSize = BMap.With * BMap.Height * 31 Copy the RGB va

12、lues into the array. System.RuntimeteropServices.Marshal.Copy(lmageC0, ptr, CSize) EnIf/eclare an array to hol the bytes of the bitmapThis coe is specific to a bitmap with 24 bits perpixels. 1 Unlock the bits.BMap.UnlockBits(bmpata) Return TrueEn Function3.應(yīng)用程序的基本要求:顯示圖像(初始圖像,處理進(jìn)程中的圖像入水縱橫比例.唏放.水平移4、

13、BMP 圖像文件結(jié)構(gòu),組織圖像數(shù)據(jù),實(shí)現(xiàn)測(cè)試性功能:負(fù)片、鏡像、圖像的代數(shù)操作,新建圖像BMP Bitmap 關(guān)于象的結(jié)構(gòu): BITMAPFILEHEAER (14Bytes)位圖信息頭 一 BITMAPINFOHEAER( 40Bytes)調(diào)色板 一 Palette ( 256Long=256*4Bytes)實(shí)際的位圖數(shù)據(jù)-Image ata:每行存儲(chǔ)的字節(jié)數(shù)是有效像素?cái)?shù)據(jù)(8 位圖像二像素?cái)?shù):24 位圖像=像素?cái)?shù)字節(jié)4 (8bppw3)4)*4:彩色圖像(24bpp=(w 怡+3)4 45.圖像數(shù)據(jù)組織:調(diào)色板、彩色圖像.多波段圖像7 = 0. 2997? + 0. 587& + 0. 1

14、1456、圖像數(shù)據(jù)統(tǒng)計(jì):直方圖(計(jì)算及繪制)、最大最小.方差、爛7.灰度變幻,線性變幻.直方圖均衡化(點(diǎn)運(yùn)算)8、中值濾波、梯度銳化.卷積處理 frmGraian驅(qū)慣化 Ge,j)H,j+-,y)i+i/(/+1j)-/(/,j)I G(fJ) = max(| /(/J + -/(/,J)I,| f(i +1 J)-/(/,I) G(/,j) = (/(/,J +1)-/(/,J)2 + (/(/ + 1,j)-/(/,y)2 G(f,;)=i/(/+ij+i)-/(/,ni+i/(/+1,j)-/(/,;+i)i G(iJ) = rnax(| f(i+1J +1) - /(/, j)|,| /(/ +1 J) - /(/J + l)|)/億刀)+/(= J(/(, +1J +1) (f(i +1J) /億刀)+/(灰竝隕約束悌陵鶴化云S黑址nsn=4埋處9 幾何變幻( Resize,Rotate).幾何校正(Georeferencing)遙感影像、航空影像糾正方法:1、成像模型(IOP, EOP); 2、多項(xiàng)式模型(Georeferencing): 3、分區(qū)處理 掃描圖像:1、多項(xiàng)式模型(Georefer

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論