1 | initial version |

Shortest way:

```
float alpha, beta = ...
```

Mat image = imread( argv[1] );

2 | No.2 Revision |

Shortest ~~way:~~way via matrix expressions:

```
float alpha, beta = ...
```

Mat image = imread( argv[1] ~~);~~

3 | No.3 Revision |

~~Shortest way ~~A quick and dirty contrast enhancement via matrix ~~expressions:~~expressions and a linear transformation:

```
float alpha, beta = ...
Mat image = imread( argv[1] );
image += beta;
image *= alpha;
```

For instance, set beta to `-(minimum value)`

and alpha to `(maximum value - minimum value)`

.

4 | No.4 Revision |

A quick and dirty contrast enhancement via matrix expressions and a linear transformation:

```
float alpha, beta = ...
Mat image = imread( argv[1] );
image += beta;
image *= alpha;
```

For instance, set ~~beta ~~** beta** to

`-(minimum value)`

and `alpha`

`(maximum value - minimum value)`

.
Copyright OpenCV foundation, 2012-2018. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.