处理过滤器和颜色 [英] Dealing with filters and colour's
本文介绍了处理过滤器和颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要制作如下所示的过滤器此处
- 这些是我的目标筛选器,但是请指导我如何去。
- 我可以如何做这些过滤器?
- 我需要遵循哪些算法?
通过spektre从上面的链接复制图片:
- 源图像是第一行中的第一个相机。
解决方案
很难说从单个非测试屏幕图像。
1.黑白滤镜
- 最简单的不精确的转换是i =(R + G + B)/ 3
- 更好的方法是使用权重i = w0 * R + w1 * G + w2 * B其中w0 + w1 + w2 = 1这些值可以通过一个小的google搜索努力找到
2.其余
-
一些过滤器看起来像指数颜色或加权颜色像这样:
r = w0 * r; if(r> 255)r = 255;
g = w1 * g; if(g> 255)g = 255;
b = w2 * b; if(b> 255)b = 255;
-
使用3个滚动条为w0,w1,w2写入一个应用程序< 10>
- 使用上述公式重绘图片
- 经过一些实验,您应该为大多数过滤器找到w0,w1,w2 ...
-
其余的可以是这样的颜色混合:
r = w00 * r + w01 * g + w02 * b; if(r> 255)r = 255;
g = w10 * r + w11 * g + w12 * b; if(g> 255)g = 255;
b = w20 * r + w21 * g + w22 * b; if(b> 255)b = 255;
-
或:
i =(r + g + b)/ 3
r = w0 * r + w3 * i; if(r> 255)r = 255;
g = w1 * g + w3 * i; if(g> 255)g = 255;
b = w2 * b + w3 * i; if(b> 255)b = 255;
btw :
1.在输入图像中找到测试颜色
- 对于每个阴影拉制R,G,B强度绘制隐藏图
- 一轴是输入图像颜色强度,另一个是过滤颜色的R,G,B强度
- 那么你应该看到直接使用哪个公式,并且还可以计算它的权重
- 这是红色的超指数运作方式
<
- 如果线条不是线而是曲线,则使用某种伽马校正
- 更高阶(2,3,4 ...的幂)大多数2的幂就足够了
- 在这种情况下,权重也可以是负的!
某些过滤器可以使用不同的颜色空间
- 调整颜色
-
I want to make filters like shown here
- these are my target filters but can you please guide me how to go for them
- how i can make filters like these?
- which algorithms i need to follow? and which step i need to take as beginner?
- Which is the better and easiest way to get the values of RGB and shades of filters .
copy of image from link above by spektre:
- the source image is the first after camera in the first line.
解决方案
very hard to say from single non test-screen image.
1.the black and white filter
- is easy just convert RGB to intensity i and then instead RGB write iii color.
- the simplest not precise conversion is i=(R+G+B)/3
- but better way is use of weights i=w0*R+w1*G+w2*B where w0+w1+w2=1 the values can be found by a little google search effort
2.the rest
some filters seem like over exponated colors or weighted colors like this:
r=w0*r; if (r>255) r=255; g=w1*g; if (g>255) g=255; b=w2*b; if (b>255) b=255;
write an app with 3 scrollbars for w0,w1,w2 in range <0-10>
- and redraw image with above formula
- after little experimenting you should find w0,w1,w2 for most of the filters ...
the rest can be mix of colors like this:
r=w00*r+w01*g+w02*b; if (r>255) r=255; g=w10*r+w11*g+w12*b; if (g>255) g=255; b=w20*r+w21*g+w22*b; if (b>255) b=255;
or:
i=(r+g+b)/3 r=w0*r+w3*i; if (r>255) r=255; g=w1*g+w3*i; if (g>255) g=255; b=w2*b+w3*i; if (b>255) b=255;
btw if you want the closest similarity you can:
1.find test colors in input image
- like R shades, G shades , B shades , RG,RB,BG,RGB shades from 0-255
- then get colors from filtered image at the same position
- draw depedency graphs for each shade draw R,G,B intensities
- one axis is input image color intensity and the other one is R,G,B intensity of filtered color
- then you should see which formula is used directly and can also compute the weights from it
- this is how over-exponation works for Red color
- if the lines are not lines but curves then some kind of gamma correction is used
- so formulas use polynom of higher order (power of 2,3,4...) mostly power of 2 suffice
- in that case the weights can be also negative !!!
some filters could use different color spaces
- for example transform RGB to HSV
- shift hue
- and convert back to RGB
- this will shift colors a little
这篇关于处理过滤器和颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文