SUSAN算子特征點(diǎn)檢測(cè)實(shí)驗(yàn)報(bào)告_第1頁(yè)
SUSAN算子特征點(diǎn)檢測(cè)實(shí)驗(yàn)報(bào)告_第2頁(yè)
SUSAN算子特征點(diǎn)檢測(cè)實(shí)驗(yàn)報(bào)告_第3頁(yè)
SUSAN算子特征點(diǎn)檢測(cè)實(shí)驗(yàn)報(bào)告_第4頁(yè)
SUSAN算子特征點(diǎn)檢測(cè)實(shí)驗(yàn)報(bào)告_第5頁(yè)
已閱讀5頁(yè),還剩5頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、機(jī)器視覺(jué)實(shí)驗(yàn)(3)一、實(shí)驗(yàn)介紹特征點(diǎn):即圖像的極值點(diǎn)、線段的端點(diǎn)、曲線曲率最大點(diǎn),是圖像的重要特征,對(duì)圖像處理與分析具有重要作用。特征點(diǎn)保留了圖像的重要特征,可以代替圖像的處理,有效減少數(shù)據(jù)量,提高處理速度。特征點(diǎn)檢測(cè):從圖像中檢測(cè)和提取特征點(diǎn)的過(guò)程和算法。檢測(cè)方法有基于梯度的檢測(cè)方法,基于模板的檢測(cè)方法,基于梯度和模板的檢測(cè)方法。比較常用的算子有SUSAN、Harris、Moravec、Foerstner、FAST、SIFT等角點(diǎn)檢測(cè)算子。二、實(shí)驗(yàn)內(nèi)容1、SUSAN算子SUSAN算子是牛津大學(xué)的smith教授提出的,只使用一個(gè)圓形模板來(lái)計(jì)算各向同性的響應(yīng),既可檢測(cè)目標(biāo)邊緣點(diǎn),又能檢測(cè)圖像中的

2、角點(diǎn),且具有較強(qiáng)的魯棒性。(1) 基本思想 SUSAN準(zhǔn)則的原理如圖所示,用一個(gè)圓形模板遍歷圖像,若模板內(nèi)其他任意像素的灰度值與模板中心像素(核)的灰度值的差小于一定閾值,就認(rèn)為該點(diǎn)與核具有相同(或相近)的灰度值,滿(mǎn)足這樣條件的像素組成的區(qū)域稱(chēng)為核值相似區(qū)(Univalue Segment Assimilating Nucleus, USAN)。把圖像中的每個(gè)像素與具有相近灰度值的局部區(qū)域相聯(lián)系是SUSAN準(zhǔn)則的基礎(chǔ)。(2)基本步驟 第一步:選擇圓形模板,計(jì)算相似度。 a、圓形模板如圖所示,共37個(gè)像素。 b、相似度 第二步:確定USAN區(qū)域。 第三步:閾值化得到初步的邊緣響應(yīng)。 G的取值為U

3、SAN最大值的1/2。USAN值越小,角點(diǎn)的響應(yīng)就越強(qiáng)。 第四步:可選擇性進(jìn)行非極大值抑制,角點(diǎn)特征就得到全部增強(qiáng)。2、實(shí)驗(yàn)程序 BOOL CBmpProcessView:Susan(LPSTR lpDIBBits, LONG lWidth, LONG lHeight)/ 指向源圖像的指針LPSTRlpSrc;/ 指向緩存圖像的指針LPSTRlpDst;/ 指向緩存DIB圖像的指針LPSTRlpNewDIBBits;HLOCALhNewDIBBits;/循環(huán)變量long i;long j;/像素值int x,r,n=0;unsigned char pixel37;/ 暫時(shí)分配內(nèi)存,以保存新圖像

4、hNewDIBBits = LocalAlloc(LHND, lWidth * lHeight);if (hNewDIBBits = NULL)/ 分配內(nèi)存失敗return FALSE;/ 鎖定內(nèi)存lpNewDIBBits = (char * )LocalLock(hNewDIBBits);/ 初始化新分配的內(nèi)存,設(shè)定初始值為255lpDst = (char *)lpNewDIBBits;memset(lpDst, (BYTE)255, lWidth * lHeight);POINT pointxy;/定義一個(gè)POINT型數(shù)據(jù) corner.clear();/使用水平方向的結(jié)構(gòu)元素進(jìn)行腐蝕fo

5、r(j = lHeight-3; j=2; j-)for(i = 2;i lWidth-2; i+)/ 指向源圖像第j行,第i個(gè)象素的指針lpSrc = (char *)lpDIBBits + lWidth * j + i;/ 指向目標(biāo)圖像第j行,第i個(gè)象素的指針lpDst = (char *)lpNewDIBBits + lWidth * j + i;/取得當(dāng)前指針處7*7區(qū)域的像素值,注意要轉(zhuǎn)換為unsigned char型pixel0 = (unsigned char)*(lpSrc - 3 * lWidth - 1);pixel1 = (unsigned char)*(lpSrc -

6、3 * lWidth );pixel2 = (unsigned char)*(lpSrc - 3 * lWidth + 1);pixel3 = (unsigned char)*(lpSrc - 2 * lWidth + 2);pixel4 = (unsigned char)*(lpSrc - lWidth + 3);pixel5 = (unsigned char)*(lpSrc + 3);pixel6 = (unsigned char)*(lpSrc + lWidth + 3);pixel7 = (unsigned char)*(lpSrc + 2 * lWidth + 2);pixel8 =

7、 (unsigned char)*(lpSrc + 3 * lWidth + 1);pixel9 = (unsigned char)*(lpSrc + 3 * lWidth);pixel10 = (unsigned char)*(lpSrc + 3 * lWidth - 1);pixel11 = (unsigned char)*(lpSrc + 2 * lWidth - 2);pixel12 = (unsigned char)*(lpSrc + lWidth - 3);pixel13 = (unsigned char)*(lpSrc - 3);pixel14 = (unsigned char)

8、*(lpSrc - lWidth - 3);pixel15 = (unsigned char)*(lpSrc - 2 * lWidth - 2);pixel16 = (unsigned char)*(lpSrc - 2 * lWidth - 1);pixel17 = (unsigned char)*(lpSrc - 2 * lWidth );pixel18 = (unsigned char)*(lpSrc - 2 * lWidth + 1);pixel19 = (unsigned char)*(lpSrc - lWidth + 2);pixel20 = (unsigned char)*(lpS

9、rc + 2);pixel21 = (unsigned char)*(lpSrc + lWidth + 2);pixel22 = (unsigned char)*(lpSrc + 2 * lWidth + 1);pixel23 = (unsigned char)*(lpSrc + 2 * lWidth);pixel24 = (unsigned char)*(lpSrc + 2 * lWidth - 1);pixel25 = (unsigned char)*(lpSrc + lWidth - 2);pixel26 = (unsigned char)*(lpSrc - 2);pixel27 = (

10、unsigned char)*(lpSrc - lWidth - 2);pixel28 = (unsigned char)*(lpSrc - lWidth - 1);pixel29 = (unsigned char)*(lpSrc - lWidth);pixel30 = (unsigned char)*(lpSrc - lWidth + 1);pixel31 = (unsigned char)*(lpSrc + 1);pixel32 = (unsigned char)*(lpSrc + lWidth + 1);pixel33 = (unsigned char)*(lpSrc + lWidth)

11、;pixel34 = (unsigned char)*(lpSrc + lWidth - 1);pixel35 = (unsigned char)*(lpSrc - 1);pixel36 = (unsigned char)*lpSrc; n=0;for(x=0;x37;x+)if(abs(pixel36-pixelx)=30) /可根據(jù)實(shí)際情況確定閾值n+;r=0; if(nGetHDIB();/ 判斷DIB是否為空if (hDIB != NULL)LPSTR lpDIB = (LPSTR) :GlobalLock(HGLOBAL) hDIB);/ 獲取DIB寬度int cxDIB = (in

12、t) :DIBWidth(lpDIB);/ 獲取DIB高度int cyDIB = (int) :DIBHeight(lpDIB);:GlobalUnlock(HGLOBAL) hDIB);CRect rcDIB;rcDIB.top = rcDIB.left = 0;rcDIB.right = cxDIB;rcDIB.bottom = cyDIB;CRect rcDest;/ 判斷是否是打印if (pDC-IsPrinting()/ 是打印,計(jì)算輸出圖像的位置和大小,以便符合頁(yè)面/ 獲取打印頁(yè)面的水平寬度(象素)int cxPage = pDC-GetDeviceCaps(HORZRES);/

13、獲取打印頁(yè)面的垂直高度(象素)int cyPage = pDC-GetDeviceCaps(VERTRES);/ 獲取打印機(jī)每英寸象素?cái)?shù)int cxInch = pDC-GetDeviceCaps(LOGPIXELSX);int cyInch = pDC-GetDeviceCaps(LOGPIXELSY);/ 計(jì)算打印圖像大?。s放,根據(jù)頁(yè)面寬度調(diào)整圖像大小)rcDest.top = rcDest.left = 0;rcDest.bottom = (int)(double)cyDIB * cxPage * cyInch)/ (double)cxDIB * cxInch);rcDest.righ

14、t = cxPage;/ 計(jì)算打印圖像位置(垂直居中)int temp = cyPage - (rcDest.bottom - rcDest.top);rcDest.bottom += temp/2;rcDest.top += temp/2;else / 不必縮放圖像rcDest = rcDIB;/ 輸出DIB:PaintDIB(pDC-m_hDC, &rcDest, pDoc-GetHDIB(),&rcDIB, pDoc-GetDocPalette();/ 恢復(fù)正常光標(biāo) CPen *ppen=new CPen;ppen-CreatePen(PS_SOLID,1,RGB(255,0,0);pDC-SelectObject(ppen);for(int i=0;iMoveTo(corneri.x-3,corneri.y);pDC-LineTo(corneri.x+3,corneri.y);pDC-MoveTo(corneri.x,corner

溫馨提示

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

最新文檔

評(píng)論

0/150

提交評(píng)論