Crashing on size(img)
Show older comments
I am having trouble calling the following code:
% Load image and convert image to array
img = imread(imgPath);
% Get the size of the image
imageSize = size(img);
It crashes at the second line, with the error:
Array indices must be positive integers or logical values.
imageSize = size(img);
I've tried checking the path is correct, it is.
I've tried isempty() on img, it's not
I've tried resaving the image to the project folder, it looks fine.
I've tried checking the format it's in, it's uint8
I've tried disp(img) and it says:
(:,:,1) =
Columns 1 through 23
208 209 210 212 213 214 214 214 213 213 213 214 214 214 215 215 217 217 217 217 217 217 217
... for many more lines
Please can someone tell me what I'm doing wrong
Accepted Answer
More Answers (0)
Categories
Find more on Color and Styling 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!