角点检测(3)SUSAN算子
来源:互联网 发布:node.js手游框架 编辑:程序博客网 时间:2024/06/11 02:06
#include "stdafx.h"#include <iostream>#include <stdlib.h>#include <cv.h>#include <cxcore.h>#include <highgui.h>#include <math.h>int main( int argc, char** argv ){ int height ,width ,step ,channels ; int i,j,k,same ,max,min,thresh,sum; uchar*data0,*data1 ; //char *filename="result.bmp"; // IplImage* Img,*nimg; //声明IplImage指针 //载入图像 IplImage* nimg = cvLoadImage("1.jpg"); IplImage* Img = cvCreateImage(cvGetSize(nimg),8,1);cvCvtColor( nimg, Img, CV_BGR2GRAY );height = Img->height;width = Img->width;step = Img->widthStep/sizeof(uchar);channels = Img->nChannels; data0 = (uchar*)Img->imageData; data1 = (uchar*)nimg->imageData;printf("Processing a %d X %d image with %d channels\n",width,height,channels);int OffSetX[37] = { -1, 0, 1,-2,-1, 0, 1, 2,-3,-2,-1, 0, 1, 2, 3,-3,-2,-1, 0, 1, 2, 3,-3,-2,-1, 0, 1, 2, 3,-2,-1, 0, 1, 2,-1, 0, 1 };int OffSetY[37] = { -3,-3,-3,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,0, 0, 0, 0, 0, 0, 0,1, 1, 1, 1, 1, 1, 1,2, 2, 2, 2, 2,3, 3, 3 }; max = min = data0[0]; //for(i=0;i<height;i++)// for(j=0;j<width;j++) //{ // if(data0[i*step+j]>max) max = data0[i*step+j]; //if(data0[i*step+j]<min) min = data0[i*step+j];// } for(i=3;i<height-3;i++) for(j=3;j<width-3;j++) { same =0;sum = 0; for(k=0;k<37;k++) { sum+=data0[(i+OffSetY[k])*step+(j+OffSetX[k])]; thresh = sum/37; if(fabs( (float)(data0[(i+OffSetY[k])*step+(j+OffSetX[k])]-data0[i*step+j]))<=thresh) same++; if(same<18) data1[i*step+j] = 255; else data1[i*step+j] = 0; } } cvNamedWindow( "Image", 1 ); //创建窗口 cvShowImage( "Image", nimg ); //显示图像 cvWaitKey(0); //等待按键 cvDestroyWindow( "Image" );//销毁窗口 cvReleaseImage( &Img ); //释放图像 cvReleaseImage( &nimg ); return 0;}
0 0
- 角点检测(3)SUSAN算子
- susan算子角点检测
- SUSAN角点检测
- SUSAN角点检测
- susan角点检测算法
- 角点检测之SUSAN
- 角点检测 susan角点检测
- OpenCV的susan角点检测
- OpenCV的susan角点检测
- 学习之角点检测SUSAN
- opencv的susan角点检测算法
- Harris、SUSAN角点检测Matlab源代码
- 图像特征之SUSAN角点检测
- SUSAN算子——边缘检测
- 角点检测(2)harris算子
- SUSAN算子
- SUSAN算子
- 图像局部特征学习(笔记1之SUSAN角点检测)
- kindeditor配置syntaxhighlighter...
- C++第二章作业
- FFT-1-FFT计划概述
- hbase命令
- 树形DP图画入门(HDU1520) (FZU1615)
- 角点检测(3)SUSAN算子
- KVM和远程管理工具virt-manager的部署
- 汇编
- 手动生成ASH报告
- 《自己动手写操作系统》 第六章 系统调用的实现
- JavaSE 复习:基本数据类型
- Apache 2.0 中文文档[Directory, Location and Files段]
- 数据库
- virt-manager的虚拟资源中心