Resizing the image to 224*224 for resnet50
이전 댓글 표시
clc;
clear all;
close all;
path=dir('location');
n=length(path);
for i=3:n
str=path(i).name;
[p ,fname]=fileparts(str);
str=['location',str];
im=imread(str);
im=imresize(im,[224,224]);
im=im2gray(im);
% newmap = rgb2gray(map)
imwrite(im,strcat(fname,'.jpg'))
end
답변 (2개)
Aakash
2023년 6월 15일
0 개 추천
Ok so going by the tags associated with your question:
- Ensure images are present in the location folder.
- Modify the line str=['location',str] to str=['location/',str];
카테고리
도움말 센터 및 File Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!