OpenCV LBP特征提取源代码


自己写的一个结合了OPENCV的LBP特征提取,LBP特征是自己算的,OPENCV做了预处理和直方图。打印部分按照libsvm要求的格式打印的。
资源截图
代码片段和文件信息
/******************************************************************************
* File Name          : edge.c
* Author             : Kid Zhang
* Version            : v1.0
* Date               : Nov 4 2011
* Description        : This file is help user to abstract the edge of the piture
********************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include “edge.h“
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/*******************************************************************************
* Function Name  : Pyr_Segmentation
* Description    : This function is help user to do the pyramid segmentation of the piture
* Input          : - src: The point of the original picture
* Output         : - dst: The destination point of the picture
* Return         : None
*******************************************************************************/
void Pyr_Segmentation (IplImage * src IplImage *dst)
{
    CvMemStorage* storage = cvCreateMemStorage(0);  
    CvSeq* comp = NULL;  
    cvPyrSegmentation( src dst storage &comp 4 200 50 );  
    cvReleaseMemStorage( &storage );
}
/*******************************************************************************
* Function Name  : Abstract_Edge
* Description    : This function is help user to abstract the edge of the piture
* Input          : - src: The point of the original picture
* Output         : - dst: The destination point of the picture
* Return         : The destination point of the picture
*******************************************************************************/
void Abstract_Edge(IplImage *srcIplImage *dst)
{
//IplImage * temp = cvCreateImage(cvGetSize(src) IPL_DEPTH_8U3);
IplImage * temp = cvCreateImage(cvGetSize(src) IPL_DEPTH_8U3); 
IplConvKernel *kernel = cvCreateStructuringElementEx(3 3 1 1 CV_SHAPE_RECT);
cvMorphologyEx(srctempNULLkernelCV_MOP_GRADIENT1);//边缘提取
Pyr_Segmentation (dstdst);//金字塔分割
cvCvtColor(tempdstCV_BGR2GRAY);//转为灰度图像
//cvCvtColor(tempdstCV_BGR2GRAY);//转为灰度图像
}
/*********************END OF FILE*************************/

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-12-25 00:10  test
     目录           0  2011-12-13 19:25  testDebug
     文件       52224  2011-12-13 19:59  testDebug est.exe
     文件      592280  2011-12-13 19:59  testDebug est.ilk
     文件     1215488  2011-12-13 19:59  testDebug est.pdb
     目录           0  2011-12-25 00:09  testipch
     目录           0  2011-12-25 00:09  testipch est-134d8497
     文件    77594624  2011-12-25 00:09  testipch est-134d8497 est-2434c52c.ipch
     目录           0  2011-11-04 12:14  test est
     文件    38031360  2011-12-25 00:10  test est.sdf
     文件         879  2011-11-02 21:45  test est.sln
     文件       18432  2011-12-25 00:10  test est.suo
     目录           0  2011-12-13 19:59  test estDebug
     文件        2958  2011-12-13 19:59  test estDebugcl.command.1.tlog
     文件      113870  2011-12-13 19:59  test estDebugCL.read.1.tlog
     文件        6022  2011-12-13 19:59  test estDebugCL.write.1.tlog
     文件       78185  2011-11-07 21:00  test estDebugedge.obj
     文件       96405  2011-12-13 18:45  test estDebughist.obj
     文件       78368  2011-12-13 14:55  test estDebugLBP.obj
     文件           2  2011-12-13 19:59  test estDebuglink-cvtres.read.1.tlog
     文件           2  2011-12-13 19:59  test estDebuglink-cvtres.write.1.tlog
     文件           2  2011-12-13 19:59  test estDebuglink.1892-cvtres.read.1.tlog
     文件           2  2011-12-13 19:59  test estDebuglink.1892-cvtres.write.1.tlog
     文件           2  2011-12-13 19:59  test estDebuglink.1892.read.1.tlog
     文件           2  2011-12-13 19:59  test estDebuglink.1892.write.1.tlog
     文件           2  2011-12-13 19:59  test estDebuglink.2512-cvtres.read.1.tlog
     文件           2  2011-12-13 19:59  test estDebuglink.2512-cvtres.write.1.tlog
     文件           2  2011-12-13 19:59  test estDebuglink.2512.read.1.tlog
     文件           2  2011-12-13 19:59  test estDebuglink.2512.write.1.tlog
     文件           2  2011-12-13 19:59  test estDebuglink.4244-cvtres.read.1.tlog
     文件           2  2011-12-13 19:59  test estDebuglink.4244-cvtres.write.1.tlog
............此处省略59个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)