========================================================== ======
Copyright: bear does not go to the lab csdn blog
========================================================== ======
Working principle: Game render
This effect has been seen in the switching scenario of gash 4, and the motion blur of speed 12 also has this feeling.
PS is called radial fuzzy-> scaling, and a radial fuzzy-> rotation.
Scaling principle:
Determine a central point (such as 0.5, 0.5), connect to the current pixel, take the current pixel as the center, sample nearby pixels online, and take the average value at last.
Similarly, the rotation principle is similar, that is, the mean in a certain area with the same radius.
The radius and angle of the image are changed during scaling and rotation.
Using opencv
Source image:
Radial Blur-> Scaling:
# Include <math. h> # include <opencv/cv. h> # include <opencv/highgui. h> using namespace CV; using namespace STD; int num = 40; // num: Mean strength; int main () {mat src = imread ("D:/test3.jpg ", 1); MAT src1u [3]; split (SRC, src1u); int width = SRC. cols; int heigh = SRC. rows; mat img; SRC. copyto (IMG); Point Center (width/2, heigh/2); For (INT y = 0; y
Radial Blur-> Rotation:
# Include <math. h> # include <opencv/cv. h> # include <opencv/highgui. h> using namespace CV; using namespace STD; int num = 20; // mean strength; int main () {mat src = imread ("D:/test3.jpg", 1 ); mat src1u [3]; split (SRC, src1u); int width = SRC. cols; int heigh = SRC. rows; mat img; SRC. copyto (IMG); Point Center (width/2, heigh/2); For (INT y = 0; y
Principle reference:
Http://blog.csdn.net/xoyojank/article/details/5146297
Http://bbs.9ria.com/thread-111831-1-1.html