In this article we will see how we can get the mean value of image in mahotas. Mean value is the sum of pixel values divided by the total number of pixel values.
Pixel Values Each of the pixels that represents an image stored inside a computer has a pixel value which describes how bright that pixel is, and/or what color it should be. In the simplest case of binary images, the pixel value is a 1-bit number indicating either foreground or background.
Mean is most basic of all statistical measure. Means are often used in geometry and analysis; a wide range of means have been developed for these purposes. In contest of image processing filtering using mean is classified as spatial filtering and used for noise reduction.
In order to do this we will use
Syntax : img.mean()
Argument : It takes no argument
Return : It returns float32
Here img is the image loaded using mahotas, which can be donw with the help of
Note : The image should be filtered before getting mean because it can calculate for one channel at one time
Example 1 :
Mean Value for 0 channel : 129.05525723083971
Example 2 :
Mean Value for 0 channel : 27.490094866071427
Note : For each channel there are different mean value and mean can be a good option to set the threshold value for an image.
- Mahotas - Getting Bounding Boxes of Labelled Image
- Mahotas - Getting Image Moments
- Mahotas - Labelled Image from the Normal Image
- Mahotas - Reconstructing image from transformed Daubechies wavelet image
- Mahotas - Mean filter
- Mahotas - Getting Labeled Max Array
- Mahotas - Getting Border of label at given region
- Mahotas - Getting Border of labels
- Mahotas - Getting SURF Integral
- Mahotas - Getting SURF Dense Points
- Mahotas – Getting Infocusness of each pixel
- Mahotas – Getting Disk Structuring Element of given radius
- Mahotas - Element Structure for Eroding Image
- Mahotas - Dilating Image
- Mahotas - Eroding Image
- Mahotas - Opening Process on Image
- Mahotas - Element Structure for Dilating Image
- Labeled Image Function in Python Mahotas
- Loading Image using Mahotas - Python
- Mahotas - Transforming image using Daubechies wavelet
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.