An example of OPENCV image refinement

Source: Internet
Author: User

Transferred from: Http://blog.csdn.net/zfdxx369/article/details/9091953?utm_source=tuicool

This article is Zhang's classic image refinement paper, the effect is very good, the use of parallel computing, the speed is very fast;

Below is the "smart vision" on the csdn of this paper program of a transformation, pro-Test available!

Since OPENCV does not have its own image thinning function, the basic on-line is based on the 1.0 interface, so hands-on into the 2.0 Mat type interface, easy to use. In the refinement method, when the classical Zhang parallel fast thinning algorithm, the contour movement after refinement and the original image is relatively good.

depth_8u binary Image Refinement classic Zhang parallel fast thinning algorithm void thin (const mat &AMP;SRC, Mat &dst, const int iterations) {const int HEI    Ght =src.rows-1;    const int width =src.cols-1;    Copy an array to another array if (src.data! = dst.data) {src.copyto (DST);    } int n = 0,i = 0,j = 0;    Mat tmpimg;    Uchar *pu, *pc, *PD;     BOOL isfinished =false;          for (n=0; n<iterations; n++) {dst.copyto (tmpimg);   Isfinished =false;  One-time pre-column scan starts//scanning process starts for (I=1; i

An example of OPENCV image refinement

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.