Iplimage To Bitmap (銀展提供)

if (ipl->depth == 8)

{

if (ipl->nChannels == 3)

{

return gcnew System::Drawing::Bitmap(ipl->width , ipl->height , ipl->widthStep , System::Drawing::Imaging::PixelFormat::Format24bppRgb ,

(System::IntPtr)ipl->imageData);

}

else

{

return gcnew System::Drawing::Bitmap(ipl->width , ipl->height , ipl->widthStep , System::Drawing::Imaging::PixelFormat::Format8bppIndexed ,

(System::IntPtr)ipl->imageData);

}

}

Bitmap To Iplimage

IplImage* tmp;

System::Drawing::Imaging::BitmapData^ bmData = bitmap->LockBits(System::Drawing::Rectangle(0, 0, bitmap->Width, bitmap->Height) ,

System::Drawing::Imaging::ImageLockMode::ReadWrite, bitmap->PixelFormat);

if(bitmap->PixelFormat == System::Drawing::Imaging::PixelFormat::Format8bppIndexed)

{

tmp = cvCreateImage(cvSize(bitmap->Width , bitmap->Height) , IPL_DEPTH_8U , 1);

tmp->imageData = (char*)bmData->Scan0.ToPointer();

}

else if (bitmap->PixelFormat == System::Drawing::Imaging::PixelFormat::Format24bppRgb)

{

tmp = cvCreateImage(cvSize(bitmap->Width , bitmap->Height) , IPL_DEPTH_8U , 3);

tmp->imageData = (char*)bmData->Scan0.ToPointer();

}

转载于:https://www.cnblogs.com/mfryf/archive/2012/02/13/2349443.html

ilpimage to bitmap相关推荐

  1. Android 自定义View Canvas —— Bitmap

    Bitmap 绘制图片 常用的方法有一下几种 (1) drawBitmap(@NonNull Bitmap bitmap, float left, float top, @Nullable Paint ...

  2. BitMap 内存使用优化

    在Android应用里,最耗费内存的就是图片资源.而且在Android系统中,读取位图Bitmap时,分给虚拟机中的图片的堆栈大小只有8M,如果超出了,就会出现OutOfMemory异常.所以,对于图 ...

  3. 第52章,bitmap图像处理(从零开始学android),第52章、Bitmap图像处理(从零开始学Android)...

    1.Drawable → Bitmap public static Bitmap drawableToBitmap(Drawable drawable) { Bitmap bitmap = Bitma ...

  4. GDI+ Bitmap与WPF BitmapImage的相互转换

    原文:GDI+ Bitmap与WPF BitmapImage的相互转换 using System.Windows.Interop; //... // Convert BitmapImage to Bi ...

  5. Android 中一些常用类的常用方法(Math、Random、Color、Paint、Canvas、Bitmap、BitmapFactory)...

    1.java.lang.Math类常用的常量和方法: Math.PI 记录的圆周率 Math.E 记录e的常量 Math.abs 求绝对值 Math.sin 正弦函数 Math.asin 反正弦函数 ...

  6. C#图片灰度处理(位深度24→位深度8),用灰度数组byte[]新建一个8位灰度图像Bitmap 。...

    原文:C#图片灰度处理(位深度24→位深度8) #region 灰度处理/// <summary>/// 将源图像灰度化,并转化为8位灰度图像./// </summary>// ...

  7. R.drawable 转 bitmap

    引用:http://zhidao.baidu.com/question/291703800.html Bitmap bmp=BitmapFactory.decodeResource(r, R.draw ...

  8. B-tree索引与Bitmap索引的对比测试

    昨天发现一条语句没有走索引,检查发现表没有建相应索引,先建立B-tree索引,测试发现是全表扫描,检查表数据发现此字段的值只有2个,删除原索引又建立bitmap索引,发现还是全表扫描,再次检查数据发现 ...

  9. Bitmap上下合成图片

    合成两张图片,上下叠加的效果: /*** 把两个位图覆盖合成为一个位图,以底层位图的长宽为基准** @param backBitmap 在底部的位图* @param frontBitmap 盖在上面的 ...

最新文章

  1. _Linux和安卓之间可以传输文件吗?
  2. Terminal Services将改名为RDS
  3. ec200s 方案 移远_移远4GCat1无线通讯模块EC200S
  4. Linux 技巧:让进程在后台可靠运行的几种方法(转)
  5. 523. Continuous Subarray Sum
  6. 如何在三个月掌握三年的经验
  7. 人工智能 ppt_【138期】厉害了!人工智能高清大图+PPT模板全集系列!
  8. jQuery 利用 $.getJson() 实现跨域
  9. 云南“轮椅学子”博士毕业,清华校长俯身与他合影,他的妈妈被全网刷屏!...
  10. 【learning】一种奇妙的网络流建模方式
  11. Web请求响应编码问题详解
  12. IOS的Application以及IOS目录的介绍
  13. db4o_8.0对象数据库官方文档翻译_学习笔记一
  14. labview 上位机报警提示,报警记录,txt文档存储
  15. 云计算与大数据应用技术————21大数据2021142247537刘新敏
  16. 去除百度推广等广告的插件神器
  17. 详解 WebRTC 高音质低延时的背后 — AGC(自动增益控制)
  18. HDU 1874 畅通工程续 Floyd
  19. Dungeon Master(地下城主)
  20. 【无标题】(2019)NOC编程猫创新编程复赛小学组真题含参考

热门文章

  1. java super()方法_Java super关键字的使用方法详解
  2. 为什么传值时加号变成了空格_为什么中英文字间距不一样?我想谈谈我的理解...
  3. 014_Spring事务
  4. 语言专升本必背代码_2020年【山西省专升本】,专升本专业与考试科目,专升本招生院校,专升本报名流程大全!...
  5. java ui调试_如何使用 IBM i System Debugger 调试 Java 程序
  6. 卡迪夫大数据专业排名_大数据揭秘!英国名校哪些专业录取率低?申请人最多呢?...
  7. 谷歌设计规范_[图]谷歌Play商城启用圆角矩形图标设计规范 6月24日强制生效
  8. RecyclerView的优化:RecycledViewPool
  9. 将源码包打包成RPM包
  10. vue 怎么在字符串中指定位置插入字符_vue 我想在一个字符串中间加入一个/br 该怎么写?...