我将使用 sift 来识别某种类型的对象,如果该对象的颜色发生变化,它能识别出来吗?我将使用 opencv 库进行筛选 cv2.xfeatures2d.SIFT_create()
最佳答案
SIFT 仅对灰度图像进行操作。在 Lowe's 的结论中paper ,他指出:
The features described in this paper use only a monochrome intensity image, so further distinctiveness could be derived from including illumination-invariant color descriptors (Funt and Finlayson, 1995; Brown and Lowe, 2002).
OpenCV implementation在提取特征之前将彩色图像转换为灰度图像。
static Mat createInitialImage( const Mat& img, bool doubleImageSize, float sigma )
{
/* ... */
Mat gray, gray_fpt;
if( img.channels() == 3 || img.channels() == 4 )
{
cvtColor(img, gray, COLOR_BGR2GRAY);
gray.convertTo(gray_fpt, DataType<sift_wt>::type, SIFT_FIXPT_SCALE, 0);
}
else
img.convertTo(gray_fpt, DataType<sift_wt>::type, SIFT_FIXPT_SCALE, 0);
/* ... */
}
关于python - sift算法颜色不变吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40694713/