当前位置:网站首页>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)
边栏推荐
- Kotlin's collaboration: Context
- Postfix tips and troubleshooting commands
- 基于人脸识别的课堂考勤系统 tkinter+openpyxl+face_recognition
- Detailed explanation of common network attacks
- Draw some simple graphics with MFC
- Line by line explanation of yolox source code of anchor free series network (6) -- mixup data enhancement
- Codeforces Round #803 (Div. 2) C. 3SUM Closure
- Analysis report on production and marketing demand and investment forecast of China's PVC industry from 2021 to 2026
- TCP congestion control details | 3 design space
- The second largest gay dating website in the world was exposed, and the status of programmers in 2022
猜你喜欢

面试官:值为 nil 为什么不等于 nil ?

Baiwen.com 7 days Internet of things smart home learning experience punch in the next day

互聯網醫院HIS管理平臺源碼,在線問診,預約掛號 智慧醫院小程序源碼
![How to read the source code [debug and observe the source code]](/img/40/a2fca67bcde3c468a739c6990325f4.jpg)
How to read the source code [debug and observe the source code]

Wechat applet for the first time

Type conversion, variable

STM32实现74HC595控制

Analysis report on production and marketing demand and investment forecast of China's PVC industry from 2021 to 2026

Redis core technology and practice - learning notes (VI) how to achieve data consistency between master and slave Libraries

Cloud primordial weekly | CNCF released the 2021 cloud primordial development status report, which was released on istio 1.13
随机推荐
Leetcode 538 converts binary search tree into cumulative tree -- recursive method and iterative method
QT adjust win screen brightness and sound size
Applet with multiple tabs and Swipers + paging of each tab
[LINUX]CentOS 7 安装MYSQL时报错“No package mysql-server available“No package zabbix-server-mysql availabl
MySQL has been stopped in the configuration interface during installation
[combinatorics] generating function (summation property)
Web-ui automated testing - the most complete element positioning method
Research Report on market demand and investment planning for the development of China's office chair industry, 2022-2028
WEB-UI自动化测试-最全元素定位方法
Module 9 operation
PHP MySQL inserts multiple pieces of data
How to purchase Google colab members in China
Kotlin's collaboration: Context
[vscode] convert tabs to spaces
How to deploy applications on kubernetes cluster
Five problems of database operation in commodity supermarket system
Getting started with deops
PUT vs. POST for Uploading Files - RESTful API to be Built Using Zend Framework
Lesson 13 of the Blue Bridge Cup -- tree array and line segment tree [exercise]
Detailed explanation of common network attacks