how to detect only object without background?
조회 수: 2 (최근 30일)
이전 댓글 표시
댓글 수: 2
Guillaume
2020년 2월 2일
You'll get more chance of getting help if you actually write words to explain what you want.
As it is,we just have a question title with no definition of what's an object (the foot? the white dots?) or what's background (the black bit).
채택된 답변
Image Analyst
2020년 2월 2일
Find out where all color channels are darker than some threshold, then and the masks and take the largest blob
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Threshold to create mask for each channel.
threshold = 20; % Whatever...
mask = (redChannel < threshold) & (greenChannel < threshold) & (blueChannel < threshold);
backgroundMask = bwareafilt(mask, 1); % Take largest blob
footMask = ~backgroundMask; % The inverse of the background mask.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!