当前位置:网站首页>统计图像中各像素值的数量
统计图像中各像素值的数量
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)
边栏推荐
- 互聯網醫院HIS管理平臺源碼,在線問診,預約掛號 智慧醫院小程序源碼
- Ml (machine learning) softmax function to realize the classification of simple movie categories
- TCP congestion control details | 3 design space
- Gear2021 monthly update - December
- PHP MySQL order by keyword
- PHP MySQL where clause
- 聊聊支付流程的設計與實現邏輯
- STM32 realizes 74HC595 control
- 基于人脸识别的课堂考勤系统 tkinter+openpyxl+face_recognition
- win32:堆破壞的dump文件分析
猜你喜欢

1147_ Makefile learning_ Target files and dependent files in makefile

Research on Swift

Leetcode 108 converts an ordered array into a binary search tree -- recursive method

Talk about the design and implementation logic of payment process

How to install PHP on Ubuntu 20.04

互聯網醫院HIS管理平臺源碼,在線問診,預約掛號 智慧醫院小程序源碼

MySQL grouping query

Draw some simple graphics with MFC

Redis core technology and practice - learning notes (IX): slicing cluster

win32:堆破坏的dump文件分析
随机推荐
First day of rhcsa study
Leetcode 108 converts an ordered array into a binary search tree -- recursive method
win32:堆破壞的dump文件分析
Postfix 技巧和故障排除命令
List的stream中Long对象与long判等问题记录
AcWing 271. 杨老师的照相排列【多维DP】
MinGW compile boost library
PHP MySQL Update
Keepalived setting does not preempt resources
Loop through JSON object list
Hongmeng fourth training
Research Report on market demand and investment planning for the development of China's office chair industry, 2022-2028
supervisor监控Gearman任务
BFS - topology sort
AcWing 3438. Number system conversion
Type conversion, variable
PUT vs. POST for Uploading Files - RESTful API to be Built Using Zend Framework
List of financial products in 2022
Basic grammar of interview (Part 2)
[vscode] convert tabs to spaces