Python - Mapas de color

 
Vista:

Mapas de color

Publicado por Geomata (21 intervenciones) el 12/01/2021 10:02:08
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import skimage.io as io
import numpy as np
import matplotlib.pyplot as plt
import cv2
a = np.ones((50,200))
b = a*100
c =a*200
d = np.block([[b],[c],[b]])
e =d.astype('uint8')
f= e
def applyCustomColorMap(b_esp):
    mapac_esp =np.zeros((256,1,3),dtype=np.uint8)
    mapac_esp[0:105,0,0]=255
    mapac_esp[105:255,0,0:2]=255
    im_color =cv2.applyColorMap(b_esp,mapac_esp)
    return im_color;
espa =applyCustomColorMap(e);
plt.imshow(espa);
 
def applyCustomColorMap(b_arg):
    mapac_esp =np.zeros((256,1,3),dtype=np.uint8)
    mapac_esp[0:105,0,2]=255
    mapac_esp[105:255,0,:]=255
    im_color =cv2.applyColorMap(b_arg,mapac_esp)
    return im_color;
arg =applyCustomColorMap(f);
plt.subplot
plt.imshow(arg);
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder