Giter Club home page Giter Club logo

imgproc's Introduction

imgproc

Fork from QtOpenCV's example: imageprocess.

QtOpenCV is an amazing integration of OpenCV and Qt(cv::Mat <==> QImage). I highly recommend to star it.

Changes

  • Change enviroment to Visual Studio 2017 + Qt 5.9.1
  • Added Icon and Toolbar for MainWindow.
  • Fixed sync bug when wheel event.
  • Finished the TODO: sync with the scrollbar.

imgproc's People

Contributors

pezy avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

liuguohua2019

imgproc's Issues

简化"添加新算法"的流程

这个应用最直接的需求就是: 试验 OpenCV 的算法. 那么最该首要关注的是: 遇到一个新算法, 想加到这个应用上的步骤.

下面简要总结下目前的过程:

  1. 新建一个 class, 继承 AbstractConvert 类.
  2. 如果有参数配置, 则重写 initParamsWidget() 方法. 创建参数配置的 UI.
  3. 重写 applyTo 方法. 将算法逻辑写在里面.
  4. 增加一个枚举量, 唯一标识此算法.
  5. 在主页面的 createImageActions 里添加一条 createImageAction. 绑定枚举与菜单项名称.
  6. 在 action 对应的 slot 函数中增加工厂逻辑: 在 switch 语句中增加一条 case.

其中 1 ~ 3 比较正常, 完成一个新算法必不可少的两项: 配置参数与算法逻辑.

然而 4, 5, 6 在代码中会显得非常冗长. 每增加一项算法, 因为这三条的原因, 代码长度会增加 3 倍. 如果遇到后期要维护修改, 譬如更改枚举变量名称, 则需要对应着改三处.

由于后期的修改点, 几乎集中在这个流程中. 所以缩减 4 ~ 6 的步骤很有必要. 但无论如何, 创建对象少不了, 增加菜单少不了. 这两者的绑定也少不了.

除此之外, 其实还有一个隐藏的效率要求: 创建对象的过程应该是"动态"的, 即, 只有在点击菜单项的那一刻, 才创建.

最后, 还有一个新需求需要考虑: 不仅需要菜单项, 还需要相对应的工具栏上的工具按钮, 所以还需要多指定一个 icon 名称.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.