Exemplo n.º 1
0
def colorspace(src, cs=None):
    '''

    '''
    from skimage.color.colorconv import gray2rgb
    if not isinstance(src, ndarray):
        src = asarray(src)

    return gray2rgb(src)
Exemplo n.º 2
0
def colorspace(src, cs=None):
    '''

    '''

    if not isinstance(src, ndarray):
        src = asarray(src)

    return gray2rgb(src)
            ptop = max(0, y0 - pad)
            pbottom = min(data.height, y1 + pad)
            pright = min(data.width, x1 + pad)
            pleft = max(0, x0 - pad)

            sub_image = data_array[ptop:pbottom, pleft:pright, :].copy()
            sub_mask = mask[ptop:pbottom, pleft:pright]
            sub_highlight = highlight[ptop:pbottom, pleft:pright]

            H = Homography(sub_image, mask=sub_mask)
            output = H.rectified
            sub_highlight = warp(sub_highlight,
                                 AffineTransform(H.H),
                                 preserve_range=True)

            gs = gray2rgb(rgb2gray(output))

            highlighted = output.copy()
            highlighted[sub_highlight == 0] = 0.5 * gs[sub_highlight == 0]
            highlighted[sub_highlight == 128] = (255, 0, 0)

            projection_matrix = H.H
            metadata['use_quad'] = False
            metadata['projection'] = projection_matrix.tolist()
            metadata['subimage'] = dict(left=ptop,
                                        right=pbottom,
                                        bottom=pright,
                                        top=pleft)

        out_folder = args.ofolder
        out_basename = stem + '-facade-{:02}'.format(j + 1)
Exemplo n.º 4
0
def colorspace(src, cs=None):
    from skimage.color.colorconv import gray2rgb
    if not isinstance(src, ndarray):
        src = asarray(src)

    return gray2rgb(src)