当前位置:网站首页>圖像24比特深度轉8比特深度
圖像24比特深度轉8比特深度
2022-07-03 17:56: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)
边栏推荐
- SDNUOJ1015
- How to install PHP on Ubuntu 20.04
- Kotlin的協程:上下文
- Five problems of database operation in commodity supermarket system
- Type conversion, variable
- 面试官:值为 nil 为什么不等于 nil ?
- Website with JS doesn't work in IE9 until the Developer Tools is activated
- Global and Chinese pediatric palliative care drug market development research and investment planning recommendations report 2022-2028
- Deops入门
- Cloud primordial weekly | CNCF released the 2021 cloud primordial development status report, which was released on istio 1.13
猜你喜欢
Discussion sur la logique de conception et de mise en oeuvre du processus de paiement
(8) HS corner detection
Wechat applet for the first time
Market demand survey and marketing strategy analysis report of global and Chinese pet milk substitutes 2022-2028
PHP MySQL inserts data
IntelliJ 2021.3 short command line when running applications
Codeforces Round #803 (Div. 2) C. 3SUM Closure
Leetcode 669 pruning binary search tree -- recursive method and iterative method
STM32 realizes 74HC595 control
Module 9 operation
随机推荐
Getting started with deops
Records of long objects and long judgments in the stream of list
Write a program to process a list container of string type. Find a special value in the container 9.27: and delete it if found. Rewrite the above procedure with deque container.
一入“远程”终不悔,几人欢喜几人愁。| 社区征文
Deops入门
Solve the problem of inaccurate network traffic monitored by ZABBIX with SNMP
First day of rhcsa study
Y is always discrete and can't understand, how to solve it? Answer: read it several times
i++与++i的区别:通俗易懂的讲述他们的区别
Brief introduction to the core functions of automatic penetration testing tool
As soon as we enter "remote", we will never regret, and several people will be happy and several people will be sad| Community essay solicitation
Talk about the design and implementation logic of payment process
STM32 realizes 74HC595 control
A. Berland Poker &1000【简单数学思维】
PHP MySQL inserts data
Draw some simple graphics with MFC
【统信UOS】扫描仪设备管理驱动安装
List of financial products in 2022
ArrayList分析3 : 删除元素
win32:堆破壞的dump文件分析