当前位置:网站首页>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 .
边栏推荐
- 学习记录:USART—串口通讯
- Cost accounting [20]
- MATLAB实例:阶跃函数的两种表达方式
- 12306: mom, don't worry about me getting the ticket any more (1)
- Determine the Photo Position
- 毕业才知道IT专业大学生毕业前必做的1010件事
- Report on the market trend, technological innovation and market forecast of printing and decorative paper in China
- Market trend report, technical innovation and market forecast of geosynthetic clay liner in China
- Printing quality inspection and verification system Industry Research Report - market status analysis and development prospect forecast
- 0-1背包問題(一)
猜你喜欢
LeetCode#19. Delete the penultimate node of the linked list
Flex --- detailed explanation of flex layout attributes
ucore lab 2
Learning record: STM32F103 clock system overview working principle
STM32学习记录:玩转按键控制蜂鸣器和LED
Record of force deduction and question brushing
1010 things that college students majoring in it must do before graduation
STM32如何使用STLINK下载程序:点亮LED跑马灯(库版本)
Ball Dropping
How to build a nail robot that can automatically reply
随机推荐
7-1 懂的都懂 (20 分)
Path problem before dynamic planning
Leetcode notes - dynamic planning -day7
洛谷P1102 A-B数对(二分,map,双指针)
STM32学习记录:输入捕获应用
Cost accounting [16]
LeetCode#198. raid homes and plunder houses
UCORE Lab 1 system software startup process
ucorelab3
ucore lab 2
Learning record: understand systick system timer and write delay function
China earth moving machinery market trend report, technical dynamic innovation and market forecast
China's earthwork tire market trend report, technical dynamic innovation and market forecast
Learning record: use stm32f1 watchdog
B - 代码派对(女生赛)
学习记录:如何进行PWM 输出
C语言是低级和高级的分水岭
Visual analysis of data related to crawling cat's eye essays "sadness flows upstream into a river" | the most moving film of Guo Jingming's five years
[C language] twenty two steps to understand the function stack frame (pressing the stack, passing parameters, returning, bouncing the stack)
Hospital privacy screen Industry Research Report - market status analysis and development prospect forecast