blendersynth.blender.compositor.image_overlay

Overlay RGB image in compositor

class blendersynth.blender.compositor.image_overlay.AlphaImageOverlay(name='AlphaImageOverlay', node_tree=None, scene=None)[source]

Overlay an image on top of the render, using the alpha channel of the image as a mask

add_node(key)

Create a new node in the group by name

Return type:

Node

add_socket(socket_type, name, in_out)

Create a new socket, compatible with Blender <4

Parameters:
  • socket_type (str) – Type of socket

  • name (str) – Name of socket

  • in_out (str) – INPUT or OUTPUT

input(name)

Get input socket by name

Return type:

NodeSocket

property inputs: dict

Input sockets

Link two sockets in the group

Parameters:
  • from_socket (NodeSocket) – Socket to link from

  • to_socket (NodeSocket) – Socket to link to

Return type:

NodeLink

output(name)

Get output socket by name

Return type:

NodeSocket

property outputs: dict

Output sockets

save_image(loc, image_data)

Save an image to a location. Will also reload any node reference to the image.

Parameters:

loc (str) – Location to save image to

class blendersynth.blender.compositor.image_overlay.AxesOverlay(name='BoundingBoxOverlay', node_tree=None, scene=None, camera=None, size=1, thickness=2)[source]

Overlay which draws axes on top of an existing render

add_node(key)

Create a new node in the group by name

Return type:

Node

add_socket(socket_type, name, in_out)

Create a new socket, compatible with Blender <4

Parameters:
  • socket_type (str) – Type of socket

  • name (str) – Name of socket

  • in_out (str) – INPUT or OUTPUT

input(name)

Get input socket by name

Return type:

NodeSocket

property inputs: dict

Input sockets

Link two sockets in the group

Parameters:
  • from_socket (NodeSocket) – Socket to link from

  • to_socket (NodeSocket) – Socket to link to

Return type:

NodeLink

output(name)

Get output socket by name

Return type:

NodeSocket

property outputs: dict

Output sockets

save_image(loc, image_data)

Save an image to a location. Will also reload any node reference to the image.

Parameters:

loc (str) – Location to save image to

update(points, scene=None, camera=None)[source]

Plot axes onto the image.

Parameters:
  • points (List[ndarray]) – list of N x 4 2D points of centre + XYZ unit axes

  • scene (Scene) – Scene

  • camera (Camera) – Camera

class blendersynth.blender.compositor.image_overlay.BoundingBoxOverlay(name='BoundingBoxOverlay', node_tree=None, scene=None, camera=None, col=(0, 0, 255, 255), thickness=2)[source]

Overlay which draws bounding boxes on top of the render.

add_node(key)

Create a new node in the group by name

Return type:

Node

add_socket(socket_type, name, in_out)

Create a new socket, compatible with Blender <4

Parameters:
  • socket_type (str) – Type of socket

  • name (str) – Name of socket

  • in_out (str) – INPUT or OUTPUT

input(name)

Get input socket by name

Return type:

NodeSocket

property inputs: dict

Input sockets

Link two sockets in the group

Parameters:
  • from_socket (NodeSocket) – Socket to link from

  • to_socket (NodeSocket) – Socket to link to

Return type:

NodeLink

output(name)

Get output socket by name

Return type:

NodeSocket

property outputs: dict

Output sockets

save_image(loc, image_data)

Save an image to a location. Will also reload any node reference to the image.

Parameters:

loc (str) – Location to save image to

update(bboxes, scene=None, camera=None)[source]

Given [N x 4] bounding boxes, draw them onto a new temp image.

class blendersynth.blender.compositor.image_overlay.KeypointsOverlay(name='KeypointsOverlay', node_tree=None, scene=None, camera=None, marker='x', size=5, color=(0, 0, 255), thickness=2)[source]

Overlay which draws keypoints on top of the render.

add_node(key)

Create a new node in the group by name

Return type:

Node

add_socket(socket_type, name, in_out)

Create a new socket, compatible with Blender <4

Parameters:
  • socket_type (str) – Type of socket

  • name (str) – Name of socket

  • in_out (str) – INPUT or OUTPUT

input(name)

Get input socket by name

Return type:

NodeSocket

property inputs: dict

Input sockets

Link two sockets in the group

Parameters:
  • from_socket (NodeSocket) – Socket to link from

  • to_socket (NodeSocket) – Socket to link to

Return type:

NodeLink

output(name)

Get output socket by name

Return type:

NodeSocket

property outputs: dict

Output sockets

save_image(loc, image_data)

Save an image to a location. Will also reload any node reference to the image.

Parameters:

loc (str) – Location to save image to

update(keypoints, scene=None, camera=None)[source]

Given [N x 3] keypoints, draw them onto a new temp image.

Parameters:
  • keypoints (ndarray) – N x 3 keypoints

  • scene (Scene) – Scene to draw from

  • camera (Camera) – Camera