当前位置:网站首页>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 .
边栏推荐
- 51 lines of code, self-made TX to MySQL software!
- MATLAB实例:阶跃函数的两种表达方式
- Accounting regulations and professional ethics [1]
- Report on the market trend, technological innovation and market forecast of printing and decorative paper in China
- 0 - 1 problème de sac à dos (1)
- Es6---es6 content details
- 学习记录:使用STM32F1看门狗
- Ball Dropping
- Find 3-friendly Integers
- Cost accounting [23]
猜你喜欢
Learning record: STM32F103 clock system overview working principle
STM32 how to use stlink download program: light LED running light (Library version)
Ball Dropping
程序员的你,有哪些炫技的代码写法?
用C语言写网页游戏
12306: mom, don't worry about me getting the ticket any more (1)
1010 things that college students majoring in it must do before graduation
JS --- all knowledge of JS objects and built-in objects (III)
ucore lab5
LeetCode#237. Delete nodes in the linked list
随机推荐
学习记录:USART—串口通讯
Stm32 dossiers d'apprentissage: saisie des applications
Cost accounting [22]
Research Report on printed circuit board (PCB) connector industry - market status analysis and development prospect forecast
STM32如何使用STLINK下载程序:点亮LED跑马灯(库版本)
China chart recorder market trend report, technology dynamic innovation and market forecast
Path problem before dynamic planning
csapp shell lab
Learning record: STM32F103 clock system overview working principle
C 基本语法
差分(一维,二维,三维) 蓝桥杯三体攻击
Research Report on market supply and demand and strategy of Chinese graphic screen printing equipment industry
Medical colposcope Industry Research Report - market status analysis and development prospect forecast
用C语言写网页游戏
Accounting regulations and professional ethics [3]
区间和------离散化
China's salt water membrane market trend report, technological innovation and market forecast
China's earthwork tire market trend report, technical dynamic innovation and market forecast
China's earthwork equipment market trend report, technical dynamic innovation and market forecast
Learning records: serial communication and solutions to errors encountered