File: test_graph_colorize.py

package info (click to toggle)
gamera 1%3A3.4.2%2Bgit20160808.1725654-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 22,312 kB
  • ctags: 24,991
  • sloc: xml: 122,324; ansic: 52,869; cpp: 50,664; python: 35,034; makefile: 118; sh: 101
file content (15 lines) | stat: -rw-r--r-- 346 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python

from gamera.core import *
init_gamera()

def test_colorize():
   img0 = load_image("data/testline.png")
   img0 = img0.to_onebit()
   ccs = img0.cc_analysis()
   for i in range(3):
      color = img0.graph_color_ccs(ccs,method=i)
      color.save_PNG("tmp/colors-%d.png" % i)

if __name__ == "__main__":
   test_colorize()