easyidp.visualize.draw_backward_one_roi#

easyidp.visualize.draw_backward_one_roi(proj, result_dict, buffer=40, title=None, save_as=None, show=False, color='red', alpha=0.5, dpi=72)#

Plot one ROI results on all available images.

Parameters:
  • proj (easyidp.Recons) – The 3D reconstruction project object

  • result_dict (dict) –

    The dictionary of one ROI backward to all images.
    e.g. {"IMG_2345": np.array([...]), "IMG_2346": np.array([])}

  • buffer (int, optional) – The pixel buffer number around the backward ROI results, by default 40

  • title (str, optional) – The image title displayed on the top, by default None -> Projection on [img_name]

  • save_as (str, optional) – file path to save the output figure, by default None

  • show (bool, optional) – whether display (in jupyter notebook) or popup (in command line) the figure, by default False

  • color (str, optional) – the polygon line color, by default ‘red’

  • alpha (float, optional) – the polygon transparency, by default 0.5

  • dpi (int, optional) – the dpi of produced figure, by default 72

Example

Data prepare:

>>> import easyidp as idp
>>> lotus = idp.data.Lotus()

>>> roi = idp.ROI(lotus.shp, name_field='plot_id')
>>> roi.get_z_from_dsm(lotus.metashape.dsm)

>>> ms = idp.Metashape(lotus.metashape.project, chunk_id=0)
>>> img_dict_ms = roi.back2raw(ms)

Then use this code to show the results of ROI [N1W1]:

>>> idp.visualize.draw_backward_one_roi(ms, img_dict_ms['N1W1'], save_as="draw_backward_one_roi.png")

It will get the following figure:

draw_backward_one_roi.png'