问2个和天使之羽cg有关的问题

光明之魂2怎样救爷爷的孙子_百度拇指医生
&&&网友互助
?光明之魂2怎样救爷爷的孙子
拇指医生提醒您:该问题下为网友贡献,仅供参考。
找到后追加20分
先和爷爷说话之后在草丛下方有信之后买4个手雷去巴迪的海盗船的倒数第三关就是有一排一排桶的那关把桶炸掉之后把天使之羽掷向孙子就行啦
楼上说的挺对 就是有的要注意1:炸弹城里的商店是没有的 必须是完成隐藏任务 也就是打完妖精森林后 去酒吧和原城商店的主任对话(很好认),进门后直走,紫色长头发。跟她对话,触发剧情,然后出城门,就有个关卡了,进去打到最后一层(很简单的),里面的门右面的地上有宣传单,拿着(回去和那个女的说话,把单子给他,她会给你白银之戒{我没记错的话,N年钱玩的}),有东西买(如果你是那种完美玩家的话,表情符不可缺少,拿下,联机的时候用用),说正题,如果进去的时候你身上有药,全卖光,全买炸弹(后面炸箱子啊什么的都有用,基本只能靠这个),还有一个你也知道,那个药店的老板娘去了酒吧后,200血的大补也没得卖了,所以这是个必须完成的任务,然后你随便打一关,药店就恢复了,200的血再现。(建议打海盗船两遍,因为第二次打败船长又会触发剧情),然后打完章鱼后去城门,有幽灵船了(隐藏关卡,可以不去)
现在说说你提问的,要救爷爷的孙子,一个是炸弹(我们有了),还有一个就是孙子的信(在爷爷的下面的左边一个凹进去的城墙那里),然后跟爷爷对话,触发了剧情后,去打海盗船,还有要待两个光明之羽,一个自己备用,一个放在R栏里面向孙子投掷(长按B后放开)。最后要纠正楼上一点,其实炸弹不是要用4个。技术差点的话是要4个的我承认。把炸弹扔在两组木桶的中央,其实是可以一下子爆掉两排木桶的,不过要是保险点带4个也可以。over 祝你愉快 光2是个好游戏 蛮还念以前玩的时候 所有的秘籍(不用金手指),和隐藏关卡我都知道,再有问题发我消息,百度知道我天天上的
在去大地图的门口左边找一找的到孙子的信跟爷爷对话去海贼船有木桶的地方用手雷或炸弹4个炸掉看到他别跟他对话模拟器会卡机...把天使之羽扔给他送回城在城里跟他对话得到力量之酒
在海盗船打BOSS前倒数2层,用手雷炸开后(4个)和孙子对话,用天使之羽送他上西天,在葛兰多尔城和他对话即可获得力量之酒
在海盗船中的一个图 没有怪的有2个箱子堵着
你要先买5个手雷在那扔
打完妖精之泉,就好公主后,到葛兰多尔城与爷爷对话,再到下面拿信,再去打巴迪海盗船,有一关没有怪,准备好4个手雷炸开油桶孙子就救出来了
这很简单:一:更爷爷对话,从下方草地里发现信件,交给他,得知在海盗那里.二:带四个手雷(建议多带一个备用)二个天使之羽(一个自己用),接着就出发。最后,到一个有桶的地方,用四个炸开它(有四个),将天使之羽投给他。回去后,与他对话就能得到力之酒
/f?kz=这里有所有光明之魂的密道,攻略,金手指...反正很全我也爱玩光明之魂系列他给我的初中生活带来很多快乐虽然现在我已经是个大学生但是回忆起以前和同学们一起半夜玩游戏还是非常非常的快乐支持光明之魂系列!!!
在海盗船中的一个图 没有怪的有2个箱子堵着
你要先买5个手雷在那扔
向医生提问
完善患者资料:*性别:
为您推荐:
* 百度拇指医生解答内容由公立医院医生提供,不代表百度立场。
* 由于网上问答无法全面了解具体情况,回答仅供参考,如有必要建议您及时当面咨询医生
向医生提问有关SIFT函数的关键代码
function [ pos, scale, orient, desc ] = SIFT( im, octaves,
intervals, object_mask, contrast_threshold, curvature_threshold,
interactive )
% [ pos, scale, orient, desc ] = SIFT( im, octaves, intervals,
object_mask, contrast_threshold, curvature_threshold, interactive
if ~exist('octaves')
&& octaves = 4;
if ~exist('intervals')
&& intervals = 2;
if ~exist('object_mask')
&& object_mask =
ones(size(im));
if size(object_mask) ~= size(im)
&& object_mask =
ones(size(im));
if ~exist('contrast_threshold')
&& contrast_threshold =
if ~exist('curvature_threshold')
&& curvature_threshold =
if ~exist('interactive')
&& interactive = 1;
% Check that the image is normalized to [0,1]
if( (min(im(:)) & 0) | (max(im(:)) &
&& fprintf( 2, 'Warning: image
not normalized to [0,1].\n' );
% Blur the image with a standard deviation of 0.5 to prevent
% and then upsample the image by a factor of 2 using linear
interpolation.
% Lowe claims that this increases the number of stable keypoints
% a factor of 4.
if interactive &= 1
&& fprintf( 2, 'Doubling image
size for first octave...\n' );
antialias_sigma = 0.5;
if antialias_sigma == 0
&& signal =
&& g = gaussian_filter(
antialias_sigma );%至少比0.5大
&& if exist('corrsep') == 3
&&& signal =
corrsep( g, g, im );
signal = conv2( g, g, im, 'same' );
[X Y] = meshgrid( 1:0.5:size(signal,2), 1:0.5:size(signal,1)
signal = interp2( signal, X, Y, '*linear'
subsample = [0.5]; % subsampling rate for doubled image is 1/2
if interactive &= 1
&& fprintf( 2, 'Prebluring
image...\n' );
preblur_sigma = sqrt(sqrt(2)^2 - (2*antialias_sigma)^2);
if preblur_sigma == 0
&& gauss_pyr{1,1} =
&& g = gaussian_filter(
preblur_sigma );
&& if exist('corrsep') == 3
gauss_pyr{1,1} = corrsep( g, g, signal );
gauss_pyr{1,1} = conv2( g, g, signal, 'same' );
clear signal
pre_time =
if interactive &= 1
&& fprintf( 2, 'Preprocessing
time %.2f seconds.\n', pre_time );
% The initial blurring for the first image of the first octave
of the pyramid.
initial_sigma = sqrt( (2*antialias_sigma)^2 + preblur_sigma^2
% Keep track of the absolute sigma for the octave and
absolute_sigma = zeros(octaves,intervals+3);
absolute_sigma(1,1) = initial_sigma * subsample(1);
% Keep track of the filter sizes and standard deviations used to
generate the pyramid
filter_size = zeros(octaves,intervals+3);
filter_sigma = zeros(octaves,intervals+3);
% Generate the remaining levels of the geometrically sampled
gaussian and DOG pyramids
if interactive &= 1
&& fprintf( 2, 'Expanding the
Gaussian and DOG pyramids...\n' );
for octave = 1:octaves
&& if interactive
fprintf( 2, '\tProcessing octave %d: image size %d x %d subsample
%.1f\n', octave, size(gauss_pyr{octave,1},2),
size(gauss_pyr{octave,1},1), subsample(octave) );
fprintf( 2, '\t\tInterval 1 sigma %f\n', absolute_sigma(octave,1)
&& sigma = initial_
&& g = gaussian_filter( sigma
&& filter_size( octave, 1 ) =
length(g);
&& filter_sigma( octave, 1 ) =
&& DOG_pyr{octave} =
zeros(size(gauss_pyr{octave,1},1),size(gauss_pyr{octave,1},2),intervals+2);%M*N*Z
&& for interval =
2:(intervals+3)%从第二层开始方便差分DOG计算
% Compute the standard deviation of the gaussian filter needed
% produce the
% next level of the geometrically sampled
pyramid.& Here, sigma_i+1 = k*sigma.
% By definition of successive convolution, the required blurring
sigma_f to
% produce sigma_i+1 from sigma_i is:
%&&& sigma_i+1^2
= sigma_f,i^2 + sigma_i^2
%& (k*sigma_i)^2 = sigma_f,i^2 + sigma_i^2
% therefore:
sigma_f,i = sqrt(k^2 - 1)sigma_i
% where k = 2^(1/intervals) to span the octave, so:
%& sigma_f,i = sqrt(2^(2/intervals) -
sigma_f = sqrt(2^(2/intervals) - 1)*
g = gaussian_filter( sigma_f );
sigma = (2^(1/intervals))*%得到下一个sigma
% Keep track of the absolute sigma
absolute_sigma(octave,interval) = sigma * subsample(octave);
% Store the size and standard deviation of the filter for later
filter_size(octave,interval) = length(g);
filter_sigma(octave,interval) =
if exist('corrsep') == 3
gauss_pyr{octave,interval} = corrsep( g, g,
gauss_pyr{octave,interval-1} );
else%卷积后获得当前层的高斯金子塔
gauss_pyr{octave,interval} = conv2( g, g,
gauss_pyr{octave,interval-1}, 'same' );
end%获得DOG金字塔&&&&&
DOG_pyr{octave}(:,:,interval-1) = gauss_pyr{octave,interval} -
gauss_pyr{octave,interval-1};
if interactive &= 1
fprintf( 2, '\t\tInterval %d sigma %f\n', interval,
absolute_sigma(octave,interval) );
end&&&&&&&&&&&&&
&& if octave &
% The gaussian image 2 images from the top of the stack for
% this octave have be blurred by 2*sigma.&
Subsample this image by a
% factor of 2 to procuduce the first image of the next
sz = size(gauss_pyr{octave,intervals+1});
[X Y] = meshgrid( 1:2:sz(2), 1:2:sz(1) );
gauss_pyr{octave+1,1} =
interp2(gauss_pyr{octave,intervals+1},X,Y,'*nearest');
absolute_sigma(octave+1,1) =
absolute_sigma(octave,intervals+1);
subsample = [subsample subsample(end)*2];
pyr_time =
if interactive &= 1
&& fprintf( 2, 'Pryamid
processing time %.2f seconds.\n', pyr_time );
% Display the gaussian pyramid when in interactive mode
if interactive &= 2
&& sz = zeros(1,2);
&& sz(2) =
(intervals+3)*size(gauss_pyr{1,1},2);
&& for octave = 1:octaves
sz(1) = sz(1) + size(gauss_pyr{octave,1},1);
&& pic = zeros(sz);
&& for octave =
1:octaves%显示所有组所有层的图像
sz = size(gauss_pyr{octave,1});
for interval = 1:(intervals + 3)
&&&pic(y:(y+sz(1)-1),x:(x+sz(2)-1))
gauss_pyr{octave,interval};&&&&&&&&&&
x = x + sz(2);
y = y + sz(1);
&& imshow(pic);
&& resizeImageFig( fig,
size(pic), 0.25 );
&& fprintf( 2, 'The gaussian
pyramid (0.25 scale).\nPress any key to continue.\n' );
&& close(fig)
% Display the DOG pyramid when in interactive mode
if interactive &= 2
&& sz = zeros(1,2);
&& sz(2) =
(intervals+2)*size(DOG_pyr{1}(:,:,1),2);
&& for octave = 1:octaves
sz(1) = sz(1) + size(DOG_pyr{octave}(:,:,1),1);
&& pic = zeros(sz);
&& for octave = 1:octaves
sz = size(DOG_pyr{octave}(:,:,1));
for interval = 1:(intervals + 2)
&&&pic(y:(y+sz(1)-1),x:(x+sz(2)-1))
DOG_pyr{octave}(:,:,interval);&&&&&&&&&&
x = x + sz(2);
y = y + sz(1);
&& imshow(pic);
&& resizeImageFig( fig,
size(pic), 0.25 );
&& fprintf( 2, 'The DOG pyramid
(0.25 scale).\nPress any key to continue.\n' );
&& close(fig)
end%已经可能到这边
xx = [ 1 -2& 1 ];
xy = [ 1 0 -1; 0 0 0; -1 0 1 ]/4;
%| Dxx&&& Dxy
%|&&&&&&&&&&&
%| Dxy&&& Dyy
%|&&&&&&&&&&&
% Coordinates of keypoints after each stage of processing for
% in interactive mode.
raw_keypoints = [];
contrast_keypoints = [];
curve_keypoints = [];
% Detect local maxima in the DOG pyramid
if interactive &= 1
&& fprintf( 2, 'Locating
keypoints...\n' );
loc = cell(size(DOG_pyr)); % boolean maps of keypoints
for octave = 1:octaves
&& if interactive
fprintf( 2, '\tProcessing octave %d\n', octave );
&& for interval =
2:(intervals+1)
keypoint_count = 0;
contrast_mask = abs(DOG_pyr{octave}(:,:,interval))
&= contrast_
loc{octave,interval} =
zeros(size(DOG_pyr{octave}(:,:,interval)));
if exist('corrsep') == 3
else&&&&&&&&
edge = ceil(filter_size(octave,interval)/2);
y=(1+edge):(size(DOG_pyr{octave}(:,:,interval),1)-edge)&&&&&&&&
for x=(1+edge):(size(DOG_pyr{octave}(:,:,interval),2)-edge)
&&&&&&&&&&&
% Only check for extrema where the object mask is 1
&&&&&&&&&&&
object_mask(round(y*subsample(octave)),round(x*subsample(octave)))
&&&&&&&&&&&&&&&
&&&&&&&&&&
&&&&&&&&&&&&&&
if( (interactive &= 2) | (contrast_mask(y,x) == 1)
&&&&&&&&&&&&&&&&&
DOG_pyr{octave}((y-1):(y+1),(x-1):(x+1),(interval-1):(interval+1));&
&&&&&&&&&&&&&&&&&
pt_val = tmp(2,2,2);
&&&&&&&&&&&&&&&&&
if( (pt_val == min(tmp(:))) | (pt_val == max(tmp(:))) )
&&&&&&&&&&&&&&&&&&&&
% The point is a local extrema of the DOG image.&
Store its coordinates for
&&&&&&&&&&&&&&&&&&&&
% displaying keypoint location in interactive mode.
&&&&&&&&&&&&&&&&&&&&
raw_keypoints = [raw_ x*subsample(octave)
y*subsample(octave)];
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&
if abs(DOG_pyr{octave}(y,x,interval)) &=
contrast_threshold
&&&&&&&&&&&&&&&&&&&&&&&
% The DOG image at the extrema is above the contrast
threshold.& Store
&&&&&&&&&&&&&&&&&&&&&&&
% its coordinates for displaying keypoint locations in interactive
&&&&&&&&&&&&&&&&&&&&&&&
contrast_keypoints = [contrast_
raw_keypoints(end,:)];%最后一行加入对比度
&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&
% Compute the entries of the Hessian matrix at the extrema
&&&&&&&&&&&&&&&&&&&&&&&
Dxx = sum(DOG_pyr{octave}(y,x-1:x+1,interval) .* xx);
&&&&&&&&&&&&&&&&&&&&&&&
Dyy = sum(DOG_pyr{octave}(y-1:y+1,x,interval) .* yy);
&&&&&&&&&&&&&&&&&&&&&&&
Dxy = sum(sum(DOG_pyr{octave}(y-1:y+1,x-1:x+1,interval) .*
&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&
% Compute the trace and the determinant of the Hessian.
&&&&&&&&&&&&&&&&&&&&&&&
Tr_H = Dxx + D
&&&&&&&&&&&&&&&&&&&&&&&
Det_H = Dxx*Dyy - Dxy^2;
&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&
% Compute the ratio of the principal curvatures.
&&&&&&&&&&&&&&&&&&&&&&&
curvature_ratio = (Tr_H^2)/Det_H;
&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&
if ((Det_H &= 0) & (curvature_ratio
& curvature_threshold))
&&&&&&&&&&&&&&&&&&&&&&&&&&
% The ratio of principal curvatures is below the threshold
&&&&&&&&&&&&&&&&&&&&&&&&&&
% it is not an edge point).& Store its
coordianates for displaying
&&&&&&&&&&&&&&&&&&&&&&&&&&
% keypoint locations in interactive mode.
&&&&&&&&&&&&&&&&&&&&&&&&&&
curve_keypoints = [curve_ raw_keypoints(end,:)];
&&&&&&&&&&&&&&&&&&&&&&&&&&
%最后一行加入去边缘关键点矩阵
&&&&&&&&&&&&&&&&&&&&&&&&&&
% Set the loc map to 1 to at this point to indicate a
&&&&&&&&&&&&&&&&&&&&&&&&&&
loc{octave,interval}(y,x) = 1;
&&&&&&&&&&&&&&&&&&&&&&&&&&
keypoint_count = keypoint_count + 1;
&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&
end&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&
end&&&&&&&&&&&&&&
&&&&&&&&&&&
end&&&&&&&&
if interactive &= 1
fprintf( 2, '\t\t%d keypoints found on interval %d\n',
keypoint_count, interval );
keypoint_time =
if interactive &= 1
&& fprintf( 2, 'Keypoint location
time %.2f seconds.\n', keypoint_time );
% Display results of extrema detection and keypoint filtering in
interactive mode.
if interactive &= 2
&& imshow(im);
plot(raw_keypoints(:,1),raw_keypoints(:,2),'y+');
&& resizeImageFig( fig, size(im),
&& fprintf( 2, 'DOG extrema (2x
scale).\nPress any key to continue.\n' );
&& close(fig);
&& imshow(im);
plot(contrast_keypoints(:,1),contrast_keypoints(:,2),'y+');
&& resizeImageFig( fig, size(im),
&& fprintf( 2, 'Keypoints after
removing low contrast extrema (2x scale).\nPress any key to
continue.\n' );
&& close(fig);
&& imshow(im);
plot(curve_keypoints(:,1),curve_keypoints(:,2),'y+');
&& resizeImageFig( fig, size(im),
&& fprintf( 2, 'Keypoints after
removing edge points using principal curvature filtering (2x
scale).\nPress any key to continue.\n' );
close(fig);&
clear raw_keypoints contrast_keypoints curve_keypoints
g = gaussian_filter( 1.5 * absolute_sigma(1,intervals+3) /
subsample(1) );
zero_pad = ceil( length(g) / 2 );
if interactive &= 1
&& fprintf( 2, 'Computing
gradient magnitude and orientation...\n' );
mag_thresh = zeros(size(gauss_pyr));
mag_pyr = cell(size(gauss_pyr));
grad_pyr = cell(size(gauss_pyr));
for octave = 1:octaves
&& for interval =
2:(intervals+1)&&&&&&
0.5*(gauss_pyr{octave,interval}(2:(end-1),3:(end))-gauss_pyr{octave,interval}(2:(end-1),1:(end-2)));
0.5*(gauss_pyr{octave,interval}(3:(end),2:(end-1))-gauss_pyr{octave,interval}(1:(end-2),2:(end-1)));
zeros(size(gauss_pyr{octave,interval}));&&&&&
mag(2:(end-1),2:(end-1)) = sqrt( diff_x .^ 2 + diff_y .^ 2 );
mag_pyr{octave,interval} = zeros(size(mag)+2*zero_pad);
mag_pyr{octave,interval}((zero_pad+1):(end-zero_pad),(zero_pad+1):(end-zero_pad))
grad = zeros(size(gauss_pyr{octave,interval}));
grad(2:(end-1),2:(end-1)) = atan2( diff_y, diff_x );
grad(find(grad == pi)) = -
grad_pyr{octave,interval} = zeros(size(grad)+2*zero_pad);
grad_pyr{octave,interval}((zero_pad+1):(end-zero_pad),(zero_pad+1):(end-zero_pad))
clear mag grad
grad_time =
if interactive &= 1
&& fprintf( 2, 'Gradient
calculation time %.2f seconds.\n', grad_time );
num_bins = 36;
hist_step = 2*pi/num_
hist_orient = [-pi:hist_step:(pi-hist_step)];
% Initialize the positions, orientations, and scale
information
% of the keypoints to emtpy matrices.
orient = [];
scale = [];
if interactive &= 1
&& fprintf( 2, 'Assigining
keypoint orientations...\n' );
for octave = 1:octaves
&& if interactive
fprintf( 2, '\tProcessing octave %d\n', octave );
&& for interval = 2:(intervals +
if interactive &= 1
fprintf( 2, '\t\tProcessing interval %d ', interval );
end&&&&&&&&&&&
keypoint_count = 0;
&&&&&&&&&&
g = gaussian_filter( 1.5 *
absolute_sigma(octave,interval)/subsample(octave) );
hf_sz = floor(length(g)/2);
g'*g;&&&&&&
loc_pad = zeros(size(loc{octave,interval})+2*zero_pad);
loc_pad((zero_pad+1):(end-zero_pad),(zero_pad+1):(end-zero_pad)) =
loc{octave,interval};
[iy ix]=find(loc_pad==1);
for k = 1:length(iy)
x = ix(k);
y = iy(k);
g.*mag_pyr{octave,interval}((y-hf_sz):(y+hf_sz),(x-hf_sz):(x+hf_sz));
grad_window =
grad_pyr{octave,interval}((y-hf_sz):(y+hf_sz),(x-hf_sz):(x+hf_sz));
orient_hist=zeros(length(hist_orient),1);
for bin=1:length(hist_orient)
&&&&&&&&&&&
% Compute the diference of the orientations mod pi
&&&&&&&&&&&
diff = mod( grad_window - hist_orient(bin) + pi, 2*pi ) -
&&&&&&&&&&&
&&&&&&&&&&&
% Accumulate the histogram bins
&&&&&&&&&&&
orient_hist(bin)=orient_hist(bin)+sum(sum(wght.*max(1 -
abs(diff)/hist_step,0)));
&&&&&&&&&&&
%orient_hist(bin)=orient_hist(bin)+sum(sum(wght.*(abs(diff)
&= hist_step)));
% Find peaks in the orientation histogram using nonmax
suppression.
orient_&&&&&&&
rot_right = [ peaks(end); peaks(1:end-1) ];
rot_left = [ peaks(2:end); peaks(1)
];&&&&&&&&
peaks( find(peaks & rot_right) ) = 0;
peaks( find(peaks & rot_left) ) = 0;
% Extract the value and index of the largest peak.
[max_peak_val ipeak] = max(peaks);
peak_val = max_peak_
while( peak_val & 0.8*max_peak_val
)&&&&&&&&&&
&&&&&&&&&&&
&&&&&&&&&&&
&&&&&&&&&&&
for j = -1:1
&&&&&&&&&&&&&&
A = [A; (hist_orient(ipeak)+hist_step*j).^2
(hist_orient(ipeak)+hist_step*j) 1];
&&&&&&&&&&&&
bin = mod( ipeak + j + num_bins - 1, num_bins ) + 1;
&&&&&&&&&&&&&&
b = [b; orient_hist(bin)];
&&&&&&&&&&&
&&&&&&&&&&&
c = pinv(A)*b;
&&&&&&&&&&&
max_orient = -c(2)/(2*c(1));
&&&&&&&&&&&
while( max_orient & -pi )
&&&&&&&&&&&&&&
max_orient = max_orient + 2*
&&&&&&&&&&&
&&&&&&&&&&&
while( max_orient &= pi )
&&&&&&&&&&&&&&
max_orient = max_orient - 2*
&&&&&&&&&&&
end&&&&&&&&&&&
&&&&&&&&&&&
&&&&&&&&&&&
% Store the keypoint position, orientation, and scale
information
&&&&&&&&&&&
pos = [ [(x-zero_pad) (y-zero_pad)]*subsample(octave) ];
&&&&&&&&&&&
orient = [ max_orient];
&&&&&&&&&&&
scale = [ octave interval
absolute_sigma(octave,interval)];
&&&&&&&&&&&
keypoint_count = keypoint_count + 1;
&&&&&&&&&&&
&&&&&&&&&&&
% Get the next peak
&&&&&&&&&&&
peaks(ipeak) = 0;
&&&&&&&&&&&
[peak_val ipeak] = max(peaks);
end&&&&&&&&
if interactive &= 1
fprintf( 2, '(%d keypoints)\n', keypoint_count );
end&&&&&&&&&&&
clear loc loc_pad
orient_time =
if interactive &= 1
&& fprintf( 2, 'Orientation
assignment time %.2f seconds.\n', orient_time );
% Display the keypoints with scale and orientation in
interactive mode.
if interactive &= 2
&& imshow(im);
&& display_keypoints( pos,
scale(:,3), orient, 'y' );
&& resizeImageFig( fig, size(im),
&& fprintf( 2, 'Final keypoints
with scale and orientation (2x scale).\nPress any key to
continue.\n' );
&& close(fig);
orient_bin_spacing = pi/4;
orient_angles =
[-pi:orient_bin_spacing:(pi-orient_bin_spacing)];
grid_spacing = 4;
[x_coords y_coords] = meshgrid( [-6:grid_spacing:6] );
feat_grid = [x_coords(:) y_coords(:)]';
[x_coords y_coords] = meshgrid(
[-(2*grid_spacing-0.5):(2*grid_spacing-0.5)] );
feat_samples = [x_coords(:) y_coords(:)]';
feat_window = 2*grid_desc = [];
if interactive &= 1
&& fprintf( 2, 'Computing
keypoint feature descriptors for %d keypoints', size(pos,1)
for k = 1:size(pos,1)
pos(k,1)/subsample(scale(k,1));
pos(k,2)/subsample(scale(k,1));&&
&& % Rotate the grid
coordinates.
&& M = [cos(orient(k))
-sin(orient(k)); sin(orient(k)) cos(orient(k))];
&& feat_rot_grid = M*feat_grid +
repmat([x; y],1,size(feat_grid,2));
&& feat_rot_samples =
M*feat_samples + repmat([x; y],1,size(feat_samples,2));
feat_desc = zeros(1,128);
for s = 1:size(feat_rot_samples,2)
x_sample = feat_rot_samples(1,s);
y_sample = feat_rot_samples(2,s);
% Interpolate the gradient at the sample position
[X Y] = meshgrid( (x_sample-1):(x_sample+1),
(y_sample-1):(y_sample+1) );
Z = gauss_pyr{scale(k,1),scale(k,2)};
[m,n] = size(Z);
G = interp2( 1:m,1:n,Z, X, Y, '*linear' );
G(find(isnan(G))) = 0;
diff_x = 0.5*(G(2,3) - G(2,1));
diff_y = 0.5*(G(3,2) - G(1,2));
mag_sample = sqrt( diff_x^2 + diff_y^2 );
grad_sample = atan2( diff_y, diff_x );
if grad_sample == pi
grad_sample = -
% Compute the weighting for the x and y dimensions.
x_wght = max(1 - (abs(feat_rot_grid(1,:) - x_sample)/grid_spacing),
y_wght = max(1 - (abs(feat_rot_grid(2,:) - y_sample)/grid_spacing),
pos_wght = reshape(repmat(x_wght.*y_wght,8,1),1,128);
diff = mod( grad_sample - orient(k) - orient_angles + pi, 2*pi ) -
orient_wght = max(1 - abs(diff)/orient_bin_spacing,0);
orient_wght =
repmat(orient_wght,1,16);&&&&&&&&
% Compute the gaussian weighting.
exp(-((x_sample-x)^2+(y_sample-y)^2)/(2*feat_window^2))/(2*pi*feat_window^2);
% Accumulate the histogram bins.
feat_desc = feat_desc + pos_wght.*orient_wght*g*mag_
feat_desc = feat_desc / norm(feat_desc);
feat_desc( find(feat_desc & 0.2) ) = 0.2;
&& feat_desc = feat_desc /
norm(feat_desc);
&& desc = [
feat_desc];
&& if (interactive
&= 1) & (mod(k,25) == 0)
fprintf( 2, '.' );
desc_time =
sample_offset = -(subsample - 1);
for k = 1:size(pos,1)
&& pos(k,:) = pos(k,:) +
sample_offset(scale(k,1));
if size(pos,1) & 0
&scale = scale(:,3);
if interactive &= 1
&& fprintf( 2, '\nDescriptor
processing time %.2f seconds.\n', desc_time );
&& fprintf( 2, 'Processing time
summary:\n' );
&& fprintf( 2,
'\tPreprocessing:\t%.2f s\n', pre_time );
&& fprintf( 2, '\tPyramid:\t%.2f
s\n', pyr_time );
&& fprintf( 2,
'\tKeypoints:\t%.2f s\n', keypoint_time );
&& fprintf( 2, '\tGradient:\t%.2f
s\n', grad_time );
&& fprintf( 2,
'\tOrientation:\t%.2f s\n', orient_time );
&& fprintf( 2,
'\tDescriptor:\t%.2f s\n', desc_time );
&& fprintf( 2, 'Total processing
time %.2f seconds.\n', pre_time + pyr_time + keypoint_time +
grad_time + orient_time + desc_time );
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

参考资料

 

随机推荐