Extracting Region Properties From A Number Of Images.

1 visualización (últimos 30 días)
Chris Corbett
Chris Corbett el 29 de Oct. de 2014
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.

Respuestas (0)

Categorías

Más información sobre Earth and Planetary Science en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by