tsdconseil / opencv-demonstrator

OpenCV demonstrator (GUI)
http://www.tsdconseil.fr/log/opencv/demo/index-en.html
GNU Lesser General Public License v3.0
141 stars 57 forks source link

Simplify + clarify + document how to create a new demo (C++ API) #35

Open juliena82 opened 8 years ago

juliena82 commented 8 years ago

Currently the C++ API to create a new demo is complex, not all in English, and not documented.

applemuncy commented 8 years ago

Yes, awhile back I did work at making a new demonstration with the prime purpose of learning the internals of Opencv-demo. What I learned about the process and documentation is that it was just a start with important information missing. At the time I thought the best change would be to direct the developer to pick the simplest demo, copy, rename it, modify all the other places needed to make a working demo.
Now I'm thinking I will create a "default" demo to fill that role plus be useful as the default demo to load when none has been selected. I think I will name it default-demo or demo-default.

juliena82 commented 8 years ago

@applemuncy

Great idea!

Actually, there is already the "demo-skeleton" files (demo-skeleton.hpp / demo-skeleton.cc), but indeed, this file is not currently compilable, so the user cannot just copy / past; he has to do other modifications in this file and in other files (e.g. model.xml and schema.xml)

Maybe this "demo-skeleton" could be modified using your idea, e.g. really working and being included in the build chain, and doing some really simple image processing (for instance compute the gradient).

Also we could manage, again in the goal of simplifying the life of anyone who wants to add a demo, to make the edition of model.xml and schema.xml files optionnal. E.g. for a simple démos without parameters, one would just have to copy/paste the demo-skeletton, and add the new file to the Makefile.

What do you think about it?

applemuncy commented 8 years ago

Right, I know about the demo-skeleton.* files. And IMO they become stale because they don't actually get tested as a real demo. Yes, demo-skeleton.* could be made to work as a real demo.

applemuncy commented 8 years ago

OK. I've got it working but needs a little polish.

applemuncy commented 8 years ago

I'm ready to close on this issue. The next person to go though the process can find the rough spots and provide better edits.