日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

fast 算法原理

發(fā)布時(shí)間:2025/4/5 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 fast 算法原理 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

代碼在git

p10p_{10}p10?p9p_9p9?p8p_8p8?
p11p_{11}p11?p7p_7p7?
p12p_{12}p12?p6p_6p6?
p13p_{13}p13? P p5p_5p5?
p14p_{14}p14?p4p_4p4?
p15p_{15}p15?p3p_3p3?
p16p_{16}p16? p1p_1p1?p2p_2p2?
fast 算法的源碼實(shí)現(xiàn)只是比較
  • pppp1p_1p1?,p9p_9p9?的灰度差
  • pppp5p_5p5?,p13p_{13}p13?的灰度差
在計(jì)算fast 前需要進(jìn)行中止濾波
在計(jì)算后要進(jìn)行非極大抑制
  • 第1步:在圖像中選擇某個(gè)像素,它的灰度值記為。
  • 第2步:設(shè)定一個(gè)閾值,用于判斷兩個(gè)像素灰度值差異大小,為了能夠自適應(yīng)不同的圖像,一般采用相對(duì)百分比例,比如設(shè)置為的20%。
  • 第3步:以像素為中心,選取半徑為3的圓上的16個(gè)像素點(diǎn)。選取方式見下圖右所示。
  • 第4步:如果16個(gè)像素點(diǎn)中有連續(xù)的個(gè)點(diǎn)的灰度大于或者小于,那么可以將像素確定為關(guān)鍵點(diǎn)。在ORB的論文中,作者說時(shí)效果較好,稱之為FAST-9。實(shí)際操作中為了加速,我們可以把第1,5,9,13個(gè)像素點(diǎn)當(dāng)做錨點(diǎn),在FAST-9算法中,只有當(dāng)這4個(gè)錨點(diǎn)中有3個(gè)及以上灰度值同時(shí)大于或者小于,當(dāng)前像素才可能是一個(gè)關(guān)鍵點(diǎn)進(jìn)入到下一個(gè)階段的判斷,否則就可以排除掉,這大大加速了關(guān)鍵點(diǎn)檢測(cè)的速度。
  • 第5步:遍歷圖像中每個(gè)像素點(diǎn),循環(huán)執(zhí)行以上四個(gè)步驟。

# 校驗(yàn)rows, cols = image.shape[:2]if row < 3 or col < 3:return Falseif row >= rows-3 or col >= cols-3:return Falseintensity = int(image[row][col])ROI = circle(row, col)# 獲取位置1,9,5,13的像素值row1, col1 = ROI[0]row9, col9 = ROI[8]row5, col5 = ROI[4]row13, col13 = ROI[12]intensity1 = int(image[row1][col1])intensity9 = int(image[row9][col9])intensity5 = int(image[row5][col5])intensity13 = int(image[row13][col13])# 統(tǒng)計(jì)上面4個(gè)位置中滿足 像素值 > intensity + threshold點(diǎn)的個(gè)數(shù)countMore = 0# 統(tǒng)計(jì)上面4個(gè)位置中滿足 像素值 < intensity - threshold點(diǎn)的個(gè)數(shù)countLess = 0if intensity1 - intensity > threshold:countMore += 1elif intensity1 + threshold < intensity:countLess += 1if intensity9 - intensity > threshold:countMore += 1elif intensity9 + threshold < intensity:countLess += 1if intensity5 - intensity > threshold:countMore += 1elif intensity5 + threshold < intensity:countLess += 1if intensity13 - intensity > threshold:countMore += 1elif intensity13 + threshold < intensity:countLess += 1

總結(jié)

以上是生活随笔為你收集整理的fast 算法原理的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。