-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gabor filter #28
base: master
Are you sure you want to change the base?
Gabor filter #28
Conversation
We first extract some information from the image - width, height etc., convert to luma and compute gradients. Then, for each pixel (x,y), we compute rho = xcos(theta) + ysin(theta). After a few more transformations and finding the bins with highest values, we generate the resulting image.
Preliminary Hough transform implementation
It is used to improve contrast in images and works by performing enhancement on small 'contextual' regions or neighborhood of each pixel in the given image.
Adaptive Histogram Equalization
Laplacian filter
Fix the horizontal kernel of Sobel filter.
* Mean filter version 1
|
||
gaborfn | ||
:: (RealFloat p, Fractional p) => p -> p -> p -> p -> p -> p -> p -> Complex p | ||
gaborfn λ θ ψ σ γ x y = exp ( (-0.5) * ((x'^2 + γ^2*y'^2) / (σ^2)) :+ 0) * exp ( 0 :+ (2*pi*(x'/λ+ψ)) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(2*pi*(x'/λ+ψ))
, that's incorrect, should be (2*pi*x'/λ+ψ)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great, you copy pasted it from Wikipedia, even managed to copy it with an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very sorry sir, will correct that. I was unaware of the exact formula and found the haskell version on wiki. Will correct it.
θ = pi | ||
ψ = 0 | ||
σ = 4.0 | ||
γ = 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did you come up with all these values? They are already supplied as arguments.
gaborFilter :: (Array arr cs e, Array arr X e, Floating e, Fractional e) => | ||
Border (Pixel cs e) -- ^ Border resolution technique. | ||
-> Filter arr cs e | ||
gaborFilter !border = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am really confused by this implementation. I might be wrong, but isn't the gabor filter, after getting created with gaborfn
, supposed to be used simply as a convolution kernel? Could you give me a reference to the source you are using for this implementation, besides the wikipedia one of course. In fact it be nice if you could include all source you use for all algorithms, if not in source code at least in the PR.
Just by looking at the code it seems as if you are assuming that gabor kernel is separable, which I think is a mistake, so please correct me if I am wrong.
A partial pure implementation of Gabor filter. A few changes yet to be made before producing sample outputs.