Manish

Manish

How to find contours in image using evision and nx?

How to detect square region in an image using nx?

/nx

Most Liked

kip

kip

ex_cldr Core Team

@Manish, welcome to the forum. You’ll find this a very welcoming and supportive community. However, this question is far too broad encourage community engagement. You are encouraged to show what you have tried, what you are trying to achieve and to be clearer about what specifically you are asking for help with.

If you’ve not got any background in image processing then I suggest reading a few articles on “edge detection”. Then look at the OpenCV functions for edge detection which map to the eVision/OpenCV ones.

kokolegorille

kokolegorille

Some helpful resources for evision…

cocoa

cocoa

Also, please read the inline docs. Pulling up the inline docs and presenting them in a friendly way is a built-in feature of IEx. It only requires one to type h ModuleName.FunctionName. For example

iex> h Evision.findContours

                     def findContours(image, mode, method)

  @spec findContours(Evision.Mat.maybe_mat_in(), integer(), integer()) ::
          {[Evision.Mat.t()], Evision.Mat.t()} | {:error, String.t()}

Finds contours in a binary image.

##### Positional Arguments

  • **image**: `Evision.Mat`.
    Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's.
    Zero pixels remain 0's, so the image is treated as binary . You can use
    #compare, #inRange, #threshold , #adaptiveThreshold, #Canny, and others to
    create a binary image out of a grayscale or color one. If mode equals to
    #RETR_CCOMP or #RETR_FLOODFILL, the input can also be a 32-bit integer
    image of labels (CV_32SC1).


  • **mode**: `int`.
    Contour retrieval mode, see #RetrievalModes


  • **method**: `int`.
    Contour approximation method, see #ContourApproximationModes


##### Keyword Arguments
...

Where Next?

Popular in Questions Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
dotdotdotPaul
Okay, I’m having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I’m sure I’...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New

Other popular topics Top

WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31307 143
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52774 488
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement