-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@unpack error using contour_topology.jl #25
Comments
Thanks for raising the issue. It turns out that I forgot a simple @unpack id, is_outer, pixels = node.data # See Parameters.jl for "@unpack" It turns out that the
then the following code snippet will run. using ImageComponentAnalysis, TestImages, ImageBinarization, ImageCore, AbstractTrees, UnPack
img = Gray.(testimage("blobs"))
img2 = binarize(img, Otsu())
components = label_components(img2, trues(3,3), 1)
tree = establish_contour_hierarchy(components)
# Iterate over all DigitalContour's in the tree.
for node in PostOrderDFS(tree)
@unpack id, is_outer, pixels = node.data # See Parameters.jl or UnPack.jl for "@unpack"
@show id, is_outer, pixels
end Note that the id = node.data.id
is_outer = node.data.is_outer
pixels = node.data.pixels I see that you must be using the master branch. Apologies for not tagging a new release in such a long time. I did a bunch of clean-up since the last release. At the moment I am working on an implementation of Fourier Descriptors so that one can reason about the shape of a connected component based on its contour. Once that is finished I was planning to update all the documentation, give lots more examples and tag a new release. |
Thank you for your answer! |
Thanks for the kind words. Please could you elaborate on what you meant by "how this works". Were you referring to I still need to write some documentation for the concept of the contour hierarchy, but a good place to start to get the basic idea is to at the OpenCV example. I haven't implemented any convenience functions for grabbing information about where a component sits in the hierarchy. The OpenCV example talks about different "contour retrieval modes". I'm not sure that any of those constitute the best approach for representing the information, and hence I have just exposed the tree to the end-user so that they can decide what information they want to extract and how. |
Actually I'm more interested in drawing the contour than hierarchy. |
Hi,
Thanks for this very nice package.
I'm trying to reproduce your example of contour drawing:
And I get this error:
I belive that it is due to the fact that @unpack belives that "pixels node.data" are two different Expr.
I have no idea how Parameters.jl works...
Thank you for your time,
Best regards,
Félix
The text was updated successfully, but these errors were encountered: