Skip to content
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

Evision.boxPoints/1 is not working #99

Closed
navrkr opened this issue Oct 9, 2022 · 5 comments
Closed

Evision.boxPoints/1 is not working #99

navrkr opened this issue Oct 9, 2022 · 5 comments

Comments

@navrkr
Copy link

navrkr commented Oct 9, 2022

It is asking for a map as input but we are getting a tuple as output for minAreaRect

*** (FunctionClauseError) no function clause matching in Evision.boxPoints/1

The following arguments were given to Evision.boxPoints/1:

    # 1
    {{224.0, 262.5}, {343.0, 344.0}, 90.0}

Attempted function clauses (showing 1 out of 1):

    def boxPoints(box) when is_reference(box) or is_map(box) and is_map_key(box, :__struct__) and is_atom(:erlang.map_get(:__struct__, box))

(evision 0.1.7-dev) lib/generated/evision.ex:6346: Evision.boxPoints/1
@cocoa-xu
Copy link
Owner

cocoa-xu commented Oct 9, 2022

Hi @navrkr, I've fixed the function guard generation in v0.1.9, and the latest version is available on hex.pm.

def deps do
  [
    {:evision, "~> 0.1.9"}
  ]
end

The hex.pm release will use precompiled binaries by default. If you prefer to compile it locally, please set the environment variable EVISION_PREFER_PRECOMPILED to false before mix compile or iex -S mix.

One more note is that you might need to delete the _build/${MIX_ENV}/lib/evision/evision.so (MIX_ENV is dev by default) if you are okay with using precompiled binaries. Because the deployer will not override existing files if this file exists.

Bug fixes

  • Support parsing RefWrapper<T> (&value)[N] from list or tuple. (#99)

    See the function in c_src/evision.cpp.

    bool parseSequence(ErlNifEnv *env, ERL_NIF_TERM obj, RefWrapper<T> (&value)[N], const ArgInfo& info)
    # `RotatedRect` has to be a tuple, {centre, size, angle}
    Evision.boxPoints!({{224.0, 262.5}, {343.0, 344.0}, 90.0})
    
    # while `Point`/`Size` can be either a list, `[x, y]`, or a tuple, `{x, y}`
    Evision.boxPoints!({[224.0, 262.5], [343.0, 344.0], 90.0})
  • Fixed the mapping from a type to the corresponding function guard in py_src/helper.py. (#99)

@cocoa-xu
Copy link
Owner

cocoa-xu commented Oct 9, 2022

As the patches above should fix this issue, I'll close this one for now.

Please feel free to reopen it if there is any other issue with Evision.boxPoints/1, also don't hesitate to open a new issue if you encounter other problems. :)

@cocoa-xu cocoa-xu closed this as completed Oct 9, 2022
@navrkr
Copy link
Author

navrkr commented Oct 10, 2022

Yeah issue resolved. Can you help me with image ROI method I'm getting this error when try to solve it.
Screenshot from 2022-10-09 23-25-17

@kipcole9
Copy link

Hmmm thats really impossible to read. May I suggest you open a separate issue (since this one is resolved) and cut/paste the text into a code block rather than a screen shot. It makes it almost impossible for the maintainer to work with your example if its a screenshot.

@navrkr
Copy link
Author

navrkr commented Oct 10, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants