当前位置:网站首页>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 .
边栏推荐
猜你喜欢

D - Function(HDU - 6546)女生赛

LeetCode#237. Delete nodes in the linked list

Lab 8 文件系统

Crawling cat's eye movie review, data visualization analysis source code operation instructions

Winter vacation daily question - maximum number of balloons

ucore lab 2

Learning record: Tim - capacitive key detection

The wechat red envelope cover designed by the object is free! 16888

ucorelab4

ucore lab7
随机推荐
ucore lab 2
Research Report on printed circuit board (PCB) connector industry - market status analysis and development prospect forecast
Cost accounting [14]
LeetCode#237. Delete nodes in the linked list
Winter vacation daily question - maximum number of balloons
C语言学习笔记
洛谷P1102 A-B数对(二分,map,双指针)
Jupyter installation and use tutorial
Learning record: Tim - capacitive key detection
Research Report on market supply and demand and strategy of China's Medical Automation Industry
ucore lab 2
LeetCode#204. Count prime
LeetCode#53. Maximum subarray sum
Crawler series (9): item+pipeline data storage
学习记录:理解 SysTick系统定时器,编写延时函数
力扣刷题记录--完全背包问题(一)
Crawler series of learning while tapping (3): URL de duplication strategy and Implementation
Stm32 dossiers d'apprentissage: saisie des applications
0-1背包問題(一)
Research Report on market supply and demand and strategy of geosynthetics industry in China