Seite **1** von **1**

### Ex2 Question 1 b)

Verfasst: **12. Mai 2010 19:22**

von **Ondori**

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)?

Thanks for your help.

### Re: Ex2 Question 1 b)

Verfasst: **13. Mai 2010 12:39**

von **diane**

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,.....)

### Re: Ex2 Question 1 b)

Verfasst: **13. Mai 2010 15:31**

von **Pavel**

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?

### Re: Ex2 Question 1 b)

Verfasst: **16. Mai 2010 16:31**

von **andy-held**

And what is it about the gaussian filter?

I assume we should use gaussian derivation?

### Re: Ex2 Question 1 b)

Verfasst: **17. Mai 2010 11:14**

von **Christoph Vogel**

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

### Re: Ex2 Question 1 b)

Verfasst: **17. Mai 2010 11:16**

von **diane**

@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).

### Re: Ex2 Question 1 b)

Verfasst: **17. Mai 2010 23:56**

von **schwanal**

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?

### Re: Ex2 Question 1 b)

Verfasst: **18. Mai 2010 10:27**

von **Christoph Vogel**

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.