Extracting Region Properties From A Number Of Images.

조회 수: 3 (최근 30일)
Chris Corbett
Chris Corbett 2014년 10월 29일
Hi,
I have a set of 9 images of the earth taken by a meteosat satellite and I'm looking to get some properties of the image out of it, starting with the area and diameter of the earth in each image, as they change slightly.
I have it working when just using one image, but when I introduce a for loop to run all through the images I'm having issues with 'Subscripted assignment dimension mismatch'.
I believe the issue begins with the line below.
blob_measurements(:,:,n) = regionprops(labeled_image(:,:,n), sixnm(:,:,n), 'all');
The entire code can be seen below, I imagine it is to do with the way I'm using (:,:,n).
binary_threshold = 10
for n = 1:9
binary_image(:,:,n) = sixnm(:,:,n) > binary_thershold;
binary_image(:,:,n) = imfill(binary_image(:,:,n), 'holes');
labeled_image(:,:,n) = bwlabel(binary_image(:,:,n), 8);
blob_measurements(:,:,n) = regionprops(labeled_image(:,:,n) ...
, sixnm(:,:,n), 'all');
boundaries(:,:,n) = bwboundaries(binary_image(:,:,n));
thisBoundary = boundaries{1};
figure()
colormap(gray)
imagesc(sixnm(:,:,n))
hold on
plot(thisBoundary(:,2), thisBoundary(:,1), 'g', 'LineWidth', 2);
blob_centroid(:,:,n) = blob_measurements(1).Centroid;
blob_area(:,:,n) = blob_measurements(1).Area;
blob_diameter(:,:,n) = sqrt(4 * blob_area / pi);
disp(['The centre of the earth is at ',num2str(blob_centroid),'.']);
disp(['The diameter of the earth in pixels is ',num2str(blob_diameter),'.']);
end
sixnm refers to the image array.
Thanks, Chris.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Earth and Planetary Science에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by