Matrix class C#

China☆狼群 提交于 2019-12-14 00:14:02

问题


I'm trying to make some geometric transformations (e.g. scale,shear) on an image already loaded in a bitmap object

I then found a Built-in Matrix class in C# , I used it but I'm not sure on how to initialize a 2x2 matrix or a column vector etc.

The 4th overloaded constructor forces me to enter 6 values representing 3x2 ,but that I don't want!

I used this reference but couldn't find an answer
https://msdn.microsoft.com/en-us/library/system.drawing.drawing2d.matrix(v=vs.110).aspx


回答1:


As @Daniel pointed out, System.Drawing.Drawing2D.Matrix is for visual geometrical transformations only, not mathematical.

If you'd like mathematical transformations I'd recommend you take a look at Math.NET or what I'd recommend, OpenCV library. OpenCV is written in C++, but has an excellent C# wrappers. It can be easily installed via Nuget.



来源:https://stackoverflow.com/questions/33041874/matrix-class-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!