当前位置:网站首页>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)
边栏推荐
- [mathematical logic] equivalent calculus and reasoning calculus of predicate logic (individual word | predicate | quantifier | predicate logic formula | two basic formulas | proposition symbolization
- [tutorial] build your first application on coreos
- PHP MySQL inserts data
- How to purchase Google colab members in China
- Getting started with deops
- QT adjust win screen brightness and sound size
- AcWing 271. 杨老师的照相排列【多维DP】
- A. Odd Selection【BruteForce】
- 面试官:值为 nil 为什么不等于 nil ?
- Micro service component sentinel console call
猜你喜欢

How to deploy applications on kubernetes cluster

AcWing 271. 杨老师的照相排列【多维DP】

Interviewer: why is the value nil not equal to nil?

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

STM32实现74HC595控制

Win32: dump file analysis of heap corruption

Draw some simple graphics with MFC

Embedded-c language-7

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

The third day of writing C language by Yabo people
随机推荐
自动渗透测试工具核心功能简述
[combinatorics] recursive equation (summary of the solution process of recursive equation | homogeneous | double root | non-homogeneous | characteristic root is 1 | exponential form | the bottom is th
[combinatorics] recursive equation (case where the non-homogeneous part is exponential | example where the non-homogeneous part is exponential)
Line by line explanation of yolox source code of anchor free series network (6) -- mixup data enhancement
PR second time
聊聊支付流程的设计与实现逻辑
Codeforces Round #803 (Div. 2) C. 3SUM Closure
Redis core technology and practice - learning notes (VIII) sentinel cluster: sentinel hung up
模块九作业
小程序 多tab 多swiper + 每个tab分页
supervisor监控Gearman任务
Leetcode 108 converts an ordered array into a binary search tree -- recursive method
Analyse ArrayList 3: suppression d'éléments
[combinatorics] generating function (shift property)
Research Report on investment trends and development planning of China's thermal insulation material industry, 2022-2028
Module 9 operation
Mathematical formula (test)
Kotlin's collaboration: Context
Micro service component sentinel console call
PHP MySQL order by keyword