Unity3D图像后处理特效——Edge Detect Effect Normals

This version of the Edge Detect image effect creates outlines around edges by taking the scene geometry into account. Edges are not determined by colour differences but by the surface normals and distance from camera of neighbouring pixels (the surface normal is an "arrow" that indicates the direction the surface is facing at a given pixel position). Generally, where two adjacent pixels have significantly different normals and/or distances from the camera, there is an edge in the scene.

该边界提取的图像特效版本是通过场景中物体的几何信息来将其轮廓线抽取出来。边缘不仅由颜色的差异来决定,同时也由相邻像素所对应的法线朝向和离相机的距离来决定。一般来说,当两个相邻像素拥有明显不同的法线朝向或距相机距离时,这就是场景中的一个边缘。

 

As with the other image effects, this effect is only available in Unity Pro and you must have the Pro Standard Assets installed before it becomes available

和其他图像特效一样,该特效只能在Unity Pro上进行使用,并且在使用之前必须安装Pro Standard Assets

 

没有边缘检测的场景

 

该场景中的边缘显示

 

This effect uses the ImageEffectOpaque attribute which enables image effects to be executed before the transparent render passes. By default, image effects are executed after both opaque and transparent passes have been fully rendered.

该特效使用了ImageEffectOpaque属性,该属性使图像特效在渲染透明物体通道之前执行。默认情况下,图像特效都是在场景中实体和透明物体全部渲染完成后进行的。

 

Properties           属性

Mode

模式

Chose between Thin and Thick. Thick will take more samples into consideration to construct outlines.

在粗细之间进行选择。粗表示使用更多的采样点来生成轮廓线

 

Edge Sensitivity     边缘敏感度

Depth

深度

The minimum difference between the distances of adjacent pixels that will indicate an edge.

相邻像素的深度最小差异。大于该差异,则认为存在边。

Normals

法线

The minimum difference between the normals of adjacent pixels that will indicate an edge.

相邻像素的最小法线朝向差异。大于该差异,则认为存在边。

 

Background options   背景选项

Edges only

仅边缘

Blend the background with a fixed color.

将一个固定颜色与背景进行混合

Background

背景

The color used when Edges only is > 0.

当Edges Only数值大于0时所采用的颜色

 

Hardware support    硬件支持

This effect requires a graphics card with pixel shaders (2.0) or OpenGL ES 2.0. Additionally, depth texture support is required. PC: NVIDIA cards since 2004 (GeForce 6), AMD cards since 2004 (Radeon 9500), Intel cards since 2006 (GMA X3000); Mobile: OpenGL ES 2.0 with depth texture support; Consoles: Xbox 360, PS3.

这个特效需要显卡拥有像素着色器(2.0)或者OpenGL ES 2.0。台式机:2004年以后的NVIDIA显卡(GeForce 6),2004年以后的AMD显卡(Radeon 9500),2006年以后的Intel卡(GMA X3000);移动设备:OpenGL ES 2.0并支持深度纹理;控制台: Xbox 360 PS3

 

All image effects automatically disable themselves when they can not run on end-users graphics card.

所有图像特效如果无法在用户显卡上运行时将会自动被关闭。
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Unity3D UGUI 专用文字特效插件 Text Effects 1.15 UI Text Effects are a set of effects for the standard Unity UI (uGUI) Text. - All script and shader sources included! - Extremely easy to use - just choose the effect from the component menu, and it's applied. - Add fancy titles, custom text appearance, mix multiple effects. - Rich Text support. - Mobile platform support. 12 extremely valuable effects: - Better Outline: a more continuous outline than the standard one. - Gradient Color: global/local, vertical/horizontal, override/additive/multiply. - Depth Effect: add thickness to text. - Soft Shadow: blurry shadow. - Outer Bevel: add outer lit and shaded edges. - Skew Effect: add horizontal+vertical transformations and perspective. - Curve Effect: bend or distort text vertically. - Character Spacing: increase or decrease the distance between individual characters. - Limit Visible Characters: hide characters, make a typewriter. - Overlay Texture: add an image overlay, local/global, override/additive/multiply. - Inner Bevel: add lit and shaded edges inside the characters, override/additive/multiply (only "override" on SM2 level GPUs). - Inner Outline: add outline inside the characters, override/additive/multiply. - With this package, you can finally echo effects from Photoshop or Word, while still using the standard Unity UI Text. - Suggestions for new effects are very welcome. The newly made effects will be added to the package. 仅供学习交流使用,如有侵权请告知删除。
图像传感器的Blemish Detect算法是用于检测和修复传感器上的坏点(blemish)和暗点(dark spot)的一种技术。下面是一个简单的C++实现: ```c++ #include <iostream> #include <vector> // 定义图像大小 const int WIDTH = 640; const int HEIGHT = 480; // 定义阈值参数 const double BLEMISH_THRES = 0.1; const double DARKSPOT_THRES = 0.1; // 读取图像数据 std::vector<double> readImage(const char* filename) { std::vector<double> img(WIDTH * HEIGHT); // 从文件中读取图像数据 // ... return img; } // 计算坏点和暗点 void detectBlemishDarkSpot(const std::vector<double>& img, std::vector<bool>& blemish, std::vector<bool>& darkSpot) { int numBlemish = 0; int numDarkSpot = 0; for (int i = 0; i < img.size(); i++) { if (img[i] > BLEMISH_THRES) { blemish[i] = true; numBlemish++; } if (img[i] < DARKSPOT_THRES) { darkSpot[i] = true; numDarkSpot++; } } std::cout << "Num blemish: " << numBlemish << std::endl; std::cout << "Num dark spot: " << numDarkSpot << std::endl; } // 修复坏点和暗点 void repairBlemishDarkSpot(std::vector<double>& img, const std::vector<bool>& blemish, const std::vector<bool>& darkSpot) { for (int i = 0; i < img.size(); i++) { if (blemish[i]) { // 使用插值算法修复坏点 img[i] = (img[i-1] + img[i+1]) / 2.0; } if (darkSpot[i]) { // 直接将暗点修复为0 img[i] = 0.0; } } } int main() { // 读取图像数据 std::vector<double> img = readImage("test.jpg"); // 初始化坏点和暗点标记 std::vector<bool> blemish(img.size(), false); std::vector<bool> darkSpot(img.size(), false); // 检测坏点和暗点 detectBlemishDarkSpot(img, blemish, darkSpot); // 修复坏点和暗点 repairBlemishDarkSpot(img, blemish, darkSpot); // 输出修复后的图像数据 // ... return 0; } ``` 上述代码中,readImage函数用于从文件中读取图像数据,detectBlemishDarkSpot函数用于检测图像中的坏点和暗点,并输出其数量,repairBlemishDarkSpot函数用于修复坏点和暗点。在修复坏点时,使用插值算法将坏点周围的像素值进行平均。在修复暗点时,将暗点的像素值直接设为0。最后,输出修复后的图像数据。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值