当前位置:网站首页>cv图像翻转,EmguCV图像旋转「建议收藏」
cv图像翻转,EmguCV图像旋转「建议收藏」
2022-07-25 20:53:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
i use this codeprivate void button12_Click(object sender, EventArgs e)
{
Bitmap bm = new Bitmap(pictureBox1.Image);
Image img = new Image(bm);
double x = 20;
img.Rotate(x, new Gray(255));
pictureBox9.Image = img.ToBitmap();
}
for image rotation
but it doesn’t work ,
why????
解决方案follow this link: http://www.emgu.com/wiki/files/1.4.0.0/html/ae9c1603-5135-1a2f-bd46-1dd736d4d7a8.htm[^]
You will see the Rotate method also has an argument called crop, set this argument false and all information of your image will be preserved.
I think your code should be changed into:
img = img.Rotate(x, new Gray(255),false);
Hope this will help you!
You may have to try this:
Image imgOut= img.Rotate(x, new Gray(255));
pictureBox9.Image= imgOut.ToBitmap();
I did not compile, even though i have emgucv on my machine, but I looked into their libray. I believe you should call like I said above.
see their implementation:
public Image WarpAffine(Matrix mapMatrix, int width, int height, INTER interpolationType, WARP warpType, TColor backgroundColor) where TMapDepth: new()
{
Image image = new Image(width, height);
//this call externs c function
CvInvoke.cvWarpAffine(base.Ptr, image.Ptr, mapMatrix.Ptr, (int) (interpolationType | ((INTER) ((int) warpType))), backgroundColor.MCvScalar);
return image;
}
Well, in case of “it doesn’t work”.
The problem is not that complected.
change this line
img.Rotate(x, new Gray(255));
to
img = img.Rotate(x, new Gray(255));
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/127844.html原文链接:https://javaforall.cn
边栏推荐
- 牛客-TOP101-BM38
- Leetcode customs clearance: hash table six, this is really a little simple
- An interview question about concurrent reading and writing of map in golang
- Compilation and operation of program
- MPI learning notes (II): two implementation methods of matrix multiplication
- yuv422转rgb(422sp转420p)
- [workplace rules] it workplace rules | poor performance
- How to use buffer queue to realize high concurrent order business (glory Collection Edition)
- Character function and string function (2)
- Rand1 generates rand9
猜你喜欢

Key network protocols in tcp/ip four layer model

Embedded development: embedded foundation -- threads and tasks
![[matlab] download originality documents based on oil monkey script and MATLAB](/img/c2/1788b758778ba73dd02fb0d006869e.png)
[matlab] download originality documents based on oil monkey script and MATLAB

Force deduction ----- calculate the money of the force deduction bank
What's special about Huawei's innovative solutions to consolidate the foundation of ERP for small and medium-sized enterprises?

文件操作详解

Fanoutexchange switch code tutorial

Leetcode customs clearance: hash table six, this is really a little simple

DDD go practice

The onnx model is exported as a TRT model
随机推荐
103. (cesium chapter) cesium honeycomb diagram (square)
Too many passwords, don't know how to record? Why don't you write a password box applet yourself
IEC61131 address representation
leetcode-79:单词搜索
In June 2021, the interview suffered a Waterloo. Is it so convoluted now
[matlab] download originality documents based on oil monkey script and MATLAB
Remote - actual combat
Fanoutexchange switch code tutorial
【单细胞高级绘图】07.KEGG富集结果展示
An interview question about recover in golang
Use Navicat to connect to MySQL database through SSH channel (pro test is feasible)
Leetcode-6131: the shortest dice sequence impossible to get
Miscellaneous notes -- a hodgepodge
【网络教程】IPtables官方教程--学习笔记2
"Chain" connects infinite possibilities: digital asset chain, wonderful coming soon!
Huatai Securities account opening process, is it safe to open an account on your mobile phone
[MCU] 51 MCU burning those things
一道golang中关于recover的面试题
Open source SPL enhances mangodb computing
npm 模块 移除_【已解决】npm卸载模块后该模块并没有从package.json中去掉[通俗易懂]