フィルターのクリア

How to preprocess this image.?

4 ビュー (過去 30 日間)
Karthik K
Karthik K 2019 年 3 月 28 日
移動済み: Rik 2022 年 12 月 30 日
Hello. I am preprocessing the image using convexhull method. Initial and intermediate methods are fine. The last method in displaying preprocessing image I am not getting the required display. I need only the rounded coins to get displayed at the end of preprocessed image without any black pixels. But it is displaying only with white pixel values. Pixel vales are copied properly from the original image(I) to preprocessed Image(PI). I am executing with the following code.
clc;clear;
subplot(2,3,1);
I = imread('coins.png');
imshow(I);
title('Original');
subplot(2,3,2);
BW = imbinarize(I);
imshow(BW);
title('Binary');
subplot(2,3,3);
CH = bwconvhull(BW);
imshow(CH);
title('Union Convex Hull');
subplot(2,3,4);
CH_objects = bwconvhull(BW,'objects');
imshow(CH_objects);
title('Objects Convex Hull');
for a=1:size(I,1)
for b=1:size(I,2)
if(CH_objects(a,b)==0)
PI(a,b)=1;
else
PI(a,b)=I(a,b);
end
end
end
subplot(2,3,5);
imshow(PI);
title('Preprocessed Image');
  1 件のコメント
S WASIQUE ALI
S WASIQUE ALI 2022 年 5 月 6 日
移動済み: Rik 2022 年 12 月 30 日
I want to process the backround and foreground separately. For background i want to threshold the Intensity value Intensity value <1 to be zero and rest of the Intensity value should remain unaltered. please help me out with some code

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

採用された回答

Catalytic
Catalytic 2019 年 3 月 28 日
編集済み: Catalytic 2019 年 3 月 28 日
PI=I;
PI(~CH_objects)=255;
imshow(PI);
title('Preprocessed Image');
Capture.PNG
  1 件のコメント
Karthik K
Karthik K 2019 年 3 月 28 日
Good. Thank You So Much.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Image Processing Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by