【发布时间】:2014-01-17 00:38:59
【问题描述】:
我需要根据颜色定位卫星图像中的区域。我可以使用 Matlab 根据颜色对区域进行聚类,但我无法识别空间位置。请帮助我如何使用Matlab识别这些区域的经纬度
<i>
veg= imread('vegimg3.png');
imshow(veg), title('Vegitation in Kolleru');
cform = makecform('srgb2lab');
newveg = applycform(veg,cform);
ab = double(newveg(:,:,2:3));
nrows = size(ab,1);
ncols = size(ab,2);
disp(nrows);
disp(ncols);
ab = reshape(ab,nrows*ncols,2);
nColors = 6;
% repeat the clustering 3 times to avoid local minima
[cluster_idx cluster_center] = kmeans(ab,nColors,'distance','sqEuclidean','replicates',3);
pixel_labels = reshape(cluster_idx,nrows,ncols);
%figure, imshow(pixel_labels,[]), title('image labeled by cluster index');
segmented_images = cell(1,3);
rgb_label = repmat(pixel_labels,[1 1 3]);
for k = 1:nColors
color = he;
color(rgb_label ~= k) = 0;
segmented_images{k} = color;
imtool(segmented_images{k}), title('objects in cluster'+k);
end
</i>
$ 在这里我可以按颜色对图像进行聚类但我需要每个像素的经纬度信息
【问题讨论】:
-
这无法回答;我们需要更多关于图像的信息。比如,它是在什么高度拍摄的,在什么角度下拍摄的,地球的哪一块等等。你碰巧知道图像角落的纬度/经度吗?或者图像中的任何其他位置?
-
尝试在您的图像上定位一些已知的地理特征或具有已知坐标的对象(您至少需要三个,但越多越好),然后您可以为整个图像插入坐标。否则,根据您提供的信息,问题似乎无法解决。
标签: matlab image-processing cluster-analysis