You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We'd like to convert the stroke extraction code (#1151) to use PyBPL once we have things working. Our current GNN processing code in #1151 uses Matlab BPL with some modifications by @shengcheng. It would make documenting setup easier if we could use Python for this component instead. There is a partial Python implementation of BPL. It would be nice if we could use a modified version of pyBPL instead of calling out to Matlab.
The first step here is determining if this is possible. It looks like this might not be, because pyBPL uses the Matlab API for some parts that aren't yet implemented. Stroke extraction might be one.
(In theory we could reimplement the stroke extraction logic ourselves, maybe calling out using say opencv-python (or similar tools) but I expect that's probably more work than is worthwhile at this point.)
The text was updated successfully, but these errors were encountered:
Since I just looked through the code, it might be some help to point out that AFAICT anyway the stroke extraction code uses only three exports from BPL:
extract_junctions() (function)
trace_graph() (function)
UGraph (class)
Unfortunately, it doesn't look like PyBPL covers these at the moment. So if we want to replace them we would have to re-implement those parts ourselves.
I think rewriting this ourselves is doable but there are bound to be some difficulties. It's doable because there are only ~600 or 700 lines of code total, with no randomness and nothing that looks obviously irreplaceable to me. As for difficulties, I think potentially the most annoying here is finding equivalents for Matlab's image processing functions, specifically edge(), imdilate(), imbothat(), bwmorph(), and bwconncomp(). (These are the functions I noticed were used in ske.m and its dependencies.) Pillow or OpenCV might be useful if we decided to go down that route.
For now let’s have this rewrite as a lower priority given we have the matlab version functioning. It be nice to only need to invoke Python scripts for processing but this may be a larger project time wise than we want to tackle before the demo.
We'd like to convert the stroke extraction code (#1151) to use PyBPL once we have things working. Our current GNN processing code in #1151 uses Matlab BPL with some modifications by @shengcheng. It would make documenting setup easier if we could use Python for this component instead. There is a partial Python implementation of BPL. It would be nice if we could use a modified version of pyBPL instead of calling out to Matlab.
The first step here is determining if this is possible. It looks like this might not be, because pyBPL uses the Matlab API for some parts that aren't yet implemented. Stroke extraction might be one.
(In theory we could reimplement the stroke extraction logic ourselves, maybe calling out using say
opencv-python
(or similar tools) but I expect that's probably more work than is worthwhile at this point.)The text was updated successfully, but these errors were encountered: