Git Product home page Git Product logo

seeded-region-growing-algorithm's Introduction

种子生长算法代码

算法步骤:

1.对图像顺序扫描,找到第一个还没有标记的像素,设该像素为(x0,y0),若之前已有k类,则标记(x0,y0)为第k+1类,并把(x0,y0)压入堆栈stack

2.,从堆栈中取出一个像素当做(x0,y0),以(x0,y0)为中心考虑(x0,y0)的8领域(或者4领域)的像素(x,y),如果(x,y)(x0,y0)像素值在一定范围内,把(x,y)也标记为第k+1类,并把(x,y)压入堆栈stack

3.重复执行步骤2直到堆栈为空,当堆栈为空时,返回到步骤1

4.重复执行步骤1-3直到图像中的每个点都被标记,生长结束。

使用方法:

1.img中是测试图片

2.growseed.py可以演示种子生长的具体流程

3.growseed_filter.py添加了面积的计算,其中面积小于threshold的会被过滤掉,最终输出一个随机颜色类别表示的标记图片

4.本代码只适合灰度图像

示例图片:

输入二值图像

输入二值图像

输出面积过滤后的图像

用于车牌检测

Enjoy Yourself!

=======

seeded-region-growing-algorithm's People

Contributors

zqpei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.