Skip to content

Commit

Permalink
doc(postprocessing): add docu to semantic segmentation fct
Browse files Browse the repository at this point in the history
  • Loading branch information
themasterlink committed Sep 21, 2022
1 parent 6847ea4 commit bddc8d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion blenderproc/python/camera/LensDistortionUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ def set_lens_distortion(k1: float, k2: float, k3: float = 0.0, p1: float = 0.0,
raise Exception("The iterative distortion algorithm is unstable.")

# update undistorted projection
# this can not be changed to x -=, for whatever reasons
x -= x_ - P_und[0, :] # * factor
y -= y_ - P_und[1, :] # * factor

Expand Down
9 changes: 9 additions & 0 deletions blenderproc/python/postprocessing/PostProcessingUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@ def semantic_segmentation_mapping(image: Union[List[np.ndarray], np.ndarray],
map_by: Union[str, List[str]],
default_values: Optional[Dict[str, int]]) \
-> Dict[str, Union[np.ndarray, List[np.ndarray], List[Dict[str, Any]]]]:
""" Maps an image or a list of images to the desired segmentation images plus segmentation dictionary for keys,
which can not be stored in an image (e.g. `name`).
:param image: A list or single image of a scene, must contain the pass indices defined in
`enable_segmentation_output`.
:param map_by: The keys which will be extracted from the objects, either a single key or a list of keys.
:param default_values: If an object does not provide a key a default key must be provided.
:return: A dict mapping each key in map_by to an output list of images or a dictionary containing the information
"""

return_dict: Dict[str, Union[np.ndarray, List[np.ndarray], List[Dict[str, Any]]]] = {}
is_stereo_case = bpy.context.scene.render.use_multiview
Expand Down

0 comments on commit bddc8d0

Please sign in to comment.