diff --git a/Documentation/Cookbook/Art/contrast1.png b/Documentation/Cookbook/Art/contrast1.png new file mode 100644 index 0000000000000000000000000000000000000000..67f59ebe02f87e91d727f5346b7f79144ba9955a Binary files /dev/null and b/Documentation/Cookbook/Art/contrast1.png differ diff --git a/Documentation/Cookbook/Art/contrast2.png b/Documentation/Cookbook/Art/contrast2.png new file mode 100644 index 0000000000000000000000000000000000000000..2da8172f7c538218655f8c0f03b080a3173be628 Binary files /dev/null and b/Documentation/Cookbook/Art/contrast2.png differ diff --git a/Documentation/Cookbook/Art/contrast3.png b/Documentation/Cookbook/Art/contrast3.png new file mode 100644 index 0000000000000000000000000000000000000000..f255cd8a8a8bd24aacdcf62512b6cc2956596564 Binary files /dev/null and b/Documentation/Cookbook/Art/contrast3.png differ diff --git a/Documentation/Cookbook/Art/contrast4.png b/Documentation/Cookbook/Art/contrast4.png new file mode 100644 index 0000000000000000000000000000000000000000..6633b21cff7bc3f51d18da8b50cd28743011a6c2 Binary files /dev/null and b/Documentation/Cookbook/Art/contrast4.png differ diff --git a/Documentation/Cookbook/rst/recipes/contrast_enhancement.rst b/Documentation/Cookbook/rst/recipes/contrast_enhancement.rst index f6f822837cac7c5d61da468f6a3d219bea5a63b6..2998a91745d747a03274160e9dfc8ce8fd7cee72 100644 --- a/Documentation/Cookbook/rst/recipes/contrast_enhancement.rst +++ b/Documentation/Cookbook/rst/recipes/contrast_enhancement.rst @@ -8,13 +8,24 @@ The contrast enhancement application is aiming at reducing this dynamic by compressing it in a smarter way than just linear compression. In a linear compression, compression changes the dynamic range (for instance from 12 to 8 bits) but does not change the repartition of the pixel. -//math here +|image1| |image2| + +.. |image1| image:: ../Art/contrast1.png + +.. |image2| image:: ../Art/contrast2.png + Here the equalization of histogram is creating a look up table in order to maximize the use of dynamics. -//math here + +..image::../Art/contrast3.png + With this in mind you can then try it on your own images with the simple following use : -//Syntax here + +:: + otbcli_ContrastEnhancement -in input_image.tif + -out output_image.tif + -spatial global Advanced parameters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -28,20 +39,28 @@ bands. The classical use of this method is to conserve ratio between the different color, conserve the hue. * channel : you provide the application with a n bands image and each of them are equalized independently. -//syntax here? + The other main mode is the local equalization. You can choose a window size that will be use to split the image in tiles and histograms will be computed over those tiles. Gain will be interpolated between the adjacent tiles in order to give a smooth result. +:: + otbcli_ContrastEnhancement -in input_image.tif + -out output_image.tif + -spatial.local.h 500 + -spatial.local.w 500 + -mode lum + The application also offers a way to limit contrast by adjusting original histogram. The limitation factor represent the limit height that can have any bucket of the histogram : we compute the height of the perfect flat histogram and the maximal height is the limitation factor time this "flat height". -//image here -Finally you have the choice to ignore a particular value with the nodata +..image::../Art/contrast4.png + +Finally you have the choice to ignore a particular value with the "nodata" parameter, and also the choice to put manually your minimum and maximum value. Any value out of bound will be ignored.