Canvas BBox:
The ycCanvasBBox node is designed to process bounding box data within a canvas context, allowing you to manage and manipulate spatial data effectively. This node is particularly useful for tasks that involve object detection or spatial analysis within a defined canvas area. By parsing bounding box data formatted as strings, it enables you to extract and utilize coordinates and dimensions of various objects or regions of interest on a canvas. The node ensures that you have a consistent output format, even if the input data is incomplete, by providing a fixed number of bounding box outputs. This feature is beneficial for maintaining a uniform data structure, which can be crucial for downstream processing or integration with other systems.
Canvas BBox Input Parameters:
canvas_width
The canvas_width parameter specifies the width of the canvas on which the bounding boxes are defined. It is an integer value that determines the horizontal extent of the canvas, impacting how the bounding box coordinates are interpreted in relation to the overall canvas size.
canvas_height
The canvas_height parameter defines the height of the canvas. Similar to canvas_width, it is an integer value that sets the vertical extent of the canvas, influencing the interpretation of bounding box coordinates in the vertical dimension.
bbox_data
The bbox_data parameter is a string that contains the bounding box information in a specific format: "x1,y1,w1,h1;x2,y2,w2,h2;...". Each segment represents a bounding box with x and y coordinates for the top-left corner, and width and height for the dimensions. This parameter is crucial as it provides the raw data that the node processes to extract bounding box details.
Canvas BBox Output Parameters:
canvas_width
The output canvas_width is the same as the input parameter, representing the width of the canvas. It is returned to maintain consistency and provide context for the bounding box data.
canvas_height
Similar to canvas_width, the output canvas_height is the same as the input parameter, representing the height of the canvas. It ensures that the bounding box data is interpreted correctly in relation to the canvas dimensions.
bbox_strings
The bbox_strings output consists of up to ten strings, each representing a bounding box in the format "x,y,width,height". If fewer than ten bounding boxes are provided in the input, the remaining outputs are empty strings. This output ensures a consistent number of bounding box entries, facilitating easier integration with other processes or systems that require a fixed data structure.
Canvas BBox Usage Tips:
- Ensure that the
bbox_datastring is correctly formatted with semicolons separating each bounding box and commas separating the coordinates and dimensions within each box. - Use the node to preprocess bounding box data before feeding it into other nodes or systems that require a fixed number of bounding box entries.
Canvas BBox Common Errors and Solutions:
Invalid bbox format
- Explanation: This error occurs when the
bbox_datastring does not conform to the expected format of"x,y,width,height". - Solution: Verify that each bounding box in the
bbox_datastring is correctly formatted with four comma-separated values and that each box is separated by a semicolon.
Empty bbox_data
- Explanation: If the
bbox_datastring is empty or contains only whitespace, the node will not be able to parse any bounding boxes. - Solution: Ensure that the
bbox_datastring contains valid bounding box information before passing it to the node.
