OpenCV 2.4.3 and Python

后端 未结 2 725
别那么骄傲
别那么骄傲 2021-02-02 17:29

Few days ago I went into searching for a good way to make a simple computer vision system. OpenCV library is something I need but it proved hard to learn with Python especially

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-02 17:52

    I think you are taking it in the reverse path.

    Actually, with the new cv2 module, OpenCV has become far more simple compared to old cv interface. Not just simple, but very fast and highly productive, due to the Numpy support. Only thing is that, we should know how to use it appropriately.

    Here, you should use the function as follows :

    img = cv2.imread('pic.jpg')
    gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
    

    I would like you to visit one SOF which shows some comparison between both the modules : What is different between all these OpenCV Python interfaces?

    Another one SOF is here, which is a simple demonstration on how you can speed up the code with Numpy support : Performance comparison of OpenCV-Python interfaces, cv and cv2

    You need not learn C++ or C to use OpenCV, although C++ is the official language. Still, Python-OpenCV has good support. Once you get a grip on how to use OpenCV, you will be able to convert C++ codes into Python yourself. Then you can learn OpenCV from C++ tutorials also. For example, I started learning OpenCV from "Learning OpenCV" by Gary Bradsky which is completely in C++. At that time, there was only cv interface.

    As you mentioned in your comments, opencvpython.blogspot.com has some introductory tutorials. I started it focussing newbies in OpenCV.

    Also, check this SOF for more tutorials : Books for OpenCV and Python?

提交回复
热议问题