Clear Filters
Clear Filters

Count of total pixels and dimensions(rows and columns) of a picture?

8 views (last 30 days)
How do I obtain the number of pixels and the dimensions of this picture?

Accepted Answer

Davide Masiello
Davide Masiello on 16 Mar 2022
Edited: Davide Masiello on 16 Mar 2022
grayImage = imread('retina.jpg');
numberOfPixels = numel(grayImage)
numberOfPixels = 1879445
[rows,cols] = size(grayImage)
rows = 1357
cols = 1385

More Answers (0)

Categories

Find more on Read, Write, and Modify Image 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!