> I have one more question not directly related to this topic. Is there
> any way to adjust *"robustness"  of shape recognition*? My "straight
> lines" are almost always get translated into "lines", it is a bit harder
> with "circles", and I only once was able to draw a square that was
> recognized as a "square".
>
> What are the rules that I have to follow to maximize quality of
> recognition? I couldn't find any parameter in configuration file,
> responsible for that, but I assume there must be something in the source
> code.

Indeed there are some parameters in the source code, they are in 
src/xo-shapes.h
They didn't make it into the config file because it is not clear to me 
which ones are most relevant for users to customize, and there are too many.

For circles, you'd tinker with CIRCLE_MIN_DET and CIRCLE_MAX_SCORE -- 
decrease the first one a bit (it's on a scale from 0 to 1, with 1 only 
allowing perfect circles and 0 allowing any shape), increase the second 
one a bit (the scale there is 0 to infinity, but 1 would already catch 
most non-crazy shapes).

For rectangles, you can try to tinker with the two RECTANGLE_... 
parameters, but the main obstacle in practice is that to recognize a 
rectangle, you have to have a stroke that is composed of four pieces 
that get recognized as lines -- so if you round your corners, the pieces 
won't pass the line recognition test -- and increasing tolerance for 
lines leads to too many things being mistakenly recognized as lines.

The main trick to get rectangles recognized is that you don't have to 
draw them all in one go. If you draw the four sides successively with 
one pen stroke each, and each separately gets recognized as a line and 
the lines fit together, the four sides will get combined into a 
rectangle. (However, you're not allowed to undo or erase partway through 
the drawing process, of course).  The sides must be drawn in order 
around the rectangle (clockwise or counterclockwise), but each 
individual side can be drawn forward or backwards.
(So: usually I draw the top edge left-to-right, then the right edge 
downwards, then the bottom edge left-to-right, then the left edge 
downwards, and I find that recognition is a lot better this way).
(In principle you can also do 2 edges first, then the 2 others, going 
around the rectangle, or any other such combination.)

Denis

------------------------------------------------------------------------------
_______________________________________________
Xournal-devel mailing list
Xournal-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xournal-devel

Reply via email to