当前位置:网站首页>Image 24 bit depth to 8 bit depth
Image 24 bit depth to 8 bit depth
2022-07-03 17:56:00 【I am a little rice】
import os
import cv2
import numpy as np
labels_path = 'label_5_class_png_1024_1024'
labels_save_path = 'label_5_class_png_1024_1024_1'
// Get all the files in the folder
label_names = os.listdir(labels_path)
for s in label_names:
label_path = os.path.join(labels_path, s)
label_save_path = os.path.join(labels_save_path, s)
// Read the file
label = cv2.imread(label_path)
// 24 Bit depth turn 8 Bit depth
label = cv.cvtColor(label, cv.COLOR_BGR2GRAY)
// Save the file
cv2.imwrite(label_save_path, label)
边栏推荐
- Managing multiple selections with MVVM - managing multiple selections with MVVM
- Redis core technology and practice - learning notes (IX): slicing cluster
- Loop through JSON object list
- Kotlin的協程:上下文
- (8) HS corner detection
- How to install PHP on Ubuntu 20.04
- 远程办公工具分享|社区征文
- Design limitations of structure type (struct)
- Talk about the design and implementation logic of payment process
- PHP MySQL Update
猜你喜欢
Codeforces Round #803 (Div. 2) C. 3SUM Closure
SQL injection database operation foundation
BFS - topology sort
Redis core technology and practice - learning notes (11): why not just string
微服务组件Sentinel控制台调用
Wechat applet for the first time
Micro service component sentinel console call
聊聊支付流程的设计与实现逻辑
模块九作业
TCP拥塞控制详解 | 3. 设计空间
随机推荐
Managing multiple selections with MVVM - managing multiple selections with MVVM
互聯網醫院HIS管理平臺源碼,在線問診,預約掛號 智慧醫院小程序源碼
Graduation summary
Win32: analyse du fichier dump pour la défaillance du tas
Baiwen.com 7 days Internet of things smart home learning experience punch in the next day
Y is always discrete and can't understand, how to solve it? Answer: read it several times
The difference between i++ and ++i: tell their differences easily
BFS - topology sort
Gear2021 monthly update - December
Analyse ArrayList 3: suppression d'éléments
supervisor监控Gearman任务
Research Report on competitive strategy Outlook Analysis and investment strategic planning of China's smart home equipment industry, 2022-2028
List of financial products in 2022
(8) HS corner detection
Wechat applet for the first time
ArrayList analysis 3: delete elements
STM32 realizes 74HC595 control
Applet with multiple tabs and Swipers + paging of each tab
Talk about the design and implementation logic of payment process
PHP MySQL inserts data