How do I find area using image processing?
5 次查看(过去 30 天)
显示 更早的评论
Determine the area of the big white spot on Jupiter as shown below. Also compare the size of the spot with size of Earth. Note that appoximate values are: Radius of Jupiter: R_J = 71,500 km Radius of Earth: R_E = 6380 km
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162278/image.png)
Wikipedia says: http://en.wikipedia.org/wiki/Great_Red_Spot#Great_Red_Spot The Great Red Spot is a persistent anticyclonic storm. The strorm is large enough to be visible through Earth-based telescopes. The spot is large enough to contain two or three planets the size of Earth.
Here is a code that i started to write:
if true
% jupiter.m
% find and compare the size of great red spot
clc; clear; figure
A = imread('jupiter2.jpg'); % image above
B = rgb2gray(A);
C = imcrop(B, [330 460 140 80]); % crop the big white spot
D = C > 160;
subplot(2,2,1); imshow(A);
subplot(2,2,2); imshow(B);
subplot(2,2,3); imshow(C);
subplot(2,2,4); imshow(D);
...
fprintf('Pixel area = %f\n',p_area);
fprintf('Real area = %f km^2\n',r_area);
fprintf('Size of Earth = %f km^2\n',pi*RE^2);
fprintf('Ratio = %f\n',r_area/(pi*RE^2));
end
In the code i don't know what to write instead of three dots? Below i've provided the output that my teacher got.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162284/image.png)
0 个评论
采纳的回答
Image Analyst
2014-5-7
See my image segmentation tutorial: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 It will show you how to get the area. Basically, call bwlabel() and regionprops(). (By the way, you can find it without cropping if you look at the circularity and size.)
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!