当前位置:网站首页>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
边栏推荐
- Character function and string function (2)
- Rent two or three things
- Success factors of software R & D effectiveness measurement
- [FAQ] access the HMS core push service, and the server sends messages. Cause analysis and solutions of common error codes
- Huatai Securities account opening process, is it safe to open an account on your mobile phone
- Qixin Jushi cloud spectrum new chapter | Haitai Fangyuan and Sichuan Unicom reach ecological strategic cooperation
- Pychart automatically enters the test mode when running the program
- Pycharm跑程序时自动进入测试模式
- 预处理指令
- Niuke-top101-bm37
猜你喜欢

Miscellaneous notes -- a hodgepodge

Kubernetes advanced part learning notes

leetcode-155:最小栈

【FiddlerTX插件】使用Fiddler抓包腾讯课堂视频下载(抓不到包解决方案)

Fanoutexchange switch code tutorial

leetcode-114:二叉树展开为链表

Embedded development: embedded foundation -- threads and tasks

ROS_ Rqt toolbox

Solution to oom exceptions caused by improper use of multithreading in production environment (supreme Collection Edition)
![[MCU] 51 MCU burning those things](/img/fa/8f11ef64a18114365c084fff7d39f6.png)
[MCU] 51 MCU burning those things
随机推荐
Implementation of simple registration and login
Cesium 多边形渐变色纹理(Canvas)
Decompile app
【FiddlerTX插件】使用Fiddler抓包腾讯课堂视频下载(抓不到包解决方案)
leetcode-79:单词搜索
Sum of two numbers and three numbers
Golang language quickly get started to comprehensive practical notes (go language, beego framework, high concurrency chat room, crawler)
The international summit osdi included Taobao system papers for the first time, and end cloud collaborative intelligence was recommended by the keynote speech of the conference
使用oap切面导致controller被重复调用
[fiddlertx plug-in] use Fiddler to capture the package Tencent classroom video download (unable to capture the package solution)
Use of C log4net: add file name and line number to the output log content; Repackaged class output file name and line number
Opencv learning Fourier transform experience and line direction Fourier transform code
Recommend a website that converts curl commands into PHP code & a website that initiates and executes curl requests online
476-82(322、64、2、46、62、114)
Test cases and defect report templates
Leetcode-919: complete binary tree inserter
牛客-TOP101-BM37
[advanced drawing of single cell] 07. Display of KEGG enrichment results
预处理指令
Beisen Holdings' IPO: a total loss of 4.115 billion yuan in three years, and a total of 2.84 billion yuan in the previous nine rounds of financing