Opencv: Documentation improvement plan

Created on 31 Aug 2017  路  3Comments  路  Source: opencv/opencv

i have a request and a suggestion about Documentation improvement plan

i already made some contributions related to documentation and i want to keep working on it. I want to work according a right plan so if some tasks that users can do are identified clearly i will choose a task and work on it. after completing a task choose another and so on.

my suggestion is gathering feedbacks from users in documentation pages

for example see msdn.microsoft.com
there is "Is this page helpful? Yes No"

documentation feature

Most helpful comment

I have tried to improve the documentation (list of PRs) by adding Java and Python code to some C++ tutorials.
Here some suggestions / guidelines I propose to follow. Discussion and proposition are welcome.

Write code that follows good practices

  • C++:

    • drop parameters with already good default values, for example imread(filename, IMREAD_COLOR) should be replaced by imread(filename) in my opinion

    • avoid using pointers, global variables if not needed

  • Java:

    • try to follow naming and coding convention specific to Java (e.g. CamelCase naming)

    • formatting can be easily and automatically done using for instance the Eclipse IDE

  • Python

    • try to write pythonic code (e.g. index slicing, itertools?)

    • for efficiency, try to use directly Numpy function instead of rewrite it using for loops

    • try to write Python 2 / 3 compatible code, see http://python-future.org/

  • in all case, try to declare variables the closest to their usage. It helps the comprehension of the program.
  • try to use CommandLineParser in C++ and argparse in Python for command lines option

Tutorial content

  • try to write in a way consistent with the other tutorials
  • a good outline for a tutorial should be in my opinion: (introduction +) theory / code / explanation / references (if any)
  • in my opinion, explanation of the code is not necessary since the tutorial code should be made self-explanatory
  • I would favor first a good tutorial code (especially in Java and Python where there are less examples), then the theory if the topic needs it
  • tutorial code should be embedded with @snippet doxygen command instead of @code command. This allows the code to be automatically verified for syntax error and to be run easily.

Suggestions / improvements

  • I have noticed that somehow with Numpy documentation the first referenced link by google is always from the latest documentation version
  • I wonder if something could be done, maybe in the search engine optimization parameters? This would avoid user to look at outdated documentation, since I regularly see people linking to the outdated 3.0-beta documentation.
  • I think an improvement could be to add accepted mat type in function inputs, especially for the imgproc module?
  • also, it would be great to have a note if a function is optimized using OpenCL or IPP
  • normalization / consistency in the path of the tutorial code. Currently, I sometimes find quite difficult to find the corresponding code for a given tutorial (e.g. some imgproc tutorials are in ImgTrans directory).

All 3 comments

I have some suggestions:

The first point should be relatively easy as it should be mostly some copy-pasting. The hard part should be to provide the code in C++, Java and in Python but it can be done progressively.

The second point is more a personal request as I have sometimes some difficulties to locate the source code of a function and the Github search option returns too many results.

I have tried to improve the documentation (list of PRs) by adding Java and Python code to some C++ tutorials.
Here some suggestions / guidelines I propose to follow. Discussion and proposition are welcome.

Write code that follows good practices

  • C++:

    • drop parameters with already good default values, for example imread(filename, IMREAD_COLOR) should be replaced by imread(filename) in my opinion

    • avoid using pointers, global variables if not needed

  • Java:

    • try to follow naming and coding convention specific to Java (e.g. CamelCase naming)

    • formatting can be easily and automatically done using for instance the Eclipse IDE

  • Python

    • try to write pythonic code (e.g. index slicing, itertools?)

    • for efficiency, try to use directly Numpy function instead of rewrite it using for loops

    • try to write Python 2 / 3 compatible code, see http://python-future.org/

  • in all case, try to declare variables the closest to their usage. It helps the comprehension of the program.
  • try to use CommandLineParser in C++ and argparse in Python for command lines option

Tutorial content

  • try to write in a way consistent with the other tutorials
  • a good outline for a tutorial should be in my opinion: (introduction +) theory / code / explanation / references (if any)
  • in my opinion, explanation of the code is not necessary since the tutorial code should be made self-explanatory
  • I would favor first a good tutorial code (especially in Java and Python where there are less examples), then the theory if the topic needs it
  • tutorial code should be embedded with @snippet doxygen command instead of @code command. This allows the code to be automatically verified for syntax error and to be run easily.

Suggestions / improvements

  • I have noticed that somehow with Numpy documentation the first referenced link by google is always from the latest documentation version
  • I wonder if something could be done, maybe in the search engine optimization parameters? This would avoid user to look at outdated documentation, since I regularly see people linking to the outdated 3.0-beta documentation.
  • I think an improvement could be to add accepted mat type in function inputs, especially for the imgproc module?
  • also, it would be great to have a note if a function is optimized using OpenCL or IPP
  • normalization / consistency in the path of the tutorial code. Currently, I sometimes find quite difficult to find the corresponding code for a given tutorial (e.g. some imgproc tutorials are in ImgTrans directory).

Related issue to close or redirect the obsolete and no more maintained Python tutorial website.


At the same time, mention about 2.4 OpenCV documentation being obsolete should be added. Here some examples for other libraries:

image

image

2.4 OpenCV branch still exist and the corresponding 2.4 documentation is still relevant. But most of the time, people that arrive on 2.4 doc are newcomers that just google something about OpenCV.


For tutorials improvement, a good thing would be to add references to the corresponding chapters of the Szeliski book.

Good theory with practical examples would be the best for the OpenCV tutorials. For instance, I have found this course.

Also, there are C++, Java and Python code in lot of OpenCV tutorials. Something like Python notebook could also be explored for interactive code.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

westonpace picture westonpace  路  3Comments

opencv-pushbot picture opencv-pushbot  路  3Comments

wmfuture picture wmfuture  路  3Comments

opencv-pushbot picture opencv-pushbot  路  3Comments

dustsigns picture dustsigns  路  3Comments