-
Notifications
You must be signed in to change notification settings - Fork 164
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
Improve kernel generation for Sobel operator #600
base: develop
Are you sure you want to change the base?
Conversation
Improved comments and some other things Applied adviced changes Applied adviced changes Should handle grayscale dilation/erosion Checking
…e/Sobel_kernel_generation
Check build Check build Check build 5 5 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 7 7 7 8 test separate x and separate y 9 check smoothing part check partial smoothing check smoothing stage 1 Check smoothing stage 2 resume stuck build check build 1 1
Codecov Report
@@ Coverage Diff @@
## develop #600 +/- ##
===========================================
+ Coverage 78.72% 79.41% +0.69%
===========================================
Files 118 118
Lines 5034 5199 +165
===========================================
+ Hits 3963 4129 +166
+ Misses 1071 1070 -1 |
Hi @meshtag, But I also wonder why only However, I might be missing something, if that's the case, please correct me. |
Hi @Harsh-4 , |
Thanks for taking out the time, @meshtag
Yes that is a sound argument and might be the reason why Thus, modification or an entirely different specialization (as interface of std containers like And honestly, I had no idea when I saw your message (on slack) that Other than that, thanks for explaining your thought process on this to me. |
Happy to explain! Thanks for your input :) |
Description
This pull request intends to extend support for Sobel kernel generation in Gil. It is an improvisation over #562 in terms of performance as well as feature completeness and follows a completely different approach. This API is constructed on top of already existing implementation of 2D convolution as suggested here by @simmplecoder and will hence benefit directly when improvements in 2D convolution are made during GSoC 2021.
Created API returns a Sobel kernel corresponding to user specified horizontal and vertical derivative for images. It also provides an option to specify the size of desired kernel. Generated kernels were verified with Opencv kernels. The script used for obtaining required Opencv kernels is :
The idea of repeated kernel convolution is well known but its implementation present here depends largely on my own intuition, hence I have tried to test it with as many random test cases as I could. This inevitably lead to a somewhat large test file. However, if the size of test file is unacceptably large, I can remove some tests and keep only the most complicated ones.
I have used Gil's
gray32f_view_t
for storing kernel data with the motive of avoiding dynamic memory allocation and using inbuiltconvolve2d()
function. One possible disadvantage that stems from this fact is that we cannot obtain kernels containing very large numbers since we do not have more than 32 bits to store them. One possible workaround is to use astd::array
for storing kernel data/numbers asfloat/double
and overloadconvolve2d()
for handlingstd::array
(perhaps this could be added in GSoC bucketlist for project 1?).The implementation is completely designed by me and possibly differs from those in other standard libraries such as OpenCv, Scikit, etc(I have not investigated them yet).
A schematic representation of the used workflow is attached here for the convenience of reviewer(s).
This is an experimental feature and I do not expect a quick merge (we can chose to bring it in after modifying
convolve2d()
as mentioned above).References
https://stackoverflow.com/a/10032882/14958679
#562 (comment)
Depends on #577
Tasklist