mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
change remaining c-api CV_ prefixes in constants
This commit is contained in:
@@ -66,9 +66,9 @@ Now we call the :imread:`imread <>` function which loads the image name specifie
|
||||
|
||||
.. container:: enumeratevisibleitemswithsquare
|
||||
|
||||
+ CV_LOAD_IMAGE_UNCHANGED (<0) loads the image as is (including the alpha channel if present)
|
||||
+ CV_LOAD_IMAGE_GRAYSCALE ( 0) loads the image as an intensity one
|
||||
+ CV_LOAD_IMAGE_COLOR (>0) loads the image in the RGB format
|
||||
+ IMREAD_UNCHANGED (<0) loads the image as is (including the alpha channel if present)
|
||||
+ IMREAD_GRAYSCALE ( 0) loads the image as an intensity one
|
||||
+ IMREAD_COLOR (>0) loads the image in the RGB format
|
||||
|
||||
.. literalinclude:: ../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp
|
||||
:language: cpp
|
||||
@@ -83,8 +83,8 @@ After checking that the image data was loaded correctly, we want to display our
|
||||
|
||||
.. container:: enumeratevisibleitemswithsquare
|
||||
|
||||
+ *CV_WINDOW_AUTOSIZE* is the only supported one if you do not use the Qt backend. In this case the window size will take up the size of the image it shows. No resize permitted!
|
||||
+ *CV_WINDOW_NORMAL* on Qt you may use this to allow window resize. The image will resize itself according to the current window size. By using the | operator you also need to specify if you would like the image to keep its aspect ratio (*CV_WINDOW_KEEPRATIO*) or not (*CV_WINDOW_FREERATIO*).
|
||||
+ *WINDOW_AUTOSIZE* is the only supported one if you do not use the Qt backend. In this case the window size will take up the size of the image it shows. No resize permitted!
|
||||
+ *WINDOW_NORMAL* on Qt you may use this to allow window resize. The image will resize itself according to the current window size. By using the | operator you also need to specify if you would like the image to keep its aspect ratio (*WINDOW_KEEPRATIO*) or not (*WINDOW_FREERATIO*).
|
||||
|
||||
.. literalinclude:: ../../../../samples/cpp/tutorial_code/introduction/display_image/display_image.cpp
|
||||
:language: cpp
|
||||
|
||||
@@ -68,7 +68,7 @@ Explanation
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
cvtColor( image, gray_image, CV_BGR2GRAY );
|
||||
cvtColor( image, gray_image, COLOR_BGR2GRAY );
|
||||
|
||||
As you can see, :miscellaneous_transformations:`cvtColor <cvtcolor>` takes as arguments:
|
||||
|
||||
@@ -76,7 +76,7 @@ Explanation
|
||||
|
||||
* a source image (*image*)
|
||||
* a destination image (*gray_image*), in which we will save the converted image.
|
||||
* an additional parameter that indicates what kind of transformation will be performed. In this case we use **CV_BGR2GRAY** (because of :readwriteimage:`imread <imread>` has BGR default channel order in case of color images).
|
||||
* an additional parameter that indicates what kind of transformation will be performed. In this case we use **COLOR_BGR2GRAY** (because of :readwriteimage:`imread <imread>` has BGR default channel order in case of color images).
|
||||
|
||||
#. So now we have our new *gray_image* and want to save it on disk (otherwise it will get lost after the program ends). To save it, we will use a function analagous to :readwriteimage:`imread <imread>`: :readwriteimage:`imwrite <imwrite>`
|
||||
|
||||
@@ -90,8 +90,8 @@ Explanation
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
namedWindow( imageName, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( "Gray image", CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( imageName, WINDOW_AUTOSIZE );
|
||||
namedWindow( "Gray image", WINDOW_AUTOSIZE );
|
||||
|
||||
imshow( imageName, image );
|
||||
imshow( "Gray image", gray_image );
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ Image Watch works with any existing project that uses OpenCV image objects (for
|
||||
|
||||
cout << "Loading input image: " << argv[1] << endl;
|
||||
Mat input;
|
||||
input = imread(argv[1], CV_LOAD_IMAGE_COLOR);
|
||||
input = imread(argv[1], IMREAD_COLOR);
|
||||
|
||||
cout << "Detecting edges in input image" << endl;
|
||||
Mat edges;
|
||||
|
||||
Reference in New Issue
Block a user