# how do I classify image based on smoothness and high frequency?

3 ビュー (過去 30 日間)
nadia naji 2021 年 4 月 19 日

Hello,
I have some blocks of image and I need to find out the block is smooth or is full of edge, but I really do not know how I can do this. could you please help me with this issue or introduce me to a link or tutorial for this? does matlab have any function for this? thank you.
##### 3 件のコメント表示非表示 2 件の古いコメント
Bjorn Gustavsson 2021 年 4 月 19 日
@Jonas: Nah, no need to, it is a worthwhile suggestion. There are more steps towards a complete answer to this question, my suggestion is a "better step" - but more steps might be necessary - std of the laplacian, entropy of the laplacian etc...

サインインしてコメントする。

### 回答 (2 件)

Bjorn Gustavsson 2021 年 4 月 19 日
For measure of smoothness I'd go with something like this:
d2I = del2(I); % laplacian of your image (grayscale, double).
From there we could do many calculations of the statistics of the second-derivative-variations:
avg_d2I = mean(d2I(:));
avg_d2I2 = mean(d2I(:).^2);
std_d2I = std(d2I(:));
Just to mention a couple. You have to judge what values correspond to smooth and non-smooth in your data. You could also look at the gradients instead of the laplacian, but you can to doodle with that in the same way as I've sketched here...
HTH
##### 0 件のコメント表示非表示 -1 件の古いコメント

サインインしてコメントする。

Image Analyst 2021 年 4 月 19 日
nadia, you forgot to post the image. We don't know what it looks like, or how big the blocks are relative to the total image size. Please post the image in your original post.
In the meantime, I suggest you try sdtfilt() and take the mean and see if that works for you.
sdImage = stdfilt(grayImage, true(5));
smoothnessMetric = mean2(sdImage)
If it doesn't work well for you, then we can discuss other metrics, after we see the image(s).

サインインしてコメントする。

R2016a

### Community Treasure Hunt

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

Start Hunting!

Translated by