📄 cv.h
字号:
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright( C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
//(including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort(including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef _CV_H_
#define _CV_H_
#ifndef __CV_DEFINE_USER_LIST__
#include <ipl.h>
#include "cvpixelaccess.h"
#ifndef _CVTYPES_H_
#include "cvtypes.h"
#endif
#include "cverror.h"
#endif /* __CV_DEFINE_USER_LIST__ */
/****************************************************************************************\
* Function definition *
\****************************************************************************************/
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvCreateImageHeader
// Purpose: allocates IplImage structure, initializes and returns it
// Context:
// Parameters:
// size - image size(width and height)
// depth- image depth
// channels - number of channels.
// Returns:
// this call is short form of
// iplCreateImageHeader( channels, 0, depth, channels == 1 ? "GRAY" :
// channels == 3 || channels == 4 ? "RGB" : "",
// channels == 1 ? "GRAY" : channels == 3 ? "BGR" :
// channels == 4 ? "BGRA" : "",
// IPL_DATA_ORDER_PIXEL, IPL_ORIGIN_TL, 4,
// size.width, size.height,
// 0,0,0,0);
//F*/
OPENCVAPI IplImage* cvCreateImageHeader( CvSize size, int depth, int channels );
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvCreateImage
// Purpose: creates header and allocates data
// Context:
// Parameters:
// size - image size(width and height)
// depth- image depth
// channels - number of channels.
// Returns:
// this call is short form of
// header = cvCreateImageHeader(size,depth,channels);
// cvCreateImageData(header);
//F*/
OPENCVAPI IplImage* cvCreateImage( CvSize size, int depth, int channels );
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvReleaseImageHeader
// Purpose: releases header
// Context:
// Parameters:
// image - released image header
// Returns:
// this call is short form of
// if( image )
// {
// iplDeallocate( *image, IPL_IMAGE_HEADER | IPL_IMAGE_ROI );
// *image = 0;
// }
//F*/
OPENCVAPI void cvReleaseImageHeader( IplImage** image );
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvReleaseImage
// Purpose: releases header and image data
// Context:
// Parameters:
// image - released image
// Returns:
// this call is short form of
// if( image )
// {
// iplDeallocate( *image, IPL_IMAGE_ALL );
// *image = 0;
// }
//F*/
OPENCVAPI void cvReleaseImage( IplImage** image );
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvCreateImageData
// Purpose: allocates image data
// Context:
// Parameters:
// image - image header
// Returns:
// this call is short form of
// if( image->depth == IPL_DEPTH_32F )
// {
// iplAllocateImageFP( image, 0, 0 );
// }
// else
// {
// iplAllocateImage( image, 0, 0 );
// }
//F*/
OPENCVAPI void cvCreateImageData( IplImage* image );
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvReleaseImageData
// Purpose: releases image data
// Context:
// Parameters:
// image - image header
// Returns:
// this call is short form of
// iplDeallocate( image, IPL_IMAGE_DATA );
//F*/
OPENCVAPI void cvReleaseImageData( IplImage* image );
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvSetImageData
// Purpose: set pointer to data and step parameter to given values
// Context:
// Parameters:
// image - image header
// data - user data
// step - distance between raster lines in bytes
// Returns:
//F*/
OPENCVAPI void cvSetImageData( IplImage* image, void* data, int step );
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvSetImageCOI
// Purpose: set channel of interest to given value.
// Context:
// Parameters:
// image - image header
// coi - channel of interest
// Returns:
// Notes:
// If roi is NULL and coi != 0, roi is allocated.
//F*/
OPENCVAPI void cvSetImageCOI( IplImage* image, int coi );
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvSetImageROI
// Purpose: set image ROI to given rectangle
// Context:
// Parameters:
// image - image header
// rect - ROI rectangle
// Returns:
// Notes:
// If roi is NULL and rect is not equal to a whole image, roi is allocated.
//F*/
OPENCVAPI void cvSetImageROI( IplImage* image, CvRect rect );
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvGetImageRawData
// Purpose: fills output variables with image parameters
// Context:
// Parameters:
// image - image header
// data - pointer to top-left corner of ROI
// step - = image->widthStep(full width of raster line)
// roi_size - width and height of ROI
// Returns:
// Notes:
// All the output parameters are optional
//F*/
OPENCVAPI void cvGetImageRawData( const IplImage* image, uchar** data,
int* step, CvSize* roi_size );
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvInitImageHeader
// Purpose: initializes image header structure without memory allocation
// Context:
// Parameters:
// image - image header. User allocates it manually(e.g. on stack)
// size - width and height of the image
// depth - image depth
// channels - number of channels
// origin - IPL_ORIGIN_TL or IPL_ORIGIN_BL.
// align - alignment for raster lines
// clear - if 1, header is cleared before it is initialized.
// Returns:
//F*/
OPENCVAPI void cvInitImageHeader( IplImage* image, CvSize size, int depth,
int channels, int origin, int align, int clear );
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvCopyImage
// Purpose: copies entire image(no ROI is considered) to another
// Context:
// Parameters:
// src - source image
// dst - destination image
// Returns:
// Notes:
// if destination image is smaller, its data is reallocated.
//F*/
OPENCVAPI void cvCopyImage(IplImage* src, IplImage* dst);
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvGetImageROI
// Purpose: return region of interest of given image(if image doesn't have ROI then
// return realy size of element)
// Context:
// Parameters:
// img - source image
// Returns:
// Notes:
//F*/
OPENCVAPI CvRect cvGetImageROI( IplImage* img );
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvCloneImage
// Purpose: creates copy of source image(allocates image data, ROI and maskROI if
// it present in source image)
// Context:
// Parameters:
// img - source image
// Returns:
// Notes:
//F*/
OPENCVAPI IplImage* cvCloneImage( IplImage* src );
/****************************************************************************************\
* Pyramids *
\****************************************************************************************/
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvPyrUp
// Purpose: performs upsampling by factor 2 of the image with subsequent
// Gaussian smoothing.
// Context:
// Parameters:
// src - source image
// dst - destination image(must have twice larger width and height than source image)
// filter - filter applied. Only IPL_GAUSSIAN_5x5 is allowed.
// Returns:
//F*/
OPENCVAPI void cvPyrUp( IplImage* src, IplImage* dst,
IplFilter filter CV_DEFAULT(IPL_GAUSSIAN_5x5) );
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvPyrDown
// Purpose: performs downsampling by factor 2 of the image with prior Gaussian.
// Context:
// Parameters:
// src - source image
// dst - destination image(must have twice smaller width and height than
// source image)
// filter - filter applied. Only IPL_GAUSSIAN_5x5 is allowed.
// Returns:
//F*/
OPENCVAPI void cvPyrDown( IplImage* src, IplImage* dst,
IplFilter filter CV_DEFAULT(IPL_GAUSSIAN_5x5) );
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvPyrSegmentation
// Purpose: segments image by pyramid-linking
// Context:
// Parameters:
// src - source image
// dst - destination image
// storage - pointer to the memory storage
// comp - pointer to the sequence of the connected components
// level - number of level to the pyramid costruction
// threshold1 - the first segmentation threshold
// threshold2 - the second segmentation threshold
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -