ContourX  VERY Ltd. ® ContourX™   [ver. ]

This utility computes the external contour of a connected convex planar figure and prepares it for using in an HTML document as image map coordinates.

Application domain

As known, HTML format allows to mark the "active regions" on an image contained ( <MAP> tag). There are three types of regions:
1) rectangle, defined by coordinates of its left-top and right-bottom angles ( <AREA SHAPE="RECT" COORDS="Xl, Yt, Xr, Yb"> );
2) circle, defined by coordinates of its center and radius length ( <AREA SHAPE="CIRCLE" COORDS="Xc, Yc, R"> );
3) polygon, defined by the list of pixel coordinates of its vertices ( <AREA SHAPE="POLYGON" COORDS="X1, Y1, ..., Xn, Yn"> ).

Whereas the specification of active region of first two types represents quite a trivial task, the specification of perimeter of some complicated figure is very laborious (and irksome) process. Existing applications intended for making this work easier, did not advance further than vertices specification visualization. In the contrary, the ContourX automatically builds a draft version of a contour, and then gives user a visual to make any corrections desired.



Definition 1. A figure is named connected, if it can not be represented as a union of two separate parts (which have no common point).
  Example 1. This figure's contour will be computed incorrectly:

Definition 2. A figure is named convex, if it contains along with any of its two points also all the points of line segment between them.
  Example 2. This figure's contour will be computed incorrectly:
  Example 3. Nevertheless, this figure's contour will be computed correctly:

It is easy to observe that correct computation of a figure's vertex requires the shortest segment between the vertex and one of coordinate axes comprises no other point of the figure.

Preparatory treatment

Before computing a region's contour with the ContourX, you usually need to "cut out" this region from the image containing; here is an instance:

(You can do it for example with the Paint application, which is a component of all Windows versions.)
On the base of such "temporary" image file you can compute the contour of desired region.

User interface features

  • The application window is splitted into two panels - the contour's coordinate list and its visualization.
  • The coordinate list is a basic presentation, since finally just this list will be included into an HTML document.
  • The general method of visualization of various user's actions is positioning the Windows cursor onto required coordinates instead of drawing marks on an image, so it remains not distorted.
  • After the contour is computed, any click on the image panel positions the mouse cursor on the nearest vertex.

    General operations

  • Open
  • You can open an image file of BMP, DIB, GIF, or JPG format, as well as previously saved HTML document containing computed contour.
  • Save
  • Computed contour is saved in HTML format with the filename equal to the source image file, by default in the same folder. This document has following form:

    <HTML><BODY><IMG SRC='image-filename' BORDER=0 USEMAP='#map-name'>
    <MAP NAME='map-name'><AREA HREF='javascript:' SHAPE='POLYGON' COORDS='coordinate-list'></MAP>
    </BODY> <HTML>

    So, if you wish to edit a contour prepared in other way (for example, by other appplication), bring it to the form of HTML as shown above and then open it in the ContourX.

  • Create Contour
  • Please take into account that the ContourX has two contour computation algorithms - Reductive Contour and Extensive Contour. The first of them is recommended for the rather simple polygons, i.e. figures consisting of line segments mainly; the second one is especially suitable for the figures formed by curves. Clearly, the second algorithm provides greater precision and gives more vertices.
  • Delete Point
  • You can remove a vertex from the contour, i.e. rectify this part of contour. To do so, click on some vertex on the image panel or corresponding line of the cooredinate list, then select menu Edit, Delete Point.
  • Insert Point
  • You can add a vertex in any place of the image. To do so, select a vertex, which will precede new point in the contour, select menu Edit, Insert Point, then write new point coordinates in the left panel, or click on the place meant for new point in the right panel.
  • Change Point
  • You can move any vertex. To do so, select menu Edit, Change Point, then write new coordinates of the vertex in the left panel, or click on new place meant for the vertex in the right panel.
  • Rectification
  • You can rectify the contour between any two vertices. To do so, use menu Edit, Start Rectification, or corresponding hotkey, or the toolbar button (cursor icon will be changed to ), then click on the first of two vertices (cursor icon will be changed to ), and then click on the second of two vertices.
    Tip Use of zoom will make this operation more suitable.

    Extra facility

  • Zoom
  • You can zoom in a picture in the right panel. To do so, use menu View, Magnifier, or corresponding hotkey, or the toolbar button (cursor icon will be changed to ), then click in the center of image area you wish to zoom in. You can also specify zoom scale desirable selecting the corresponding line of Zoom list in the menu View.
  • Move Beginning
  • The ContourX begins to enumerate the vertices from almost random point. You can change the enumeraion order so a certain vertex becames a start point of the coordinate list. To do so, select menu Edit, Move Beginning (or use corresponding hotkey), and then select a vertex, which you want to make a first in the list.
  • Clockwise Contour
  • You can specify enumeration direction in the coordinate list - clockwise or anticlockwise.
  • Run Painter
  • If you need to change the image, you can open it in your usual image editor. To do so, you should specify this image editor selecting menu Settings, Custom Painter. Henceforth you will call the image editor using menu File, Run Painter..., or corresponding hotkey, or the toolbar button.


  • Show Grid
  • You can display gridlines on the image for more suitable determination of coordinates.
  • Show Points
  • Select this option and specify the point color different from the contour color to view the vertices in the right panel.
  • Background Color
  • For correct computation of contour of a figure you need to specify exactly the color of ambient background. You can specify the image background color with the system Color Dialog (select menu Settings, Background Color...) using the dialog palette or clicking on background area in the right panel (cursor icon will be changed to ).
  • Grid Color
  • Using this function you can specify the color of the gridlines so as they will be distinctly visible on the image.
  • Contour Color
  • Using this function you can specify the color to highlight the computed contour in the right panel.
  • Point Color
  • Using this function you can specify the color to highlight the computed contour vertices in the right panel.


    Interactive Illustration

    Click on various control elements of the following pseudo-window to try the ContourX functioning:

    File Edit View Settings Help
       256x128 - 34 points. o

  • Download

    Copyright © 2004-2008 VERY Ltd. ®