当前位置:网站首页>OpenCVSharpSample04WinForms
OpenCVSharpSample04WinForms
2022-06-13 02:29:00 【An unforgettable squirrel】
1、 Create a winform project
Add a in the interface flowLayoutPanel1, And please change it to the window size
2、 add to opencvsharp4
3、 stay form1.cs Add opencvsharp quote
using OpenCvSharp;
using OpenCvSharp.Extensions;
4、 Modify the code according to the example
Found in editing , Error on this line
pictureBoxIpl = new OpenCvSharp.UserInterface.PictureBoxIpl
The study found that ,opencvSharp3 Contains userinterface, But in 4 Not in China , Delete this function , compile , The system runs as follows :

This program demonstrates how to display... On the interface mat graphics
The main idea is
(1) Using functions BitmapConverter.ToBitmap() Turn the picture into bmp
(2) take bmp Load into PictureBox
(3) take PictureBox Add to flowLayoutPanel1 Inside
The main codes are as follows :
Bitmap bitmap;
using (var iplImage = new Mat(@"..\..\Images\Penguin.png", ImreadModes.AnyDepth | ImreadModes.AnyColor))
{
bitmap = iplImage.ToBitmap(); // BitmapConverter.ToBitmap()
}
var pictureBox = new PictureBox
{
Image = bitmap,
ClientSize = bitmap.Size
};
//How to redraw:
//iplImage.ToBitmap(dst: (Bitmap)pictureBox.Image);
flowLayoutPanel1.Controls.Add(pictureBox);opencvsharp Documents
https://shimat.github.io/opencvsharp_docs/html/d69c29a1-7fb1-4f78-82e9-79be971c3d03.htm
opencvsharp Mat turn bitmap
Mat mat = OpenCvSharp.Extensions.BitmapConverter.ToMat(image); //bitmap turn mat
Bitmap bitmap = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat); // mat turn bitmap
边栏推荐
- [reading papers] deepface: closing the gap to human level performance in face verification. Deep learning starts with the face
- Review the history of various versions of ITIL, and find the key points for the development of enterprise operation and maintenance
- ROS learning -5 how function packs with the same name work (workspace coverage)
- Chapter7-10_ Deep Learning for Question Answering (1/2)
- Barrykay electronics rushes to the scientific innovation board: it is planned to raise 360million yuan. Mr. and Mrs. Wang Binhua are the major shareholders
- [reading papers] comparison of deeplobv1-v3 series, brief review
- Leetcode daily question - 890 Find and replace mode
- Cumulative tax law: calculate how much tax you have paid in a year
- [pytorch] kaggle image classification competition arcface + bounding box code learning
- Sensor: MQ-5 gas module measures the gas value (code attached at the bottom)
猜你喜欢

L1 regularization and its sparsity
![[unity] problems encountered in packaging webgl project and their solutions](/img/f4/13696831b27becc2e45a712bb79f4c.png)
[unity] problems encountered in packaging webgl project and their solutions
![[pytorch] kaggle large image dataset data analysis + visualization](/img/b0/7b8aff44d6bedd7ca2c705f13a8556.jpg)
[pytorch] kaggle large image dataset data analysis + visualization

ROS learning-7 error in custom message or service reference header file
![Leetcode 926. 将字符串翻转到单调递增 [前缀和]](/img/ca/d23c1927bc32393cf023c748e4b449.png)
Leetcode 926. 将字符串翻转到单调递增 [前缀和]

Chapter7-11_ Deep Learning for Question Answering (2/2)
![[learning notes] xr872 GUI littlevgl 8.0 migration (file system)](/img/9b/0bf88354e8cfdbcc1ea91311c9a823.jpg)
[learning notes] xr872 GUI littlevgl 8.0 migration (file system)

Review the history of various versions of ITIL, and find the key points for the development of enterprise operation and maintenance

微信云开发粗糙理解

Chapter7-10_ Deep Learning for Question Answering (1/2)
随机推荐
An image is word 16x16 words: transformers for image recognition at scale
SQL server deletes all tables and all stored procedures in the database
Sensor: sht30 temperature and humidity sensor testing ambient temperature and humidity experiment (code attached at the bottom)
Huawei equipment is configured with IP and virtual private network hybrid FRR
Classification and summary of system registers in aarch64 architecture of armv8/arnv9
1、 Set up Django automation platform (realize one click SQL execution)
4.11 introduction to firmware image package
L1 regularization and its sparsity
Understand CRF
ROS learning-6 detailed explanation of publisher programming syntax
[reading papers] deepface: closing the gap to human level performance in face verification. Deep learning starts with the face
Resource arrangement
Queuing theory, game theory, analytic hierarchy process
Paper reading - beat tracking by dynamic programming
Jump model between mirrors
After idea uses c3p0 connection pool to connect to SQL database, database content cannot be displayed
C language compressed string is saved to binary file, and the compressed string is read from binary file and decompressed.
Yovo3 and yovo3 tiny structure diagram
Basic exercise of test questions Yanghui triangle (two-dimensional array and shallow copy)
Cumulative tax law: calculate how much tax you have paid in a year