-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add weighted median filter #375
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
Conversation
|
@mshabunin, don't we have weighted median filter already in opencv? |
|
@mshabunin, any updates? |
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.
This memory should be freed.
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.
It will be easier to avoid such errors with cv::AutoBuffer for 1D arrays and cv::Mat for 2D arrays.
|
@zhou-chao , please fix merge conflicts. @vpisarev , we have median filter, but WMF is different. |
|
@mshabunin, ah, ok then |
|
@mshabunin Updated and thanks! |
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 guess using cv::ximgproc; will be enough.
|
@zhou-chao , looks good, thank you! Please squash commits into one and we will merge it. |
|
Is this the right way to squash the commits? @mshabunin |
|
Actually not, after squash you will get only one united commit instead of four: master...mshabunin:wmfv3 |
|
It seems I screwed things up, XD. I had synced with the upstream between my commits, and I squashed them all into one. Any way to rescue? |
# assuming upstream=github.com/Itseez/opencv_contrib
git fetch upstream master
git checkout upstream/master -B wmfv3
git pull https://github.com/mshabunin/opencv_contrib.git wmfv3 |
|
Thanks a lot! @mshabunin |
|
👍 |
Weighted median filter is widely used in various Computer Vision tasks, such as dense correspondence estimation, structure-texture separation and artifact removal. OpenCV has no very good implementation of this filter yet.
What we provide here is an amazingly efficient implementation of weighted median filter considering both varying weights and order statistics. Our method was published in CVPR 2014 with a lot positive comments [1]. With several new data structures and algorithm modifications, it is 100+ times faster than the straightforward implementation while not sacrificing any accuracy and result quality. For QVGA size images, the performance is near realtime (~ 28 fps).
For examples and detailed description, please visit http://www.cse.cuhk.edu.hk/leojia/projects/fastwmedian/index.htm.
[1] Zhang Qi, Li Xu, and Jiaya Jia. "100+ times faster weighted median filter (WMF)." In Computer Vision and Pattern Recognition (CVPR), 2014 IEEE Conference on, pp. 2830-2837. IEEE, 2014.