瀏覽代碼

Added tutorial 02 info

Clemens-A. Brust 11 年之前
父節點
當前提交
bcd16f66d4
共有 2 個文件被更改,包括 23 次插入3 次删除
  1. 22 2
      core/tutorial/02_grayscale.md
  2. 1 1
      core/tutorial/progs/02_grayscale.cpp

+ 22 - 2
core/tutorial/02_grayscale.md

@@ -1,11 +1,12 @@
 # Tutorial 02 - Grayscale Image Operations
 
-## Pattern for gray value transforms
+After reading your image from a file into memory, you may want to optimize its histogram using gray value transforms. This tutorial will tech you the basics.
 
+## Pattern for gray value transforms
 You can use the following pattern for your gray value transforms.
 
 ``` c++
-template <class P> void MyTransform(ImageT<P>& image)
+template <class P> void MyTransform(NICE::ImageT<P>& image)
 {
 	for(int x = 0; x < image.width(); x++) {
 		for(int y=0; y < image.height(); y++) {
@@ -18,3 +19,22 @@ template <class P> void MyTransform(ImageT<P>& image)
 ```
 
 Note that the get/setPixelQuick Methods don't perform boundary checks!
+
+### Optimization
+If you have access to Intel IPP, you can use the overloaded operators provided in ImageOperators.h.
+
+Another easy way to improve performance is adding a "parallel for" OpenMP compilation hint.
+
+## Gamma transforms
+Gamma transforms are a little more complicated, because gray values are not always in the [0,1] range.
+For example, the _Image_ and _GrayImage16s_ use the full positive range of their data types while the _FloatImage_ class can handle arbitrary ranges.
+
+You can use the __max()__ and __min()__ methods on your image to find its specific range. 
+
+## Histogram
+NICE provides a _Histogram_ class for 8-bit grayscale and color images (_Image_ and _ColorImage_).
+To calculate an image's histogram, use the constructor:
+
+``` c++
+NICE::Histogram histogram(image, 0, 256);
+```

+ 1 - 1
core/tutorial/progs/02_grayscale.cpp

@@ -3,7 +3,7 @@
  * Sample Implementation
  *
  * @file 02_grayscale.cpp
- * @brief Sample implementation for tutorial 01
+ * @brief Sample implementation for tutorial 02
  * @date 09.03.2014
  * @author Clemens-A. Brust
  */