当前位置:网站首页>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)
边栏推荐
- Supervisor monitors gearman tasks
- [Tongxin UOS] scanner device management driver installation
- TCP拥塞控制详解 | 3. 设计空间
- Remote office tools sharing | community essay solicitation
- i++与++i的区别:通俗易懂的讲述他们的区别
- [vscode] convert tabs to spaces
- A. Berland Poker & 1000 [simple mathematical thinking]
- Leetcode540: a single element in an ordered array
- Cloud primordial weekly | CNCF released the 2021 cloud primordial development status report, which was released on istio 1.13
- Module 9 operation
猜你喜欢

Deops入门

Draw some simple graphics with MFC

Module 9 operation

PHP MySQL inserts multiple pieces of data

MySQL grouping query

Research Report on investment trends and development planning of China's thermal insulation material industry, 2022-2028

Redis core technology and practice - learning notes (VII) sentinel mechanism

Line by line explanation of yolox source code of anchor free series network (5) -- mosaic data enhancement and mathematical understanding

Talk about the design and implementation logic of payment process

Ml (machine learning) softmax function to realize the classification of simple movie categories
随机推荐
Leetcode 108 converts an ordered array into a binary search tree -- recursive method
Internet hospital his management platform source code, online consultation, appointment registration smart hospital applet source code
PHP processing - watermark images (text, etc.)
Brief introduction to the core functions of automatic penetration testing tool
win32:堆破坏的dump文件分析
Website with JS doesn't work in IE9 until the Developer Tools is activated
AcWing 271. Teacher Yang's photographic arrangement [multidimensional DP]
面试官:值为 nil 为什么不等于 nil ?
SDNUOJ1015
Codeforces Round #803 (Div. 2) C. 3SUM Closure
Ssl/bio of OpenSSL_ get_ fd
Analysis report on production and marketing demand and investment forecast of China's PVC industry from 2021 to 2026
How to deploy applications on kubernetes cluster
link preload prefetch
Draw some simple graphics with MFC
微服务组件Sentinel控制台调用
[LINUX]CentOS 7 安装MYSQL时报错“No package mysql-server available“No package zabbix-server-mysql availabl
A. Berland Poker &1000【简单数学思维】
MySQL grouping query
Research Report on market demand and investment planning for the development of China's office chair industry, 2022-2028