/*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.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., 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 the copyright holders 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 __OPENCV_CORE_C_H__
#define __OPENCV_CORE_C_H__
#include "opencv2/core/types_c.h"
#ifdef __cplusplus
extern "C" {
#endif
/****************************************************************************************\
* Array allocation, deallocation, initialization and access to elements *
\****************************************************************************************/
/* <malloc> wrapper.
If there is no enough memory, the function
(as well as other OpenCV functions that call cvAlloc)
raises an error. */
CVAPI(void*) cvAlloc( size_t size );
/* <free> wrapper.
Here and further all the memory releasing functions
(that all call cvFree) take double pointer in order to
to clear pointer to the data after releasing it.
Passing pointer to NULL pointer is Ok: nothing happens in this case
*/
CVAPI(void) cvFree_( void* ptr );
#define cvFree(ptr) (cvFree_(*(ptr)), *(ptr)=0)
/* Allocates and initializes IplImage header */
CVAPI(IplImage*) cvCreateImageHeader( CvSize size, int depth, int channels );
/* Inializes IplImage header */
CVAPI(IplImage*) cvInitImageHeader( IplImage* image, CvSize size, int depth,
int channels, int origin CV_DEFAULT(0),
int align CV_DEFAULT(4));
/* Creates IPL image (header and data) */
CVAPI(IplImage*) cvCreateImage( CvSize size, int depth, int channels );
/* Releases (i.e. deallocates) IPL image header */
CVAPI(void) cvReleaseImageHeader( IplImage** image );
/* Releases IPL image header and data */
CVAPI(void) cvReleaseImage( IplImage** image );
/* Creates a copy of IPL image (widthStep may differ) */
CVAPI(IplImage*) cvCloneImage( const IplImage* image );
/* Sets a Channel Of Interest (only a few functions support COI) -
use cvCopy to extract the selected channel and/or put it back */
CVAPI(void) cvSetImageCOI( IplImage* image, int coi );
/* Retrieves image Channel Of Interest */
CVAPI(int) cvGetImageCOI( const IplImage* image );
/* Sets image ROI (region of interest) (COI is not changed) */
CVAPI(void) cvSetImageROI( IplImage* image, CvRect rect );
/* Resets image ROI and COI */
CVAPI(void) cvResetImageROI( IplImage* image );
/* Retrieves image ROI */
CVAPI(CvRect) cvGetImageROI( const IplImage* image );
/* Allocates and initializes CvMat header */
CVAPI(CvMat*) cvCreateMatHeader( int rows, int cols, int type );
#define CV_AUTOSTEP 0x7fffffff
/* Initializes CvMat header */
CVAPI(CvMat*) cvInitMatHeader( CvMat* mat, int rows, int cols,
int type, void* data CV_DEFAULT(NULL),
int step CV_DEFAULT(CV_AUTOSTEP) );
/* Allocates and initializes CvMat header and allocates data */
CVAPI(CvMat*) cvCreateMat( int rows, int cols, int type );
/* Releases CvMat header and deallocates matrix data
(reference counting is used for data) */
CVAPI(void) cvReleaseMat( CvMat** mat );
/* Decrements CvMat data reference counter and deallocates the data if
it reaches 0 */
CV_INLINE void cvDecRefData( CvArr* arr )
{
if( CV_IS_MAT( arr ))
{
CvMat* mat = (CvMat*)arr;
mat->data.ptr = NULL;
if( mat->refcount != NULL && --*mat->refcount == 0 )
cvFree( &mat->refcount );
mat->refcount = NULL;
}
else if( CV_IS_MATND( arr ))
{
CvMatND* mat = (CvMatND*)arr;
mat->data.ptr = NULL;
if( mat->refcount != NULL && --*mat->refcount == 0 )
cvFree( &mat->refcount );
mat->refcount = NULL;
}
}
/* Increments CvMat data reference counter */
CV_INLINE int cvIncRefData( CvArr* arr )
{
int refcount = 0;
if( CV_IS_MAT( arr ))
{
CvMat* mat = (CvMat*)arr;
if( mat->refcount != NULL )
refcount = ++*mat->refcount;
}
else if( CV_IS_MATND( arr ))
{
CvMatND* mat = (CvMatND*)arr;
if( mat->refcount != NULL )
refcount = ++*mat->refcount;
}
return refcount;
}
/* Creates an exact copy of the input matrix (except, may be, step value) */
CVAPI(CvMat*) cvCloneMat( const CvMat* mat );
/* Makes a new matrix from <rect> subrectangle of input array.
No data is copied */
CVAPI(CvMat*) cvGetSubRect( const CvArr* arr, CvMat* submat, CvRect rect );
#define cvGetSubArr cvGetSubRect
/* Selects row span of the input array: arr(start_row:delta_row:end_row,:)
(end_row is not included into the span). */
CVAPI(CvMat*) cvGetRows( const CvArr* arr, CvMat* submat,
int start_row, int end_row,
int delta_row CV_DEFAULT(1));
CV_INLINE CvMat* cvGetRow( const CvArr* arr, CvMat* submat, int row )
{
return cvGetRows( arr, submat, row, row + 1, 1 );
}
/* Selects column span of the input array: arr(:,start_col:end_col)
(end_col is not included into the span) */
CVAPI(CvMat*) cvGetCols( const CvArr* arr, CvMat* submat,
int start_col, int end_col );
CV_INLINE CvMat* cvGetCol( const CvArr* arr, CvMat* submat, int col )
{
return cvGetCols( arr, submat, col, col + 1 );
}
/* Select a diagonal of the input array.
(diag = 0 means the main diagonal, >0 means a diagonal above the main one,
<0 - below the main one).
The diagonal will be represented as a column (nx1 matrix). */
CVAPI(CvMat*) cvGetDiag( const CvArr* arr, CvMat* submat,
int diag CV_DEFAULT(0));
/* low-level scalar <-> raw data conversion functions */
CVAPI(void) cvScalarToRawData( const CvScalar* scalar, void* data, int type,
int extend_to_12 CV_DEFAULT(0) );
CVAPI(void) cvRawDataToScalar( const void* data, int type, CvScalar* scalar );
/* Allocates and initializes CvMatND header */
CVAPI(CvMatND*) cvCreateMatNDHeader( int dims, const int* sizes, int type );
/* Allo
![avatar](https://profile-avatar.csdnimg.cn/default.jpg!1)
龙年行大运
- 粉丝: 1402
- 资源: 3960
最新资源
- ChatGPT-GPTCMS-AI人工智能资源
- 基于多主体主从博弈的区域综合能源系统低碳经济优化调度策略:考虑奖惩阶梯型碳机制与双重激励的综合需求响应方法研究,基于多主体主从博弈的区域综合能源系统低碳经济优化调度策略-考虑奖惩阶梯型碳机制与双重激
- 基于Python的剪切板监听图片识别白板设计源码
- minio-rsc-Rust资源
- 多尺度卷积神经网络与注意力机制融合的滚动轴承故障诊断技术研究与应用,基于多尺度卷积神经网络与注意力机制的滚动轴承故障诊断方法研究与实践,基于多尺度卷积神经网络的滚动轴承故障诊断 针对
- 基于C#和SQLServer的鲜花管理系统设计源码
- 三相共直流母线式光储VSG虚拟同步机并网逆变器模型仿真:快速离散化分析与700V直流母线电压下的性能研究,三相共直流母线式光储VSG虚拟同步机构网型逆变器模型仿真:高效功率追踪与双闭环控制,三相共直流
- 基于C++的Coin模拟登陆数据库操作设计源码
- 基于Java语言的DazzlingHare项目设计源码
- 基于Java语言的ztosdk设计源码下载与优化
- 基于Vue和TypeScript的Web前端合作医疗系统设计源码
- 基于TCP/IP协议栈的纯RTL语言实现:跨平台IP通信工具,集成TCP服务器、客户端及ICMP Ping功能,TCP/IP协议栈的纯RTL语言实现:跨平台支持TCP服务器、客户端、ICMP及Ping
- 风力发电项目报告.zip
- LingLongGUI-硬件开发资源
- COMSOL模拟:多类型锂离子电池热管理模型与电化学热耦合效应研究,COMSOL中多型锂离子电池热管理模型的研发:包括电化学热耦合模型及不同形态电池的相变换热与热失控保护模型,comsol 锂离子电池
- 圣钰SAAS后台管理系统-当前系统只维护不升级.yubb-saas-pro商业版开发中-移动应用开发资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)