官术网_书友最值得收藏!

Planning the app

The final app must consist of the following modules and scripts:

  • wx_gui.py: This module is our implementation of a basic GUI using wxpython. We will make extensive use of this file throughout the book. This module includes the following layouts:
    • wx_gui.BaseLayout: This is a generic layout class from which more complicated layouts can be built.
  • chapter1.py: This is the main script for this chapter. It contains the following functions and classes:
    • chapter1.FilterLayout: This is a custom layout based on wx_gui.BaseLayout, which displays the camera feed and a row of radio buttons that allows the user to select from the available image filters to be applied to each frame of the camera feed.
    • chapter1.main: This is the main routine function for starting the GUI application and accessing the webcam.
  • tools.py: This is a Python module and has a lot of helper functions that we use in this chapter, which you can reuse for your projects.

The next section demonstrates how to create a black-and-white pencil sketch.

主站蜘蛛池模板: 都昌县| 雷州市| 江永县| 麟游县| 山阳县| 高雄县| 西和县| 奉节县| 鹤庆县| 沭阳县| 大兴区| 贡嘎县| 禹城市| 六安市| 河北区| 蚌埠市| 永德县| 永济市| 汝城县| 宜兰市| 汤原县| 中方县| 江孜县| 怀柔区| 水城县| 屯留县| 宜都市| 沾化县| 潮安县| 云阳县| 玉山县| 灌阳县| 高陵县| 垫江县| 南召县| 江油市| 凯里市| 九江县| 黄平县| 阿拉善左旗| 平定县|