我有一个有4个斑点的图像,我希望这些斑点与我希望在此图像上绘制的图形中的X,Y坐标完全(或非常接近)排列。该图像目前为600x600像素,但可以调整。
我的图表比例来自
AXIS([388020 388090 5776940 5777010])
如何调整图像以匹配?那么matlab最重要的是它?
这是我的matlab脚本,运行这个我可以看到matlab绘图,但下面没有图像......而且matlab绘图似乎是倒置的。
%接受csv文件 每行的%输出包含3个圆圈和估计的图像 %点
d = size(dataAdjusted) length = d(1)
表示i = [1:1]
%# read and display image
img = imread('hciLab_N.png');
figure('Visible', 'off'),imagesc([388020 388090], [5776940 5777010], img);
%# make sure the image doesn't disappear if we plot something else
hold on
%axis([388020 388090 5776940 5777010]);
%location estimation
yCoord = dataAdjusted(i,2)
xCoord = dataAdjusted(i,3)
%first circle y, x, radius
c1Y = dataAdjusted(i,4);
c1X = dataAdjusted(i,5);
c1R = dataAdjusted(i,6);
%second circle y, x, radius
c2Y = dataAdjusted(i,7);
c2X = dataAdjusted(i,8);
c2R = dataAdjusted(i,9);
%third circle y, x, radius
c3Y = dataAdjusted(i,10);
c3X = dataAdjusted(i,11);
c3R = dataAdjusted(i,12);
%draw location
%rectangle('Position',[xCoord-.5,yCoord-.5,2*.5,2*.5],'Curvature',[1,1], 'EdgeColor', 'r')
[locX, locY] = makeCircle(xCoord, yCoord, .5);
scatter(locX, locY, .2,'b')
%draw circles
%rectangle('Position',[c1X-c1R,c1Y-c1R,2*c1R,2*c1R],'Curvature',[1,1])
%rectangle('Position',[c2X-c2R,c2Y-c2R,2*c2R,2*c2R],'Curvature',[1,1])
%rectangle('Position',[c3X-c3R,c3Y-c3R,2*c3R,2*c3R],'Curvature',[1,1])
[c1X, c1y] = makeCircle(c1X, c1Y, c1R);
scatter(c1X, c1y, .2,'k')
[c2X, c2y] = makeCircle(c2X, c2Y, c2R);
scatter(c2X, c2y, .2,'k')
[c3X, c3y] = makeCircle(c3X, c3Y, c2R);
scatter(c3X, c3y, .2,'k')
% 80 5776978.148 388054.1747
%rectangle('Position',[388054.1747-1,5776978.148-1,2*1,2*1],'Curvature',[1,1], 'EdgeColor', 'g')
[r1X, r1y] = makeCircle(388054.1747, 5776978.148, 1);
scatter(r1X, r1y,.2,'g')
% 87 5776988.825 388043.9639
%rectangle('Position',[388043.9639-1,5776988.825-1,2*1,2*1],'Curvature',[1,1], 'EdgeColor', 'g')
[r2X, r2y] = makeCircle(388043.9639, 5776988.825, 1);
scatter(r2X, r2y,.2,'g')
% 88 5776970.712 388054.2578
%rectangle('Position',[388054.2578-1,5776970.712-1,2*1,2*1],'Curvature',[1,1], 'EdgeColor', 'g')
[r3X, r3y] = makeCircle(388054.2578,5776970.712, 1);
scatter(r3X, r3y,.2,'g')
% 89 5776975.889 388039.8496
%rectangle('Position',[388039.8496-1,5776975.889-1,2*1,2*1],'Curvature',[1,1], 'EdgeColor', 'g')
[r4X, r4y] = makeCircle(388039.8496,5776975.889, 1);
scatter(r4X, r4y,.2,'g')
%title(['Localization of duty cycle ' this_name ]);
saveas(gcf, ['TrilaterationNumber_Adjusted_WithRouters_Scaled' num2str(i)], 'png');
端