1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The discrete integral of a contour of an image

  1. Sep 8, 2012 #1
    Hi everybody !!

    I have a question about discrete integrals with contours. I want to integrate
    the points that makes the contour of an image. When the contour is only one
    curve it is easy I get the function in every point of the contour and I multiply
    by the distance between two consecutive points.

    But my problems y when this curve changes of topology so the contour
    can be several contours inside, outside the other curve. So I wonder if I can use the
    same method.

    Example 1: I calculate the corresponding functions
    of the elements in the position of the contour multiplyed
    by the width between two consecutive points.


    My problem Example 2: It is when my contour is not a curve
    with starting and ending if not particionates and becomes
    more curves. Someone knows how to calculate the discrete
    integral over the points 1, and 2??.


    The problem can be arbitrary I just show a case to explain my

    Thank you very much
    Esmeralda Ruiz
  2. jcsd
  3. Sep 9, 2012 #2

    Stephen Tashi

    User Avatar
    Science Advisor

    Do you mean that it "bifurcates" and becomes more curves?

    It isn't possible to say what you should do unless we understand what you are trying to accomplish by doing the integration. What function are you integrating? What is the result of the integration supposed to mean?
  4. Sep 9, 2012 #3
    Thanks for answering. I attached an example I want to calculate the integral of a contour (discrete points). The function could be the force that makes evolve this contour. The first example is the trivial I calculate the function in every points and I multiply it by the width between the two consecutive points so the results is ok (the last point with the first). The problem is when the curve changes of topology or as you said bifurcates in others caused by the force applying to it. Then I would still like to calculate the integral of that curve(s) to keep evolving until it converges. I do not know if there is any way to do it a numerical way to calculate discrete integrals over some points or numerical optimization methods. The ones I know they need a polinomial function not an image.

    Thanks for your help

    Attached Files:

  5. Sep 9, 2012 #4

    Stephen Tashi

    User Avatar
    Science Advisor

    Does your problem represent an actual problem in physics (force = force in newtons)?

    Or is this a kind of metaphorical force - some function f(...) that you invented to measure how much a contour departs from a smooth shape like a circle, some function that merely plays a role in image processing?
  6. Sep 9, 2012 #5
    It is the second thing the curve must evolve certain shape so the force can be for every point of the curve multiplied by a force. For example the force can be

    c1 = average inside of the curve
    c2 = average outside of Phi0
    I1 = image

    But the function I am using is working my problem is how to make the integral of
    arbitrary points that can be in whatever point of the image. I also tried triangulization and getting the area of the triangles of every point. But it seems not work.

    Thank you again
  7. Sep 9, 2012 #6
    So for example if you have several x,y and z (function) that are not consecutive how to integrate

    instead of having a polinomial function you have an arbitrary function.

    Thanks again
  8. Sep 9, 2012 #7

    Stephen Tashi

    User Avatar
    Science Advisor

    Even though you are not dealing with physics, it might be useful to think about physics.

    In physics, line integrals are often used to compute the flow of particles or "lines of force" through a contour. The net flow through a closed contour will be zero unless there are "sources" or "sinks" of particles within that area. Can the "force" that you are using be imagined as a "flux" of particles?
  9. Sep 10, 2012 #8
    right, I think you gave me the idea, so if I did not understood wrong, every curve will have the height equal 1 it would be the same as a line (height = 1), the only thing to consider is the width. So if I have two curves separated it will be the same idea as before ( I think), but without considering the width between two curves no connected and this will give me the integral that it would be equal the length of the contour. I think this is why the triangulation was not working because I was not looking for the area. Thank you very much it was a very good idea !!.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook