Skip to main content

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
}
}
}]

Successful response:


[{
"UpdateBoundingBox": {
"count": 1,
"status": 0
}
}]

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]
},
"blobs": true
}
}, {
"FindBoundingBox": {
"_ref": 2,
"image_ref": 1,
"blobs": false,
"coordinates": true,
"labels": true,
"in_rectangle": {
"x": 100,
"y": 0,
"width": 500,
"height": 500
}
}
}, {
"UpdateBoundingBox": {
"ref": 2,
"label": "People",
"remove_props": ["label_type"]
}
}]

Successful response:


[{
"FindImage": {
"blobs_start": 0,
"returned": 1,
"status": 0
}
}, {
"FindBoundingBox": {
"entities": [{
"_coordinates": {
"height": 40,
"width": 40,
"x": 120,
"y": 50
},
"_label": "Dog"
}],
"returned": 1,
"status": 0
}
}, {
"UpdateBoundingBox": {
"count": 1,
"status": 0
}
}]