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

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.

主站蜘蛛池模板: 新邵县| 肇东市| 江津市| 仙桃市| 福贡县| 晋中市| 响水县| 济宁市| 高州市| 革吉县| 黔东| 彰化市| 社会| 山阴县| 湟源县| 庆阳市| 峨眉山市| 隆德县| 五指山市| 思南县| 柘荣县| 习水县| 金湖县| 故城县| 孙吴县| 仪陇县| 永修县| 秦安县| 来安县| 泽普县| 昆山市| 上蔡县| 朝阳区| 织金县| 锡林浩特市| 科技| 金昌市| 潜江市| 都江堰市| 基隆市| 武冈市|