当前位置:网站首页>Opencv learning log 12 binarization of Otsu method
Opencv learning log 12 binarization of Otsu method
2022-07-06 15:42:00 【@Spring sauce】
Preface
This article focuses on opencv How to use Otsu method to binarize images in .
One 、 Binarization of Otsu method
// Third question Binarization of Otsu method
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
int main()
{
cv::Mat srcMat = imread("C://Users//john//Desktop//1.jpg", 0);
cv::Mat resMat;
// imshow("src", srcMat);
// threshold(srcMat, resMat, 100, 255, THRESH_OTSU); // Dajin law
threshold(srcMat, resMat, 100, 255, THRESH_BINARY); // Fixed threshold
// adaptiveThreshold(srcMat, resMat, 255, ADAPTIVE_THRESH_GAUSSIAN_C, THRESH_BINARY_INV, 15, 10); // The adaptive
imshow("res", resMat);
waitKey(0);
}
summary
1. The code can run directly , If you don't understand, please leave a message .
边栏推荐
- E. Breaking the Wall
- Market trend report, technical innovation and market forecast of Chinese hospital respiratory humidification equipment
- China's salt water membrane market trend report, technological innovation and market forecast
- ucorelab4
- Jupyter installation and use tutorial
- 基于485总线的评分系统
- 0-1背包问题(一)
- Learning record: understand systick system timer and write delay function
- Cost accounting [15]
- 0 - 1 problème de sac à dos (1)
猜你喜欢
Record of force deduction and question brushing
Unpleasant error typeerror: cannot perform 'ROR_‘ with a dtyped [float64] array and scalar of type [bool]
毕业才知道IT专业大学生毕业前必做的1010件事
入门C语言基础问答
Matlab comprehensive exercise: application in signal and system
Matlab example: two expressions of step function
Es6---es6 content details
STM32学习记录:输入捕获应用
Learning record: Tim - Basic timer
Your wechat nickname may be betraying you
随机推荐
0-1背包问题(一)
Matlab example: two expressions of step function
Hospital privacy screen Industry Research Report - market status analysis and development prospect forecast
F - Birthday Cake(山东省赛)
JS调用摄像头
STM32学习记录:玩转按键控制蜂鸣器和LED
Research Report on printed circuit board (PCB) connector industry - market status analysis and development prospect forecast
Flex --- detailed explanation of flex layout attributes
STM32学习记录:输入捕获应用
China earth moving machinery market trend report, technical dynamic innovation and market forecast
Optimization method of path problem before dynamic planning
基于485总线的评分系统
JS --- all basic knowledge of JS (I)
LeetCode#412. Fizz Buzz
ucore lab7
LeetCode#53. Maximum subarray sum
FSM and I2C experiment report
LeetCode#36. Effective Sudoku
MATLAB综合练习:信号与系统中的应用
ucore lab 2