Code Monkey home page Code Monkey logo

pomar's Introduction

Pomar

Build Status

Pomar is a library in C++ 11 to work with morphlogical trees. Its goal is to be a self-contained and easy to install library which provides a set of classes that abstracts common algorithms to create and handle morphological trees.

Documentation

Building

Pomar has generic code using templates and code with no template at all. Initially, we choose to put all code which does not use templates in implementation file, in order to keep the compilation time as low as possible for the user.

The Pomar library can be built using cmake. For terminal user, you just need follow the steps below:

  1. install cmake (https://cmake.org/)
  2. download pomar library
  3. go to the root directory (where there is a file CMakeLists.txt)
  4. run: >$ cmake . -Bbuild
  5. go to the just created directory called 'build'
  6. build your project. For example, if you are working with makefile just run: >$ make
  7. after build you can run the tests by running: >$ ctest
  8. If you do not want to compile the tests, in the step 6, you should compile just the library, for example, run: >$ make pomar
  9. after compile, pomar will generate a static library in the build directory (libpomar), in order to integrate pomar in you project you should link this directory as well as indicate the include directory. For example, to compile in gcc you should use the following options: -std=c++11 -L${PomarDirectory}/build -I${PomarDirectory}/include -lpomar

Features

  • Max-tree and min-tree building
  • Component tree transverse
  • Component tree prune
  • Component tree node reconstruction
  • Component tree reconstruction
  • Generic adjacency relation interface

Related libraries

pomar's People

Contributors

alexmorimitsu avatar dennisjosesilva avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

pomar's Issues

Attribute collection

Design and implement a class to represent a collection attributes over the nodes of a component tree. For example, this class should provide a way to access the values of a set of attributes (defined by the user) for each node. For example:

attr[attr_type][node_id] => return the value of attribute 'attr_type' of the node 'node_id'.

Refactor naming and Physical Structure

This is a refactor issue, the class and method names are pretty bad. This issue tries to make these names shorter and clear in order to make code shorter and easy to understand.

Below there are some suggestions to be discussed: (original name => proposed new name)

MorphologicalTree => CTree

nodes
cmap

MorphologicalTree() => CTree()
MorphologicalTree(parent, sortedIndex, vertices) => CTree(parent, sortedIndices, vertices)
tranverseFromLeavesToRoot(visit) => tranverse(visit)
getNumberOfNodes() => numberOfNodes()
getNodeLevel(id) => nodeLevel(id)
getNodeParent(id) => nodeParent(id)
getNodeChildren(id) => nodeChildren(id)
getNodePixels(id) => nodeVertices(id)
reconstructTreeNode() => reconstructNode()
createNodes(parent, sortedIndex, vertices) => createNodes(parent, sortedIndices, vertices)

MTNode => CTNode

OK excepted by:
vertexIndixes => vertexIndices

MorphologicalTreeBuilderSorter => CTSorter (Extract it from the Builder file)

sort(vertices) => sort(vertices)
countingSort() => countingSort(vertices)

MaxTreeSorter => MaxTreeSorter

sort(vertices) => sort(vertices)
countingSort() => countingSort(vertices)

MorphologicalTreeBuilder => CTBuilder

build(vertices, adj, treeType)
buildWithSorter(vertices, adj, sorter) => build(vertices, adj, sorter)
findRoot(zpar, x)
canonizeTree(vertices, sortedVertices, parent)

AdjacencyRelation => Adjacency

getAdjacentElements(curElem) => neighbours(id)

Image2DAdjacencyRelationByTranslating => AdjacencyByTranslating (remove it from Image2D)

Image2DAdjacencyRelationByTranslating(width, height, t) => AdjacencyByTranslating
createFourConnectedAdjacency(width, height) => create4CAdjacency(width, height)
createEightConnectedAdjacency(width, height) => create8CAdjacency(width, height)

Point2D => OK

Create alias for the CTree and CTNode

The classes CTree and CTNode should have aliases for the most common types like the class Point2D.

The types should have aliases are:

  • unsigned char
  • char
  • unsigned int
  • int
  • unsigned long
  • long
  • float
  • double

Design and Pixel Indexer 2D

Design and implement a set of classes to represent Image 2D Indexing such that if it accesses a position out of domain it returns an invalid value (a constant value, null, exception etc...)

Bit Quads Algorithm

Design and implement the algorithm to compute the bit-quads incrementally.

Attribute computer

Design and implement the attribute computer which interacts with attribute collection. This function provides the interface to classes which compute attributes for a component tree.

Get started example

The wiki page should have a get started page where the basic functionality of the framework should be shown. In this example, an image should be read (maybe using stb library), its component tree should be read, an attribute like area should be computed and an opening filter should be executed.

Incremental attribute computer

Design and implement the class IncrementalAttributeComputer which implements AttributeComputer. This class provides the interface and algorithm to compute attributes in incremental fashion using a no-recursive algorithm.

Documentation

A basic documentation for users get started with.

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.