unction targetModel = createTargetModel(targetImage, targetModelImage)
% gathers the information needed to match the target in a test image.
% targetImage -- the image that only contains the target.
% targetModel -- a struct that contains the informations needed to match
% targetModelImage -- a contour image of the target with absolute white background
% for plot
colormap = {'r*','b*','c*','g*','m*','ro','bo','co','go','mo','r+','b+','c+','g+','m+'};
colormap = [colormap {'rx','bx','cx','gx','mx','rs','bs','cs','gs','ms','rd','bd','cd','gd','md'}];
% transform to gray image
im_mat_g = rgb2gray(targetImage);
% calculate SURF points in target image (See SURFMEX library for detail)
% cr is column row position of all SURF point
% descr is the descriptor for each SURF point
options.hessianThreshold = 100;
[cr, descr, sign, info] = surfpoints(im_mat_g,options);
% ori is the major orientation of the SURF point descriptor
ori = -info(3,:)*pi/180; % need to be modified if use new SURFmex library, see http://computervisionblog.wordpress.com/
figure;
imshow(targetImage); hold on
plot(cr(1,:),cr(2,:),colormap{1});
% find the midle point of the image
rc_mid = size(im_mat_g)/2;
cr_mid = rc_mid([2 1]);
model.descr = descr;
model.cr = cr;
% for each SURF point
for i=1:size(cr,2)
% save the angle of the line between the SURF point and the middle point
model.ori2mid(i) = atan2(cr_mid(2)-cr(2,i),cr_mid(1)-cr(1,i)) -ori(i);
% save the length of the line between the SURF point and the middle point devide by the scale of the SURF descriptor
model.scale2mid(i) = ((cr_mid(1) - cr(1,i))^2 + (cr_mid(2) - cr(2,i))^2)^0.5 / info(1,i);
% save the major orientation of the SURF point descriptor
model.ori(i) = ori(i);
% save the scale of the SURF point descriptor
model.scale(i) = info(1,i);
end
model.maxsize = max(size(im_mat_g));
model.targetImage = targetImage;
model.targetModelImage = targetModelImage;
targetModel = model;
end
%Ek_BLG(Type, Potential, {plot})
%
%Plots the E-k for bilayer graphene, and outputs the bandgap Eg.
%Type is a string, either 'AA' or 'AB'.
%Potential is a number, measured in eV.
%{plot} is an optional input. Set to 0 to suppress plotting E-k.
function Eg = Untitled(L,U,P)
%Ek_BLG(L,U,P)
%Computes the bandgap and plots the Ek for bilayer graphene under the influence
%...of a potential. Based on the paper "Coulomb excitations in AA- and
%AB-stacked bilayer graphite," by J.H. Ho et. tal.
%
%James K Fodor, Sept. 12, 2006
%------------------------------------Define Constants---------------------------------
a0 = 1.42; %C-C spacing in angstroms
alpha0 = 2.569; %Interaction parameters used
alpha1 = 0.361; %...for AA type bilayer
alpha3 = -0.032; %...graphene.
alpha0p = 2.598; %Interaction parameters used
alpha1p = 0.364; %...for AB type bilayer
alpha1pp = 0.319; %...graphene.
alpha3p = 0.177;
alpha6 = -.026;
c = 1; %Constant used in for loops.
%-------------------------------------Define k range----------------------------------
kx = -2*pi/(3*a0):2*pi/(3*499.5*a0):2*pi/(3*a0);
%The kx range.
%----------------------------------------Find Ek--------------------------------------
%-- --- --- --- --- --- --- --- --- ---For AA-type --- --- --- --- --- --- --- --- ---
for c = 1:1000
hk(c) = exp(0)+exp(1i*3*a0/2*kx(c))+exp(-1i*(3*a0/2*kx(c))); %h(k) for ky = 0.
H = [U,-alpha0*hk(c),-alpha1,-alpha3*hk(c); %H matrix for AA.
-alpha0*conj(hk(c)),U,-alpha3*conj(hk(c)),-alpha1;
-alpha1,-alpha3*hk(c),0,-alpha0*hk(c);
-alpha3*conj(hk(c)),-alpha1,-alpha0*conj(hk(c)),0];
E(:,c) = eig(H); %Solve the
%eigenvalue problem.
end
if nargin == 2 || (nargin ==3 && P == 1) %Plot E-k unless
plot(kx,E,'.'); %...user specifies
ylabel('E (eV)','fontsize',[20]); %...not to.
title(['Ek for AA bigraphene layer under potential U = ', num2str(U),
'eV'],'fontsize',(20));
set(gca,'linewidth',[2],'fontsize',[20],'position',[0.15,0.2,0.74,0.7]);
end
%-- --- --- --- --- --- --- --- --- ---For AB-type --- --- --- --- --- --- --- --- ---
for c = 1:1000
hk(c) = exp(0)+exp(1i*3*a0/2*kx(c))+exp(-1i*(3*a0/2*kx(c))); %h(k) for ky = 0.
H = [U+alpha6,-alpha0p*hk(c),-alpha1p,-alpha3p*conj(hk(c)); %H matrix for AB.
-alpha0p*conj(hk(c)),U,-alpha3p*conj(hk(c)),-alpha1pp*hk(c);
-alpha1p,-alpha3*hk(c),alpha6,-alpha0p*conj(hk(c));
-alpha3*hk(c),-alpha1pp*conj(hk(c)),-alpha0*hk(c),0];
E(:,c) = eig(H); %Solve the eigenvalue
%...problem.
end
if nargin == 2 || (nargin==3 && P==1) %Plot E-k unless
plot(kx,E,'.'); %...user specifies
ylabel('E (eV)','fontsize',[20]); %...not to
title(['Ek for AB bigraphene layer under potential U = ', num2str(U),
'eV'],'fontsize',[20]);
set(gca,'linewidth',[2],'fontsize',[20],'position',[0.15,0.2,0.74,0.7]);
end
end
%---------------------------------Compute the bandgap---------------------------------E3 =
sss.rar_blur
版权申诉
170 浏览量
2022-09-23
18:26:54
上传
评论
收藏 2KB RAR 举报
weixin_42651887
- 粉丝: 79
- 资源: 1万+
最新资源
- 批量word文件内容替换工具1.0 (批量实现多个 Word 文档文件文字替换利器).exe
- Cartoon GUI Pack 1.2.zip
- 【数据集和代码】基于加速度传感器的步态识别行人分类实验(可做步态识别)
- 我分享个魔兽内存修改器
- Python毕业设计基于Django的网易云数据分析可视化大屏系统的设计与实现+使用说明+全部资料(优秀项目).zip
- mp3 idv2,idv1,frame分析工具
- Python毕业设计基于Django的网易云数据分析可视化大屏系统的设计与实现+使用说明+全部资料(高分项目).zip
- 人工兔优化算法ARO MATLAB源码, 应用案例为函数极值求解以及优化svm进行分类,代码注释详细,可结合自身需求进行应用
- 人才网站设计-asp.net+sql-(系统源码)
- asp.net+sql人才网站设计-含系统源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈