필터 지우기
필터 지우기

How to remove white background from image

조회 수: 13 (최근 30일)
Fateme Jalali
Fateme Jalali 2016년 7월 28일
편집: Image Analyst 2016년 7월 28일
Hello,I want to know how to remove white background completely from this image.what is the way?

채택된 답변

Image Analyst
Image Analyst 2016년 7월 28일
편집: Image Analyst 2016년 7월 28일
I'd use min() to get the min in all three color channels. Then use bwareafilt() to get just the largest blob. This will be the rectangle. You can use find to find the first and last row and column and finally crop the image, something like this untested code.
grayImage = min(rgbImage, [], 3);
binaryImage = grayImage < 200;
binaryImage = bwareafilt(binaryImage, 1);
[rows, columns] = find(binaryImage);
row1 = min(rows);
row2 = max(rows);
col1 = min(columns);
col2 = max(columns);
% Crop
croppedImage = rgbImage(row1:row2, col1:col2, :);

추가 답변 (1개)

Stalin Samuel
Stalin Samuel 2016년 7월 28일
refer here for related discussions

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by