Looking to identify a football from an image
11 次查看(过去 30 天)
显示 更早的评论
I currently have a still image of a football about to be kicked. I would like to identify the ball and it's center. 

0 个评论
回答(3 个)
Kevin Holly
2022-9-30
RGB = imread('YourImage.png');
% Convert RGB image to lab space
I = rgb2lab(RGB);
% Apply thresholds
BW = (I(:,:,1) >= 14.5 ) & (I(:,:,1) <= 89.77) & ...
(I(:,:,2) >= 0.12) & (I(:,:,2) <= 12.5) & ...
(I(:,:,3) >= 3.8) & (I(:,:,3) <= 33.0);
% Open mask
se = strel('disk', 13,0);
BW = imopen(BW, se);
% Filter out smaller objects
BW=bwareafilt(BW,[50000 Inf]);
% Find Centroid and Area of object
rp = regionprops(BW,"Centroid","Area")
% Display masked image for verfication purposes
maskedRGBImage = RGB;
maskedRGBImage(repmat(~BW,[1 1 3])) = 0;
imshow(maskedRGBImage)
% Add marker on centroid
hold on
scatter(rp.Centroid(1),rp.Centroid(2),'b','filled')
carol
2025-10-2,18:04
移动:Image Analyst
2025-10-3,14:26
From a still image, sometimes you can spot the brand and model by the pattern and logo on the ball. If the center is tricky, using image editing software to mark the exact midpoint can help. Have you tried zooming in or enhancing the contrast to see details more clearly? It might make identifying the exact type of ball easier
0 个评论
Image Analyst
2025-10-3,14:27
You can use transfer learning to identify footballs in a variety of images with a variety of colors, orientations, sizes, etc. See this answer:
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!