Helo, I just learned to use Python. And i have some arrays in tuple bellow.
(array([[ 90, 94, 6],
[126, 108, 24],
[180, 116, 42],
[166, 116, 46],
[ 72, 94, 31]]), array([[101, 96, 14],
[190, 165, 84],
[202, 134, 63],
[170, 115, 50],
[ 40, 50, 0]]), array([[145, 125, 53],
[150, 112, 40],
[148, 73, 6],
[156, 90, 31],
[ 25, 11, 1]]), array([[133, 124, 57],
[165, 142, 75],
[195, 142, 77],
[169, 120, 62],
[ 82, 74, 28]]), array([[ 73, 105, 40],
[ 56, 77, 10],
[138, 135, 67],
[ 97, 95, 34],
[ 45, 69, 21]]))
How can i turn that tuple become an image? Thanks
You can do:
import numpy as np
import matplotlib.pyplot as plot
x = (array([[ 90, 94, 6],
[126, 108, 24],
[180, 116, 42],
[166, 116, 46],
[ 72, 94, 31]]), array([[101, 96, 14],
[190, 165, 84],
[202, 134, 63],
[170, 115, 50],
[ 40, 50, 0]]), array([[145, 125, 53],
[150, 112, 40],
[148, 73, 6],
[156, 90, 31],
[ 25, 11, 1]]), array([[133, 124, 57],
[165, 142, 75],
[195, 142, 77],
[169, 120, 62],
[ 82, 74, 28]]), array([[ 73, 105, 40],
[ 56, 77, 10],
[138, 135, 67],
[ 97, 95, 34],
[ 45, 69, 21]]))
x = np.array(x)
plot.imshow(x)
Or you can go with OpenCV's imshow
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.