示例#1
0
def plot_radiance_image_strip(
        image,
        count=5,
        ev_steps=-2,
        cctf_encoding=COLOUR_STYLE_CONSTANTS.colour.colourspace.cctf_encoding,
        **kwargs):
    """
    Plots given HDRI / radiance image as strip of images of varying exposure.

    Parameters
    ----------
    image : array_like
         HDRI / radiance image to plot.
    count : int, optional
        Strip images count.
    ev_steps : numeric, optional
        Exposure variation for each image of the strip.
    cctf_encoding : callable, optional
        Encoding colour component transfer function / opto-electronic
        transfer function used for plotting.

    Other Parameters
    ----------------
    \\**kwargs : dict, optional
        {:func:`colour.plotting.display`},
        Please refer to the documentation of the previously listed definition.

    Returns
    -------
    tuple
        Current figure and axes.
    """

    image = as_float_array(image)

    grid = matplotlib.gridspec.GridSpec(1, count)
    grid.update(wspace=0, hspace=0)

    height, width, _channel = image.shape
    for i in range(count):
        ev = i * ev_steps
        axis = plt.subplot(grid[i])
        axis.imshow(np.clip(cctf_encoding(adjust_exposure(image, ev)), 0, 1))
        axis.text(width * 0.05,
                  height - height * 0.05,
                  'EV {0}'.format(ev),
                  color=(1, 1, 1))
        axis.set_xticks([])
        axis.set_yticks([])
        axis.set_aspect('equal')

    return render(**kwargs)
示例#2
0
def radiance_image_strip_plot(image,
                              count=5,
                              ev_steps=-2,
                              encoding_cctf=DEFAULT_PLOTTING_ENCODING_CCTF,
                              **kwargs):
    """
    Plots given HDRI / radiance image as strip of images of varying exposure.

    Parameters
    ----------
    image : array_like
         HDRI / radiance image to plot.
    count : int, optional
        Strip images count.
    ev_steps : numeric, optional
        Exposure variation for each image of the strip.
    encoding_cctf : callable, optional
        Encoding colour component transfer function / opto-electronic
        transfer function used for plotting.

    Other Parameters
    ----------------
    \**kwargs : dict, optional
        {:func:`colour.plotting.display`},
        Please refer to the documentation of the previously listed definition.

    Returns
    -------
    Figure
        Current figure or None.
    """

    image = np.asarray(image)

    grid = matplotlib.gridspec.GridSpec(1, count)
    grid.update(wspace=0, hspace=0)

    height, width, _channel = image.shape
    for i in range(count):
        ev = i * ev_steps
        axis = matplotlib.pyplot.subplot(grid[i])
        axis.imshow(np.clip(encoding_cctf(adjust_exposure(image, ev)), 0, 1))
        axis.text(width * 0.05,
                  height - height * 0.05,
                  'EV {0}'.format(ev),
                  color=(1, 1, 1))
        axis.set_xticks([])
        axis.set_yticks([])
        axis.set_aspect('equal')

    return display(**kwargs)
示例#3
0
def radiance_image_strip_plot(image,
                              count=5,
                              ev_steps=-2,
                              encoding_cctf=DEFAULT_PLOTTING_ENCODING_CCTF,
                              **kwargs):
    """
    Plots given HDRI / radiance image as strip of images of varying exposure.

    Parameters
    ----------
    image : array_like
         HDRI / radiance image to plot.
    count : int, optional
        Strip images count.
    ev_steps : numeric, optional
        Exposure variation for each image of the strip.
    encoding_cctf : callable, optional
        Encoding colour component transfer function / opto-electronic
        transfer function used for plotting.
    \**kwargs : dict, optional
        Keywords arguments.

    Returns
    -------
    Figure
        Current figure or None.
    """

    image = np.asarray(image)

    grid = matplotlib.gridspec.GridSpec(1, count)
    grid.update(wspace=0, hspace=0)

    height, width, _channel = image.shape
    for i in range(count):
        ev = i * ev_steps
        axis = matplotlib.pyplot.subplot(grid[i])
        axis.imshow(
            np.clip(encoding_cctf(adjust_exposure(image, ev)), 0, 1))
        axis.text(width * 0.05,
                  height - height * 0.05,
                  'EV {0}'.format(ev),
                  color=(1, 1, 1))
        axis.set_xticks([])
        axis.set_yticks([])
        axis.set_aspect('equal')

    return display(**kwargs)
示例#4
0
def radiance_image_strip_plot(image,
                              count=5,
                              ev_steps=-2,
                              OECF=DEFAULT_PLOTTING_OECF):
    """
    Plots given HDRI / radiance image as strip of images of varying exposure.

    Parameters
    ----------
    image : array_like
         HDRI / radiance image to plot.
    count : int, optional
        Strip images count.
    ev_steps : numeric, optional
        Exposure variation for each image of the strip.
    OECF : callable, optional
        OECF / opto-electronic conversion function used for plotting.

    Returns
    -------
    bool
        Definition success.
    """

    image = np.asarray(image)

    grid = matplotlib.gridspec.GridSpec(1, count)
    grid.update(wspace=0, hspace=0)

    height, width, _channel = image.shape
    for i in range(count):
        ev = i * ev_steps
        axis = matplotlib.pyplot.subplot(grid[i])
        axis.imshow(
            np.clip(OECF(adjust_exposure(image, ev)), 0, 1))
        axis.text(width * 0.05,
                  height - height * 0.05,
                  'EV {0}'.format(ev),
                  color=(1, 1, 1))
        axis.set_xticks([])
        axis.set_yticks([])
        axis.set_aspect('equal')

    matplotlib.pyplot.show()

    return True