Implementation of the Self Similarity descriptor based on the paper:
Matching Local Self-Similarities across Images and Videos, Eli Shechtman and Michal Irani
CVPR '07
Written by: Varun Gulshan, [email protected]
Description of files:
1. defines.h: Some definition used in mexFindSimMaps.cpp
2. mexFindSimMaps.cpp: A mex file which does the final self similarity descriptor computation. You will need to mex this before usage. So run mex -O mexFindSimMaps.cpp, and it should compile without issues (atleast it does with gcc and Visual C++)
3. ssimDescriptor.m: The outer matlab wrapper to do the descriptor computation
4. example.m: An example to show usage of the wrapper ssimDescriptor.m file
How to use ssimDescriptor.m?
Usage: [resp,drawCoords,salientCoords,uniformCoords]=ssimDescriptor(img ,parms ,allXCoords ,allYCoords)
Inputs:
img is a double image. (just do double(imread('image name'))
parms is a parameter structure described below.
allXCoords (1xN): the x coordinates where to calculate the descriptor
allYCoords (1xN): the y coordinates where to calculate the descriptor
(So the descriptors are calculated at [allYCoords(i) allXCoords(i)] , i=1 .. N)
(Note: There is a margin around the image where descriptors cannot be computed, and specifying a point outside the margin can result in a segmentation fault. The margin depends on the values in the structure parms, and is described below.)
Returns:
resp (DxN1)-> the descriptors at the passed locations (only those descriptors which were neither salient nor uniform)
drawCoords (2xN1) -> the coordinates where the descriptors were found valid and hence returned in resp (the first row is the X-coordinates, the second row is the Y-coordinates)
salientCoords (2xN2) -> the coordinates where no descriptor was calculated because it was salient (the first row is the X-coordinates, the second row is the Y-coordinates)
uniformCoords (2xN3)-> the coordinates where no descriptor was calculated because it was uniform (the first row is the X-coordinates, the second row is the Y-coordinates)
N1 = number of computed descriptors which are not salient or uniform
N2 = number of salient descriptors
N3 = number of uniform descriptors
N1+N2+N3=N
The parameter structure has the following options
1. parms.size -> the patch size, only odd number allowed (common values are 3,5,7,9)
2. parms.coRelWindowRadius -> the correlation radius (as described in the self similarity paper) (common values are 10 , 20 , 30, 40 )
3. parms.numRadiiIntervals -> the number of intervals into which to quantize the radial bins (common values are 3,4 ,5)
4. parms.numThetaIntervals -> the number of intervals into which to quantize the angular bins (common values: 10 , 15, 20 )
5. parms.varNoise -> some parameter described in the paper for checking salient patches (common values depend on the range of the image data. (Common values: 100, 150 , 200 assuming that you have a rgb image with values between 0-255. if you use a different range like [0-1] you will need to change this accordingly)
6. parms.autoVarRadius -> the auto variance radius parmater described in paper. (common values 1,2,3)
7. parms.saliencyThresh -> parameter used to detect salient patches . Value of 1 disables saliency checking, value of 0 makes all patches salient(values in the range [0,1])
8. parms.nChannels -> the number of channels in the image (size(img,3))
NOTE on allowed ranges for allXCoords and allYCoords:
Let radius=(parms.size-1)/2; (the radius of the patch)
margin=radius+parms.coRelWindowRadius
h and w are the height and width of the image
Then allXCoords can only lie in the closed interval [margin+1 , w-margin]
allYCoords can only lie in the closed interval [margin+1 , h-margin]
NOTE on uniformCoords and salientCoords:
The Irani paper mentions salient features and uniform features. This description was not very clear in the paper. This code contains my understanding of these salient features, and currently uniform feature detection is not implemented, though the skeleton functions which should detect this uniformity have been created in ssimDescriptor.m . You can also disable the salient feature detection by setting parms.saliencyThresh to 1.
Other notes:
This is a first implementation of this descriptor. There could be possible speeding up of this code and less memory usage, if there are such improvements, then the code on the page will be updated.
ssim.rar_图像 姿态_图像自相似性_目标检测_自相似性_视频相似检测
版权申诉
137 浏览量
2022-09-24
16:58:17
上传
评论
收藏 269KB RAR 举报
我虽横行却不霸道
- 粉丝: 75
- 资源: 1万+
最新资源
- tensorflow-gpu-2.5.0-cp39-cp39-manylinux2010-x86-64.whl
- tensorflow-gpu-2.5.2-cp39-cp39-manylinux2010-x86-64.whl
- 内含方正小标宋简体、仿宋-Gb2312、黑体、楷体、宋体,五个公文常用字体
- 记忆卡牌游戏源码及可运行文件
- 利用wps的js宏编写的一键格式修改辅助工具
- 基于matlab实现训练RBF网络的,但用的算法是梯度下降法,算法仍然是自己写的.rar
- 基于matlab实现小波分析改造后,可以分析脑电数据的程序,出现32个导联每个通道的功率谱.rar
- 基于matlab实现物体的应力和应变DIC-通过识别一系列图像的变形得到物体的应力和应变
- 基于matlab实现文档+程序NSGA-II多目标优化的matlab代码.rar
- 基于matlab实现文档+程序 多目标优化,NSGA2算法实现.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈