Extracting Region Properties From A Number Of Images.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Earth and Planetary Science en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!