next up previous contents
Next: Features from graphs Up: Extracting features from an Previous: Connecting points with neighbours

Cutting connections in a graph

 

cutarcs Remove arcs connecting different color nodes
-vdata <nodes> graph nodes
-edata <arcs> graph arcs
-dout <arcs> arcs left after cutting

This command removes arcs connecting nodes that have different color (third field in the nodes data frame). This command is mainly used for removing some of the arcs that command delaunay produces.

Example: Following commands load an image, find top and bottom points, connect points, remove arcs connecting tops and bottoms and finally show the resulting graph on the original image.

...
# Load image
NDA> loadimg paper.gif img_in
NDA> cnvimg -in img_in -out img_gray -gray
# Find top and bottom points
NDA> findtb -in img_gray -dout nodes -size 5
# Connect neighbouring points
NDA> delaunay -vdata nodes -dout arcs
# Remove part of the arcs
NDA> cutarcs -vdata nodes -edata arcs -dout part
# Convert graph into image
NDA> gr2fr -vdata nodes -edata part -dout pix
NDA> f2i -d pix -iout img -bgimg img_gray
Doing grayscale
Image is 512 x 512.
# Show image
NDA> mkgrp g
NDA> bgimg g -img img
NDA> show g


next up previous contents
Next: Features from graphs Up: Extracting features from an Previous: Connecting points with neighbours

Anssi Lensu
Tue Jul 23 11:58:18 EET DST 2002