필터 지우기
필터 지우기

How can I crop a picture automatically to get exactly only the Rubik's cube, despite its location or proximity in the image? I am using MATLAB. My aim is to click the picture

조회 수: 1 (최근 30일)

답변 (1개)

Image Analyst
Image Analyst 2022년 10월 17일
What I'd do is to convert to hsv color space, threshold on the S channel, fill regions, then take the convex hull of the region(s) then take the largest single blob. Something like
hsvImage = rgb2hsv(rgbImage);
sImage = hsvImage(:, :, 2);
mask = sImage > 0.25;
mask = imfill(mask, 'holes');
mask = bwconvhull(mask, 'objects');
mask = bwareafilt(mask, 1);

카테고리

Help CenterFile Exchange에서 Rubik's Cube에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by