How to use the gradient.get_phase function in gradient

To help you get started, we’ve selected a few gradient examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ctmakro / opencv_playground / painterfun.py View on Github external
def samplepoints():
        # sample a lot of points from one error image - save computation cost

        point_list = []
        y,x,d = wherediff()
        phasemap = gradient.get_phase(flower)

        # while not enough points:
        while len(point_list)0.5*rn():
                # get gradient orientation info from phase map
                phase = phasemap[ry,rx] # phase should be between [0,2pi)

                # choose direction perpendicular to gradient
                angle = (phase/math.pi*180+90)%360
                # angle = 22.5