Principle:
Polar Coordinate is a constant representation of the object's field of view. For example, all squares are the same, resulting in a class of two-dimensional rotation and scale immutability.
ROV = m * log (SQRT (X2 + y2 ))
Phi = atan (y/X)
Core functions:
Cvlogpolar
Effect:
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/45/D3/wKiom1PsKpiwtjKEAADnFIOZh1M388.jpg "style =" float: none; "Title =" clipboard1.png "alt =" wkiom1pskpiwtjkeaadnfiozh1m388.jpg "/>
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/45/D4/wKioL1PsK7Hhq8QkAAFKAciw63g529.jpg "style =" float: none; "Title =" clipboard2.png "alt =" wkiol1psk7hhq8qkaafkaciw63g529.jpg "/>
Code:
# Include "CV. H "# include" cxcore. H "# include" highgui. H "# include <iostream> int logpolar (INT argc, char ** argv) // polar: two levels, polar {iplimage * src = cvloadimage (" E: \ picture \ zenfanxin. jpg "); iplimage * DST = cvcreateimage (cvgetsize (SRC), Src-> depth, Src-> nchannels); iplimage * src2 = cvcreateimage (cvgetsize (SRC ), src-> depth, Src-> nchannels); double M = 80; // it seems that the larger the range of m, the clearer the restored image cvlogpolar (SRC, DST, cvpoint2d32f (SRC-> width/2, Src-> height/4), M, cv_inter_linear | cv_warp_fill_outliers); // cv_inter_linear: bilinear interpolation. outliers: out-of-office by default, cartesian coordinate conversion for multiple polar coordinates cvlogpolar (DST, src2, cvpoint2d32f (SRC-> width/2, Src-> height/4), M, cv_inter_linear | cv_warp_inverse_map ); // The number-pole coordinate transformation is the Cartesian coordinate cvnamedwindow ("src"); cvnamedwindow ("DST"); cvnamedwindow ("src2"); cvshowimage ("src", Src ); cvshowimage ("DST", DST); cvshowimage ("src2", src2); cvwaitkey (0); cvdestroywindow ("src"); cvdestroywindow ("DST "); cvdestroywindow ("src2"); cvreleaseimage (& SRC); cvreleaseimage (& DST); cvreleaseimage (& src2); Return 0 ;}
This article is from the "flyclc" blog, please be sure to keep this source http://flyclc.blog.51cto.com/1385758/1539816