File Exchange

image thumbnail


version (563 Bytes) by Morteza Hajitabar Firuzjaei
Image Variance Calculation

1 Download

Updated 10 Feb 2018

From GitHub

View license on GitHub

Image Variance Calculation
Calculates variance of each Block of a image
Morteza Hajitabar Firuzjaei
Senior Computer Programmer

Cite As

Morteza Hajitabar Firuzjaei (2021). MortezaHajitabarFiruzjaei/ImageVariance (, GitHub. Retrieved .

Comments and Ratings (1)

Stephen Cobeldick

A simple script, which reads an image and basically does this:

blockproc(I, blockSize, @(s)var(double(

The author does not explain why anyone needs to download this script when that one line does everything already.

Some points reduce my rating:

* Should be written as a function, not a script.

* Should not use hard-coded filenames (function inputs are better: the best would be to accept an image as the input).

* Should not use hard-coded block sizes (function inputs are better).

* Remove the superfluous intermediate variables.

* The code requires comments, explanations, links, examples, demos, etc. as required. All beginners eventually need to learn to add useful information to their code so that people know what it does. Currently this submission has no code comments, explanation, demo, or help text (apart from this "Morteza Hajitabar Firuzjaei, Senior Computer Programmer").

* Do not put CLOSE ALL, CLEAR ALL, CLC at the top of the script. Why does this script have to close all of my figures? Why does it have to delete all of my unrelated data? Why does it have to clear my command window? What does this have to do with the functionality of this submission? While these commands might be handy when playing around, they are totally irrelevant in this situation, so why put them into this file? The only reason beginners put those commands into every file is because of this:


Summary: Currently not very useful, unless you want all of your variables deleted.

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!