⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cvpyramids.c

📁 Xilinx ISE&EDK 8.2平台的人脸检测系统设计
💻 C
📖 第 1 页 / 共 5 页
字号:
            {                                                                           \
                buf[j] = PD_LT( src[j-src_step*2], src[j - src_step], src[j] );         \
                buf[j+Wn] = PD_LT( src[j],src[j-src_step],src[j-src_step*2] );          \
            }                                                                           \
        }                                                                               \
    }                                                                                   \
    else                                                                                \
    {                                                                                   \
        if( cols > 0 )                                                                  \
        {                                                                               \
            /* top of the right border */                                               \
            for( j = 0; j < bufW; j++ )                                                 \
                dst[j]=(arrtype)_pd_scale_( PD_LT( buf[j], buf[j+bufW], buf[j+bufW*2]));\
                                                                                        \
            /* middle part of the right border */                                       \
            buf += bufW*2;                                                              \
            dst += dst_step;                                                            \
            for( i = 1; i < Hd_; i++, dst += dst_step, buf += bufW*2 )                  \
            {                                                                           \
                for( j = 0; j < bufW; j++ )                                             \
                    dst[j] = (arrtype)_pd_scale_( PD_FILTER( buf[j-bufW*2], buf[j-bufW],\
                                                  buf[j], buf[j+bufW], buf[j+bufW*2] ));\
            }                                                                           \
                                                                                        \
            /* bottom of the right border */                                            \
            if( !(H & 1) )                                                              \
            {                                                                           \
                for( j = 0; j < bufW; j++ )                                             \
                    dst[j] = (arrtype)_pd_scale_( PD_RB( buf[j-bufW*2], buf[j-bufW],    \
                                                         buf[j], buf[j+bufW] ));        \
            }                                                                           \
            else if( rows > 1 )                                                         \
            {                                                                           \
                for( j = 0; j < bufW; j++ )                                             \
                    dst[j]=(arrtype)_pd_scale_( PD_LT( buf[j-bufW*2],                   \
                                                buf[j-bufW], buf[j]));                  \
            }                                                                           \
                                                                                        \
            buf = buf0;                                                                 \
        }                                                                               \
                                                                                        \
        if( rows > 0 )                                                                  \
        {                                                                               \
            if( !(H & 1) )                                                              \
            {                                                                           \
                for( j = 0; j < Wn; j++ )                                               \
                    buf[j] = PD_LT( src[j], src[j-src_step], src[j-src_step*2] );       \
            }                                                                           \
            else if( cols == 1 )                                                        \
            {                                                                           \
                for( j = 0; j < Wn; j++ )                                               \
                    buf[j] = PD_FILTER( src[j-src_step*4], src[j-src_step*3],           \
                                        src[j-src_step*2], src[j-src_step], src[j] );   \
            }                                                                           \
            else                                                                        \
            {                                                                           \
                for( j = 0; j < Wn; j++ )                                               \
                {                                                                       \
                    buf[j] = PD_FILTER( src[j-src_step*4], src[j-src_step*3],           \
                                        src[j-src_step*2], src[j-src_step], src[j] );   \
                    buf[j+Wn] = PD_LT( src[j], src[j-src_step], src[j-src_step*2] );    \
                }                                                                       \
            }                                                                           \
        }                                                                               \
    }                                                                                   \
                                                                                        \
                                                                                        \
    /******************* STAGE 3. ******************/                                   \
                                                                                        \
    /* do horizontal convolution of the pre-processed bottom rows,*/                    \
    /* stored in buffer, and write results to the destination */                        \
    if( rows > 0 )                                                                      \
    {                                                                                   \
        dst = dst2;                                                                     \
                                                                                        \
        if( W <= 2 )                                                                    \
        {                                                                               \
            assert( Wd == 1 );                                                          \
            for( ; rows--; dst += dst_step, buf += Wn )                                 \
            {                                                                           \
                if( channels == 1 )                                                     \
                    dst[0] = (arrtype)_pd_scale_( PD_SINGULAR( buf[0], buf[Wn-1] ));    \
                else                                                                    \
                {                                                                       \
                    dst[0] = (arrtype)_pd_scale_( PD_SINGULAR( buf[0], buf[Wn-3] ));    \
                    dst[1] = (arrtype)_pd_scale_( PD_SINGULAR( buf[1], buf[Wn-2] ));    \
                    dst[2] = (arrtype)_pd_scale_( PD_SINGULAR( buf[2], buf[Wn-1] ));    \
                }                                                                       \
            }                                                                           \
        }                                                                               \
        else if( W == 3 )                                                               \
        {                                                                               \
            if( Wd == 1 )                                                               \
            {                                                                           \
                for( ; rows--; dst += dst_step, buf += Wn )                             \
                {                                                                       \
                    if( channels == 1 )                                                 \
                        dst[0] = (arrtype)_pd_scale_( PD_LT(buf[0], buf[1], buf[2] ));  \
                    else                                                                \
                    {                                                                   \
                        dst[0] = (arrtype)_pd_scale_( PD_LT(buf[0], buf[3], buf[6] ));  \
                        dst[1] = (arrtype)_pd_scale_( PD_LT(buf[1], buf[4], buf[7] ));  \
                        dst[2] = (arrtype)_pd_scale_( PD_LT(buf[2], buf[5], buf[8] ));  \
                    }                                                                   \
                }                                                                       \
            }                                                                           \
            else                                                                        \
            {                                                                           \
                for( ; rows--; dst += dst_step, buf += Wn )                             \
                {                                                                       \
                    if( channels == 1 )                                                 \
                    {                                                                   \
                        dst[0] = (arrtype)_pd_scale_( PD_LT(buf[0], buf[1], buf[2] ));  \
                        dst[1] = (arrtype)_pd_scale_( PD_LT(buf[2], buf[1], buf[0] ));  \
                    }                                                                   \
                    else                                                                \
                    {                                                                   \
                        dst[0] = (arrtype)_pd_scale_( PD_LT(buf[0], buf[3], buf[6] ));  \
                        dst[1] = (arrtype)_pd_scale_( PD_LT(buf[1], buf[4], buf[7] ));  \
                        dst[2] = (arrtype)_pd_scale_( PD_LT(buf[2], buf[5], buf[8] ));  \
                        dst[3] = (arrtype)_pd_scale_( PD_LT(buf[6], buf[3], buf[0] ));  \
                        dst[4] = (arrtype)_pd_scale_( PD_LT(buf[7], buf[4], buf[1] ));  \
                        dst[5] = (arrtype)_pd_scale_( PD_LT(buf[8], buf[5], buf[2] ));  \
                    }                                                                   \
                }                                                                       \
            }                                                                           \
        }                                                                               \
        else                                                                            \
        {                                                                               \
            for( ; rows--; dst += dst_step, buf += Wn )                                 \
            {                                                                           \
                if( channels == 1 )                                                     \
                {                                                                       \
                    /* left part of the bottom row */                                   \
                    dst[0] = (arrtype)_pd_scale_( PD_LT( buf[0], buf[1], buf[2] ));     \
                                                                                        \
                    /* middle part of the bottom row */                                 \
                    for( i = 1; i < Wd_; i++ )                                          \
                    {                                                                   \
                        dst[i] = (arrtype)_pd_scale_( PD_FILTER(buf[i*2-2], buf[i*2-1], \
                                                    buf[i*2],buf[i*2+1], buf[i*2+2] )); \
                    }                                                                   \
                                                                                        \
                    /* right part of the bottom row */                                  \
                    if( !(W & 1) )                                                      \
                        dst[i] = (arrtype)_pd_scale_( PD_RB( buf[i*2-2],buf[i*2-1],     \
                                                    buf[i*2], buf[i*2+1] ));            \
                    else if( cols > 1 )                                                 \
                        dst[i] = (arrtype)_pd_scale_( PD_LT( buf[i*2-2],                \
                                                    buf[i*2-1], buf[i*2] ));            \
                }                                                                       \
                else                                                                    \
                {                                                                       \
                    /* left part of the bottom row */                                   \
                    dst[0] = (arrtype)_pd_scale_( PD_LT( buf[0], buf[3], buf[6] ));     \
                    dst[1] = (arrtype)_pd_scale_( PD_LT( buf[1], buf[4], buf[7] ));     \
                    dst[2] = (arrtype)_pd_scale_( PD_LT( buf[2], buf[5], buf[8] ));     \
                                                                                        \
                    /* middle part of the bottom row */                                 \
                    for( i = 3; i < Wd_*3; i++ )                                        \
                    {                                                                   \
                        dst[i] = (arrtype)_pd_scale_( PD_FILTER(buf[i*2-6], buf[i*2-3], \
                                                      buf[i*2],buf[i*2+3], buf[i*2+6]));\
                    }                                                                   \
                                                                                        \
                    /* right part of the bottom row */                                  \
                    if( !(W & 1) )                                             

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -