- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图在这个 Repository 中找出语义分割数据集的 NYU-v2 .
我很难理解图像标签是如何存储的。
例如,给定以下图像:
对应的标签图片为:
现在,如果我在 OpenCV 中打开标签图像,它会将这个图像读取为 RGB 图像:(不过是错误的。甚至尝试将 -1 作为 imread
中的第二个参数)
import cv2
import numpy as np
img = img = cv2.imread(labelImage)
img.shape
>>> (468, 625, 3)
np.unque(img)
>>> array([ 0, 64, 128, 192, 224], dtype=uint8)
from PIL import Image
import numpy as np
img = np.array(Image.open(labelImage))
img.shape
>>> (468, 625)
np.unique(i)
>>> array([ 0, 2, 4, 13, 25, 39, 255], dtype=uint8)
np.unique
证实了这一点,因为纽约大学数据集中的每个图像都有 0-39 的标签(忽略 255),其中每个对象在二维空间中都有一个标签。
最佳答案
它存储为调色板(索引)图像。见 here . OpenCV 不太喜欢调色板图像,只是转换为 RGB。
如果我用 转储它ImageMagick 在终端中,您可以看到调色板(在 Colormap
下)和 Histogram
下的 7 种颜色。 :
identify -verbose YourImage.png
Image: YourImage.png
Format: PNG (Portable Network Graphics)
Mime type: image/png
Class: PseudoClass
Geometry: 625x468+0+0
Units: Undefined
Colorspace: sRGB
Type: Palette
Base type: Undefined
Endianess: Undefined
Depth: 8-bit
Channel depth:
Red: 8-bit
Green: 8-bit
Blue: 8-bit
Channel statistics:
Pixels: 292500
Red:
min: 0 (0)
max: 224 (0.878431)
mean: 64.0019 (0.250988)
standard deviation: 87.3558 (0.342572)
kurtosis: -1.23408
skewness: 0.749894
entropy: 0.746999
Green:
min: 0 (0)
max: 224 (0.878431)
mean: 37.0024 (0.145107)
standard deviation: 68.3573 (0.268068)
kurtosis: 1.38689
skewness: 1.64292
entropy: 0.594363
Blue:
min: 0 (0)
max: 192 (0.752941)
mean: 61.0934 (0.239582)
standard deviation: 80.7328 (0.316599)
kurtosis: -1.34383
skewness: 0.676587
entropy: 0.842137
Image statistics:
Overall:
min: 0 (0)
max: 224 (0.878431)
mean: 54.0326 (0.211892)
standard deviation: 78.8153 (0.30908)
kurtosis: -0.752325
skewness: 0.974955
entropy: 0.727833
Colors: 7
Histogram:
163911: ( 0, 0, 0) #000000 black
16626: ( 0, 0,128) #000080 navy
5261: ( 0,128, 0) #008000 green
37681: (128,128,192) #8080C0 srgb(128,128,192)
36210: (192, 0,128) #C00080 srgb(192,0,128)
12644: (192, 64, 0) #C04000 srgb(192,64,0)
20167: (224,224,192) #E0E0C0 srgb(224,224,192)
Colormap entries: 256
Colormap:
0: ( 0, 0, 0,255) #000000FF black
1: (128, 0, 0,255) #800000FF maroon
2: ( 0,128, 0,255) #008000FF green
3: (128,128, 0,255) #808000FF olive
4: ( 0, 0,128,255) #000080FF navy
5: (128, 0,128,255) #800080FF purple
6: ( 0,128,128,255) #008080FF teal
7: (128,128,128,255) #808080FF fractal
8: ( 64, 0, 0,255) #400000FF srgba(64,0,0,1)
9: (192, 0, 0,255) #C00000FF srgba(192,0,0,1)
10: ( 64,128, 0,255) #408000FF srgba(64,128,0,1)
11: (192,128, 0,255) #C08000FF srgba(192,128,0,1)
12: ( 64, 0,128,255) #400080FF srgba(64,0,128,1)
13: (192, 0,128,255) #C00080FF srgba(192,0,128,1)
14: ( 64,128,128,255) #408080FF srgba(64,128,128,1)
15: (192,128,128,255) #C08080FF srgba(192,128,128,1)
16: ( 0, 64, 0,255) #004000FF srgba(0,64,0,1)
17: (128, 64, 0,255) #804000FF srgba(128,64,0,1)
18: ( 0,192, 0,255) #00C000FF srgba(0,192,0,1)
19: (128,192, 0,255) #80C000FF srgba(128,192,0,1)
20: ( 0, 64,128,255) #004080FF srgba(0,64,128,1)
21: (128, 64,128,255) #804080FF srgba(128,64,128,1)
22: ( 0,192,128,255) #00C080FF srgba(0,192,128,1)
23: (128,192,128,255) #80C080FF srgba(128,192,128,1)
24: ( 64, 64, 0,255) #404000FF srgba(64,64,0,1)
25: (192, 64, 0,255) #C04000FF srgba(192,64,0,1)
26: ( 64,192, 0,255) #40C000FF srgba(64,192,0,1)
27: (192,192, 0,255) #C0C000FF srgba(192,192,0,1)
28: ( 64, 64,128,255) #404080FF srgba(64,64,128,1)
29: (192, 64,128,255) #C04080FF srgba(192,64,128,1)
30: ( 64,192,128,255) #40C080FF srgba(64,192,128,1)
31: (192,192,128,255) #C0C080FF srgba(192,192,128,1)
32: ( 0, 0, 64,255) #000040FF srgba(0,0,64,1)
33: (128, 0, 64,255) #800040FF srgba(128,0,64,1)
34: ( 0,128, 64,255) #008040FF srgba(0,128,64,1)
35: (128,128, 64,255) #808040FF srgba(128,128,64,1)
36: ( 0, 0,192,255) #0000C0FF srgba(0,0,192,1)
37: (128, 0,192,255) #8000C0FF srgba(128,0,192,1)
38: ( 0,128,192,255) #0080C0FF srgba(0,128,192,1)
39: (128,128,192,255) #8080C0FF srgba(128,128,192,1)
40: ( 64, 0, 64,255) #400040FF srgba(64,0,64,1)
41: (192, 0, 64,255) #C00040FF srgba(192,0,64,1)
42: ( 64,128, 64,255) #408040FF srgba(64,128,64,1)
43: (192,128, 64,255) #C08040FF srgba(192,128,64,1)
44: ( 64, 0,192,255) #4000C0FF srgba(64,0,192,1)
45: (192, 0,192,255) #C000C0FF srgba(192,0,192,1)
46: ( 64,128,192,255) #4080C0FF srgba(64,128,192,1)
47: (192,128,192,255) #C080C0FF srgba(192,128,192,1)
48: ( 0, 64, 64,255) #004040FF srgba(0,64,64,1)
49: (128, 64, 64,255) #804040FF srgba(128,64,64,1)
50: ( 0,192, 64,255) #00C040FF srgba(0,192,64,1)
51: (128,192, 64,255) #80C040FF srgba(128,192,64,1)
52: ( 0, 64,192,255) #0040C0FF srgba(0,64,192,1)
53: (128, 64,192,255) #8040C0FF srgba(128,64,192,1)
54: ( 0,192,192,255) #00C0C0FF srgba(0,192,192,1)
55: (128,192,192,255) #80C0C0FF srgba(128,192,192,1)
56: ( 64, 64, 64,255) #404040FF grey25
57: (192, 64, 64,255) #C04040FF srgba(192,64,64,1)
58: ( 64,192, 64,255) #40C040FF srgba(64,192,64,1)
59: (192,192, 64,255) #C0C040FF srgba(192,192,64,1)
60: ( 64, 64,192,255) #4040C0FF srgba(64,64,192,1)
61: (192, 64,192,255) #C040C0FF srgba(192,64,192,1)
62: ( 64,192,192,255) #40C0C0FF srgba(64,192,192,1)
63: (192,192,192,255) #C0C0C0FF silver
64: ( 32, 0, 0,255) #200000FF srgba(32,0,0,1)
65: (160, 0, 0,255) #A00000FF srgba(160,0,0,1)
66: ( 32,128, 0,255) #208000FF srgba(32,128,0,1)
67: (160,128, 0,255) #A08000FF srgba(160,128,0,1)
68: ( 32, 0,128,255) #200080FF srgba(32,0,128,1)
69: (160, 0,128,255) #A00080FF srgba(160,0,128,1)
70: ( 32,128,128,255) #208080FF srgba(32,128,128,1)
71: (160,128,128,255) #A08080FF srgba(160,128,128,1)
72: ( 96, 0, 0,255) #600000FF srgba(96,0,0,1)
73: (224, 0, 0,255) #E00000FF srgba(224,0,0,1)
74: ( 96,128, 0,255) #608000FF srgba(96,128,0,1)
75: (224,128, 0,255) #E08000FF srgba(224,128,0,1)
76: ( 96, 0,128,255) #600080FF srgba(96,0,128,1)
77: (224, 0,128,255) #E00080FF srgba(224,0,128,1)
78: ( 96,128,128,255) #608080FF srgba(96,128,128,1)
79: (224,128,128,255) #E08080FF srgba(224,128,128,1)
80: ( 32, 64, 0,255) #204000FF srgba(32,64,0,1)
81: (160, 64, 0,255) #A04000FF srgba(160,64,0,1)
82: ( 32,192, 0,255) #20C000FF srgba(32,192,0,1)
83: (160,192, 0,255) #A0C000FF srgba(160,192,0,1)
84: ( 32, 64,128,255) #204080FF srgba(32,64,128,1)
85: (160, 64,128,255) #A04080FF srgba(160,64,128,1)
86: ( 32,192,128,255) #20C080FF srgba(32,192,128,1)
87: (160,192,128,255) #A0C080FF srgba(160,192,128,1)
88: ( 96, 64, 0,255) #604000FF srgba(96,64,0,1)
89: (224, 64, 0,255) #E04000FF srgba(224,64,0,1)
90: ( 96,192, 0,255) #60C000FF srgba(96,192,0,1)
91: (224,192, 0,255) #E0C000FF srgba(224,192,0,1)
92: ( 96, 64,128,255) #604080FF srgba(96,64,128,1)
93: (224, 64,128,255) #E04080FF srgba(224,64,128,1)
94: ( 96,192,128,255) #60C080FF srgba(96,192,128,1)
95: (224,192,128,255) #E0C080FF srgba(224,192,128,1)
96: ( 32, 0, 64,255) #200040FF srgba(32,0,64,1)
97: (160, 0, 64,255) #A00040FF srgba(160,0,64,1)
98: ( 32,128, 64,255) #208040FF srgba(32,128,64,1)
99: (160,128, 64,255) #A08040FF srgba(160,128,64,1)
100: ( 32, 0,192,255) #2000C0FF srgba(32,0,192,1)
101: (160, 0,192,255) #A000C0FF srgba(160,0,192,1)
102: ( 32,128,192,255) #2080C0FF srgba(32,128,192,1)
103: (160,128,192,255) #A080C0FF srgba(160,128,192,1)
104: ( 96, 0, 64,255) #600040FF srgba(96,0,64,1)
105: (224, 0, 64,255) #E00040FF srgba(224,0,64,1)
106: ( 96,128, 64,255) #608040FF srgba(96,128,64,1)
107: (224,128, 64,255) #E08040FF srgba(224,128,64,1)
108: ( 96, 0,192,255) #6000C0FF srgba(96,0,192,1)
109: (224, 0,192,255) #E000C0FF srgba(224,0,192,1)
110: ( 96,128,192,255) #6080C0FF srgba(96,128,192,1)
111: (224,128,192,255) #E080C0FF srgba(224,128,192,1)
112: ( 32, 64, 64,255) #204040FF srgba(32,64,64,1)
113: (160, 64, 64,255) #A04040FF srgba(160,64,64,1)
114: ( 32,192, 64,255) #20C040FF srgba(32,192,64,1)
115: (160,192, 64,255) #A0C040FF srgba(160,192,64,1)
116: ( 32, 64,192,255) #2040C0FF srgba(32,64,192,1)
117: (160, 64,192,255) #A040C0FF srgba(160,64,192,1)
118: ( 32,192,192,255) #20C0C0FF srgba(32,192,192,1)
119: (160,192,192,255) #A0C0C0FF srgba(160,192,192,1)
120: ( 96, 64, 64,255) #604040FF srgba(96,64,64,1)
121: (224, 64, 64,255) #E04040FF srgba(224,64,64,1)
122: ( 96,192, 64,255) #60C040FF srgba(96,192,64,1)
123: (224,192, 64,255) #E0C040FF srgba(224,192,64,1)
124: ( 96, 64,192,255) #6040C0FF srgba(96,64,192,1)
125: (224, 64,192,255) #E040C0FF srgba(224,64,192,1)
126: ( 96,192,192,255) #60C0C0FF srgba(96,192,192,1)
127: (224,192,192,255) #E0C0C0FF srgba(224,192,192,1)
128: ( 0, 32, 0,255) #002000FF srgba(0,32,0,1)
129: (128, 32, 0,255) #802000FF srgba(128,32,0,1)
130: ( 0,160, 0,255) #00A000FF srgba(0,160,0,1)
131: (128,160, 0,255) #80A000FF srgba(128,160,0,1)
132: ( 0, 32,128,255) #002080FF srgba(0,32,128,1)
133: (128, 32,128,255) #802080FF srgba(128,32,128,1)
134: ( 0,160,128,255) #00A080FF srgba(0,160,128,1)
135: (128,160,128,255) #80A080FF srgba(128,160,128,1)
136: ( 64, 32, 0,255) #402000FF srgba(64,32,0,1)
137: (192, 32, 0,255) #C02000FF srgba(192,32,0,1)
138: ( 64,160, 0,255) #40A000FF srgba(64,160,0,1)
139: (192,160, 0,255) #C0A000FF srgba(192,160,0,1)
140: ( 64, 32,128,255) #402080FF srgba(64,32,128,1)
141: (192, 32,128,255) #C02080FF srgba(192,32,128,1)
142: ( 64,160,128,255) #40A080FF srgba(64,160,128,1)
143: (192,160,128,255) #C0A080FF srgba(192,160,128,1)
144: ( 0, 96, 0,255) #006000FF srgba(0,96,0,1)
145: (128, 96, 0,255) #806000FF srgba(128,96,0,1)
146: ( 0,224, 0,255) #00E000FF srgba(0,224,0,1)
147: (128,224, 0,255) #80E000FF srgba(128,224,0,1)
148: ( 0, 96,128,255) #006080FF srgba(0,96,128,1)
149: (128, 96,128,255) #806080FF srgba(128,96,128,1)
150: ( 0,224,128,255) #00E080FF srgba(0,224,128,1)
151: (128,224,128,255) #80E080FF srgba(128,224,128,1)
152: ( 64, 96, 0,255) #406000FF srgba(64,96,0,1)
153: (192, 96, 0,255) #C06000FF srgba(192,96,0,1)
154: ( 64,224, 0,255) #40E000FF srgba(64,224,0,1)
155: (192,224, 0,255) #C0E000FF srgba(192,224,0,1)
156: ( 64, 96,128,255) #406080FF srgba(64,96,128,1)
157: (192, 96,128,255) #C06080FF srgba(192,96,128,1)
158: ( 64,224,128,255) #40E080FF srgba(64,224,128,1)
159: (192,224,128,255) #C0E080FF srgba(192,224,128,1)
160: ( 0, 32, 64,255) #002040FF srgba(0,32,64,1)
161: (128, 32, 64,255) #802040FF srgba(128,32,64,1)
162: ( 0,160, 64,255) #00A040FF srgba(0,160,64,1)
163: (128,160, 64,255) #80A040FF srgba(128,160,64,1)
164: ( 0, 32,192,255) #0020C0FF srgba(0,32,192,1)
165: (128, 32,192,255) #8020C0FF srgba(128,32,192,1)
166: ( 0,160,192,255) #00A0C0FF srgba(0,160,192,1)
167: (128,160,192,255) #80A0C0FF srgba(128,160,192,1)
168: ( 64, 32, 64,255) #402040FF srgba(64,32,64,1)
169: (192, 32, 64,255) #C02040FF srgba(192,32,64,1)
170: ( 64,160, 64,255) #40A040FF srgba(64,160,64,1)
171: (192,160, 64,255) #C0A040FF srgba(192,160,64,1)
172: ( 64, 32,192,255) #4020C0FF srgba(64,32,192,1)
173: (192, 32,192,255) #C020C0FF srgba(192,32,192,1)
174: ( 64,160,192,255) #40A0C0FF srgba(64,160,192,1)
175: (192,160,192,255) #C0A0C0FF srgba(192,160,192,1)
176: ( 0, 96, 64,255) #006040FF srgba(0,96,64,1)
177: (128, 96, 64,255) #806040FF srgba(128,96,64,1)
178: ( 0,224, 64,255) #00E040FF srgba(0,224,64,1)
179: (128,224, 64,255) #80E040FF srgba(128,224,64,1)
180: ( 0, 96,192,255) #0060C0FF srgba(0,96,192,1)
181: (128, 96,192,255) #8060C0FF srgba(128,96,192,1)
182: ( 0,224,192,255) #00E0C0FF srgba(0,224,192,1)
183: (128,224,192,255) #80E0C0FF srgba(128,224,192,1)
184: ( 64, 96, 64,255) #406040FF srgba(64,96,64,1)
185: (192, 96, 64,255) #C06040FF srgba(192,96,64,1)
186: ( 64,224, 64,255) #40E040FF srgba(64,224,64,1)
187: (192,224, 64,255) #C0E040FF srgba(192,224,64,1)
188: ( 64, 96,192,255) #4060C0FF srgba(64,96,192,1)
189: (192, 96,192,255) #C060C0FF srgba(192,96,192,1)
190: ( 64,224,192,255) #40E0C0FF srgba(64,224,192,1)
191: (192,224,192,255) #C0E0C0FF srgba(192,224,192,1)
192: ( 32, 32, 0,255) #202000FF srgba(32,32,0,1)
193: (160, 32, 0,255) #A02000FF srgba(160,32,0,1)
194: ( 32,160, 0,255) #20A000FF srgba(32,160,0,1)
195: (160,160, 0,255) #A0A000FF srgba(160,160,0,1)
196: ( 32, 32,128,255) #202080FF srgba(32,32,128,1)
197: (160, 32,128,255) #A02080FF srgba(160,32,128,1)
198: ( 32,160,128,255) #20A080FF srgba(32,160,128,1)
199: (160,160,128,255) #A0A080FF srgba(160,160,128,1)
200: ( 96, 32, 0,255) #602000FF srgba(96,32,0,1)
201: (224, 32, 0,255) #E02000FF srgba(224,32,0,1)
202: ( 96,160, 0,255) #60A000FF srgba(96,160,0,1)
203: (224,160, 0,255) #E0A000FF srgba(224,160,0,1)
204: ( 96, 32,128,255) #602080FF srgba(96,32,128,1)
205: (224, 32,128,255) #E02080FF srgba(224,32,128,1)
206: ( 96,160,128,255) #60A080FF srgba(96,160,128,1)
207: (224,160,128,255) #E0A080FF srgba(224,160,128,1)
208: ( 32, 96, 0,255) #206000FF srgba(32,96,0,1)
209: (160, 96, 0,255) #A06000FF srgba(160,96,0,1)
210: ( 32,224, 0,255) #20E000FF srgba(32,224,0,1)
211: (160,224, 0,255) #A0E000FF srgba(160,224,0,1)
212: ( 32, 96,128,255) #206080FF srgba(32,96,128,1)
213: (160, 96,128,255) #A06080FF srgba(160,96,128,1)
214: ( 32,224,128,255) #20E080FF srgba(32,224,128,1)
215: (160,224,128,255) #A0E080FF srgba(160,224,128,1)
216: ( 96, 96, 0,255) #606000FF srgba(96,96,0,1)
217: (224, 96, 0,255) #E06000FF srgba(224,96,0,1)
218: ( 96,224, 0,255) #60E000FF srgba(96,224,0,1)
219: (224,224, 0,255) #E0E000FF srgba(224,224,0,1)
220: ( 96, 96,128,255) #606080FF srgba(96,96,128,1)
221: (224, 96,128,255) #E06080FF srgba(224,96,128,1)
222: ( 96,224,128,255) #60E080FF srgba(96,224,128,1)
223: (224,224,128,255) #E0E080FF srgba(224,224,128,1)
224: ( 32, 32, 64,255) #202040FF srgba(32,32,64,1)
225: (160, 32, 64,255) #A02040FF srgba(160,32,64,1)
226: ( 32,160, 64,255) #20A040FF srgba(32,160,64,1)
227: (160,160, 64,255) #A0A040FF srgba(160,160,64,1)
228: ( 32, 32,192,255) #2020C0FF srgba(32,32,192,1)
229: (160, 32,192,255) #A020C0FF srgba(160,32,192,1)
230: ( 32,160,192,255) #20A0C0FF srgba(32,160,192,1)
231: (160,160,192,255) #A0A0C0FF srgba(160,160,192,1)
232: ( 96, 32, 64,255) #602040FF srgba(96,32,64,1)
233: (224, 32, 64,255) #E02040FF srgba(224,32,64,1)
234: ( 96,160, 64,255) #60A040FF srgba(96,160,64,1)
235: (224,160, 64,255) #E0A040FF srgba(224,160,64,1)
236: ( 96, 32,192,255) #6020C0FF srgba(96,32,192,1)
237: (224, 32,192,255) #E020C0FF srgba(224,32,192,1)
238: ( 96,160,192,255) #60A0C0FF srgba(96,160,192,1)
239: (224,160,192,255) #E0A0C0FF srgba(224,160,192,1)
240: ( 32, 96, 64,255) #206040FF srgba(32,96,64,1)
241: (160, 96, 64,255) #A06040FF srgba(160,96,64,1)
242: ( 32,224, 64,255) #20E040FF srgba(32,224,64,1)
243: (160,224, 64,255) #A0E040FF srgba(160,224,64,1)
244: ( 32, 96,192,255) #2060C0FF srgba(32,96,192,1)
245: (160, 96,192,255) #A060C0FF srgba(160,96,192,1)
246: ( 32,224,192,255) #20E0C0FF srgba(32,224,192,1)
247: (160,224,192,255) #A0E0C0FF srgba(160,224,192,1)
248: ( 96, 96, 64,255) #606040FF srgba(96,96,64,1)
249: (224, 96, 64,255) #E06040FF srgba(224,96,64,1)
250: ( 96,224, 64,255) #60E040FF srgba(96,224,64,1)
251: (224,224, 64,255) #E0E040FF srgba(224,224,64,1)
252: ( 96, 96,192,255) #6060C0FF srgba(96,96,192,1)
253: (224, 96,192,255) #E060C0FF srgba(224,96,192,1)
254: ( 96,224,192,255) #60E0C0FF srgba(96,224,192,1)
255: (224,224,192,255) #E0E0C0FF srgba(224,224,192,1)
Rendering intent: Perceptual
Gamma: 0.454545
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Matte color: grey74
Background color: white
Border color: srgb(223,223,223)
Transparent color: none
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 625x468+0+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Properties:
date:create: 2020-01-21T11:05:35+00:00
date:modify: 2020-01-21T11:05:35+00:00
png:IHDR.bit-depth-orig: 8
png:IHDR.bit_depth: 8
png:IHDR.color-type-orig: 3
png:IHDR.color_type: 3 (Indexed)
png:IHDR.interlace_method: 0 (Not interlaced)
png:IHDR.width,height: 625, 468
png:PLTE.number_colors: 256
png:sRGB: intent=0 (Perceptual Intent)
signature: 12c7d4ddd28f23d431ea875c618757f305577bf8aec476ec418728c161d3de8e
Artifacts:
verbose: true
Tainted: False
Filesize: 6497B
Number pixels: 292500
Pixels per second: 54.4078MP
User time: 0.000u
Elapsed time: 0:01.005
Version: ImageMagick 7.0.9-6 Q16 x86_64 2019-11-27 https://imagemagick.org
pngcheck
像这样:
pngcheck -vp YourImage.png
File: YourImage.png (6497 bytes)
chunk IHDR at offset 0x0000c, length 13
625 x 468 image, 8-bit palette, non-interlaced
chunk PLTE at offset 0x00025, length 768: 256 palette entries
0: ( 0, 0, 0) = (0x00,0x00,0x00)
1: (128, 0, 0) = (0x80,0x00,0x00)
2: ( 0,128, 0) = (0x00,0x80,0x00)
3: (128,128, 0) = (0x80,0x80,0x00)
4: ( 0, 0,128) = (0x00,0x00,0x80)
5: (128, 0,128) = (0x80,0x00,0x80)
6: ( 0,128,128) = (0x00,0x80,0x80)
7: (128,128,128) = (0x80,0x80,0x80)
8: ( 64, 0, 0) = (0x40,0x00,0x00)
9: (192, 0, 0) = (0xc0,0x00,0x00)
10: ( 64,128, 0) = (0x40,0x80,0x00)
11: (192,128, 0) = (0xc0,0x80,0x00)
12: ( 64, 0,128) = (0x40,0x00,0x80)
13: (192, 0,128) = (0xc0,0x00,0x80)
14: ( 64,128,128) = (0x40,0x80,0x80)
15: (192,128,128) = (0xc0,0x80,0x80)
16: ( 0, 64, 0) = (0x00,0x40,0x00)
17: (128, 64, 0) = (0x80,0x40,0x00)
18: ( 0,192, 0) = (0x00,0xc0,0x00)
19: (128,192, 0) = (0x80,0xc0,0x00)
20: ( 0, 64,128) = (0x00,0x40,0x80)
21: (128, 64,128) = (0x80,0x40,0x80)
22: ( 0,192,128) = (0x00,0xc0,0x80)
23: (128,192,128) = (0x80,0xc0,0x80)
24: ( 64, 64, 0) = (0x40,0x40,0x00)
25: (192, 64, 0) = (0xc0,0x40,0x00)
...
...
251: (224,224, 64) = (0xe0,0xe0,0x40)
252: ( 96, 96,192) = (0x60,0x60,0xc0)
253: (224, 96,192) = (0xe0,0x60,0xc0)
254: ( 96,224,192) = (0x60,0xe0,0xc0)
255: (224,224,192) = (0xe0,0xe0,0xc0)
chunk IDAT at offset 0x00331, length 5660
zlib: deflated, 32K window, default compression
chunk IEND at offset 0x01959, length 0
No errors detected in p.png (4 chunks, 97.8% compression).
magick -size 1x1 xc:black xc:navy xc:green xc:'#8080C0' xc:'#C00080' xc:'#C04000' xc:'#E0E0C0' +append palette.png
magick OpenCVresult.png +dither -remap palette.png result.png
convert
代替
magick
.
关于python - OpenCV 将图像读取为 3 channel 图像,而 PIL 将图像读取为 1 channel 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59839709/
我遇到以下问题。我想读取一个包含数百万行和数百列的大型 csv。我想向下转换列的数据类型。我的方法是读取 csv,然后使用 pd.to_numeric() 对其进行向下转换。我不知道列数及其类型。在读
目前,我从 SQL server (2008) 数据库获取数据。 cyurrent的方法是使用DataTable,然后将其传递并使用。 if (parameters != null)
我有以下问题。我有一个巨大的 csv 文件,想用多处理加载它。对于一个包含 500000 行和 130 列不同数据类型的示例文件,Pandas 需要 19 秒。我试过 dask 因为我想多处理阅读。但
是否有关于用于序列化各种 MFC 数据结构的二进制格式的明确文档?我已经能够在十六进制编辑器中查看我自己的一些类,并使用 Java 的 ByteBuffer 类读取它们(使用自动字节顺序转换等)。 但
我正在使用 Selenium 进行测试,我们用 HTML 文件编写测试用例,并用它们制作测试套件,我们的要求是编写足够健壮的测试用例,以根据测试环境改变自身。 为此,我不希望在 HTML 脚本本身中包
我需要一个 JavaScript 代码来读取存储为 .txt 文件的字典(或者也可以保存为任何其他类型的文件。它也可以在线获得)并将其内容存储在一个变量中。我不能找到一种让 JavaScript 像
我正在尝试遍历包含 SSH 登录和其他日志的日志文本文件。 程序正在返回 SSH 登录的总数。 我的解决方案确实有效,但似乎有点慢(在 200mo 文件上大约需要 3.5 秒)。我想知道是否有任何方法
我正在将大量数据从一个电子表格复制到工作簿中的其他 160 个电子表格。目前,Excel (2013) 遇到错误,因为它没有足够的资源来完成操作。 我的目标是将工作表 4 中 V13:XI1150 范
我正在尝试读取一个有 1147 行的文本文件。下面的代码仅读取第 1050-1147 行。我的目标是读取整个文件并提取位于不同行的特定值以在脚本中使用。一个示例是包含“BlockList: 2”的行中
我正在为游戏编写解释器。用户将其移动输入解释器,程序执行该移动。 现在我想为每个决定实现一个时间限制。玩家不应该能够思考超过 30 秒来写一个移动并按下回车。 call_with_time_limit
以this file例如,我正在尝试读取 data.frame 中的数据。来自 the doc (pdf 文件,表 1),它遵循一些 fortran 约定。我尝试了以下但收效甚微: dir 0' 将
我正在使用 R 阅读 Outlook 附件。我的引用在这里:Download attachment from an outlook email using R 这是我的电子邮件的截图: 这每天都会发送
我不会从表格中读取行来将主题放在列表中 php脚本 $url_obj='http://'.$host.':8069/xmlrpc/object'; $sock=new xmlrpc_client($u
我有一个这样的 csv 文件: id,name,value 1,peter,5 2,peter\,paul,3 我如何读取此文件并告诉 R "\," 不表示新列,仅表示 ","。 我必须添加该文件
我正在尝试读取 ~/Library/Preferences/com.apple.mail.plist (在 Snow Leopard 上)以获取电子邮件地址和其他信息以进入“关于”对话框。我使用以下代
This question already has answers here: How do I use floating-point division in bash? (19个回答) 5个月前关闭
本练习的目标是读取输入文件并将其存储到表中,然后验证输入中的某些字段并输出任何错误记录。我需要读取并存储每个策略组,以便表中一次仅存储 5 条记录,而不是整个文件。 所以我需要读取一个包含 5 条记录
据我了解,LWT 插入始终以 SERIAL 一致性级别完成。如果为 true,这是否意味着读取作为 LWT 插入的行可以安全地以 ANY 的一致性级别读取? 换句话说,我假设 LWT 插入是完全一致的
我看到很多很多通过java脚本读取cookie的函数,但我只想在变量中使用它一次,我是JS新手。 这是我的代码 var TheNumber = (Math.random() + '') * 10000
我正在使用 asp.net 和 C#。我在服务器上部署了一个应用程序[已发布],现在我想查看该网站的代码,据我所知,我可以阅读程序集来查看代码。 请告诉我如何实现它。 提前致谢。 最佳答案 您可以使用
我是一名优秀的程序员,十分优秀!