Effacer les filtres
Effacer les filtres

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

8 vues (au cours des 30 derniers jours)
How do I obtain the number of pixels and the dimensions of this picture?

Réponse acceptée

Davide Masiello
Davide Masiello le 16 Mar 2022
Modifié(e) : Davide Masiello le 16 Mar 2022
grayImage = imread('retina.jpg');
numberOfPixels = numel(grayImage)
numberOfPixels = 1879445
[rows,cols] = size(grayImage)
rows = 1357
cols = 1385
  3 commentaires
Image Analyst
Image Analyst le 16 Mar 2022
image is a built-in function. It's best to choose another name, like grayImage.
Davide Masiello
Davide Masiello le 16 Mar 2022
@Image Analyst thanks! I changed it.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Read, Write, and Modify Image dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by