From: Sprinceana on
I'm trying to undersant how to compute values for the degree of blury of images.

I found two documents here:

http://lmgtfy.com/?q=detection+for+digital+images+using+wavelet+transform

First pdf

Then I found a document that explains the use of gaussians for first and second derivative.

http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MARBLE/low/edges/canny.htm


I've tried to implement those formulas step by step in a file called haar_wav:

% read and display rgb image
RGB = imread('102.jpg');
imshow(RGB);

% read and display grayscale image

GRAYSCALE = rgb2gray(RGB);
figure,imshow(GRAYSCALE);

% u(x) is the input of type Dirac
% creating a dirac it's 0 for every x=0 and Inf for every x=0


syms a; % to compute a value in an integral it must be declared as symbolic value
a = 5;

x=0:1:100; % 0-initial value, 1 step is increasing the initial value with 1 each time
% 100 is the final value

% equation that describes Dirac impulse

Y=(1/(a*sqrt(pi)))*exp(-x.^2/a^2);

figure, stem(Y) % plot the Dirac impulse each value of the Dirac impulse

% entry of type Dirac impulse property for dirac impulse

u(x) = int(dirac(x-a)*sin(x),-inf, inf);

r = sqrt(pow(x,2)+pow(y,2)) % r is a parameter that enters in the formula of luminance that I don't know how to implement

% defining luminance - here is the problem !!! (I(x) =f(x/r) how to add this formula in matlab)

% edge is modelled as a step function described by this formula

% A is unknown amplitude, B - pedestal offset

modelling_edge = A*u(x)+ B;

% focal_blur_of_edge =

I don't know two things:

A is undefined B is equal to what in the formula of lmgtfy (first pdf) ?

Another question must I defined luminance as I=f(x/r)
where r = sqrt(pow(x,2)+pow(y,2)).

But I don't know how to define I(x) =f(x/r) how I can add this formula to my code?

Thanks in advance for your help!

I attach here my full m file:

http://www.mediafire.com/?mej4mzm33t0


Please I need some guidance I'm sure that somebody experienced this problem in the past. I tried as you can see to start from 0 to implement for an image test called 102.jpg and I'm trying step by step to implement those formulas to obtain the value that represent how blury is my image (a statistical value).

And I have another question:

I must extract the edges using canny operator after applying function rgb2gray.

(this I know to do but just need a confirmation if I must display also the image using canny operator.)
From: Sprinceana on
After this line of code:

u(x) = int(dirac(x-a)*sin(x),-inf, inf);

Here are the equations added regarding the link provided with gaussians:

r = sqrt(pow(x,2)+pow(y,2)); % r is a parameter that enter in the luminance formula

fun_gauss = exp[-pow(r,2)/2*pow(sigma,2)]/2*pi*pow(sigma,2);

first_derivative = -r*exp[-pow(r,2)/2*pow(sigma,2)]/2*pi*pow(sigma,4);

second_derivative = -exp[-pow(r,2)/2*pow(sigma,2)]/2*pi*pow(sigma,4)*[1-(r*r/sigma*sigma)]


% then we implement luminance formula after defining r parameter

% I = f(x/r) how to implement this formula in matlab here is my problem!!!!

modelling_edge = A*u(x)+ B;

In have some questions again:

1)

What are the values for x and y that describes r as a circle equation of what I can see. How to set x and y in circle equation.

2)

Then sigma variable what value to assing to it?

3)

And how to explain luminance described by this formula:

I = f(x/r) (is in fact the question for my first post of this reply)

4) Is it good to apply a canny operator after I transformed my test image called 102.jpg into graysscale? (I know how to do this but need an answer of yes or no to add it to the code)
From: Sprinceana on
And after computing luminance I must follow the instructions from this link:

http://www.elderlab.yorku.ca/~elder/publications/journals/ElderPAMI98.pdf
From: Sprinceana on
Formule de luminance c'est I(x) = f(x/r) comment ecrire cette formule en matlab ?
From: Walter Roberson on
Sprinceana wrote:
> Formule de luminance c'est I(x) = f(x/r) comment ecrire cette formule en
> matlab ?

Have you considered using rgb2gray() ? Perhaps in combination with im2double() ?