Cvloadimage function analysis cvloadimagem () function

Source: Internet
Author: User
1. function prototype: iplimage * cvloadimage (const char * filename, int flags = cv_load_image_color); filename: name of the file to be read (including the suffix); flags: specify the color and depth of the image to be read: The specified color can be converted into three channels (cv_load_image_color), one channel (cv_load_image_grayscale), or remain unchanged (cv_load_image_anycolor ). Specify whether or not the input image is converted into 8 bits per pixel for each color channel (same as in early versions of opencv), or remains the same as the input image. Select cv_load_image_anydepth. The input image format can be 8-bit unsigned, 16-bit unsigned, 32-bit signed, or 32-bit floating point. If the input contains a conflicting sign, a smaller number is used. For example, cv_load_image_color | cv_load_image_anycolor is loaded into the 3-channel diagram. Cv_load_image_anycolor and cv_load_image_unchanged are equivalent. However, cv_load_image_anycolor can be used with cv_load_image_anydepth, so cv_load_image_unchanged is no longer used. If you want to load the most authentic image, select cv_load_image_anydepth | cv_load_image_anycolor. The cvloadimage function reads an image from a specified file and returns a pointer to the image. Currently, the following file formats are supported: Windows bitmap files-BMP, dib; JPEG files-JPEG, JPG, jpe; portable network images-PNG; portable image formats-PBM, PGM, and ppm; sun rasters-Sr, Ras; TIFF file-Tiff, Tif; openexr HDR Image-EXR; JPEG 2000 image-JP2. 2. How to Use the cvloadimage function: cvloadimage (filename,-1); the number of original channels for reading the image cvloadimage (filename, 0) by default; forced conversion to read the image as a grayscale image cvloadimage (filename, 1); read color legend: forcibly convert the read image to grayscale image display # include Cvloadimage function analysis cvloadimagem () function

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.