特定の範囲における二値化について(初心者です)
30 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
coco
el 17 de En. de 2021
Comentada: coco
el 24 de En. de 2021
二値化において、imbinarizeを用いているのですが、 イメージAの左半分の閾値を右半分の閾値よりも高く設定して二値化したいです。
そこで以下のような方法で行ってみたところエラーが出てしまいました。 改善点を教えて頂きたいです。 よろしくお願い致します。
binariA=imbinarize(A(:,1:end/2),ave*2)+ imbinarize(A(:,end/2:end),ave);
左半分の閾値を右半分の閾値の2倍にしてみました。
2 comentarios
Respuesta aceptada
Akira Agata
el 22 de En. de 2021
以下のような処理になるかと思いますが、いかがでしょう?
% グレースケール画像を準備
I = imread('cameraman.tif');
% 幅の半分、閾値1、閾値2を準備
wHalf = round(size(I,2)/2);
th1 = uint8(50);
th2 = uint8(150);
% 左半分と右半分を異なる閾値で2値化
BW = [I(:,1:wHalf)>th1, I(:,wHalf+1:end)>th2];
% 確認
figure
imshowpair(I,BW,'montage')
Más respuestas (0)
Ver también
Categorías
Más información sobre イメージ タイプの変換 en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!