ilpimage to bitmap
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相关推荐
- Android 自定义View Canvas —— Bitmap
Bitmap 绘制图片 常用的方法有一下几种 (1) drawBitmap(@NonNull Bitmap bitmap, float left, float top, @Nullable Paint ...
- BitMap 内存使用优化
在Android应用里,最耗费内存的就是图片资源.而且在Android系统中,读取位图Bitmap时,分给虚拟机中的图片的堆栈大小只有8M,如果超出了,就会出现OutOfMemory异常.所以,对于图 ...
- 第52章,bitmap图像处理(从零开始学android),第52章、Bitmap图像处理(从零开始学Android)...
1.Drawable → Bitmap public static Bitmap drawableToBitmap(Drawable drawable) { Bitmap bitmap = Bitma ...
- GDI+ Bitmap与WPF BitmapImage的相互转换
原文:GDI+ Bitmap与WPF BitmapImage的相互转换 using System.Windows.Interop; //... // Convert BitmapImage to Bi ...
- Android 中一些常用类的常用方法(Math、Random、Color、Paint、Canvas、Bitmap、BitmapFactory)...
1.java.lang.Math类常用的常量和方法: Math.PI 记录的圆周率 Math.E 记录e的常量 Math.abs 求绝对值 Math.sin 正弦函数 Math.asin 反正弦函数 ...
- C#图片灰度处理(位深度24→位深度8),用灰度数组byte[]新建一个8位灰度图像Bitmap 。...
原文:C#图片灰度处理(位深度24→位深度8) #region 灰度处理/// <summary>/// 将源图像灰度化,并转化为8位灰度图像./// </summary>// ...
- R.drawable 转 bitmap
引用:http://zhidao.baidu.com/question/291703800.html Bitmap bmp=BitmapFactory.decodeResource(r, R.draw ...
- B-tree索引与Bitmap索引的对比测试
昨天发现一条语句没有走索引,检查发现表没有建相应索引,先建立B-tree索引,测试发现是全表扫描,检查表数据发现此字段的值只有2个,删除原索引又建立bitmap索引,发现还是全表扫描,再次检查数据发现 ...
- Bitmap上下合成图片
合成两张图片,上下叠加的效果: /*** 把两个位图覆盖合成为一个位图,以底层位图的长宽为基准** @param backBitmap 在底部的位图* @param frontBitmap 盖在上面的 ...
最新文章
- _Linux和安卓之间可以传输文件吗?
- Terminal Services将改名为RDS
- ec200s 方案 移远_移远4GCat1无线通讯模块EC200S
- Linux 技巧:让进程在后台可靠运行的几种方法(转)
- 523. Continuous Subarray Sum
- 如何在三个月掌握三年的经验
- 人工智能 ppt_【138期】厉害了!人工智能高清大图+PPT模板全集系列!
- jQuery 利用 $.getJson() 实现跨域
- 云南“轮椅学子”博士毕业,清华校长俯身与他合影,他的妈妈被全网刷屏!...
- 【learning】一种奇妙的网络流建模方式
- Web请求响应编码问题详解
- IOS的Application以及IOS目录的介绍
- db4o_8.0对象数据库官方文档翻译_学习笔记一
- labview 上位机报警提示,报警记录,txt文档存储
- 云计算与大数据应用技术————21大数据2021142247537刘新敏
- 去除百度推广等广告的插件神器
- 详解 WebRTC 高音质低延时的背后 — AGC(自动增益控制)
- HDU 1874 畅通工程续 Floyd
- Dungeon Master(地下城主)
- 【无标题】(2019)NOC编程猫创新编程复赛小学组真题含参考
热门文章
- java super()方法_Java super关键字的使用方法详解
- 为什么传值时加号变成了空格_为什么中英文字间距不一样?我想谈谈我的理解...
- 014_Spring事务
- 语言专升本必背代码_2020年【山西省专升本】,专升本专业与考试科目,专升本招生院校,专升本报名流程大全!...
- java ui调试_如何使用 IBM i System Debugger 调试 Java 程序
- 卡迪夫大数据专业排名_大数据揭秘!英国名校哪些专业录取率低?申请人最多呢?...
- 谷歌设计规范_[图]谷歌Play商城启用圆角矩形图标设计规范 6月24日强制生效
- RecyclerView的优化:RecycledViewPool
- 将源码包打包成RPM包
- vue 怎么在字符串中指定位置插入字符_vue 我想在一个字符串中间加入一个/br 该怎么写?...