Ex2 Question 1 b)

Moderator: Computer Vision

Ondori
Mausschubser
Beiträge: 89
Registriert: 28. Okt 2006 19:50

Ex2 Question 1 b)

I'm not really sure what the output of dxdy_hist should be.

Does a 2d histogramm of the derivatives mean to look at every pixel and the corresponding dx and dy values and then decide in which interval (bin) they separately belong? After that do you increase the value in a num_bins*num_bins matrix at that point (bin_value dx, bin_value dy)?

Then the histogramm would show the frequency of (dx, dy)-pairs, wouldn't it?
And the output would be a num_bins^2 matrix, but shouldn't it be then displayed in a 3d-plot (dx, dy and frequency)?

diane
Windoof-User
Beiträge: 25
Registriert: 21. Jun 2009 17:33

Re: Ex2 Question 1 b)

I think you fully understood what kind of information the dxdy histogram should encode.
The dx and dy values of each pixel are computed, and each pixel increment (+1) the corresponding (bin_value dx, bin_value dy) value in a 2D histogram whose size is num_bins*num_bins.

There is one small missing step. All images are assumed to be represented by a 1D representation vector (see slide 16 of the corresponding lecture). So even when we consider color histograms (3D by definition) or histograms of derivatives (2D by definition) we expect to build a final 1D histogram, by concatenating the vectors of the different dimensions.

Hint: look at the comments h(:) or reshape(h,.....)

Pavel
Windoof-User
Beiträge: 37
Registriert: 21. Okt 2006 23:42

Re: Ex2 Question 1 b)

so, just to be clear; the output vector is supposed always to be 1xN?

and the input for 1b is still not clear to me:
in the exercise sheet you say rgb_hist takes rgb images with values from [0,255], which should refer to slide 18.(that suggests a 3D histogram btw)
rg_hist similary is supposed to tage a rg image with values [0,1], which should refer to slide 21.

In the code on the other hand both functions get the same image and the comment says that one is supposed to return a normalized histogram while the other is not. Which is the correct formulation?

andy-held
Windoof-User
Beiträge: 27
Registriert: 8. Feb 2007 15:22
Kontaktdaten:

Re: Ex2 Question 1 b)

And what is it about the gaussian filter?
I assume we should use gaussian derivation?
Woran faileds denn?

Christoph Vogel
Erstie
Beiträge: 20
Registriert: 30. Mär 2010 17:38

Re: Ex2 Question 1 b)

Please use a gaussian filter. Use a standard deviation of 6, as written in the exercise description.

diane
Windoof-User
Beiträge: 25
Registriert: 21. Jun 2009 17:33

Re: Ex2 Question 1 b)

@Pavel: the output is a vector which size is N, N*N or N*N*N, depending how the N=nb_bins value is used.
But in principle yes, it is a 1D vector, for all cases.
All histograms need to be normalized.

@andy-held: As stated in the lecture's slides, gaussian derivative filters should be used (both directions).

schwanal
Erstie
Beiträge: 20
Registriert: 5. Mai 2010 12:56

Re: Ex2 Question 1 b)

i dont really get what we are doing there..

if i understand the excercise rgb_hist correctly, we create an 256/256/256 array where we save all RGB intensity values in. then we normalize the values to 255 so fas so clear but then we reshape it to a 1d vektor what size has to be 256^3... and then we create the classes and classify them?? in my opinion i see no sense what we do there and why we do this and i cannot find a slide of the lecture where we refer to this method?

Christoph Vogel
Erstie
Beiträge: 20
Registriert: 30. Mär 2010 17:38

Re: Ex2 Question 1 b)

As Diane said the output should be a vector. In case of the rgb-histogram we want N bins per color channel. That leaves you with N^3 bins in total and a histogram-vector of exactly that size. The color values are quantized in bins, for instance one bin contains the amount of pixel with values between (0-25,0-25,0-25), another bin collects the amount of pixel between (26-50,0-25,0-25) and so on.
Now two images can be compared by using the histogram distance functions of exercise 1c, applied on the histograms of the images.