180 likes | 332 Views
Generalized Hough Transform. Correlation as a base of Generalized Hough Transform. Correlation In order to match a part of a model to a whole , we can use correlation to find the optimal aligning transformation:. Calculating Correlation.
E N D
Correlation as a base of Generalized Hough Transform Correlation In order to matcha part of a model to a whole, we can use correlation to find the optimal aligning transformation:
Calculating Correlation For each translation, compute the correlation between the target and the translated query:
Calculating Correlation For each translation, compute the correlation between the target and the translated query:
Calculating Correlation For each translation, compute the correlation between the target and the translated query:
Calculating Correlation For each translation, compute the correlation between the target and the translated query:
Calculating Correlation For each translation, compute the correlation between the target and the translated query:
Best match in Correlation For each translation, compute the correlation between the target and the translated query: Best match
Accumulator Space for Correlation Accumulator space like in Hough For each translation, compute the correlation between the target and the translated query:
Complexity of calculating Correlation Complexity for binary n * n grids with O(n) non-zero points: • Brute Force: O(n4) – for each of O(n2) translations, compute the O(n2) dot product.
Complexity of calculating Correlation Complexity for binary nxn grids with O(n) non-zero points: • Brute Force: O(n4) – for each of O(n2) translations, compute the O(n2) dot product. • Fast Integration: O(n3) – for each of O(n2) translations, compute the O(n) dot product.
Complexity of calculating Correlation Complexity for binary nxn grids with O(n) non-zero points: • Brute Force: O(n4) – for each of O(n2) translations, compute the O(n2) dot product. • Fast Integration: O(n3) – for each of O(n2) translations, compute the O(n) dot product. • Fourier: O(n2logn) – compute the FFT, multiply frequency components, compute the IFFT.
Correlation as Voting The value of the correlation at the point (x0,y0) is: This can be understood in two ways: • g(x-x0, y-y0) is the function g(x, y) translated by (x0,y0) • g(x-x0, y-y0) is the function g(x0, y0) translated by (x,y) andflipped about the origin
Correlation as Voting In the second approach, we treat the pixels as bins and for every possible translation (x,y), we do the following: • Translate g by (x,y) • Flip g • Scale by the value f(x,y) • Update the values of all the bins by the values of the transformed g.
Generalized Hough Transform Correlation as Voting
Complexity of Correlation Complexity for binary n * ngrids with O(n) non-zero points: • Brute Force: O(n4) – for each of O(n2) translations, compute the O(n2) dot product. • Fast Integration: O(n3) – for each of O(n2) translations, compute the O(n) dot product. • Fourier: O(n2logn) – compute the FFT, multiply frequency components, compute the IFFT. • Fast Voting: O(n2) – for each of O(n) points on the boundary, cast O(n) votes.
The main idea of a Generalized Hough Transform When we compute the correlation by voting, we spend most of the time casting bad votes. Use extra shape information (e.g. gradients) to cast fewer votes: • O(n) complexity: For each of O(n) points on the boundary, cast O(1) votes.