hepesu / LineFiller

Leak-proofing line art filling and segmentation based on trapped-ball filling, and a deep learning model for grouping.
MIT License
60 stars 10 forks source link

Method for grouping segmentations. #1

Open hepesu opened 6 years ago

hepesu commented 6 years ago

In the first commit, I use a simple algorithm to group the fill results. It works, but not good.

For the next release, I am trying using CNN to extract feature then using cluster method for grouping. This may work, because someone used this for shape segmentation, a similar task. And I am busy doing annotation for training, it will be public soon.

But I am thinking about using more interesting method, maybe reinforcement learning. A little filling game, the agent has some actions, one is floodfill. Actions are inferred with CNN from the filling result. The reward depends on result and if all areas are filled, the game is finished. Training data of second method can be used, but the environment need some code.

hepesu commented 6 years ago

RL is redundant. Let a agent choose where to fill? maybe traditional algorithm is more faster and accurater. The advantage is that it can output groups(ids) and maybe is easy to train. Compare to that, Line closing model with floodfill is better. Or maybe I can use a CNN model to do the fill.

The leak-proofing line art filling is a big problem here. I have tried levelset based and graph cuts based method (state of art, although 10 years+), but they have their failure situation. Trapped-ball filling gives acceptable result in all situation, and it looks really like human filling method. So I choose trapped-ball for filling.

Learning based method have huge problem here, because it is not determined and pixel-level precise. A better solution is to combine traditional algorithms and learning method, such as combine CNN with levelset, CNN with CRF.

At present, trapped-ball/floodfill+group, closing+trapped-ball/floodfill+group are most preferred.