rasvaan / accurator

Accurator cpack
7 stars 3 forks source link

Define selectors of bounding box #206

Closed rasvaan closed 8 years ago

rasvaan commented 8 years ago

Write a function recording the selectors of the bounding box, based on annotation.js:

addTagFragment : function(tag, update) {
        var target = this.findSpecificTarget(tag);
        if (! this._anno || !target) return;

        var label   = tag.title;
        var x =  target.hasSelector.x;
        var y =  target.hasSelector.y;
        var w =  target.hasSelector.w;
        var h =  target.hasSelector.h;
        var torious = {
            src: Y.one('img#'+this.get('imageId')).get('src'),
            text: label,
            targetId: target['@id'],
            fieldsId: this.get('fieldsId'),
            annotationId: tag.annotation,
            shapes: [{
            type:'rect',
            geometry: { x:x,y:y,width:w,height:h }
            }]
        };
rasvaan commented 8 years ago

This information is directly obtained from annotorious, functions above are use for populating image with already existing targets.