当前位置:网站首页>统计图像中各像素值的数量
统计图像中各像素值的数量
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)
边栏推荐
- Market demand survey and marketing strategy analysis report of global and Chinese pet milk substitutes 2022-2028
- PHP MySQL create database
- TCP拥塞控制详解 | 3. 设计空间
- WebView module manages the application window interface to realize the logical control and management operation of multiple windows (Part 1)
- Discussion sur la logique de conception et de mise en oeuvre du processus de paiement
- 模块九作业
- Talk about the design and implementation logic of payment process
- Line by line explanation of yolox source code of anchor free series network (6) -- mixup data enhancement
- Internet hospital his management platform source code, online consultation, appointment registration smart hospital applet source code
- Analysis report on production and marketing demand and investment forecast of China's PVC industry from 2021 to 2026
猜你喜欢
How to read the source code [debug and observe the source code]
MySQL has been stopped in the configuration interface during installation
Talk about the design and implementation logic of payment process
Win32: dump file analysis of heap corruption
Redis core technology and practice - learning notes (IX): slicing cluster
(8) HS corner detection
Interviewer: why is the value nil not equal to nil?
STM32 realizes 74HC595 control
Discussion sur la logique de conception et de mise en oeuvre du processus de paiement
Ml (machine learning) softmax function to realize the classification of simple movie categories
随机推荐
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.
SDNUOJ1015
link preload prefetch
Y is always discrete and can't understand, how to solve it? Answer: read it several times
Market demand survey and marketing strategy analysis report of global and Chinese pet milk substitutes 2022-2028
[vscode] convert tabs to spaces
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
Introduction to PHP MySQL
A. Odd Selection【BruteForce】
Design limitations of structure type (struct)
win32:堆破坏的dump文件分析
IntelliJ 2021.3 short command line when running applications
Kotlin的協程:上下文
STM32 realizes 74HC595 control
PHP MySQL reads data
Inheritance of ES6 class
Deops入门
Five problems of database operation in commodity supermarket system
[mathematical logic] equivalent calculus and reasoning calculus of predicate logic (individual word | predicate | quantifier | predicate logic formula | two basic formulas | proposition symbolization
Automata and automatic line of non-standard design