Image 如何在图像中获得更精确的点位置

Image 如何在图像中获得更精确的点位置,image,matlab,image-processing,computer-vision,Image,Matlab,Image Processing,Computer Vision,通常,我们可以通过以下方式获得图像中的点位置: figure, imshow rice.png; [x,y,~] = ginput(1) 返回的内容如下所示: x = 121 y = 100 这些数字是用像素来衡量的,但我希望得到更准确的结果,如: x = 121.35 y = 100.87 任何帮助都将被告知 对于使用控制点对齐/注册两幅图像,不同控制点确实需要亚像素精度。 Matlab有一个非常好的用户界面,您可能想看看:。 还提供了一个不错的教程 给定两个图像oim1和oim2,您可

通常,我们可以通过以下方式获得图像中的点位置:

figure, imshow rice.png;
[x,y,~] = ginput(1)
返回的内容如下所示:

x = 121
y = 100
这些数字是用像素来衡量的,但我希望得到更准确的结果,如:

x = 121.35
y = 100.87

任何帮助都将被告知

对于使用控制点对齐/注册两幅图像,不同控制点确实需要亚像素精度。
Matlab有一个非常好的用户界面,您可能想看看:。
还提供了一个不错的教程

给定两个图像
oim1
oim2
,您可以使用
cpselect
oim2
转换为“适合”
oim1

>> [input_points, base_points] = cpselect(oim2, oim1, 'Wait', true);
>> T = cp2tform( input_points, base_points, 'similarity' ); % find similarity transformation
>> aim2 = tformarray( oim2, T, makeresampler('cubic','fill'), [2 1], [2 1], size(oim1(:,:,1)'), [], 0 );

要使用控制点对齐/注册两幅图像,您需要不同控制点的亚像素精度。
Matlab有一个非常好的用户界面,您可能想看看:。
还提供了一个不错的教程

给定两个图像
oim1
oim2
,您可以使用
cpselect
oim2
转换为“适合”
oim1

>> [input_points, base_points] = cpselect(oim2, oim1, 'Wait', true);
>> T = cp2tform( input_points, base_points, 'similarity' ); % find similarity transformation
>> aim2 = tformarray( oim2, T, makeresampler('cubic','fill'), [2 1], [2 1], size(oim1(:,:,1)'), [], 0 );
我认为这可能有用

% load example image    
Istruct = load('gatlin');    
I = Istruct.X./max(Istruct.X(:));

% display it
figure;
imagesc(I);
colormap(gray);

% get some point
[x,y]=ginput(1);

[x, y] % x and y will be double
我认为这可能有用

% load example image    
Istruct = load('gatlin');    
I = Istruct.X./max(Istruct.X(:));

% display it
figure;
imagesc(I);
colormap(gray);

% get some point
[x,y]=ginput(1);

[x, y] % x and y will be double

为什么你需要这种额外的准确性?如果你正在做图像对齐,你可能想考虑<代码> CPSELECT< /COD> >我尝试做Prrutt分析,想法是:从两个不同的图像中选择两组点,并通过旋转、缩放和平移来转换一组点,使其尽可能接近另一组点。我想更精确的点位置可能有助于产生更令人满意的输出。为什么需要这种额外的精度?如果你正在做图像对齐,你可能想考虑<代码> CPSELECT< /COD> >我尝试做Prrutt分析,想法是:从两个不同的图像中选择两组点,并通过旋转、缩放和平移来转换一组点,使其尽可能接近另一组点。我想更精确的点位置可能有助于产生更令人满意的输出。太棒了!!!它工作得很好!!!只需注意,如果宽度不等于高度,图像可能会失真:添加
轴图像
到分解迷宫!!!它工作得很好!!!只需注意,如果宽度不等于高度,图像可能会失真:添加
轴图像
以溶解