Giter Club home page Giter Club logo

superpixelregionfill's Introduction

SuperpixelRegionFill

Superpixels-based region filling

GitHub: yhlleo/SuperpixelRegionFill

抠取图像区域的一个小demo,借助图像超像素分割的方法,将图像成子分块,再利用种子填充算法,选取子块区域。

超像素分割方法,采用论文SEEDS: Superpixels Extracted via Energy-Driven Sampling提出的方法,对于物体的边界具有较好的保留,如下图所示。可以辅助目标检测中制作Banchmark。

Star Star Labels

本工程在其基础上,获得的图像labelscontours,然后分别实现区域种子填充,Windows下编译环境为:

  • OpenCV
  • CMake
  • Visual Studio

工程demo包括:

  • SuperSeedsTest: SEEDS 提供的用例,可获取超像素分割labelscontours
  • SeedFillTest : 基于labels种子填充子块
  • BoundaryFillTest : 基于contours种子填充子块

vs_solution

(测试代码以./data文件下demo.jpg为例)

demo-seg

在选取了种子点(col, row)->(248, 71)后,两种方法得到的区域mask分别为:

demo-contours-sf

demo-contours-bf

由于保存的labels图像是8bit位图(内存中是CV_32SC1),所以是有损的,如果使用labels区域填充的时候,最好不要使用demo中从保存图像中加载labels数据(也就是在内存中进行,例如通过函数传参)。

种子填充算法使用递归的形式,对于小块的像素区域比较有效,但是由于编译器栈深度有限,填充区域过大的时候,会出现栈溢出的BUG,这里需要注意一下。

##References

superpixelregionfill's People

Contributors

yhlleo avatar

Watchers

James Cloos avatar Yaokun Lu 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.