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!