First of all, thank De Lihui Teacher Translation finishing of the "Opencv-python Chinese course", this document is really good, for OpenCV beginners, help is very large, can let beginners quick start.
Recommend two OPENCV learning sites:
(1) http://docs.opencv.org/2.4/index.html
This site can query the use of OPENCV functions, such as: Cv2.minarearect () function, in the query, be sure not to enter parentheses, so you can not retrieve.
(2) Http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_gui/py_table_of_contents_gui/py_ Table_of_contents_gui.html
This site is the official use of OpenCV, De Lihui Teacher is the translation of this site.
These two URLs are really great for OPENCV beginners.
Learn Python and OpenCV for more than half a year, but did not write a blog before, in order to exercise their writing skills, recently began to write blog. The task at this stage is to make up the things you learned in the previous period.
"Python+opencv Learning" series of articles is just my study of the process of recording, the main record some important content, convenient to consult later. I am a small white one, I hope the great God criticized the advice.
The specific use of each function in the program is explained in detail in the URL above
1. Start using pictures
(1) Read into the image
Import cv2
img = cv2.imread (' test.jpg ', 0)
cv2.imshow (' Image ', img)
cv2.waitkey (0)
Cv2.destroyallwindows ()
Cv2.imread () The second parameter is the image read format, where 0 is read in grayscale format.
Note: If your image path has errors, it will not complain, but the print img result is none.
(2) Save the image
Import cv2
img = cv2.imread (' test.jpg ', 0)
cv2.imwrite (' person01.png ', IMG)
(3) Summary
Import NumPy as NP
import cv2
img = cv2.imread (' test01.jpg ', 0)
cv2.imshow (' Image ', img)
k = Cv2.waitkey (0)
If k =:
cv2.destroyallwindows ()
elif k = = Ord (' s '):
cv2.imwrite (' messigray.png ', img)
Cv2.destroyallwindows ()
Note: If your system is 64 bits, you will need to
k = Cv2.waitkey (0)
Change into
k = Cv2.waitkey (0) &0xff