当前位置:网站首页>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 .
边栏推荐
- Accounting regulations and professional ethics [2]
- China's salt water membrane market trend report, technological innovation and market forecast
- 12306: mom, don't worry about me getting the ticket any more (1)
- Stm32 dossiers d'apprentissage: saisie des applications
- ucore lab7
- Es6--- two methods of capturing promise status as failed
- Determine the Photo Position
- Find 3-friendly Integers
- JS --- detailed explanation of JS DOM (IV)
- Research Report on market supply and demand and strategy of Chinese graphic screen printing equipment industry
猜你喜欢

LeetCode#237. Delete nodes in the linked list

学习记录:TIM—基本定时器

STM32学习记录:玩转按键控制蜂鸣器和LED

Intensive learning notes: Sutton book Chapter III exercise explanation (ex17~ex29)

LeetCode#62. Different paths

Winter vacation daily question - maximum number of balloons
![Unpleasant error typeerror: cannot perform 'ROR_‘ with a dtyped [float64] array and scalar of type [bool]](/img/dc/834463f460c085207dc9d531805e90.jpg)
Unpleasant error typeerror: cannot perform 'ROR_‘ with a dtyped [float64] array and scalar of type [bool]

MATLAB实例:阶跃函数的两种表达方式

C语言必背代码大全

JS --- detailed explanation of JS facing objects (VI)
随机推荐
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
China's earthwork tire market trend report, technical dynamic innovation and market forecast
JS --- JS function and scope (II)
Alice and Bob (2021牛客暑期多校训练营1)
csapp shell lab
Research Report on market supply and demand and strategy of Chinese hospital cleaning chemicals industry
HDU-6025-Coprime Sequence(女生赛)
ucore lab 6
STM32學習記錄:輸入捕獲應用
0-1背包问题(一)
Matlab example: two expressions of step function
Cost accounting [14]
Crawling cat's eye movie review, data visualization analysis source code operation instructions
JS --- detailed explanation of JS facing objects (VI)
cs零基础入门学习记录
Scoring system based on 485 bus
学习记录:USART—串口通讯
0-1 knapsack problem (I)
C语言必背代码大全
Learning record: Tim - capacitive key detection