• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ CV_ERROR函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中CV_ERROR函数的典型用法代码示例。如果您正苦于以下问题:C++ CV_ERROR函数的具体用法?C++ CV_ERROR怎么用?C++ CV_ERROR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了CV_ERROR函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: cvSubstituteContour

/* replaces one contour with another */
CV_IMPL void
cvSubstituteContour( CvContourScanner scanner, CvSeq * new_contour )
{
    _CvContourInfo *l_cinfo;

    CV_FUNCNAME( "cvSubstituteContour" );

    __BEGIN__;

    if( !scanner )
        CV_ERROR( CV_StsNullPtr, "" );

    l_cinfo = scanner->l_cinfo;
    if( l_cinfo && l_cinfo->contour && l_cinfo->contour != new_contour )
    {
        l_cinfo->contour = new_contour;
        scanner->subst_flag = 1;
    }

    __END__;
}
开发者ID:DORARA29,项目名称:AtomManipulator,代码行数:22,代码来源:cvcontours.cpp


示例2: CV_FUNCNAME

void CvMatrix::save( const char* filename, const char* matname )
{
    CV_FUNCNAME( "CvMatrix::write" );
    __BEGIN__;

    if( !matrix )
        return;
    if( icvIsXmlOrYaml( filename ) )
        cvSave( filename, matrix, matname );
    else
    {
        if( save_image )
            save_image( filename, matrix );
        else
            CV_ERROR( CV_StsNotImplemented,
            "Saving a matrixe in such a format requires HigGUI.\n"
            "Link it to your program and call any function from it\n" );
    }

    __END__;
}
开发者ID:DORARA29,项目名称:AtomManipulator,代码行数:21,代码来源:cximage.cpp


示例3: cvGetWindowName

CV_IMPL const char* cvGetWindowName( void* window_handle )
{
    const char* window_name = "";

    CV_FUNCNAME( "cvGetWindowName" );

    __BEGIN__;

    CvWindow* window;

    if( window_handle == 0 )
        CV_ERROR( CV_StsNullPtr, "NULL window" );

    window = icvWindowByHWND( (HWND)window_handle );
    if( window )
        window_name = window->name;

    __END__;

    return window_name;
}
开发者ID:NaterGator,项目名称:AndroidOpenCV_mods,代码行数:21,代码来源:window_w32.cpp


示例4: cvReleaseImage

CV_IMPL void
cvReleaseImage( IplImage ** image )
{
    CV_FUNCNAME( "cvReleaseImage" );

    __BEGIN__

    if( !image )
        CV_ERROR( CV_StsNullPtr, "" );

    if( *image )
    {
        IplImage* img = *image;
        *image = 0;
        
        cvReleaseData( img );
        cvReleaseImageHeader( &img );
    }

    __END__;
}
开发者ID:mikanradojevic,项目名称:sdkpub,代码行数:21,代码来源:cvarray.cpp


示例5: cvGetWindowName

CV_IMPL const char* cvGetWindowName( void* window_handle )
{
    const char* window_name = "";

    CV_FUNCNAME( "cvGetWindowName" );

    __BEGIN__;

    CvWindow* window = 0;

    if( window_handle == 0 )
        CV_ERROR( CV_StsNullPtr, "NULL window" );

    // window = TODO: find window by handle
    if( window )
        window_name = window->name;

    __END__;

    return 0;
}
开发者ID:FanChao90,项目名称:opencv,代码行数:21,代码来源:window_winrt.cpp


示例6: wrprDeviceIsValid

/**
  \internal
  \fn bool wrprDeviceIsValid( gige::IDevice& device )
  \brief Wrapper to GigEVisionAPI function IDevice::Connect()
  \param device - selected device
  \return true - device valid

*/
bool
wrprDeviceIsValid( gige::IDevice& device )
{
  bool b_ret = device != NULL;

  CV_FUNCNAME("wrprDeviceIsConnect");
  __BEGIN__;

  if(b_ret)
  {
    try {
      b_ret = device.IsValid ();
    } catch (...) {
      CV_ERROR(CV_StsError, "GigEVisionAPI: API device validation state (from IsValid()) failed.\n");
      b_ret = false;
    }
  }
  __END__;

  return (b_ret);
}
开发者ID:ArkaJU,项目名称:opencv,代码行数:29,代码来源:cap_giganetix.cpp


示例7: cvGetWindowHandle

CV_IMPL void* cvGetWindowHandle( const char* window_name )
{
    void* hwnd = 0;

    CV_FUNCNAME( "cvGetWindowHandle" );

    __BEGIN__;

    CvWindow* window;

    if( window_name == 0 )
        CV_ERROR( CV_StsNullPtr, "NULL window name" );

    window = icvFindWindowByName( window_name );
    if( window )
        hwnd = (void*)window->hwnd;

    __END__;

    return hwnd;
}
开发者ID:NaterGator,项目名称:AndroidOpenCV_mods,代码行数:21,代码来源:window_w32.cpp


示例8: cvMoveWindow

CV_IMPL void cvMoveWindow( const char* name, int x, int y )
{
    CV_FUNCNAME( "cvMoveWindow" );

    __BEGIN__;

    CvWindow* window;
    RECT rect;

    if( !name )
        CV_ERROR( CV_StsNullPtr, "NULL name" );

    window = icvFindWindowByName(name);
    if(!window)
        EXIT;

    GetWindowRect( window->frame, &rect );
    MoveWindow( window->frame, x, y, rect.right - rect.left, rect.bottom - rect.top, TRUE);

    __END__;
}
开发者ID:NaterGator,项目名称:AndroidOpenCV_mods,代码行数:21,代码来源:window_w32.cpp


示例9: cvSetMouseCallback

CV_IMPL void
cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse, void* param )
{
    CV_FUNCNAME( "cvSetMouseCallback" );

    __BEGIN__;

    CvWindow* window = 0;

    if( !window_name )
        CV_ERROR( CV_StsNullPtr, "NULL window name" );

    window = icvFindWindowByName(window_name);
    if( !window )
        EXIT;

    window->on_mouse = on_mouse;
    window->on_mouse_param = param;

    __END__;
}
开发者ID:NaterGator,项目名称:AndroidOpenCV_mods,代码行数:21,代码来源:window_w32.cpp


示例10: CV_FUNCNAME

void CvANN_MLP::set_activ_func( int _activ_func, double _f_param1, double _f_param2 )
{
    CV_FUNCNAME( "CvANN_MLP::set_activ_func" );

    __BEGIN__;

    if( _activ_func < 0 || _activ_func > GAUSSIAN )
        CV_ERROR( CV_StsOutOfRange, "Unknown activation function" );

    activ_func = _activ_func;

    switch( activ_func )
    {
    case SIGMOID_SYM:
        max_val = 0.95; min_val = -max_val;
        max_val1 = 0.98; min_val1 = -max_val1;
        if( fabs(_f_param1) < FLT_EPSILON )
            _f_param1 = 2./3;
        if( fabs(_f_param2) < FLT_EPSILON )
            _f_param2 = 1.7159;
        break;
    case GAUSSIAN:
        max_val = 1.; min_val = 0.05;
        max_val1 = 1.; min_val1 = 0.02;
        if( fabs(_f_param1) < FLT_EPSILON )
            _f_param1 = 1.;
        if( fabs(_f_param2) < FLT_EPSILON )
            _f_param2 = 1.;
        break;
    default:
        min_val = max_val = min_val1 = max_val1 = 0.;
        _f_param1 = 1.;
        _f_param2 = 0.;
    }

    f_param1 = _f_param1;
    f_param2 = _f_param2;

    __END__;
}
开发者ID:cybertk,项目名称:opencv,代码行数:40,代码来源:mlann_mlp.cpp


示例11: cvGetSize

OPENCVAPI CvSize
cvGetSize( const CvArr* arr )
{
    CvSize size = { 0, 0 };

    CV_FUNCNAME( "cvGetSize" );

    __BEGIN__;

    if( _CV_IS_ARR( arr ))
    {
        CvMat *mat = (CvMat*)arr;

        size.width = mat->width;
        size.height = mat->height;
    }
    else if( _CV_IS_IMAGE( arr ))
    {
        IplImage* img = (IplImage*)arr;

        if( img->roi )
        {
            size.width = img->roi->width;
            size.height = img->roi->height;
        }
        else
        {
            size.width = img->width;
            size.height = img->height;
        }
    }
    else
    {
        CV_ERROR( CV_StsBadArg, "Parameter of cvGetSize is neither CvMat nor IplImage" );
    }

    __END__;

    return size;
}
开发者ID:mikanradojevic,项目名称:sdkpub,代码行数:40,代码来源:cvarray.cpp


示例12: cvCloneImage

CV_IMPL IplImage*
cvCloneImage( const IplImage* src )
{
    IplImage* dst = 0;
    CV_FUNCNAME( "cvCloneImage" );

    __BEGIN__;

    if( !_CV_IS_IMAGE( src ))
        CV_ERROR( CV_StsBadArg, "Bad image header" );

    if( !CvIPL.cloneImage )
    {
        CV_CALL( dst = (IplImage*)cvAlloc( sizeof(*dst)));

        memcpy( dst, src, sizeof(*src));
        dst->roi = 0;

        if( src->roi )
        {
            dst->roi = icvCreateROI( src->roi->coi, src->roi->xOffset,
                          src->roi->yOffset, src->roi->width, src->roi->height );
        }

        if( src->imageData )
        {
            int size = src->imageSize;
            cvCreateData( dst );
            memcpy( dst->imageData, src->imageData, size );
        }
    }
    else
    {
        dst = CvIPL.cloneImage( src );
    }

    __END__;

    return dst;
}
开发者ID:mikanradojevic,项目名称:sdkpub,代码行数:40,代码来源:cvarray.cpp


示例13: cvShowImage

CV_IMPL void
cvShowImage( const char* name, const CvArr* arr )
{
    CV_FUNCNAME( "cvShowImage" );

    __BEGIN__;

    CvWindow* window;

    if( !name )
        CV_ERROR( CV_StsNullPtr, "NULL name" );

    CV_LOCK_MUTEX();

    window = icvFindWindowByName(name);
    if(!window)
    {
        cvNamedWindow(name, 1);
        window = icvFindWindowByName(name);
    }

    if( window && arr )
    {
    #ifdef HAVE_OPENGL
        if (window->useGl)
        {
            cv::imshow(name, cv::cvarrToMat(arr));
            return;
        }
    #endif

        CvImageWidget * image_widget = CV_IMAGE_WIDGET( window->widget );
        cvImageWidgetSetImage( image_widget, arr );
    }

    CV_UNLOCK_MUTEX();

    __END__;
}
开发者ID:112000,项目名称:opencv,代码行数:39,代码来源:window_gtk.cpp


示例14: wrprDeviceDisconnect

/**
  \internal
  \fn bool wrprDeviceDisconnect ( gige::IDevice& device )
  \brief Wrapper to GigEVisionAPI function IDevice::Disconnect()
  \param device - selected device
  \return true - device valid

*/
bool
wrprDeviceDisconnect ( gige::IDevice& device )
{
  bool b_ret = device != NULL;

  CV_FUNCNAME("wrprDeviceDisconnect");
  __BEGIN__;

  if(b_ret)
  {
    try {
      device->Disconnect ();
    } catch (...) {
      CV_ERROR(CV_StsError, "GigEVisionAPI: API device disconnect (from Disconnect()) failed.\n");
      b_ret = false;
    }
  }

  __END__;

  return (b_ret);
}
开发者ID:ArkaJU,项目名称:opencv,代码行数:30,代码来源:cap_giganetix.cpp


示例15: CV_FUNCNAME

const CvMat* CvMLData::get_var_idx()
{
     CV_FUNCNAME( "CvMLData::get_var_idx" );
    __BEGIN__;

    int avcount = 0;

    if ( !values )
        CV_ERROR( CV_StsInternal, "data is empty" );

    assert( var_idx_mask );

    avcount = cvFloor( cvNorm( var_idx_mask, 0, CV_L1 ) );
    int* vidx;

    if ( avcount == values->cols )
        return 0;

    if ( !var_idx_out || ( var_idx_out && var_idx_out->cols != avcount ) )
    {
        cvReleaseMat( &var_idx_out );
        var_idx_out = cvCreateMat( 1, avcount, CV_32SC1);
        if ( response_idx >=0 )
            var_idx_mask->data.ptr[response_idx] = 0;
    }

    vidx = var_idx_out->data.i;

    for(int i = 0; i < var_idx_mask->cols; i++)
        if ( var_idx_mask->data.ptr[i] )
        {
            *vidx = i;
            vidx++;
        }

    __END__;

    return var_idx_out;
}
开发者ID:HVisionSensing,项目名称:Face-Expression-Recognition,代码行数:39,代码来源:data.cpp


示例16: cvGetImageROI

CV_IMPL CvRect
cvGetImageROI( const IplImage* img )
{
    CvRect rect = { 0, 0, 0, 0 };
    
    CV_FUNCNAME( "cvGetImageROI" );

    __BEGIN__;

    if( !img )
        CV_ERROR( IPL_StsNullPtr, "Null pointer to image" );

    if( img->roi )
        rect = cvRect( img->roi->xOffset, img->roi->yOffset,
                       img->roi->width, img->roi->height );
    else
        rect = cvRect( 0, 0, img->width, img->height );

    __END__;
    
    return rect;
}
开发者ID:mikanradojevic,项目名称:sdkpub,代码行数:22,代码来源:cvarray.cpp


示例17: cvImgToObs_DCT

CV_IMPL void
cvImgToObs_DCT( const void* arr, float *obs, CvSize dctSize,
                CvSize obsSize, CvSize delta )
{
    CV_FUNCNAME( "cvImgToObs_DCT" );

    __BEGIN__;

    CvMat stub, *mat = (CvMat*)arr;

    CV_CALL( mat = cvGetMat( arr, &stub ));

    if( CV_ARR_TYPE( mat->type ) != CV_8UC1 )
        CV_ERROR( CV_StsUnsupportedFormat, "" );

    IPPI_CALL( icvImgToObs_DCT_8u32f_C1R( (uchar*)mat->data.ptr, mat->step,
                                           icvGetMatSize(mat), obs,
                                           dctSize, obsSize, delta ));

    __END__;

}
开发者ID:mikanradojevic,项目名称:sdkpub,代码行数:22,代码来源:cvhmmwrap.cpp


示例18: cvReadChainPoint

/* retrieves next point of the chain curve and updates reader */
CV_IMPL CvPoint
cvReadChainPoint( CvChainPtReader * reader )
{
    char *ptr;
    int code;
    CvPoint pt = { 0, 0 };

    CV_FUNCNAME( "cvReadChainPoint" );

    __BEGIN__;

    if( !reader )
        CV_ERROR( CV_StsNullPtr, "" );

    pt = reader->pt;
    
    ptr = reader->ptr;
    if( ptr )
    {
        code = *ptr++;

        if( ptr >= reader->block_max )
        {
            cvChangeSeqBlock( (CvSeqReader *) reader, 1 );
            ptr = reader->ptr;
        }

        reader->ptr = ptr;
        reader->code = (char)code;
        assert( (code & ~7) == 0 );
        reader->pt.x = pt.x + icvCodeDeltas[code].x;
        reader->pt.y = pt.y + icvCodeDeltas[code].y;
    }

    __END__;

    return pt;
}
开发者ID:DORARA29,项目名称:AtomManipulator,代码行数:39,代码来源:cvcontours.cpp


示例19: cvResizeWindow

CV_IMPL void cvResizeWindow(const char* name, int width, int height )
{
    CV_FUNCNAME( "cvResizeWindow" );

    __BEGIN__;

    int i;
    CvWindow* window;
    RECT rmw, rw, rect;

    if( !name )
        CV_ERROR( CV_StsNullPtr, "NULL name" );

    window = icvFindWindowByName(name);
    if(!window)
        EXIT;

    // Repeat two times because after the first resizing of the mainhWnd window
    // toolbar may resize too
    for(i = 0; i < (window->toolbar.toolbar ? 2 : 1); i++)
    {
        rw = icvCalcWindowRect(window);
        MoveWindow(window->hwnd, rw.left, rw.top,
            rw.right - rw.left + 1, rw.bottom - rw.top + 1, FALSE);
        GetClientRect(window->hwnd, &rw);
        GetWindowRect(window->frame, &rmw);
        // Resize the mainhWnd window in order to make the bitmap fit into the child window
        MoveWindow(window->frame, rmw.left, rmw.top,
            rmw.right - rmw.left + width - rw.right + rw.left,
            rmw.bottom  - rmw.top + height - rw.bottom + rw.top, TRUE);
    }

    rect = icvCalcWindowRect(window);
    MoveWindow(window->hwnd, rect.left, rect.top,
        rect.right - rect.left + 1, rect.bottom - rect.top + 1, TRUE);

    __END__;
}
开发者ID:SCS-B3C,项目名称:OpenCV2-2,代码行数:38,代码来源:window_w32.cpp


示例20: releaseBGMeanStatModel

void
releaseBGMeanStatModel( BGMeanStatModel** _model ){
  CV_FUNCNAME( "releaseBGMeanStatModel" );
  
  __BEGIN__;
  
  if( !_model )
    CV_ERROR( CV_StsNullPtr, "" );
  
  if( *_model ){
    BGMeanStatModel* model = *_model;
    
    cvFree( &model->frame_cbuffer );
    cvFree( &model->mean );
    cvFree( &model->std_dev );
    cvReleaseImage( &model->foreground );
    cvReleaseImage( &model->background );
    cvReleaseMemStorage(&model->storage);
    cvFree( _model );
  }
  
  __END__;
}
开发者ID:AeroCano,项目名称:JdeRobot,代码行数:23,代码来源:bgfg_mean.cpp



注:本文中的CV_ERROR函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CV_Error函数代码示例发布时间:2022-05-30
下一篇:
C++ CV_EML_IF函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap