当前位置:网站首页>图像24位深度转8位深度
图像24位深度转8位深度
2022-07-03 17:55:00 【我是一个小稻米】
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'
// 获得文件夹下的所有文件
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)
// 读取文件
label = cv2.imread(label_path)
// 24位深度转8位深度
label = cv.cvtColor(label, cv.COLOR_BGR2GRAY)
// 保存文件
cv2.imwrite(label_save_path, label)
边栏推荐
- Leetcode 108 converts an ordered array into a binary search tree -- recursive method
- Golang unit test, mock test and benchmark test
- (8) HS corner detection
- 聊聊支付流程的设计与实现逻辑
- WebView module manages the application window interface to realize the logical control and management operation of multiple windows (Part 1)
- AcWing 271. 杨老师的照相排列【多维DP】
- How to purchase Google colab members in China
- Five problems of database operation in commodity supermarket system
- Research Report on competitive strategy Outlook Analysis and investment strategic planning of China's smart home equipment industry, 2022-2028
- PR second time
猜你喜欢
Market demand survey and marketing strategy analysis report of global and Chinese pet milk substitutes 2022-2028
win32:堆破壞的dump文件分析
QT learning diary 9 - dialog box
Win32: analyse du fichier dump pour la défaillance du tas
Redis core technology and practice - learning notes (VIII) sentinel cluster: sentinel hung up
Hongmeng third training
Wechat applet for the first time
Win32: dump file analysis of heap corruption
[set theory] order relation: summary (partial order relation | partial order set | comparable | strictly less than | covering | hasto | total order relation | quasi order relation | partial order rela
List的stream中Long对象与long判等问题记录
随机推荐
Design limitations of structure type (struct)
OpenSSL的SSL/BIO_get_fd
Baiwen.com 7 days Internet of things smart home learning experience punch in the next day
Embedded-c language-7
The third day of writing C language by Yabo people
PHP MySQL Update
supervisor监控Gearman任务
聊聊支付流程的设计与实现逻辑
[combinatorics] recursive equation (case where the non-homogeneous part is exponential | example where the non-homogeneous part is exponential)
Micro service component sentinel console call
毕业总结
Basic grammar of interview (Part 2)
SSL / bio pour OpenSSL Get FD
[combinatorics] recursive equation (summary of the solution process of recursive equation | homogeneous | double root | non-homogeneous | characteristic root is 1 | exponential form | the bottom is th
[教程]在 CoreOS 上构建你的第一个应用
PUT vs. POST for Uploading Files - RESTful API to be Built Using Zend Framework
ArrayList analysis 3: delete elements
Create a new file from templates with bash script - create new file from templates with bash script
Talk about the design and implementation logic of payment process
聊聊支付流程的設計與實現邏輯