area_pix(picture_fi​lename)

版本 1.1.0.0 (1.1 KB) 作者: juhisteri
Calculates the relation of areas of two domains by counting pixels.
28.0 次下载
更新时间 2017/3/23

查看许可证

Calculates the relation of areas of two domains by counting pixels.

An application: given a domain E and a disc D with area 1, you obtain the
area of E.

Give a picture containing
*E with one color
*D with another color (prefer white)
*black background

Since the relative areas are calculated, area(E)/area(D) applying an
affine transformation to the picture will not change the result.


Demo1:

urlwrite('http://integraali.com/stuff/kuvioD.png','kuva.png')
area_pix('picture.png')

Demo2:

t=linspace(0,2*pi,100);
x=cos(t).^3;
y=sin(t).^3;
h=figure;
plot(x,y,'k')
hold on
axis([-10 10 -10 10])
g=ginput(1);
a=g(1)+cos(t);
b=g(2)+sin(t);
plot(a,b,'k')
axis equal
box off
axis off
%edit the picture with Paint and apply Demo1

引用格式

juhisteri (2024). area_pix(picture_filename) (https://www.mathworks.com/matlabcentral/fileexchange/62210-area_pix-picture_filename), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2012b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Read, Write, and Modify Image 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Corrected some mistakes.

1.0.0.0