当前位置:网站首页>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
边栏推荐
- Unity vs -- the default debugging in VS is to start rather than attach to unity debugging
- Rand1 generates rand9
- [FAQ] access the HMS core push service, and the server sends messages. Cause analysis and solutions of common error codes
- 租房二三事
- Interpretation of filter execution sequence source code in sprigboot
- 一道golang中关于map的并发读写的面试题
- 103. (cesium chapter) cesium honeycomb diagram (square)
- Wokerman custom write log file
- Google guava is just a brother. What is the real king of caching? (glory Collection Edition)
- How to realize reliable transmission with UDP?
猜你喜欢
随机推荐
Yolov7 training error indexerror: list index out of range
Focus on data | Haitai Fangyuan directly hits the construction idea of data security governance in the securities industry
Use of C log4net: add file name and line number to the output log content; Repackaged class output file name and line number
leetcode-6130:设计数字容器系统
Explain in detail the principle of MySQL master-slave replication "suggestions collection"
Cesium 多边形渐变色纹理(Canvas)
预处理指令
Implementation of simple registration and login
[MCU] 51 MCU burning those things
matlab----EEGLab查看脑电信号
The onnx model is exported as a TRT model
leetcode-6125:相等行列对
Niuke-top101-bm38
Miscellaneous notes -- a hodgepodge
Hello, I'd like to ask questions about C and database operation.
preprocessor directives
Leetcode-919: complete binary tree inserter
Temperature and humidity environment monitoring system based on stm32
【单细胞高级绘图】07.KEGG富集结果展示
Kubernetes advanced part learning notes








