Skip to content

Conversation

@zhou-chao
Copy link
Contributor

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.

@vpisarev
Copy link
Contributor

vpisarev commented Nov 3, 2015

@mshabunin, don't we have weighted median filter already in opencv?

@vpisarev
Copy link
Contributor

@mshabunin, any updates?

Copy link
Contributor

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.

Copy link
Contributor

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.

@mshabunin
Copy link
Contributor

@zhou-chao , please fix merge conflicts.

@vpisarev , we have median filter, but WMF is different.

@vpisarev
Copy link
Contributor

@mshabunin, ah, ok then

@zhou-chao
Copy link
Contributor Author

@mshabunin Updated and thanks!

Copy link
Contributor

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.

@mshabunin
Copy link
Contributor

@zhou-chao , looks good, thank you! Please squash commits into one and we will merge it.

@zhou-chao
Copy link
Contributor Author

Is this the right way to squash the commits? @mshabunin

@mshabunin
Copy link
Contributor

Actually not, after squash you will get only one united commit instead of four: master...mshabunin:wmfv3

@zhou-chao
Copy link
Contributor Author

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?

@mshabunin
Copy link
Contributor

# 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

@zhou-chao
Copy link
Contributor Author

Thanks a lot! @mshabunin

@mshabunin
Copy link
Contributor

👍

@opencv-pushbot opencv-pushbot merged commit 8837948 into opencv:master Feb 15, 2016
opencv-pushbot pushed a commit that referenced this pull request Feb 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants