Image formats supported by OpenCV

Source: Internet
Author: User
Tags bmp image

Image formats supported by OpenCV

Currently, OpenCV supports the following image formats:

  • Windows bitmap files-BMP, DIB;
  • JPEG file-JPEG, JPG, JPE;
  • Portable Network image-PNG;
  • Portable image formats-PBM, PGM, and PPM;
  • Sun rasters-SR, RAS;
  • TIFF files-TIFF, TIF;
  • OpenEXR HDR Image-EXR;
  • JPEG 2000 image-jp2.

You can use the cvSaveImage function or imwrite () function to convert different image formats. The suffix is the corresponding image format.

1. BMP

BMP is a standard image file format in the Windows operating system. It can be divided into two categories: Device-related Bitmap (DDB) and device-independent Bitmap (DIB), which are widely used. It uses a bit ing storage format. Apart from image depth options, it does not use any compression. Therefore, BMP files occupy a large amount of space. The image depth of BMP files can be lbit, 4bit, 8bit, and 24bit. When a BMP file stores data, the image is scanned in the order of left to right and bottom to top. Because the BMP file format is a standard for exchanging graph-related data in Windows, the graphic image software running in Windows supports the BMP image format.

2. JPEG files-JPEG, JPG, and JPE

In the computer, JPEG (pronounced jay-peg, IPA: [mongod audio e audio p]) it is a lossy compression standard that is widely used for photo images. This name represents Joint Photographic Experts Group (Joint image Expert Group ). This team was founded in, released the JPEG standard in, and was recognized as ISO-1 in. JPEG and audio compression standard MPEG (Moving Picture Experts Group) are easy to confuse, but they are different organizations and standards. JPEG itself only describes how to convert an image into a byte data stream (streaming), but it does not explain how these bytes are stored on any specific storage media. The compression method of JPEG is usually destructive data compression (lossy compression), meaning that the image quality will be visible during the compression process, one JPEG-based standard Lossless JPEG adopts Lossless compression, but Lossless JPEG is not widely supported. Image files compressed in JPEG format are also known as JPEG files. The most common extended name format is. jpg, and other commonly used extended names include. JPEG,. jpe,. jfif, And. jif. JPEG data can also be embedded into other file formats, such as TIFF format.

3. Portable Network image-PNG

Portable Network Graphics is A Lossless Bitmap image format. It is designed to replace GIF and TIFF file formats and add features not available in GIF file formats. The PNG name is derived from the Portable Network Graphic Format (PNG) and an unofficial explanation is "PNG's Not GIF ". PNG uses a lossless data compression algorithm derived from LZ77, which is generally used in JAVA programs, web pages, or S60 programs because of its high compression ratio and small size of generated files.

Features:

  • Due to bandwidth restrictions in Small-size network communication, it is impossible to use a large range of bmp files on the webpage while ensuring that the images are clear and realistic.
  • Lossless Compression PNG files are compressed using the LZ77 algorithm. The result is a high compression ratio without data loss. It uses special encoding methods to mark repeated data, so it has no effect on the color of the image, nor can it cause color loss, so that it can be retained without reducing the image quality.
  • The support for transparent effect PNG can define 256 transparent layers for the original image, so that the edge of the color image can be smoothly integrated with any background, so as to completely eliminate the Sawtooth edge. This function is not available in GIF and JPEG formats.
  • PNG also supports Alpha channel transparency of true color and grayscale images.

OpenCV official tutorial Chinese version (For Python) PDF

Install OpenCV2.4.9 on Ubuntu 14.04

On Ubuntu 16.04, The OpenCV3.0 of Raspberry Pi is compiled with the CMake graphic interface.

Install OpenCV 2.4.11 in Ubuntu 16.04

Install the OpenCV3.1 + Caffe software in the open2014a + Anaconda2 + OpenCV3.1 + Ubuntu 16.04

Install and compile OpenCV3.0.0 on Linux

OpenCV Installation notes and routines in Ubuntu 16.04

TensorFlow + Caffe + OpenCV3.1 + Theano deployment in Ubuntu 16.04

Ubuntu 16.04 compilation and installation of OpenCV 3.1 and OpenCV multi-version Switch

Install OpenCV 2.4.9 in Ubuntu 14.04 and 13.10

Install OpenCV 2.4.9 on Ubuntu

Compiling and installing OpenCV source code in Ubuntu 17.04

OpenCV details: click here
OpenCV: click here

This article permanently updates link: https://www.bkjia.com/Linux/2018-03/151248.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.