coastalimagelib/corefunctions.py
def imageStats(im_mat, save_flag=0, disp_flag=0):
    """
    This function generates statistical image products for a given set of
    images and corresponding extrinsics/intrinsics. The statistical image
    products are the timex, brightest, variance, darkest.

    All images must have the same dimensions.

    Attributes:
        Bright: brightest pixels at each location across the
                collection
        Dark: darkest pixels at each location across the collection
        Timex: time- exposure (mean) of all pixels at each location
                across the collection
        Variance: standard deviation of all pixels at each location
                across the collection

    Args:
        save_flag: flag to indicate if products should be saved
                automatically to the user's drive

    """

    Dark = np.uint8(np.nanmin(im_mat, axis=2))
    Bright = np.uint8(np.nanmax(im_mat, axis=2))
    Timex = np.uint8(np.nanmean(im_mat, axis=2))
    Variance = np.uint8(np.nanstd(im_mat, axis=2))

    if save_flag:
        cv.imwrite("Darkest.jpg", Dark)
        cv.imwrite("Brightest.jpg", Bright)
        cv.imwrite("Timex.jpg", Timex)
        cv.imwrite("Variance.jpg", Variance)

    if disp_flag:
        fig, axs = plt.subplots(1, 4)
        titles = ['Dark','Bright','Timex','Variance']
        for k, im in enumerate([Dark,Bright,Timex,Variance]):
            axs[k].xaxis.set_visible(False)
            axs[k].yaxis.set_visible(False)
            axs[k].set_title(titles[k])
            axs[k].imshow(
                im.astype(np.uint8),
                cmap="gray",
                vmin=0,
                vmax=255
                )
        plt.show()

    This function generates statistical image products for a given set of
    images and corresponding extrinsics/intrinsics. The statistical image
    products are the timex, brightest, variance, darkest.

    All images must have the same dimensions.

    Attributes:
        Bright: brightest pixels at each location across the
                collection
        Dark: darkest pixels at each location across the collection
        Timex: time- exposure (mean) of all pixels at each location
                across the collection
        Variance: standard deviation of all pixels at each location
                across the collection

    Args:
        save_flag: flag to indicate if products should be saved
                automatically to the user's drive

    
This function generates statistical image products for a given set of
images and corresponding extrinsics/intrinsics. The statistical image
products are the timex, brightest, variance, darkest.

All images must have the same dimensions.
This function generates statistical image products for a given set of images and corresponding extrinsics / intrinsics . The statistical image products are the timex brightest variance darkest . All images must have the same dimensions .
def imageStats(im_mat, save_flag=0, disp_flag=0):
    Dark = np.uint8(np.nanmin(im_mat, axis=2))
    Bright = np.uint8(np.nanmax(im_mat, axis=2))
    Timex = np.uint8(np.nanmean(im_mat, axis=2))
    Variance = np.uint8(np.nanstd(im_mat, axis=2))
    if save_flag:
        cv.imwrite("Darkest.jpg", Dark)
        cv.imwrite("Brightest.jpg", Bright)
        cv.imwrite("Timex.jpg", Timex)
        cv.imwrite("Variance.jpg", Variance)
    if disp_flag:
        fig, axs = plt.subplots(1, 4)
        titles = ['Dark','Bright','Timex','Variance']
        for k, im in enumerate([Dark,Bright,Timex,Variance]):
            axs[k].xaxis.set_visible(False)
            axs[k].yaxis.set_visible(False)
            axs[k].set_title(titles[k])
            axs[k].imshow(
                im.astype(np.uint8),
                cmap="gray",
                vmin=0,
                vmax=255
                )
        plt.show()
def imageStats ( im_mat , save_flag = 0 , disp_flag = 0 ) : Dark = np . uint8 ( np . nanmin ( im_mat , axis = 2 ) ) Bright = np . uint8 ( np . nanmax ( im_mat , axis = 2 ) ) Timex = np . uint8 ( np . nanmean ( im_mat , axis = 2 ) ) Variance = np . uint8 ( np . nanstd ( im_mat , axis = 2 ) ) if save_flag : cv . imwrite ( "Darkest.jpg" , Dark ) cv . imwrite ( "Brightest.jpg" , Bright ) cv . imwrite ( "Timex.jpg" , Timex ) cv . imwrite ( "Variance.jpg" , Variance ) if disp_flag : fig , axs = plt . subplots ( 1 , 4 ) titles = [ 'Dark' , 'Bright' , 'Timex' , 'Variance' ] for k , im in enumerate ( [ Dark , Bright , Timex , Variance ] ) : axs [ k ] . xaxis . set_visible ( False ) axs [ k ] . yaxis . set_visible ( False ) axs [ k ] . set_title ( titles [ k ] ) axs [ k ] . imshow ( im . astype ( np . uint8 ) , cmap = "gray" , vmin = 0 , vmax = 255 ) plt . show ( )
This function generates statistical image products for a given set of
images and corresponding extrinsics/intrinsics.
This function generates statistical image products for a given set of images and corresponding extrinsics / intrinsics .
"""
    This function generates statistical image products for a given set of
    images and corresponding extrinsics/intrinsics. The statistical image
    products are the timex, brightest, variance, darkest.

    All images must have the same dimensions.

    Attributes:
        Bright: brightest pixels at each location across the
                collection
        Dark: darkest pixels at each location across the collection
        Timex: time- exposure (mean) of all pixels at each location
                across the collection
        Variance: standard deviation of all pixels at each location
                across the collection

    Args:
        save_flag: flag to indicate if products should be saved
                automatically to the user's drive

    """
im_mat
save_flag
flag to indicate if products should be saved
automatically to the user's drive
flag to indicate if products should be saved automatically to the user ' s drive
disp_flag
Bright
brightest pixels at each location across the
collection
brightest pixels at each location across the collection
Dark
darkest pixels at each location across the collection
darkest pixels at each location across the collection
Timex
time- exposure (mean) of all pixels at each location
across the collection
time - exposure ( mean ) of all pixels at each location across the collection
Variance
standard deviation of all pixels at each location
across the collection
standard deviation of all pixels at each location across the collection