OpenCV支持哪种图像格式 [英] Which Format of Images are supported by OpenCV

查看:629
本文介绍了OpenCV支持哪种图像格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的一个项目,需要在主屏幕上覆盖图像(某公司的徽标),并且我只希望徽标可见而不是图像的边框或多余区域,我什至尝试覆盖.png图像,然后边框和徽标也将显示为黑色.

For a project of mine a require an image(logo of some company) to be overlaid on the main screen and I want only the Logo to be visible not the borders or the extra regions of the image, I even tried overlaying the .png image but then also the borders are visible in black color along with the logo.

任何人都可以让我知道我应该使用哪种图像格式,以便仅显示图像的徽标,而不显示图像矩形部分中的多余部分.

Can anyone let me know which format of the image shall I use So that only the logo of my image gets displayed not the extra part which lies in the rectangular part of the image.

如果您需要更多说明...请让我知道

If u need more clarification... Please let me know

谢谢:)

推荐答案

听起来应该使用图像编辑程序(例如Paint, GIMP 或Photoshop,然后显示或覆盖裁剪后的图像.

It sounds like what you should do is crop your image using an image editing program, like Paint, Paint.net, GIMP or Photoshop, and then display or overlay the cropped image.

如果您真的想使用OpenCV进行此操作,请参见如何加载和显示图像,这是 imread 函数的文档.从后者中,回答您的问题的标题:

If you really want to use OpenCV to do this, here's how to load and display images, and here's the imread function's documentation. From the latter, to answer your question's title:

当前,支持以下文件格式:

Currently, the following file formats are supported:

    Windows bitmaps - *.bmp, *.dib (always supported)
    JPEG files - *.jpeg, *.jpg, *.jpe (see the Notes section)
    JPEG 2000 files - *.jp2 (see the Notes section)
    Portable Network Graphics - *.png (see the Notes section)
    Portable image format - *.pbm, *.pgm, *.ppm (always supported)
    Sun rasters - *.sr, *.ras (always supported)
    TIFF files - *.tiff, *.tif (see the Notes section)

这篇关于OpenCV支持哪种图像格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆