画像の関心領域部分を選択し、一定の輝度値以上の面積と水平面からの傾きを求める方法はありますか?
4 views (last 30 days)
Show older comments
Naoki Hashiguchi
on 27 Oct 2022
Commented: Naoki Hashiguchi
on 1 Nov 2022

この液滴内部に含まれる粒子の面積,水平面からの傾きを求める方法を教えて頂きたいです.
0 Comments
Accepted Answer
Hernia Baby
on 27 Oct 2022
Edited: Hernia Baby
on 31 Oct 2022
clear,clc;
I = imread('image.bmp');
I = imcrop(I,[150 175 300 inf]);
輝度で物体を白抜きしてみます
idx = I < 50;
I(idx) = uint8(255);
imshow(I)
白抜きの部分は以下の通りです。
I_sum = sum(idx,"all")
角度については少し自信ありません…
物体の各座標最大(いちばん下&いちばん右)
[r,c] = find(idx);
T = [r c];
[~,idx1]=max(T)
T1 = [T(idx1,:), zeros(2,1)]
theta = rad2deg(subspace([1,0,0]',diff(T1)'))
4 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!