How to process the image in parts

3 views (last 30 days)
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
Guilherme Franklin
Guilherme Franklin on 2 Feb 2022
We could keep in touch on whatsapp to talk about matlab, what do you think?
I am Brazilian.
My whatsapp number is: +5538998326580
Below is my contact link:
https://api.whatsapp.com/send?phone=5538998326580

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 2 Feb 2022
If your original image fits into memory, I see no reason why to split it into parts. Certainly a 3067 by 1540 by 3 image is not huge by any consideration. I'm not even sure how you would split it into parts if you can't fit it into memory with MATLAB. I guess you'd have to have some other program that would do that.
You know that even if you can't resolve details due to subsampling to fit onto the display, the underlying image will still have all the information, right? So why do you want to split it into parts?
  2 Comments
Image Analyst
Image Analyst on 2 Feb 2022
That doesn't make any sense. You can always zoom in with the axes toolbar. The problem with chopping your image into tiles is that each tile may now contain only part of a white ball, thus preventing you from getting an accurate measurement or detection of it. It may be a semicircle if it ends up being on the edge of a tile. Now you can't get an accurate diameter of it so you'll have to exclude it, thus getting rid of some of the balls when there is absolutely no reason to do so. What if you did chop it up into tiles? Then you'd have to have a number of axes, and since your original image it too big to fit on screen, you won't be able to see all the individual tiles simultaneously either. So then you're going to have to have some kind of program to bring the desired tile onto the screen and show it. It's just a lot of work for no benefit. Just do your image analysis and if you want to zoom in, use the axes toolbar to zoom and pan.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by