fixing all RGB instances to BGR where needed
authorStevenPuttemans <steven.puttemans@kuleuven.be>
Thu, 30 Apr 2015 09:27:58 +0000 (11:27 +0200)
committerStevenPuttemans <steven.puttemans@kuleuven.be>
Mon, 4 May 2015 07:02:46 +0000 (09:02 +0200)
14 files changed:
doc/py_tutorials/py_imgproc/py_colorspaces/py_colorspaces.markdown
doc/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.markdown
doc/tutorials/core/basic_geometric_drawing/basic_geometric_drawing.markdown
doc/tutorials/core/basic_linear_transform/basic_linear_transform.markdown
doc/tutorials/core/how_to_scan_images/how_to_scan_images.markdown
doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.markdown
doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.markdown
doc/tutorials/highgui/video-write/video_write.markdown
doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.markdown
doc/tutorials/imgproc/histograms/histogram_comparison/histogram_comparison.markdown
doc/tutorials/imgproc/morph_lines_detection/moprh_lines_detection.md
doc/tutorials/imgproc/threshold/threshold.markdown
doc/tutorials/introduction/load_save_image/load_save_image.markdown
doc/user_guide/ug_highgui.markdown

index 4bd9b496e2b14171b5abc7d3098cc6b8b7d45bb8..962630ebe23b0c09becbb0c662112c9057e41607 100644 (file)
@@ -34,7 +34,7 @@ Object Tracking
 ---------------
 
 Now we know how to convert BGR image to HSV, we can use this to extract a colored object. In HSV, it
-is more easier to represent a color than RGB color-space. In our application, we will try to extract
+is more easier to represent a color than in BGR color-space. In our application, we will try to extract
 a blue colored object. So here is the method:
 
 -   Take each frame of the video
index 48c8761c76baec52ad8c8cb0471ca5427b0a5738..2c2139406924bc511595d0c47d37ff081e7f83fb 100644 (file)
@@ -194,15 +194,15 @@ while(1):
     mag, ang = cv2.cartToPolar(flow[...,0], flow[...,1])
     hsv[...,0] = ang*180/np.pi/2
     hsv[...,2] = cv2.normalize(mag,None,0,255,cv2.NORM_MINMAX)
-    rgb = cv2.cvtColor(hsv,cv2.COLOR_HSV2BGR)
+    bgr = cv2.cvtColor(hsv,cv2.COLOR_HSV2BGR)
 
-    cv2.imshow('frame2',rgb)
+    cv2.imshow('frame2',bgr)
     k = cv2.waitKey(30) & 0xff
     if k == 27:
         break
     elif k == ord('s'):
         cv2.imwrite('opticalfb.png',frame2)
-        cv2.imwrite('opticalhsv.png',rgb)
+        cv2.imwrite('opticalhsv.png',bgr)
     prvs = next
 
 cap.release()
index db1f77421139deb994db6a1f33bf347305eff7d6..61134bd487955eeee6422f1a17e8544e8eec153d 100644 (file)
@@ -35,13 +35,13 @@ Point pt =  Point(10, 8);
 
 -   Represents a 4-element vector. The type Scalar is widely used in OpenCV for passing pixel
     values.
--   In this tutorial, we will use it extensively to represent RGB color values (3 parameters). It is
+-   In this tutorial, we will use it extensively to represent BGR color values (3 parameters). It is
     not necessary to define the last argument if it is not going to be used.
 -   Let's see an example, if we are asked for a color argument and we give:
     @code{.cpp}
     Scalar( a, b, c )
     @endcode
-    We would be defining a RGB color such as: *Red = c*, *Green = b* and *Blue = a*
+    We would be defining a BGR color such as: *Blue = a*, *Green = b* and *Red = c*
 
 Code
 ----
index 571781a3a970de68205f346296ae61f132e4ee02..bb0ffd8978c389374eac9ff0f07958f53e09363e 100644 (file)
@@ -122,8 +122,8 @@ Explanation
     *image.size()* and *image.type()*
 
 -#  Now, to perform the operation \f$g(i,j) = \alpha \cdot f(i,j) + \beta\f$ we will access to each
-    pixel in image. Since we are operating with RGB images, we will have three values per pixel (R,
-    G and B), so we will also access them separately. Here is the piece of code:
+    pixel in image. Since we are operating with BGR images, we will have three values per pixel (B,
+    G and R), so we will also access them separately. Here is the piece of code:
     @code{.cpp}
     for( int y = 0; y < image.rows; y++ ) {
         for( int x = 0; x < image.cols; x++ ) {
index 6cae0cfae86e6dab6ce7fe9abe480784b0917a12..1121caf400dcf15842867553b1ec4c8234c74652 100644 (file)
@@ -57,7 +57,7 @@ the samples directory of OpenCV at the cpp tutorial code for the core section. I
 how_to_scan_images imageName.jpg intValueToReduce [G]
 @endcode
 The final argument is optional. If given the image will be loaded in gray scale format, otherwise
-the RGB color way is used. The first thing is to calculate the lookup table.
+the BGR color space is used. The first thing is to calculate the lookup table.
 
 @snippet how_to_scan_images.cpp dividewith
 
@@ -88,7 +88,7 @@ case of a gray scale image we have something like:
 ![](tutorial_how_matrix_stored_1.png)
 
 For multichannel images the columns contain as many sub columns as the number of channels. For
-example in case of an RGB color system:
+example in case of an BGR color system:
 
 ![](tutorial_how_matrix_stored_2.png)
 
index 5f27228508aa9ac82fe74d9b727a6372f6b1fcdd..3837e475ca3eb4c052a642aaa02ce9a546a26cb0 100644 (file)
@@ -101,7 +101,7 @@ possible to use the old functions and in the end just transform the result to a
 
 @snippet interoperability_with_OpenCV_1.cpp new
 
-Because, we want to mess around with the images luma component we first convert from the default RGB
+Because, we want to mess around with the images luma component we first convert from the default BGR
 to the YUV color space and then split the result up into separate planes. Here the program splits:
 in the first example it processes each plane using one of the three major image scanning algorithms
 in OpenCV (C [] operator, iterator, individual element access). In a second variant we add to the
index 68b1fae9e43a5c3a4a8ed504fc20579216a3585a..65989744c299d5b0263c8ab5b99c996a82487ea1 100644 (file)
@@ -118,8 +118,8 @@ added.
 
 There are, however, many other color systems each with their own advantages:
 
--   RGB is the most common as our eyes use something similar, our display systems also compose
-    colors using these.
+-   RGB is the most common as our eyes use something similar, however keep in mind that OpenCV standard display
+    system composes colors using the BGR color space (a switch of the red and blue channel).
 -   The HSV and HLS decompose colors into their hue, saturation and value/luminance components,
     which is a more natural way for us to describe colors. You might, for example, dismiss the last
     component, making your algorithm less sensible to the light conditions of the input image.
index 6d4f099d9c6216004ceab0a418c1051794cb96c1..a23cac27796004455c0db16e9c2d6fa88f4dbb82 100644 (file)
@@ -12,7 +12,7 @@ class, designed for this.
 -   What type of video files you can create with OpenCV
 -   How to extract a given color channel from a video
 
-As a simple demonstration I'll just extract one of the RGB color channels of an input video file
+As a simple demonstration I'll just extract one of the BGR color channels of an input video file
 into a new video. You can control the flow of the application from its console line arguments:
 
 -   The first argument points to the video file to work on
@@ -134,7 +134,7 @@ the object with success you can send the frames of the video in a sequential ord
 outputVideo.write(res);  //or
 outputVideo << res;
 @endcode
-Extracting a color channel from an RGB image means to set to zero the RGB values of the other
+Extracting a color channel from an BGR image means to set to zero the BGR values of the other
 channels. You can either do this with image scanning operations or by using the split and merge
 operations. You first split the channels up into different images, set the other channels to zero
 images of the same size and type and finally merge them back:
index af54c0321b777e37ef234f87f2f5f87f08de7558..c10a6cfe5f0ccf125e1d60e5b184ef7c44937fe2 100644 (file)
@@ -69,7 +69,7 @@ Explanation
 -#  Most of the stuff shown is known by you (if you have any doubt, please refer to the tutorials in
     previous sections). Let's check the general structure of the program:
 
-    -   Load an image (can be RGB or grayscale)
+    -   Load an image (can be BGR or grayscale)
     -   Create two windows (one for dilation output, the other for erosion)
     -   Create a set of 02 Trackbars for each operation:
         -   The first trackbar "Element" returns either **erosion_elem** or **dilation_elem**
index ec82e095f88ea1ee50b488776db67503c86fddeb..f20e61280579e8a74d3de12932cef4c0cbbbaa4d 100644 (file)
@@ -53,7 +53,7 @@ Explanation
 -----------
 
 -#  Declare variables such as the matrices to store the base image and the two other images to
-    compare ( RGB and HSV )
+    compare ( BGR and HSV )
     @code{.cpp}
     Mat src_base, hsv_base;
     Mat src_test1, hsv_test1;
index ee74e87989f9a8c12d7c2a3da1f5b16b3c79a862..434ddf9adf66dfcfb520ce156bfa29d92a2c897f 100644 (file)
@@ -21,7 +21,7 @@ Morphology is a set of image processing operations that process images based on
 
 Two of the most basic morphological operations are dilation and erosion. Dilation adds pixels to the boundaries of the object in an image, while erosion does exactly the opposite. The amount of pixels added or removed, respectively depends on the size and shape of the structuring element used to process the image. In general the rules followed from these two operations have as follows:
 
--   __Dilation__: The value of the output pixel is the <b><em>maximum</em></b> value of all the pixels that fall within the structuring element's size and shape. For example in a binary image, if any of the pixels of the input image falling within the range of the kernel is set to the value 1, the corresponding pixel of the output image will be set to 1 as well. The latter applies to any type of image (e.g. grayscale, rgb, etc).
+-   __Dilation__: The value of the output pixel is the <b><em>maximum</em></b> value of all the pixels that fall within the structuring element's size and shape. For example in a binary image, if any of the pixels of the input image falling within the range of the kernel is set to the value 1, the corresponding pixel of the output image will be set to 1 as well. The latter applies to any type of image (e.g. grayscale, bgr, etc).
 
     ![Dilation on a Binary Image](images/morph21.gif)
 
index 7b50046650ce05021ee8cb9ade2d1770bc0ef36c..47b5647175840718be7c9c869ac397de4efe52b4 100644 (file)
@@ -104,13 +104,13 @@ Explanation
 -----------
 
 -#  Let's check the general structure of the program:
-    -   Load an image. If it is RGB we convert it to Grayscale. For this, remember that we can use
+    -   Load an image. If it is BGR we convert it to Grayscale. For this, remember that we can use
         the function @ref cv::cvtColor :
         @code{.cpp}
         src = imread( argv[1], 1 );
 
         /// Convert the image to Gray
-        cvtColor( src, src_gray, COLOR_RGB2GRAY );
+        cvtColor( src, src_gray, COLOR_BGR2GRAY );
         @endcode
     -   Create a window to display the result
         @code{.cpp}
index 3754d6075c30b06fda763f0748e8ab5a89e92459..b85c68183d879441c50cfd0fc182229d8e5bb1d3 100644 (file)
@@ -56,7 +56,7 @@ Explanation
 -----------
 
 -#  We begin by loading an image using @ref cv::imread , located in the path given by *imageName*.
-    For this example, assume you are loading a RGB image.
+    For this example, assume you are loading a BGR image.
 -#  Now we are going to convert our image from BGR to Grayscale format. OpenCV has a really nice
     function to do this kind of transformations:
     @code{.cpp}
index 28324206434eda63cad97a8dba50ec88b2246cec..ace4721d751e57c965c802434def3f2504703b56 100644 (file)
@@ -2,7 +2,7 @@ Using Kinect and other OpenNI compatible depth sensors {#tutorial_ug_highgui}
 ======================================================
 
 Depth sensors compatible with OpenNI (Kinect, XtionPRO, ...) are supported through VideoCapture
-class. Depth map, RGB image and some other formats of output can be retrieved by using familiar
+class. Depth map, BGR image and some other formats of output can be retrieved by using familiar
 interface of VideoCapture.
 
 In order to use depth sensor with OpenCV you should do the following preliminary steps:
@@ -46,7 +46,7 @@ VideoCapture can retrieve the following data:
     -   CAP_OPENNI_VALID_DEPTH_MASK - mask of valid pixels (not ocluded, not shaded etc.)
         (CV_8UC1)
 
--#  data given from RGB image generator:
+-#  data given from BGR image generator:
     -   CAP_OPENNI_BGR_IMAGE - color image (CV_8UC3)
     -   CAP_OPENNI_GRAY_IMAGE - gray image (CV_8UC1)