How to process the image in parts
Show older comments
I'm working with object detection, but my object of interest is too small. I would like to split my image into parts and process each part of the image automatically.
Here's an example:

My code below:
clear, clc, close all;
load('Detector.mat');
I = imread('fotos/foto (15).jpg');
[bboxes, scores] = detect(detector,I);
for i = 1:length(scores)
annotation = sprintf('Soja = %.1f',scores(i));
I = insertObjectAnnotation(I,'rectangle',bboxes(i,:),annotation);
end
figure
imshow(I)
title(size(bboxes,1))
'Detector.mat' is also archived.
I would like you to help me.
3 Comments
Benjamin Thompson
on 2 Feb 2022
Images are just matrices, so you can use colon notation to copy a part of the matrix:
>> A = imread('image.bmp');
>> size(A)
ans =
3067 1540 3
>> A1 = A(1:500,1:500,:);
>> figure, imshow(A1)
Guilherme Franklin
on 2 Feb 2022
Guilherme Franklin
on 2 Feb 2022
Accepted Answer
More Answers (0)
Categories
Find more on Image Category Classification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!