Hello, my name is Matteo Mattei and this is my personal website. I am computer engineer with a long experience in Linux system administration and web software development.
jPolygon is a javascript library that allows drawing a polygon in a HTML5 canvas over an image. It supports undo and clear funcions. To finalize the polygon press CTRL + mouse Click.
Include the jPolygon.js script just before the </body>
:
<script type="text/javascript" src="jPolygon.js"></script>
</body>
Then in your body put at least the following elements:
<canvas id="jPolygon" width="640" height="480" data-imgsrc="image.jpg" onclick="point_it(event)">
Your browser does not support the HTML5 canvas tag.
</canvas>
<button onclick="undo()">Undo</button>
<button onclick="clear_canvas()">Clear</button>
<textarea id="coordinates" disabled="disabled" style="width:300px; height:200px;"></textarea>
Then load the image over the canvas using the onload callback in the open body tag:
<body onload="clear_canvas()">