91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 59KB
    文件類型: .c
    金幣: 1
    下載: 0 次
    發布日期: 2024-01-28
  • 語言: C/C++
  • 標簽: SIFT??

資源簡介

這是我在一個SIFT群里找到的opencv代碼 關于SIFT檢測特征點以及生成128維描述子向量的全過程講解得很詳細 基本上每一步都有注釋 只要學過C++的 應該都看得懂 比CSDN上有些理論講解得更清楚 特別是關于編程的細節部分

資源截圖

代碼片段和文件信息

/*
Functions?for?detecting?SIFT?image?features.

For?more?information?refer?to:

Lowe?D.??Distinctive?image?features?from?scale-invariant?keypoints.
International?Journal?of?Computer?Vision?60?2?(2004)
pp.91--110.

Copyright?(C)?2006-2010??Rob?Hess?

Note:?The?SIFT?algorithm?is?patented?in?the?United?States?and?cannot?be
used?in?commercial?products?without?a?license?from?the?University?of
British?Columbia.??For?more?information?refer?to?the?file?LICENSE.ubc
that?accompanied?this?distribution.

@version?1.1.2-20100521
*/

/*
??此文件最重要
??包含SIFT特征點檢測的實現
*/

#include?“sift.h“
#include?“imgfeatures.h“
#include?“utils.h“

#include?
#include?

/************************?未暴露接口的一些本地函數的聲明?**************************/
/*************************?Local?Function?Prototypes?*************************/

//將原圖轉換為32位灰度圖并歸一化,然后進行一次高斯平滑,并根據參數img_dbl決定是否將圖像尺寸放大為原圖的2倍
static?IplImage*?create_init_img(?IplImage*?int?double?);
//將輸入圖像轉換為32位灰度圖并進行歸一化
static?IplImage*?convert_to_gray32(?IplImage*?);
//根據輸入參數建立高斯金字塔
static?IplImage***?build_gauss_pyr(?IplImage*?int?int?double?);
//對輸入圖像做下采樣生成其四分之一大小的圖像(每個維度上減半),使用最近鄰差值方法
static?IplImage*?downsample(?IplImage*?);
//通過對高斯金字塔中每相鄰兩層圖像相減來建立高斯差分金字塔
static?IplImage***?build_dog_pyr(?IplImage***?int?int?);
//在尺度空間中檢測極值點,通過插值精確定位,去除低對比度的點,去除邊緣點,返回檢測到的特征點序列
static?CvSeq*?scale_space_extrema(?IplImage***?int?int?double?int?CvMemStorage*);
//通過在尺度空間中將一個像素點的值與其周圍3*3*3鄰域內的點比較來決定此點是否極值點(極大值或極小都行)
static?int?is_extremum(?IplImage***?int?int?int?int?);
//通過亞像素級插值進行極值點精確定位(修正極值點坐標),并去除低對比度的極值點,將修正后的特征點組成feature結構返回
static?struct?feature*?interp_extremum(?IplImage***?int?int?int?int?int?double);
//進行一次極值點差值,計算x,y,σ方向(層方向)上的子像素偏移量(增量)
static?void?interp_step(?IplImage***?int?int?int?int?double*?double*?double*?);
//在DoG金字塔中計算某點的x方向、y方向以及尺度方向上的偏導數
static?CvMat*?deriv_3D(?IplImage***?int?int?int?int?);
//在DoG金字塔中計算某點的3*3海森矩陣
static?CvMat*?hessian_3D(?IplImage***?int?int?int?int?);
//計算被插值點的對比度:D?+?0.5?*?dD^T?*?X
static?double?interp_contr(?IplImage***?int?int?int?int?double?double?double?);
//為一個feature結構分配空間并初始化
static?struct?feature*?new_feature(?void?);
//去除邊緣響應,即通過計算主曲率比值判斷某點是否邊緣點
static?int?is_too_edge_like(?IplImage*?int?int?int?);
//計算特征點序列中每個特征點的尺度
static?void?calc_feature_scales(?CvSeq*?double?int?);
//將特征點序列中每個特征點的坐標減半(當設置了將圖像放大為原圖的2倍時,特征點檢測完之后調用)
static?void?adjust_for_img_dbl(?CvSeq*?);
//計算每個特征點的梯度直方圖,找出其主方向,若一個特征點有不止一個主方向,將其分為兩個特征點
static?void?calc_feature_oris(?CvSeq*?IplImage***?);
//計算指定像素點的梯度方向直方圖,返回存放直方圖的數組
static?double*?ori_hist(?IplImage*?int?int?int?int?double?);
//計算指定點的梯度的幅值magnitude和方向orientation
static?int?calc_grad_mag_ori(?IplImage*?int?int?double*?double*?);
//對梯度方向直方圖進行高斯平滑,彌補因沒有仿射不變性而產生的特征點不穩定的問題
static?void?smooth_ori_hist(?double*?int?);
//查找梯度直方圖中主方向的梯度幅值,即查找直方圖中最大bin的值
static?double?dominant_ori(?double*?int?);
//若當前特征點的

評論

共有 條評論