Total Number of pixels in an image : <p>How to get the total number of pixel in an image (785x728) image. I have applied loops here and it is taking lot of time. Any easy way</p>

<pre><code>for i=1:height
    for j=1:width
        for d=1:colorChannel
            value = double(rgbImage(i,j,d));
            display(i);
            totalSum = totalSum + value;
            display(totalSum);
        end

    end

end
</code></pre>
