microsoft / VoTT

Visual Object Tagging Tool: An electron app for building end to end Object Detection Models from Images and Videos.
MIT License
4.3k stars 837 forks source link

Feature Enhancement - Additional behavior to Close a Polygon #802

Open skywalkerisnull opened 5 years ago

skywalkerisnull commented 5 years ago

In a range of other software that has a polygon feature to select, the options to close the polygon include:

At the moment, double clicking on the last apex/point that you place can be a little confusing and can result in adding in an additional apex/point.

An extension on this would be allowing us to edit the placement of the polygon apex/point while in the creation portion of the tool. Typically, clicking an existing point will allow you to drag it about, and then the next time you click (not on an existing apex/point), it will create the new apex/point, after the one that you just edited.

This can be tied into #693 to allow for manual editing of the magic wand selection area.

kichinsky commented 5 years ago

Closing the polygon:

Editing polygon points:

skywalkerisnull commented 5 years ago

Hello @kichinsky sorry, I meant right click

Editing after the polygon has been created can be useful, however most of the time we would want to edit the polygon while we are creating it.

kichinsky commented 5 years ago

@skywalkerisnull I'm not sure what the experience should be to allow editing while creating.

image

Currently, the cursor shows where the next point will be and technically it can overlap with existing points (so we can't use just left click). I can imagine that using some modificator (e.g., the Ctrl key) will switch the mode from adding a new point to editing.


Thanks for clarifying with the right click. Unfortunately, I'm currently avoiding using it, as it triggers the menu in all browsers as a default behavior. I will check if I can prevent that without sacrificing something. :)

skywalkerisnull commented 5 years ago

Hey @kichinsky

Google Earth (desktop program) has a pretty good workflow for how to edit when creating:

https://youtu.be/GVjaZ-wW0-o

In most programs that I use where you right click, it doesn't create a point where you right click. It closes (if possible) the current polygon. So in your image above with the cat, it would close the polygon with the solid blue lines, and it would not expand to add in the point with the dashed/dotted lines connecting to it.

No worries, make sense about bringing up the browser context menus. I am fairly certain that there is a way to have JavaScript prevent the browser context menu coming up and possibly replace it with your own using something similar to:

document.oncontextmenu = function() {
    return false;
}