pythonbook/实例学习d3blocks/官网例子/imageslider.py

21 lines
506 B
Python

# Load d3blocks
from d3blocks import D3Blocks
#
# Initialize
d3 = D3Blocks()
#
# Local images
img_before, img_after = d3.import_example('southern_nebula')
#
# Internet location
img_before, img_after = d3.import_example('southern_nebula_internet')
#
# Read the image in array
img_before = cv2.imread(img_before, -1)
img_after = cv2.imread(img_after, -1)
#
# Plot
d3.imageslider(img_before, img_after)
#
# Plot
d3.imageslider(img_before, img_after, showfig=True, scale=True, colorscale=2, figsize=[400, 400])