当前位置: 首页 > news >正文

h5开发wordpress客户端优化关键词排名seo

h5开发wordpress客户端,优化关键词排名seo,网页端,泸州做网站OpenCV对图像的读取和保存支持非常方便。但也有非常不爽之处。其中之一就是不能读写ALpha通道。今天在网上找到了解决的办法(http://blog.developer.stylight.de/2010/05/how-to-load-alpha-channel-pngs-with.html):We are currently facing…

OpenCV对图像的读取和保存支持非常方便。但也有非常不爽之处。
其中之一就是不能读写ALpha通道。今天在网上找到了解决的办法(http://blog.developer.stylight.de/2010/05/how-to-load-alpha-channel-pngs-with.html):
We are currently facing the situation that we need to process PNG files that contain an alpha channel. Unfortunately OpenCV curently does not support so (but there's a hack - but that didn't help in my situation). The documentation for cvLoadImage contains a sad little note:
Note that in the current implementation the alpha channel, if any, is stripped from the output image, e.g. 4-channel RGBA image will be loaded as RGB.
Diving into the code I figured alpha channels have been disabled on purpose. Around line 220 in grfmt_png.cpp (the respective PNG encoder / decoder) it reads: png_set_strip_alpha( png_ptr ).


So the hope would be, if one disables this line libpng should be able to read in the alpha channel. Indeed it does, if you specify a large enough buffer to write in (CV_8UC4 instead of CV_8UC3). So we need a few more patches to make it work throughout:


1. In grfmt_png.cpp, line 170 add a line that allows to push through the type (alpha channel) detection:
// Allow for PNG alpha channel here
if(color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
 m_type = CV_8UC4;
}
2. In grfmt_png.cpp, around line 220 allow for an alpha channel by commenting the following statements:
//png_set_strip_alpha( png_ptr );
3. In loadsave.cpp , line 222 we finally tweak the parent routine to be more flexible towards the channels returned. Here we replace the "3" by CV_MAT_CN(type):
type = CV_MAKETYPE(CV_MAT_DEPTH(type), CV_MAT_CN(type));


(Note all changes were performed against OpenCV 2.0)


After a recompile you should be able to read alpha-channeled pngs as well!
过几天有空了仔细检查一下。测试没有问题把新的代码共享上来。再去掉8U*C的约束。就更好用了


转自 http://blog.sina.com.cn/s/blog_5119a7f90100renv.html

http://www.lbrq.cn/news/2548513.html

相关文章:

  • 烟台广告公司网站建设河南做网站优化
  • 网站建设步骤详解视频免费行情软件网站下载大全
  • 企业主页的特点快速刷排名seo软件
  • php网站空间购买苏州seo网络推广
  • 用dreamweaver建设网站成品成功营销十大经典案例
  • 自己给公司做网站b站推广入口在哪
  • 做网站需要的技术代发百度首页排名
  • 制作视频网站违法吗网站开发建设步骤
  • 建设新闻网站的意义海南百度竞价推广
  • 网站建设与服务考试友链网
  • 苏州网站建设招聘什么是关键词举例说明
  • 电气营销型网站方案杭州上城区抖音seo如何
  • 北京网站制作费用品牌推广方案范文
  • 做动漫网站的意义网页搜索优化seo
  • 广安市建设局新网站学seo优化
  • 设置自己的网站如何被百度收录
  • 企业宣传网宁波seo外包引流推广
  • 九台区建设银行网站企业营销推广方案
  • 做推广的网站那个好青岛网站
  • 制冷机电工程东莞网站建设手机一键优化
  • 网站建设视频教程php网络推广公司收费标准
  • 旅游网站建设的技术可行性宁波seo专员
  • 坪山商城网站建设哪家公司靠谱编程培训机构
  • 国家城乡住房和建设部网站人力资源培训网
  • 凌源市建设局网站如何做网页制作
  • 政务网站风格在线客服
  • 注册账号自建网站百度爱采购怎么优化排名
  • 北京市城乡和住房建设委员会网站爱站网的关键词是怎么来的
  • 东莞网站建设收费明细电商网站开发平台有哪些
  • 怎么做刷赞网站关键词排名优化工具
  • ubuntu22.04系统入门 linux入门(二) 简单命令 多实践以及相关文件管理命令
  • 向华为学习——IPD流程体系之IPD术语
  • 外卖“0元购”退场后,即时零售大战才刚开始
  • Ubuntu 系统下使用 lsusb 命令识别 USB 设备及端口类型详解
  • 【Django】-1- 开发项目搭建
  • 深入探索Weaviate:构建高效AI应用的数据库解决方案