当前位置:网站首页>统计图像中各像素值的数量
统计图像中各像素值的数量
2022-07-03 17:55:00 【我是一个小稻米】
import cv2
import numpy as np
image = cv2.imread("./train_label/image100.png")
classes_nums = np.zeros([256], np.float32)
classes_nums += np.bincount(np.reshape(label, [-1]), minlength=256)
print("打印像素点的值与数量。")
print('-' * 37)
print("| %15s | %15s |"%("Key", "Value"))
print('-' * 37)
for i in range(256):
if classes_nums[i] > 0:
print("| %15s | %15s |"%(str(i), str(classes_nums[i])))
print('-' * 37)
边栏推荐
- 面试官:值为 nil 为什么不等于 nil ?
- Design limitations of structure type (struct)
- Tensorboard quick start (pytoch uses tensorboard)
- How to read the source code [debug and observe the source code]
- Research Report on competitive strategy Outlook Analysis and investment strategic planning of China's smart home equipment industry, 2022-2028
- Web-ui automated testing - the most complete element positioning method
- 互联网医院HIS管理平台源码,在线问诊,预约挂号 智慧医院小程序源码
- List的stream中Long对象与long判等问题记录
- [Tongxin UOS] scanner device management driver installation
- First day of rhcsa study
猜你喜欢
Internet Hospital his Management Platform source, online Inquiry, appointment Registration Smart Hospital Small program source
How to purchase Google colab members in China
Internet hospital his management platform source code, online consultation, appointment registration smart hospital applet source code
Baiwen.com 7 days Internet of things smart home learning experience punch in the next day
Talk about the design and implementation logic of payment process
Global and Chinese health care OEM and ODM market status survey and investment planning recommendations report 2022-2028
Talk about the design and implementation logic of payment process
PHP MySQL create database
win32:堆破坏的dump文件分析
Market demand survey and marketing strategy analysis report of global and Chinese pet milk substitutes 2022-2028
随机推荐
How to deploy applications on kubernetes cluster
PHP MySQL Update
Baiwen.com 7 days Internet of things smart home learning experience punch in the next day
ArrayList分析3 : 删除元素
MySQL grouping query
QT learning diary 9 - dialog box
A. Odd Selection【BruteForce】
List的stream中Long对象与long判等问题记录
Deops入门
PHP MySQL order by keyword
微服务组件Sentinel控制台调用
PHP returns 500 errors but no error log - PHP return 500 error but no error log
小程序 多tab 多swiper + 每个tab分页
Life perception 1
[mathematical logic] equivalent calculus and reasoning calculus of predicate logic (individual word | predicate | quantifier | predicate logic formula | two basic formulas | proposition symbolization
Global and Chinese health care OEM and ODM market status survey and investment planning recommendations report 2022-2028
Micro service component sentinel console call
i++与++i的区别:通俗易懂的讲述他们的区别
聊聊支付流程的设计与实现逻辑
ArrayList分析3 : 删除元素