当前位置:网站首页>Exam23 named windows and simplified paths, grayscale conversion
Exam23 named windows and simplified paths, grayscale conversion
2022-06-13 02:29:00 【An unforgettable squirrel】
Function as follows :
src = new Mat(@"..\..\Images\ocv02.jpg", ImreadModes.Grayscale)
// Add @ No need to use double / Said path , That is, the following string does not change meaning
var window = new Window("window", image: src)
// Be careful window This function is not in cv Under the namespace , Belong to OpenCvSharp Next function , The second parameter can be written directly src
Color image to grayscale image
Cv2.CvtColor(srcCopy, srcCopy, ColorConversionCodes.BGRA2GRAY);
Debugging found , Original resolution 700*377*3=DataEnd-Data ,CV_8U3 Consistent with the theory
After the transformation 700*377=DataEnd-Data, The debug environment is displayed as CV_8U1
routine 2 The complete code is as follows
static void Main(string[] args)
{
readImage1();
readImage2();
}
private static void readImage2()
{
// Add @ No need to use double / Said path , That is, the following string does not change meaning
using (var src = new Mat(@"..\..\Images\ocv02.jpg", ImreadModes.Unchanged))
{
// Be careful window This function is not in cv Under the namespace ,OpenCvSharp Next function
using (var window = new Window("window", image: src))
{
// Error closing window manually
Cv2.WaitKey();
}
}
}
private static void readImage1()
{
using (var src = new Mat(@"..\..\Images\ocv02.jpg", ImreadModes.Grayscale))
{
using (var window = new Window("window", image: src))
{
Cv2.WaitKey();
}
}
}
边栏推荐
- regular expression
- 01 初识微信小程序
- [keras learning]fit_ Generator analysis and complete examples
- Several articles on norms
- 【LeetCode-SQL】1532. Last three orders
- 微信云开发粗糙理解
- Termux SSH first shell start
- Resource arrangement
- [learning notes] xr872 GUI littlevgl 8.0 migration (display part)
- Jump model between mirrors
猜你喜欢
Paper reading - beat tracking by dynamic programming
speech production model
ROS learning -5 how function packs with the same name work (workspace coverage)
L1 regularization and its sparsity
Understand CRF
[pytorch] kaggle large image dataset data analysis + visualization
Priority queue with dynamically changing priority
Armv8-m (Cortex-M) TrustZone summary and introduction
Laravel permission export
[pytorch]fixmatch code explanation (super detailed)
随机推荐
Area of basic exercise circle ※
1、 Set up Django automation platform (realize one click SQL execution)
redis 多个服务器共用一个
Open source video recolor code
A real-time target detection model Yolo
[keras] data of 3D u-net source code analysis py
ROS learning-8 pit for custom action programming
[work with notes] NDK compiles the open source library ffmpeg
[reading point paper] deeplobv3+ encoder decoder with Atlas separable revolution
[unity] problems encountered in packaging webgl project and their solutions
Huffman tree and its application
Paper reading - jukebox: a generic model for music
Laptop touch pad operation
[reading point paper] deeplobv3 rethinking atlas revolution for semantic image segmentation ASPP
Leetcode 473. Match to square [violence + pruning]
[dest0g3 520 orientation] dest0g3, which has been a long time since we got WP_ heap
Fast Color Segementation
[reading paper] generate confrontation network Gan
Redirection setting parameters -redirectattributes
Review the history of various versions of ITIL, and find the key points for the development of enterprise operation and maintenance