UpdateBoundingBox

Updates existing BoundingBox objects that satisfy the specified constraints.

Parameters

Details

If the ref parameter is used, constraints will be ignored.

If the ref parameter is specified, it must refers to the search results of a previous FindBoundingBox within the transaction.

If the rectangle parameter is present, the bounding boxes coordinates will be updated.

If the label parameter is present, the bounding boxes labels will be updated.

For more complex searches for objects to update, a Find command must be used first within the transaction.

Examples

Find the bounding boxes with the “year_captured” property equal to 2007, and updating the label and the rectangle coordinates:

[ {
    "UpdateBoundingBox": {
        "constraints": {
            "year_captured": [ "==", 2007 ],
        },
        "remove_props": [ "type" ],
        "label": "Dog",
        "rectangle": {
            "x":     100,
            "y":     100,
            "width":  50,
            "height": 50
        }
    }
}]

Find the bounding boxes connected to the image with “unique_id” = 34, and that are inside a given rectangle, and update the label to “People”, and remove the “label_type” property:

[ {
    "FindImage" : {
        "_ref" : 1,
        "constraints" : {
            "unique_id" : [ "==", 34]
        }
    }
},{
    "FindBoundingBox": {
        "_ref":        2,
        "image" :      1,
        "blobs":       false,       // Do not retrieve pixel data
        "coordinates": true,        // Retrieve coordinates
        "label":       true,        // Retrieve label
        "in_rectangle": {
            "x":      100,
            "y":      100,
            "width":  500,
            "height": 500
        }
    }
}, {
    "UpdateBoundingBox": {
        "ref": 3,
        "label": "People",
        "remove_props": ["label_type"]
    }
} ]