当前位置:网站首页>Count the number of pixel values in the image
Count the number of pixel values in the image
2022-07-03 17:56:00 【I am a little rice】
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 the value and number of pixels .")
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)
边栏推荐
- [combinatorics] recursive equation (four cases where the non-homogeneous part of a linear non-homogeneous recursive equation with constant coefficients is the general solution of the combination of po
- i++与++i的区别:通俗易懂的讲述他们的区别
- [combinatorics] recursive equation (case where the non-homogeneous part is exponential | example where the non-homogeneous part is exponential)
- [combinatorics] generating function (summation property)
- Analysis report on production and marketing demand and investment forecast of China's PVC industry from 2021 to 2026
- The second largest gay dating website in the world was exposed, and the status of programmers in 2022
- [vscode] convert tabs to spaces
- A. Berland Poker & 1000 [simple mathematical thinking]
- TCP拥塞控制详解 | 3. 设计空间
- Keepalived setting does not preempt resources
猜你喜欢
Research on Swift
Line by line explanation of yolox source code of anchor free series network (5) -- mosaic data enhancement and mathematical understanding
Lesson 13 of the Blue Bridge Cup -- tree array and line segment tree [exercise]
Baiwen.com 7 days Internet of things smart home learning experience punch in the next day
Research Report on market demand and investment planning for the development of China's office chair industry, 2022-2028
PHP MySQL create database
聊聊支付流程的设计与实现逻辑
Analysis report on production and marketing demand and investment forecast of China's PVC industry from 2021 to 2026
互聯網醫院HIS管理平臺源碼,在線問診,預約掛號 智慧醫院小程序源碼
Leetcode Valentine's Day Special - looking for a single dog
随机推荐
Leetcode 538 converts binary search tree into cumulative tree -- recursive method and iterative method
How to purchase Google colab members in China
Brief introduction to the core functions of automatic penetration testing tool
A. Berland Poker &1000【简单数学思维】
Graduation summary
Loop through JSON object list
一入“远程”终不悔,几人欢喜几人愁。| 社区征文
[linux]centos 7 reports an error when installing MySQL "no package MySQL server available" no package ZABBIX server MySQL available
PHP returns 500 errors but no error log - PHP return 500 error but no error log
SDNUOJ1015
ArrayList分析3 : 删除元素
Type conversion, variable
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 SolidWorks gear design software tool geartrax
Internet hospital his management platform source code, online consultation, appointment registration smart hospital applet source code
Stm32h7 Hal library SPI DMA transmission has been in busy solution
(9) Opencv Canny edge detection
STM32实现74HC595控制
Analysis report on production and marketing demand and investment forecast of China's PVC industry from 2021 to 2026
win32:堆破壞的dump文件分析