Floodfill fill to find similar pixels

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.