A
A
Andrei1penguin12020-11-08 01:09:47
Algorithms
Andrei1penguin1, 2020-11-08 01:09:47

How to count the histogram of an 8×8 cell?

Good day, let's say I have an 8×8 pixel image fragment, and a corresponding matrix filled with the brightness values ​​of each pixel
Let's have something like this for example:
10 20 30 40 50 60 70 80 90
15 25 35 45 55 65 75 85 95
100 110 120 130 140 150 160 170
115 125 135 145 155 165 185 185 185
180 160 120 100 80 60
215 185 165 145 105 85 65
80 70 60 40 40 20 10
85 75 65 55 45 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 25 15
I know how to find the direction of the gradient for the center pixels, for example for the pixel on the second line of the third column (35) the horizontal direction would be |25-45| = 20, and vertically |30-120| = 90
But the first thing I don't understand is how to find the direction for the extreme pixels, for example for the pixel of the first row of the first column (10)
I have a theory that the missing values ​​should be replaced with zero, and then we get the x direction: |0-20| = 0 and the y-direction is |0-15|=15
Although I'm not sure if this is the case
And I don't understand how to build a histogram for this 8 × 8 cell, in theory it should look like a vector (matrix 9×1) with dimension 9, that is, you need to find the values ​​​​and direction for 9 pixels (or take the average value and the direction of the pixels surrounding it), but I absolutely do not understand what specific pixels to take for a vector of 9 values
​​Simply put, it is not clear to me how to convert 64 pixels to 9.
As a result, I have two questions:
How to calculate the direction for the outermost pixels, and how to get the histogram of a cell (that is, compress 64 pixels into 9)
Help is greatly needed!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dmshar, 2020-11-08
@dmshar

Answered on another resource. See.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question