cv图像翻转,EmguCV图像旋转「建议收藏」

iusethiscodeprivatevoidbutton12_Click(objectsender,EventArgse){Bitmapbm=newBitmap(pictureBox1.Image);Imageimg=newImage(bm);doublex=20;img.Rotate(x,newGray(255));pictureBox9.Image…

大家好,又见面了,我是你们的朋友全栈君。

cv图像翻转,EmguCV图像旋转「建议收藏」

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.net/127844.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • android生成coredump,详解coredump–全面

    From:http://blog.csdn.net/tenfyguo/article/details/8159176一,什么是coredump我们经常听到大家说到程序core掉了,需要定位解决,这里说的大部分是指对应程序由于各种异常或者bug导致在运行过程中异常退出或者中止,并且在满足一定条件下(这里为什么说需要满足一定的条件呢?下面会分析)会产生一个叫做core的文件。通常情况下,core文件…

    2022年4月12日
    36
  • java rsa加解密_Java开发工具

    java rsa加解密_Java开发工具RSA的应用RSA是一种非对称加密算法。现在,很多登陆表单的密码的都采用RSA加密,例如京东中的登陆使用公钥对密码进行加密。Base64编码apache.commons-codex包提供了许多编码格式转换,例如Base64。以下为Base64编码表使用apache.commons-codex进行Base64对字符串进行编码与解码的程序如下:packagecom.qian.encod…

    2022年5月3日
    28
  • 怎么使用firebird maestro

    怎么使用firebird maestro數據庫圖形界面管理工具 firebirdmaes www sqlmaestro com download firebirdmaes 我的网盘地址下载链接 https pan baidu com s 1i6sQr6d 密码 bf83 使用步骤

    2025年11月9日
    3
  • Project interpreter not specified(eclipse+pydev)

    Project interpreter not specified(eclipse+pydev)

    2021年12月9日
    55
  • Linux dstat 监控工具[通俗易懂]

    Linux dstat 监控工具[通俗易懂]简述dstat是一个可以取代vmstat,iostat,netstat和ifstat这些命令的多功能产品。dstat克服了这些命令的局限并增加了一些另外的功能,增加了监控项,也变得更灵活了。dstat可以很方便监控系统运行状况并用于基准测试和排除故障。dstat可以让你实时地看到所有系统资源,例如,你能够通过统计IDE控制器当前状态来比较磁盘利用率,或者直接通过网络带宽数值来比较磁盘…

    2022年6月18日
    31
  • FPGA综合项目——SDRAM控制器

    FPGA综合项目——SDRAM控制器FPGA综合项目——SDRAM控制器目录整体框架串口接收模块接收模块测试仿真串口发送模块发送模块测试仿真整体框架串口接收模块接收模块测试仿真串口发送模块发送模块测试仿真

    2022年7月25日
    10

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号