計算機視覺相關材料

Harris特徵角點檢測

2013年01月09日 ⁄ 綜合⁄ 共 63字 ⁄ 字號 評論關閉

 
 
 
 
 
 
 
 
 
 
 
 
rotation invariance,not scale invariance
怎麼用描述符表達一個特徵點?





距離變換

分類: Image & Video Processing  400人閱讀 評論(1) 收藏 舉報

距離變換和線性濾波器,形態學變換處於平等位置,是圖像處理的一種方法,通過使用兩遍掃描光柵算法可以快速計算到曲線或點集的距離。


應用:

水平集

快速斜切匹配

圖像拼接

圖像混合的羽化

臨近點配準


方法:

首先對圖像進行二值化處理,然後給每個像素賦值爲離它最近的背景像素點與其距離(Manhattan距離or歐氏距離),得到distance metric(距離矩陣),那麼離邊界越遠的點越亮。



實現:

  1. Imgori=imread('test.jpg');
  2. I=rgb2gray(Imgori);
  3. subplot(2,3,1);imshow(I);title('origin');
  4. Threshold=100;
  5. F=I>Threshold;%front
  6. %B=I<=Threshold;%background
  7. subplot(2,3,4);imshow(F,[]);title('binary');
  8. T=bwdist(F,'chessboard');
  9. subplot(2,3,2);imshow(T,[]);title('chessboard distance transform')
  10. %the chessboard distance between (x1,y1) and (x2,y2) is max(│x1 – x2│,│y1 – y2│).
  11. T=bwdist(F,'cityblock');
  12. subplot(2,3,3);imshow(T,[]);title('chessboard distance transform')
  13. %the cityblock distance between (x1,y1) and (x2,y2) is │x1 – x2│ + │y1 – y2│.
  14. T=bwdist(F,'euclidean');
  15. subplot(2,3,5);imshow(T,[]);title('euclidean distance transform')
  16. %use Euclidean distance
  17. T=bwdist(F,'quasi-euclidean');
  18. subplot(2,3,6);imshow(T,[]);title('quasi-euclidean distance transform')
  19. %use quasi-Euclidean distance

或者單純想看這幾個距離函數的區別可以用以下code:

  1. bw = zeros(200,200); bw(50,50) = 1; bw(50,150) = 1;
  2. bw(150,100) = 1;
  3. D1 = bwdist(bw,'euclidean');
  4. D2 = bwdist(bw,'cityblock');
  5. D3 = bwdist(bw,'chessboard');
  6. D4 = bwdist(bw,'quasi-euclidean');
  7. figure
  8. subplot(2,2,1), subimage(mat2gray(D1)), title('Euclidean')
  9. hold on, imcontour(D1)
  10. subplot(2,2,2), subimage(mat2gray(D2)), title('City block')
  11. hold on, imcontour(D2)
  12. subplot(2,2,3), subimage(mat2gray(D3)), title('Chessboard')
  13. hold on, imcontour(D3)
  14. subplot(2,2,4), subimage(mat2gray(D4)), title('Quasi-Euclidean')
  15. hold on, imcontour(D4)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章