官术网_书友最值得收藏!

  • OpenCV 4 with Python Blueprints
  • Dr. Menua Gevorgyan Arsen Mamikonyan Michael Beyeler
  • 302字
  • 2021-06-24 16:49:58

Using color manipulation via curve shifting

A curve filter is essentially a function, y = f (x), that maps an input pixel value, x, to an output pixel value, y. The curve is parameterized by a set of n + 1 anchor points, as follows:

Here, each anchor point is a pair of numbers that represent the input and output pixel values. For example, the pair (30, 90) means that an input pixel value of 30 is increased to an output value of 90. Values between anchor points are interpolated along a smooth curve (hence, the name curve filter).

Such a filter can be applied to any image channel, be it a single grayscale channel or the R (red), G (green), and B (blue) channels of an RGB color image. Therefore, for our purposes, all values of x and y must stay between 0 and 255.

For example, if we wanted to make a grayscale image slightly brighter, we could use a curve filter with the following set of control points:

This would mean that all input pixel values except 0 and 255 would be increased slightly, resulting in an overall brightening effect on the image.

If we want such filters to produce natural-looking images, it is important to respect the following two rules:

  • Every set of anchor points should include (0,0) and (255,255). This is important in order to prevent the image from appearing as if it has an overall tint, as black remains black and white remains white.
  • The f(x) function should be monotonously increasing. In other words, by increasing x, f(x) either stays the same or increases (that is, it never decreases). This is important for making sure that shadows remain shadows and highlights remain highlights.

The next section demonstrates how to implement a curve filter using lookup tables.

主站蜘蛛池模板: 东乡族自治县| 葫芦岛市| 搜索| 鲁山县| 安顺市| 山丹县| 加查县| 定西市| 玉树县| 罗江县| 芦山县| 桃江县| 贡山| 杭锦后旗| 句容市| 龙口市| 买车| 日土县| 徐闻县| 崇义县| 宜兰市| 高密市| 宁南县| 军事| 托克托县| 赫章县| 买车| 双牌县| 文化| 隆德县| 株洲市| 墨玉县| 昔阳县| 获嘉县| 温泉县| 鸡东县| 朝阳市| 牡丹江市| 南陵县| 双辽市| 巴楚县|