pixel wise calculation of mean and standard deviation in matlab - image

I have an image in MATLAB. How can I calculate mean and standard deviation for each pixel?

A one-line answer like your one-line question can be :
mean(TheImage(:))

Related

Calculate SNR in single image in MATLAB

I have this image:
I want to calculate SNR in it. For this i used code:
img=imread('noicy.JPG');
img=double(img(:));
ima=max(img(:));
imi=min(img(:));
ims=std(img(:));
snr=20*log10((ima-imi)./ims)
Is that correct code to calculate SNR?
The definition of SNR can be found here or here:
Both the standard and the industry definition can be used (10log(x) and 20log(x)). check this
now, the signal is equal to the mean of the pixel values (mean(img(:))) and the noise is the standard deviation or error value of the pixel values (std(img(:))).
You may use either the ratio or the SNR=10*log10(signal/noise) to express the result in decibel.

How to detect a line in image with a little noise?

I would like to ask for advice - what kind of algorithm should I use to auto-detect a line on the image?
Before: (from http://tinyurl.com/l6d5x9s)
I want to achieve this kind of result (from http://tinyurl.com/pnfaphv):
Thank you in advance for any help!
The easiest solution would be to look at the Hough transform. If you have a reasonably straight line, use a linear method. If your line is expected to be curved, use a circular method with large radii.
The Hough transform will not actually identify pixels in the line. It will just give you the position and angle of the line. It will also give you the thickness, if you threshold the result and measure the size of the point. Normally you do this anyway, using the centroid to find the actual centre of the line.
Gaussian blur, then adaptive thresholding and use canny edge.Might work

What is the base of the logarithm in Log Transformation in image processing?

I am reading gonzales image processing book and as you know the log transformation has been defined like the following in the book:
s = c*log(1+r)
Now I have one question:
Is the logarithm based on 10 or it is a natural logarithm which is based on napier number?
The log transform is used for dark pixels enhancement. The dark pixels in an image are expanded as compare to the higher pixel values. So the base can be any number depending on the visualization effect of image.
I think log10 is often used because it is related to the decibel scale in signal processing, such as what is used in signal to noise definition.
If this is log() from math.h, then it's the natural logarithm.
That is, it's base is e, which is approximately 2.71828.

Calculating image acutance

Is there a simple algorithm for calculating an acutance value (or sharpness) for a grayscale image?
As I understand it, the Accutance is the mean value of the Gradient Filter.
Example in Mathematica:
Relationship between brightness and the blurriness of an image
The question's title is confusing, but the answer answers this.

Wavelet based interpolation

How do I do Wavelet based interpolation (simple zero-padding scheme) in matlab?
I did wavedec2 on an image, and zeroize the vertical, horizontal and diagonal domains, interpolated the 4 domains to a larger size, but it did not outperform spatial based interpolators (bilinear, nearest, bicubic) as stated in several papers.
Please advise.
Thank you.
I'm not sure I understand your question but the Matlab Pyramid Toolbox and Peter Kovesi's computer vision/image process functions has a lot of wavelet functions that should probably do what you want.

Resources