Binary image conversion from real image

3 ビュー (過去 30 日間)
Turbulence Analysis
Turbulence Analysis 2020 年 12 月 15 日
コメント済み: Turbulence Analysis 2020 年 12 月 16 日
Hi,
I intend to obtain the binary image. The intensity values of real image (varies from 0 to 4096) stored in the matrix, let's say 'h' . I tried to obtain the binarized images with the follwoing code, but I got some wierd image.. Do I need to play with the thresold ??.. In my binarized image, I am seeing any subject, instead it's just blank / white image..
BW = imbinarize(h,'global');
imshow (BW);

採用された回答

Subhadeep Koley
Subhadeep Koley 2020 年 12 月 16 日
Hi, imbinarize expects pixel values of data type double and single to be in the range [0, 1]. We should use the rescale function to adjust pixel values to the expected range.
% Load the original image
load h.mat
% Rescale "h" to adjust its pixel values in [0,1]
h = rescale(h);
% Binarize "h"
BW = imbinarize(h, 'global');
% Visualize results
figure
imagesc([h,BW])
axis image off
title("Original Image | Binarized Image")
  1 件のコメント
Turbulence Analysis
Turbulence Analysis 2020 年 12 月 16 日
Thanks, It serves the purpose..

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

その他の回答 (1 件)

Matt Gaidica
Matt Gaidica 2020 年 12 月 16 日
Are you perhaps looking for:
BW = im2bw(h);

Community Treasure Hunt

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

Start Hunting!

Translated by