图像锐化处理(两种方法 1.过滤函数,自定义核 2. 直接处理当前像素点与邻近像素点关系)
// Sharpen.cpp : Defines the entry point for the console application.
/*-----CODE FOR FUN---------------
-------CREATED BY Dream_Whui------
-------2015-3-9-------------------------*/
//锐化处理,采用两种方法,1.手动编写处理相邻像素键的关系 2.核函数
#include "stdafx.h"
#include <iostream>
#include<opencv2\opencv.hpp>
using namespace cv;
using namespace std;
void Sharpen(const Mat &image, Mat &result)
{
result.create( image.size(), image.type() );
for(int j=1; j<image.rows-1; j++)
{
const uchar* previous = image.ptr<const uchar>(j-1);
const uchar* current = image.ptr<const uchar>(j);
const uchar* next = image.ptr<const uchar>(j+1);
uchar * output = result.ptr<uchar