menpo / landmarker.io

Image and mesh annotation web application
https://www.landmarker.io
BSD 3-Clause "New" or "Revised" License
114 stars 21 forks source link

Bounding Box mode #139

Open gabrielcowley opened 7 years ago

gabrielcowley commented 7 years ago

_This PR has a staging branch, which means a production build of this branch exists and can be launched. Click here to preview this PR._

This PR adds a new 'Bounding Box' mode for 'image' mode. Bounding box mode will not work for any template other than one which has exactly 1 group label consisting of exactly 4 landmarks (this to form a box). Bounding box mode can be activated either when no landmarks have been filled in or when all four landmarks have been filled in and they make a rectangle shape which aligns with the axes.

If no landmarks are filled in, then the user can create a bounding box by right-clicking and dragging. From there, the bounding box can be manipulated using the handles in the four corners of the box. If all landmarks are filled in and make the required box shape (a small margin of error is afforded), then entering bounding box mode will replace the landmarks with the bounding box.

All of the required features have been added, but at the moment the new code does not account for changes in template. If the current template is changed while bounding box mode is active, nothing will be done. This should be the last thing that needs doing on this PR.

This PR is to be merged after the occlusion PR: https://github.com/menpo/landmarker.io/pull/137

gabrielcowley commented 7 years ago

Active template bug is now fixed and this PR is ready to be merged once #137 has been merged.