惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
I
InfoQ
D
DataBreaches.Net
Simon Willison's Weblog
Simon Willison's Weblog
F
Fortinet All Blogs
Help Net Security
Help Net Security
P
Proofpoint News Feed
F
Full Disclosure
G
GRAHAM CLULEY
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
G
Google Developers Blog
T
The Blog of Author Tim Ferriss
P
Palo Alto Networks Blog
T
Threat Research - Cisco Blogs
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Microsoft Azure Blog
Microsoft Azure Blog
T
Threatpost
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Register - Security
The Register - Security
The Hacker News
The Hacker News
Scott Helme
Scott Helme
T
Tor Project blog
Recorded Future
Recorded Future
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
Vercel News
Vercel News
L
Lohrmann on Cybersecurity
Know Your Adversary
Know Your Adversary
T
The Exploit Database - CXSecurity.com
IT之家
IT之家
C
Check Point Blog
NISL@THU
NISL@THU
Engineering at Meta
Engineering at Meta
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LangChain Blog
S
Schneier on Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
博客园 - 三生石上(FineUI控件)
Spread Privacy
Spread Privacy
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
L
LINUX DO - 最新话题
S
Security @ Cisco Blogs
The Cloudflare Blog

博客园 - 稻草人的麦田

[导入]显卡对于mipmap选择的研究 [导入]仔细研究了lithtech中的根据类名创建对象 [导入]光照优缺点 [导入]蜗牛的笔试题目 [导入]一个开发休闲游戏的程序组人与分配方案 [导入]运动模糊的制作 [导入]格里高里的数学题 [导入]水彩化 [导入]伪 HDR/Blow [导入]描边,只是换了个过滤器而已 [导入]卷积积分(转) [导入]再贴个圆形马赛克 [导入]马赛克 [导入]hlsl的浮雕效果 [导入]游戏出了一个demo [导入]图形文件的格式(转载) [导入] 一些色彩方面的知识 [导入]流浪歌手 [导入][转载]游戏引擎列表
[导入]锐化模糊
稻草人的麦田 · 2007-10-17 · via 博客园 - 稻草人的麦田

锐化模糊说是用了卷积,可是仔细看了后发现没用卷积,可能是卷积是什么概念给忘记了,可是仔细看他确实没有用卷积。他用的是周围8个像素乘上一个权值然后和自己的颜色混合的方法,这样一看又没有技术含量了。挺失望的。不过倒是也可以出一些效果。

主要是要做出那个滤波器出来,我的矩阵横向构造。滤波器函数如下:

float4 fit_filter(float3x3 inputMatrix,sampler2D tex,float2 xy,float2 texSize)
{
 float2 positionMatrix[3][3] =
 {
 {float2(-1,1),float2(0,1),float2(1,1)},
 {float2(-1, 0),float2(0, 0),float2(1, 0)},
 {float2(-1,-1),float2(0,-1),float2(1,-1)},
 }; //这里就是点周围及其自己的偏移

 float4 final_color=float4(0,0,0,0);
 for(int i =0;i<3;i++)
 {
  for(int j = 0;j<3;j++)
  {
  float2 curxy = float2(xy.x + positionMatrix[i][j].x,xy.y + positionMatrix[i][j].y);
  float2 cxy = float2(curxy.x/texSize.x,curxy.y/texSize.y);
  final_color +=tex2D(TextureSampler,cxy) * inputMatrix[i][j];
  }
 }
 return final_color;
};

通过这个函数只需要输入一个3x3的矩阵作为中心点计算的方式就可以了。

 我的锐化效果如下:

 原图:

float2 realxy = float2(IN.texCoordDiffuse.x*256,IN.texCoordDiffuse.y*256);
 /* float3x3 matr = float3x3(1/16.0,1/8.0,1/16,
         1/8.0,1/4.0,1/8.0,
         1/16.0,1/8.0,1/16.0);

*/// 这个是高斯模糊的滤波器

  float3x3 matr = float3x3(-1.0,-1.0,-1.0,
         -1.0,9.0,-1.0,
         -1.0,-1.0,-1.0);
  float2 si = float2(256,256);
  return fit_filter(matr,TextureSampler,realxy,si);

文章来源:http://songxiaoyu8.blog.163.com/blog/static/2081812820079171599956