What happens to image labels when I resize the image? Are labels also resized?
28 views (last 30 days)
Show older comments
Hi,
I have labelled images (mostly above 640x480) using MATLAB's Image Labeler App. Now for trying different deep learning architectures, I have to resize the images to a smaller dimesion (e.g., for alexnet, defult input image size is 227-by-227). My question is what happens to the labels when I resize (make small) the oringinal images? Are they also resized?
Thanks.
0 Comments
Answers (2)
Image Analyst
on 5 Aug 2021
Resizing a labeled image will not change the labels if you use the 'nearest' option
resizedImage = imresize(labeledImage, [227, 227], 'nearest');
0 Comments
Matt J
on 1 Aug 2021
Edited: Matt J
on 1 Aug 2021
If you are doing object classification, the labels are not images (they might be numeric scalars or string labels) so it is not clear what you mean by "resize" them. The answer is probably no, they are not resized and you shouldn't need to.
For semantic segmentation, the per-pixel labels do form an image so you would need to resize them, but alexnet is not the architecture you would use.
3 Comments
Matt J
on 3 Aug 2021
Edited: Matt J
on 3 Aug 2021
How is it that you have ROI labels if the entire image is intended to receive only a single classification label?
If you are classifying on a pixel-by-pixel basis (i.e., if this is semantic segmentation), then how were you able to adapt alexnet? Alexnet does not do pixel-by-pixel classification. It outputs a single classification label for the entire image. If you have a picture of a cat, then alexnet will output "cat" when working correctly. It is not intended to process ROIs or sub-regions of the image.
See Also
Categories
Find more on Image Data Workflows 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!