当前位置:网站首页>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)
边栏推荐
- [mathematical logic] equivalent calculus and reasoning calculus of predicate logic (individual word | predicate | quantifier | predicate logic formula | two basic formulas | proposition symbolization
- Ssl/bio of OpenSSL_ get_ fd
- Baiwen.com 7 days Internet of things smart home learning experience punch in the next day
- SDNUOJ1015
- How to enforce parameters in PowerShell- How do I make parameters mandatory in PowerShell?
- [LINUX]CentOS 7 安装MYSQL时报错“No package mysql-server available“No package zabbix-server-mysql availabl
- Redis core technology and practice - learning notes (VI) how to achieve data consistency between master and slave Libraries
- Global and Chinese health care OEM and ODM market status survey and investment planning recommendations report 2022-2028
- 小程序 多tab 多swiper + 每个tab分页
- Records of long objects and long judgments in the stream of list
猜你喜欢
Line by line explanation of yolox source code of anchor free series network (5) -- mosaic data enhancement and mathematical understanding
Internet hospital his management platform source code, online consultation, appointment registration smart hospital applet source code
Leetcode 538 converts binary search tree into cumulative tree -- recursive method and iterative method
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
List的stream中Long对象与long判等问题记录
一入“远程”终不悔,几人欢喜几人愁。| 社区征文
STM32实现74HC595控制
Redis core technology and practice - learning notes (VIII) sentinel cluster: sentinel hung up
AcWing 271. Teacher Yang's photographic arrangement [multidimensional DP]
1147_ Makefile learning_ Target files and dependent files in makefile
随机推荐
MinGW compile boost library
SSL / bio pour OpenSSL Get FD
The gbase 8A database does not support the DB2 function value (column_name, 0) cluster syntax
Supervisor monitors gearman tasks
聊聊支付流程的设计与实现逻辑
Website with JS doesn't work in IE9 until the Developer Tools is activated
How to install PHP on Ubuntu 20.04
PHP MySQL reads data
Ssl/bio of OpenSSL_ get_ fd
SDNUOJ1015
Global and Chinese pediatric palliative care drug market development research and investment planning recommendations report 2022-2028
Kotlin的协程:上下文
Cloud primordial weekly | CNCF released the 2021 cloud primordial development status report, which was released on istio 1.13
PHP MySQL where clause
Embedded-c language-7
Redis core technology and practice - learning notes (VII) sentinel mechanism
Create a new file from templates with bash script - create new file from templates with bash script
Classroom attendance system based on face recognition tkinter+openpyxl+face_ recognition
win32:堆破坏的dump文件分析
Internet Hospital his Management Platform source, online Inquiry, appointment Registration Smart Hospital Small program source