From 4ac5f37d49dfbdb83cf41f64349c68ee279435b6 Mon Sep 17 00:00:00 2001 From: Yuval Langer Date: Tue, 6 Sep 2016 12:48:13 +0300 Subject: [PATCH] Add inline code backticks --- .../py_image_display/py_image_display.markdown | 6 +++--- .../py_video_display/py_video_display.markdown | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/py_tutorials/py_gui/py_image_display/py_image_display.markdown b/doc/py_tutorials/py_gui/py_image_display/py_image_display.markdown index b03262220c..c286a3faf3 100644 --- a/doc/py_tutorials/py_gui/py_image_display/py_image_display.markdown +++ b/doc/py_tutorials/py_gui/py_image_display/py_image_display.markdown @@ -36,7 +36,7 @@ img = cv2.imread('messi5.jpg',0) **warning** -Even if the image path is wrong, it won't throw any error, but print img will give you None +Even if the image path is wrong, it won't throw any error, but `print img` will give you `None` ### Display an image @@ -109,8 +109,8 @@ elif k == ord('s'): # wait for 's' key to save and exit **warning** -If you are using a 64-bit machine, you will have to modify k = cv2.waitKey(0) line as follows : -k = cv2.waitKey(0) & 0xFF +If you are using a 64-bit machine, you will have to modify `k = cv2.waitKey(0)` line as follows : +`k = cv2.waitKey(0) & 0xFF` Using Matplotlib ---------------- diff --git a/doc/py_tutorials/py_gui/py_video_display/py_video_display.markdown b/doc/py_tutorials/py_gui/py_video_display/py_video_display.markdown index 7275488437..aec82147d7 100644 --- a/doc/py_tutorials/py_gui/py_video_display/py_video_display.markdown +++ b/doc/py_tutorials/py_gui/py_video_display/py_video_display.markdown @@ -42,11 +42,11 @@ while(True): cap.release() cv2.destroyAllWindows() @endcode -cap.read() returns a bool (True/False). If frame is read correctly, it will be True. So you can +`cap.read()` returns a bool (`True`/`False`). If frame is read correctly, it will be `True`. So you can check end of the video by checking this return value. Sometimes, cap may not have initialized the capture. In that case, this code shows error. You can -check whether it is initialized or not by the method **cap.isOpened()**. If it is True, OK. +check whether it is initialized or not by the method **cap.isOpened()**. If it is `True`, OK. Otherwise open it using **cap.open()**. You can also access some of the features of this video using **cap.get(propId)** method where propId @@ -55,9 +55,9 @@ video) and full details can be seen here: cv::VideoCapture::get() . Some of these values can be modified using **cap.set(propId, value)**. Value is the new value you want. -For example, I can check the frame width and height by cap.get(3) and cap.get(4). It gives me -640x480 by default. But I want to modify it to 320x240. Just use ret = cap.set(3,320) and -ret = cap.set(4,240). +For example, I can check the frame width and height by `cap.get(cv2.CAP_PROP_FRAME_WIDTH)` and `cap.get(cv2.CAP_PROP_FRAME_HEIGHT)`. It gives me +640x480 by default. But I want to modify it to 320x240. Just use `ret = cap.set(cv2.CAP_PROP_FRAME_WIDTH,320)` and +`ret = cap.set(cv2.CAP_PROP_FRAME_HEIGHT,240)`. @note If you are getting error, make sure camera is working fine using any other camera application (like Cheese in Linux). @@ -100,7 +100,7 @@ very simple, just use cv2.imwrite(). Here a little more work is required. This time we create a **VideoWriter** object. We should specify the output file name (eg: output.avi). Then we should specify the **FourCC** code (details in next paragraph). Then number of frames per second (fps) and frame size should be passed. And last one is **isColor** flag. If it is -True, encoder expect color frame, otherwise it works with grayscale frame. +`True`, encoder expect color frame, otherwise it works with grayscale frame. [FourCC](http://en.wikipedia.org/wiki/FourCC) is a 4-byte code used to specify the video codec. The list of available codes can be found in [fourcc.org](http://www.fourcc.org/codecs.php). It is