2020 09 01 Using other filtering methods to augment line direction - syntaxmonkey/Thesis GitHub Wiki
Using histogram of oriented gradients
This example has an interesting example. They create gradients and generate an image based on the directions of the gradient. The example utilizes 8 directions. Can we increase that to 72 directions. This would provide 5 degree buckets.
Try using OpenCV implementation of Structure Tensor:
Successfully get the method to run and able to test on our images.
The method returns two matrices: coherency and orientation. Not clear how to utilize the information in the matrices. Do we simply average the pixel values across each mask region?
Understanding Structure Tensor Eigenvectors and Eigenvalues
Not clear which components will produce the eigenvectors.
Another slide deck describing eigenvectors.
https://courses.cs.washington.edu/courses/cse455/09wi/Lects/lect6.pdf
More information on how to calculate the EigenVector: https://www.mathworks.com/matlabcentral/fileexchange/12362-structure-tensor-introduction-and-tutorial
Additional reading on constructing the eigenvectors: https://machinelearningmastery.com/introduction-to-eigendecomposition-eigenvalues-and-eigenvectors/
Calculating the direction.
Latex:
[u,v]\begin{bmatrix}
J11 & J12\\
J12 & J22
\end{bmatrix}
\begin{bmatrix}
u \\ v
\end{bmatrix}
\rightarrow
\begin{bmatrix}
u*J11 + v*J12 & u*J12+v*J22
\end{bmatrix}
\begin{bmatrix}
u \\ v
\end{bmatrix}
\rightarrow
\begin{bmatrix}
u*(u*J11 + v*J12) & v*(u*J12+v*J22)
\end{bmatrix}
Rules for rotating coordinates
In some cases, we have to rotate the coordinate system. Here is a site with several simple rotations: https://calcworkshop.com/transformations/rotation-rules/#:~:text=90%20Degree%20Rotation,y%20and%20make%20y%20negative.
Can now produce masked region of the original image
We can now produce masked region of the original image. This will be fed into Structure Tensor object to calculate the desired angle.
TODO: Will need to change the order of operations. Currently we shift the raster image after produce the angle and then generate the contour lines. We will need to shift the raster image and generate the angles before drawing the contour lines.