亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? cvderiv.cpp

?? 將OpenCV移植到DSP上
?? CPP
字號:
/*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*/

#include "_cv.h"

/****************************************************************************************/

/* lightweight convolution with 3x3 kernel */

/****************************************************************************************\
                             Sobel & Scharr Derivative Filters
\****************************************************************************************/

/////////////////////////////// Old IPP derivative filters ///////////////////////////////
// still used in corner detectors (see cvcorner.cpp)

icvFilterSobelVert_8u16s_C1R_t icvFilterSobelVert_8u16s_C1R_p = 0;
icvFilterSobelHoriz_8u16s_C1R_t icvFilterSobelHoriz_8u16s_C1R_p = 0;
icvFilterSobelVertSecond_8u16s_C1R_t icvFilterSobelVertSecond_8u16s_C1R_p = 0;
icvFilterSobelHorizSecond_8u16s_C1R_t icvFilterSobelHorizSecond_8u16s_C1R_p = 0;
icvFilterSobelCross_8u16s_C1R_t icvFilterSobelCross_8u16s_C1R_p = 0;

icvFilterSobelVert_32f_C1R_t icvFilterSobelVert_32f_C1R_p = 0;
icvFilterSobelHoriz_32f_C1R_t icvFilterSobelHoriz_32f_C1R_p = 0;
icvFilterSobelVertSecond_32f_C1R_t icvFilterSobelVertSecond_32f_C1R_p = 0;
icvFilterSobelHorizSecond_32f_C1R_t icvFilterSobelHorizSecond_32f_C1R_p = 0;
icvFilterSobelCross_32f_C1R_t icvFilterSobelCross_32f_C1R_p = 0;

icvFilterScharrVert_8u16s_C1R_t icvFilterScharrVert_8u16s_C1R_p = 0;
icvFilterScharrHoriz_8u16s_C1R_t icvFilterScharrHoriz_8u16s_C1R_p = 0;
icvFilterScharrVert_32f_C1R_t icvFilterScharrVert_32f_C1R_p = 0;
icvFilterScharrHoriz_32f_C1R_t icvFilterScharrHoriz_32f_C1R_p = 0;

///////////////////////////////// New IPP derivative filters /////////////////////////////

#define IPCV_FILTER_PTRS( name )                    \
icvFilter##name##GetBufSize_8u16s_C1R_t             \
    icvFilter##name##GetBufSize_8u16s_C1R_p = 0;    \
icvFilter##name##Border_8u16s_C1R_t                 \
    icvFilter##name##Border_8u16s_C1R_p = 0;        \
icvFilter##name##GetBufSize_32f_C1R_t               \
    icvFilter##name##GetBufSize_32f_C1R_p = 0;      \
icvFilter##name##Border_32f_C1R_t                   \
    icvFilter##name##Border_32f_C1R_p = 0;

IPCV_FILTER_PTRS( ScharrHoriz )
IPCV_FILTER_PTRS( ScharrVert )
IPCV_FILTER_PTRS( SobelHoriz )
IPCV_FILTER_PTRS( SobelNegVert )
IPCV_FILTER_PTRS( SobelHorizSecond )
IPCV_FILTER_PTRS( SobelVertSecond )
IPCV_FILTER_PTRS( SobelCross )
IPCV_FILTER_PTRS( Laplacian )

typedef CvStatus (CV_STDCALL * CvDeriv3x3GetBufSizeIPPFunc)
    ( CvSize roi, int* bufsize );

typedef CvStatus (CV_STDCALL * CvDerivGetBufSizeIPPFunc)
    ( CvSize roi, int masksize, int* bufsize );

typedef CvStatus (CV_STDCALL * CvDeriv3x3IPPFunc_8u )
    ( const void* src, int srcstep, void* dst, int dststep,
      CvSize size, int bordertype, uchar bordervalue, void* buffer );

typedef CvStatus (CV_STDCALL * CvDeriv3x3IPPFunc_32f )
    ( const void* src, int srcstep, void* dst, int dststep,
      CvSize size, int bordertype, float bordervalue, void* buffer );

typedef CvStatus (CV_STDCALL * CvDerivIPPFunc_8u )
    ( const void* src, int srcstep, void* dst, int dststep,
      CvSize size, int masksize, int bordertype,
      uchar bordervalue, void* buffer );

typedef CvStatus (CV_STDCALL * CvDerivIPPFunc_32f )
    ( const void* src, int srcstep, void* dst, int dststep,
      CvSize size, int masksize, int bordertype,
      float bordervalue, void* buffer );

//////////////////////////////////////////////////////////////////////////////////////////

CV_IMPL void
cvSobel( const void* srcarr, void* dstarr, int dx, int dy, int aperture_size )
{
    CvSepFilter filter;
    void* buffer = 0;
    int local_alloc = 0;

    CV_FUNCNAME( "cvSobel" );

    __BEGIN__;

    int origin = 0;
    int src_type, dst_type;
    CvMat srcstub, *src = (CvMat*)srcarr;
    CvMat dststub, *dst = (CvMat*)dstarr;

    if( !CV_IS_MAT(src) )
        CV_CALL( src = cvGetMat( src, &srcstub ));
    if( !CV_IS_MAT(dst) )
        CV_CALL( dst = cvGetMat( dst, &dststub ));

    if( CV_IS_IMAGE_HDR( srcarr ))
        origin = ((IplImage*)srcarr)->origin;

    src_type = CV_MAT_TYPE( src->type );
    dst_type = CV_MAT_TYPE( dst->type );

    if( !CV_ARE_SIZES_EQ( src, dst ))
        CV_ERROR( CV_StsBadArg, "src and dst have different sizes" );

    if( ((aperture_size == CV_SCHARR || aperture_size == 3 || aperture_size == 5) &&
        dx <= 2 && dy <= 2 && dx + dy <= 2 && icvFilterSobelNegVertBorder_8u16s_C1R_p) &&
        (src_type == CV_8UC1 && dst_type == CV_16SC1 ||
        src_type == CV_32FC1 && dst_type == CV_32FC1) )
    {
        CvDerivGetBufSizeIPPFunc ipp_sobel_getbufsize_func = 0;
        CvDerivIPPFunc_8u ipp_sobel_func_8u = 0;
        CvDerivIPPFunc_32f ipp_sobel_func_32f = 0;

        CvDeriv3x3GetBufSizeIPPFunc ipp_scharr_getbufsize_func = 0;
        CvDeriv3x3IPPFunc_8u ipp_scharr_func_8u = 0;
        CvDeriv3x3IPPFunc_32f ipp_scharr_func_32f = 0;

        if( aperture_size == CV_SCHARR )
        {
            if( dx == 1 && dy == 0 )
            {
                if( src_type == CV_8U )
                    ipp_scharr_func_8u = icvFilterScharrVertBorder_8u16s_C1R_p,
                    ipp_scharr_getbufsize_func = icvFilterScharrVertGetBufSize_8u16s_C1R_p;
                else
                    ipp_scharr_func_32f = icvFilterScharrVertBorder_32f_C1R_p,
                    ipp_scharr_getbufsize_func = icvFilterScharrVertGetBufSize_32f_C1R_p;
            }
            else if( dx == 0 && dy == 1 )
            {
                if( src_type == CV_8U )
                    ipp_scharr_func_8u = icvFilterScharrHorizBorder_8u16s_C1R_p,
                    ipp_scharr_getbufsize_func = icvFilterScharrHorizGetBufSize_8u16s_C1R_p;
                else
                    ipp_scharr_func_32f = icvFilterScharrHorizBorder_32f_C1R_p,
                    ipp_scharr_getbufsize_func = icvFilterScharrHorizGetBufSize_32f_C1R_p;
            }
            else
                CV_ERROR( CV_StsBadArg, "Scharr filter can only be used to compute 1st image derivatives" );
        }
        else
        {
            if( dx == 1 && dy == 0 )
            {
                if( src_type == CV_8U )
                    ipp_sobel_func_8u = icvFilterSobelNegVertBorder_8u16s_C1R_p,
                    ipp_sobel_getbufsize_func = icvFilterSobelNegVertGetBufSize_8u16s_C1R_p;
                else
                    ipp_sobel_func_32f = icvFilterSobelNegVertBorder_32f_C1R_p,
                    ipp_sobel_getbufsize_func = icvFilterSobelNegVertGetBufSize_32f_C1R_p;
            }
            else if( dx == 0 && dy == 1 )
            {
                if( src_type == CV_8U )
                    ipp_sobel_func_8u = icvFilterSobelHorizBorder_8u16s_C1R_p,
                    ipp_sobel_getbufsize_func = icvFilterSobelHorizGetBufSize_8u16s_C1R_p;
                else
                    ipp_sobel_func_32f = icvFilterSobelHorizBorder_32f_C1R_p,
                    ipp_sobel_getbufsize_func = icvFilterSobelHorizGetBufSize_32f_C1R_p;
            }
            else if( dx == 2 && dy == 0 )
            {
                if( src_type == CV_8U )
                    ipp_sobel_func_8u = icvFilterSobelVertSecondBorder_8u16s_C1R_p,
                    ipp_sobel_getbufsize_func = icvFilterSobelVertSecondGetBufSize_8u16s_C1R_p;
                else
                    ipp_sobel_func_32f = icvFilterSobelVertSecondBorder_32f_C1R_p,
                    ipp_sobel_getbufsize_func = icvFilterSobelVertSecondGetBufSize_32f_C1R_p;
            }
            else if( dx == 0 && dy == 2 )
            {
                if( src_type == CV_8U )
                    ipp_sobel_func_8u = icvFilterSobelHorizSecondBorder_8u16s_C1R_p,
                    ipp_sobel_getbufsize_func = icvFilterSobelHorizSecondGetBufSize_8u16s_C1R_p;
                else
                    ipp_sobel_func_32f = icvFilterSobelHorizSecondBorder_32f_C1R_p,
                    ipp_sobel_getbufsize_func = icvFilterSobelHorizSecondGetBufSize_32f_C1R_p;
            }
            else if( dx == 1 && dy == 1 )
            {
                if( src_type == CV_8U )
                    ipp_sobel_func_8u = icvFilterSobelCrossBorder_8u16s_C1R_p,
                    ipp_sobel_getbufsize_func = icvFilterSobelCrossGetBufSize_8u16s_C1R_p;
                else
                    ipp_sobel_func_32f = icvFilterSobelCrossBorder_32f_C1R_p,
                    ipp_sobel_getbufsize_func = icvFilterSobelCrossGetBufSize_32f_C1R_p;
            }
        }

        if( (ipp_sobel_func_8u || ipp_sobel_func_32f) && ipp_sobel_getbufsize_func ||
            (ipp_scharr_func_8u || ipp_scharr_func_32f) && ipp_scharr_getbufsize_func )
        {
            int bufsize = 0, masksize = aperture_size == 3 ? 33 : 55;
            CvSize size = cvGetMatSize( src );
            uchar* src_ptr = src->data.ptr;
            uchar* dst_ptr = dst->data.ptr;
            int src_step = src->step ? src->step : CV_STUB_STEP;
            int dst_step = dst->step ? dst->step : CV_STUB_STEP;
            const int bordertype = 1; // replication border
            CvStatus status;

            status = ipp_sobel_getbufsize_func ?
                ipp_sobel_getbufsize_func( size, masksize, &bufsize ) :
                ipp_scharr_getbufsize_func( size, &bufsize );

            if( status >= 0 )
            {
                if( bufsize <= CV_MAX_LOCAL_SIZE )
                {
                    buffer = cvAlloc( bufsize );
                    local_alloc = 1;
                }
                else
                    CV_CALL( buffer = cvAlloc( bufsize ));
            
                status =
                    ipp_sobel_func_8u ? ipp_sobel_func_8u( src_ptr, src_step, dst_ptr, dst_step,
                                                           size, masksize, bordertype, 0, buffer ) :
                    ipp_sobel_func_32f ? ipp_sobel_func_32f( src_ptr, src_step, dst_ptr, dst_step,
                                                             size, masksize, bordertype, 0, buffer ) :
                    ipp_scharr_func_8u ? ipp_scharr_func_8u( src_ptr, src_step, dst_ptr, dst_step,
                                                             size, bordertype, 0, buffer ) :
                    ipp_scharr_func_32f ? ipp_scharr_func_32f( src_ptr, src_step, dst_ptr, dst_step,
                                                               size, bordertype, 0, buffer ) : 
                        CV_NOTDEFINED_ERR;
            }

            if( status >= 0 &&
                (dx == 0 && dy == 1 && origin || dx == 1 && dy == 1 && !origin)) // negate the output
                cvSubRS( dst, cvScalarAll(0), dst );

            if( status >= 0 )
                EXIT;
        }
    }

    CV_CALL( filter.init_deriv( src->cols, src_type, dst_type, dx, dy,
                aperture_size, origin ? CvSepFilter::FLIP_KERNEL : 0));
    CV_CALL( filter.process( src, dst ));

    __END__;

    if( buffer && !local_alloc )
        cvFree( &buffer );
}



/* End of file. */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99在线观看| 在线观看日韩国产| 欧美日韩美少妇| 天堂蜜桃一区二区三区| 欧美在线一二三| 日本视频一区二区三区| 欧美一区二区免费| 亚洲人成人一区二区在线观看 | 高清不卡一二三区| 国产欧美一区二区精品性色 | 亚洲人成小说网站色在线| 激情图片小说一区| 国产精品久久精品日日| 欧洲一区二区三区在线| 蜜臀91精品一区二区三区| 国产精品毛片高清在线完整版| 国产精品正在播放| 国产精品伦理一区二区| 色一区在线观看| 久久国内精品视频| 亚洲视频在线一区二区| 欧美一区二区三区免费在线看| 久久69国产一区二区蜜臀| 中文字幕av一区二区三区高| 欧美男男青年gay1069videost| 国产伦精品一区二区三区免费迷| 国产精品高清亚洲| 91黄色免费观看| 国产福利一区二区三区视频在线| 亚洲精品中文在线影院| 精品国产乱码久久久久久夜甘婷婷| 色综合久久综合网欧美综合网| 久久福利资源站| 日av在线不卡| 蜜桃视频在线观看一区| 图片区小说区区亚洲影院| 国产精品免费久久久久| 国产欧美日本一区二区三区| 日韩欧美在线123| 欧美激情中文不卡| 综合久久久久久| 久久成人精品无人区| 成人免费视频视频| 99久久精品国产一区| 欧美午夜在线观看| 日韩欧美电影在线| 国产精品伦理在线| 免费成人结看片| 波多野结衣精品在线| 欧美精品日日鲁夜夜添| 久久久久久免费网| 亚洲精品一卡二卡| 国产一区二区美女| 欧美视频一区二区三区四区| 91视频在线看| 2017欧美狠狠色| 亚洲一级二级三级在线免费观看| 亚洲成av人片在线观看无码| 国产成a人无v码亚洲福利| 91国偷自产一区二区三区成为亚洲经典| 日韩精品中文字幕一区二区三区| 国产精品乱子久久久久| 国产一区二区三区观看| 555www色欧美视频| 欧美电视剧在线看免费| 亚洲国产人成综合网站| 成人网男人的天堂| 久久久99精品久久| 亚洲一区二区影院| 日韩免费电影一区| 婷婷综合久久一区二区三区| 欧美在线观看视频一区二区三区| 久久久三级国产网站| 精品一区二区免费在线观看| 在线不卡一区二区| 一区二区在线观看视频在线观看| 不卡av在线免费观看| 国产精品乱人伦中文| 99riav一区二区三区| 中文字幕在线不卡| 在线观看91视频| 亚洲一区精品在线| 欧美一卡2卡三卡4卡5免费| 国产精品理伦片| 成人毛片在线观看| 一区二区三区在线观看视频 | 一区二区三区精品视频在线| 欧美在线免费观看亚洲| 狠狠色丁香婷婷综合| 日韩电影一区二区三区| 国产精品网友自拍| 久久久久久久综合日本| 6080国产精品一区二区| 91久久精品午夜一区二区| 欧美在线你懂的| 国产丝袜欧美中文另类| 成人av电影在线网| 久久精品免费看| 一区二区三区欧美日| 日韩亚洲欧美成人一区| 国产自产v一区二区三区c| 午夜精品福利在线| 亚洲日本在线观看| 精品久久久久久无| 欧美性受xxxx黑人xyx性爽| 国产在线视视频有精品| 日本不卡的三区四区五区| 亚洲第一综合色| 亚洲国产乱码最新视频| 亚洲欧美自拍偷拍色图| 中文字幕不卡一区| 欧美激情一二三区| 26uuu成人网一区二区三区| 欧美日韩精品系列| 欧美精品久久久久久久多人混战| 九色|91porny| 免费成人小视频| 天天综合日日夜夜精品| 日本欧洲一区二区| 狠狠色综合日日| 粉嫩av一区二区三区在线播放 | 91精品国产高清一区二区三区 | 一区二区三区在线影院| 国产亚洲欧美中文| 欧美韩国日本不卡| 国产精品久久久久永久免费观看 | 欧美va亚洲va香蕉在线| 欧美美女网站色| 日韩欧美国产一区二区三区| 欧美亚洲动漫精品| 色狠狠一区二区| 在线视频亚洲一区| 久久综合网色—综合色88| 亚洲欧洲制服丝袜| proumb性欧美在线观看| 精品国产乱码久久久久久老虎 | 日韩欧美激情在线| 日韩欧美一区二区久久婷婷| 欧美在线综合视频| 国产精品一区二区无线| 在线观看精品一区| 亚洲高清不卡在线观看| 欧美精品高清视频| 久久国产精品99久久人人澡| 精品对白一区国产伦| 国产一二三精品| 精品三级在线观看| 久久草av在线| 日韩精品最新网址| 国产麻豆成人精品| 欧美精品一区二区三区蜜桃| 午夜精品久久久久久久| 色狠狠桃花综合| 亚洲制服欧美中文字幕中文字幕| 91成人免费电影| 午夜国产精品影院在线观看| 欧美日韩一区精品| 亚洲成人av福利| 在线不卡欧美精品一区二区三区| 亚洲在线中文字幕| 日韩一级黄色片| 婷婷综合在线观看| 欧美一区二区三区免费观看视频| 久久精品国产亚洲5555| 精品日韩一区二区三区免费视频| 久久精品国产精品亚洲综合| 久久精品日产第一区二区三区高清版 | 风间由美中文字幕在线看视频国产欧美| 91黄色激情网站| 精品一区二区久久| 亚洲啪啪综合av一区二区三区| 欧美精品一二三| 亚洲一区二区三区激情| 日韩欧美中文字幕一区| 99国产精品久久久久久久久久久| 亚洲444eee在线观看| 久久久久久久久久久黄色| 欧美视频你懂的| 99精品视频在线播放观看| 激情丁香综合五月| ㊣最新国产の精品bt伙计久久| 欧美日韩亚洲综合在线| www.久久久久久久久| 韩国欧美国产1区| 亚洲国产一区视频| 亚洲日本免费电影| 欧美国产激情一区二区三区蜜月| 欧美日韩的一区二区| 欧美在线免费观看亚洲| 91美女在线看| 99re热这里只有精品视频| 成人免费看片app下载| 风间由美一区二区av101| 五月婷婷欧美视频| 亚洲综合色在线| 亚洲欧洲制服丝袜| 亚洲欧美国产毛片在线| 午夜欧美视频在线观看| 丝袜诱惑制服诱惑色一区在线观看| 五月天中文字幕一区二区|