In #225 I added write_evr capability. Currently, openCV is used to do the contour finding in write_evr. I spent some time trying to write different contour finding algorithms in numpy, but these were rather slow compared to openCV (and scikit-image) implementations since they were C++/Cython accelerated. ~12seconds vs ~0.1seconds for a 3955 x 1681 matrix ended up being the time comparison. The problem with installing openCV is that it drastically inflates the size of the Echoregions package, which is supposed to be lightweight, so we'll need to implement some form of contour finding in the future.
The algorithm which openCV uses is Suzuki-Abe and this algorithm works well with holes. It's rather involved to implement, so I'll need to heavily reference openCV's implementation (https://github.com/opencv/opencv/blob/master/modules/imgproc/src/contours.cpp) to do this. Another option to try is an accelerated version of Moore-neighborhood tracing algorithm, which doesn't work well with holes, but with path simplification, can be robust as Suzuki-Abe in contour tracing of regions containing no holes.
In #225 I added
write_evrcapability. Currently,openCVis used to do the contour finding inwrite_evr. I spent some time trying to write different contour finding algorithms innumpy, but these were rather slow compared toopenCV(andscikit-image) implementations since they were C++/Cython accelerated. ~12seconds vs ~0.1seconds for a 3955 x 1681 matrix ended up being the time comparison. The problem with installingopenCVis that it drastically inflates the size of the Echoregions package, which is supposed to be lightweight, so we'll need to implement some form of contour finding in the future.The algorithm which
openCVuses is Suzuki-Abe and this algorithm works well with holes. It's rather involved to implement, so I'll need to heavily referenceopenCV's implementation (https://github.com/opencv/opencv/blob/master/modules/imgproc/src/contours.cpp) to do this. Another option to try is an accelerated version of Moore-neighborhood tracing algorithm, which doesn't work well with holes, but with path simplification, can be robust as Suzuki-Abe in contour tracing of regions containing no holes.