Skip to content

More flexible (and simpler code) autolabeller #376

@angusmoore

Description

@angusmoore

The current autolabeller code is ... spaghetti.

Collision handling is reasonably neat, but distance calculation is a nightmare. Distances to layers are based on internally calculating distance to some theoretical approximation of the graph (e.g. point to line-segment distance measurement for each line segment in a line graph). This means each layer type has to be special cased. This creates hard to maintain code, and very complex code.

A neater way would be to use the same mask that is used for collisions.

  • Separate into colours
  • Measure distance as pixel distance between given point and the nearest pixel of that colour.

This would be extremely flexible. Line of sight and distance measurement would be dead simple - basically repurposing much of the collision code. And it would not need to be extended for new layer types - colours don't change.

Potential draw backs:

  • Other annotations of the same colour will confuse it - e.g. a red line and a red series will appear the same. Could be handled by drawing a version of the graph with no annotations?
  • Performance. This is the main concern. Initial experiments show that even separating the initial image (used for the collision mask) into colour layers is already more expensive than the whole autolabeller currently. then having to calculate distances to each pixel will, similarly, be very expensive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    autolabellerIssues relating to the experimental autolabellerspeculativeSpeculative design proposals

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions