Core Function: cvfloodfill
Program:
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/45/D8/wKioL1PsXqSQizs2AAFIW7Ca3lI827.jpg "Title =" clipboard.png "alt =" wkiol1psxqsqizs2aafiw7ca3li827.jpg "/>
Code:
# Include "CV. H "# include" cxcore. H "# include" highgui. H "# include <iostream> int floodfill (INT argc, char ** argv) {iplimage * src = cvloadimage (" E: \ picture \ xibao.jpg "); cvnamedwindow ("src"); cvshowimage ("src", Src); cvfloodfill (SRC, cvpoint (100,100), cvscalar (255,), cvscalar (50, 50 ), cvscalar (50, 50), null, 8 | cv_floodfill_fixed_range); // subtract and add cvscalar (50, 50, 50) to the seed point) the low 8 bits in the range of vertices are set to 4, only the adjacent vertices in the horizontal and vertical directions of the current pixel are considered, 8. The adjacent points in the diagonal line are also considered. The high 8-bit cv_floodfill_fixed_range is compared with the seed point. Otherwise, the difference cvnamedwindow ("floodfill") between the current point and the adjacent point is considered "); cvshowimage ("floodfill", Src); cvwaitkey (0); cvdestroywindow ("src"); cvdestroywindow ("floodfill"); cvreleaseimage (& SRC); Return 0 ;}
This article is from the "flyclc" blog, please be sure to keep this source http://flyclc.blog.51cto.com/1385758/1539928