-
Notifications
You must be signed in to change notification settings - Fork 110
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
Fixed incorrect implmentation of image/conv2 and dsp/conv, hardwired network for p_median3x3_f32 #100
Conversation
QuickSelect method for finding median
It seems that the median function (in math) is implemented incorrectly as the function doesn’t even use the sorted array! (I fixed it just to show the correct implementation) . Any way I replaced it with QuickSelect method instead which is much faster than current method (unnecessarily sorting all elements to find the element in the middle). For 3×3 median filter (image) I replaced it with hardwired median search described here : Codes are in public domain and are taken from here : |
…n) memory addresses in computation
Counter example for each fix is provided using Matlab code (I used FreeMat available here http://freemat.sourceforge.net/ to try them ) image/conv2: returns incorrect values as it doesn't flip the kernel in vertical and horizontal directions, I fixed this major problem and added support for rectangular kernels too. dsp/conv : this function also doesn't work correctly as it returns an extra item in the beginning of the output and in addition uses uninitialised memory addresses to compute the final result (assumes these memory addresses are zero) |
Signed-off-by: Hamid Ebadi <[email protected]>
See the new pull here : #148 |
The array is sorted but not used at all, the median function must take the element in the middle of the sorted array.