作为序言:这是我的第一个问题 – 我尽力使其尽可能明确,但如果不符合要求的标准我会道歉.
作为夏季项目的一部分,我正在拍摄一张在冰晶中生长的内部融化图像的延时图像.对于这些图像中的每一个,我想测量所形成的图形的周长和面积.以下链接是我的一张图片的示例:
我正在尝试使用的方法如下:
>加载图像,裁剪并转换为灰度
>减少噪音的过程
>找到边缘/周长
>尝试连接边缘
>用白色填充周长
>使用regionprops测量面积和周长
这是我正在使用的代码:
clear; close all;
% load image and convert to grayscale
tyrgb = imread('TyndallTest.jpg');
ty = rgb2gray(tyrgb);
figure; imshow(ty)
% apply a weiner filter to remove noise.
% N is a measure of the window size for detecting coherent features
N=20;
tywf = wiener2(ty,[N,N]);
tywf = tywf(N:end-N,N:end-N);
% rescale the image adaptively to enhance contrast without enhancing noise
tywfb = adapthisteq(tywf);
% apply a canny edge detection
tyedb = edge(ty