def obtain_neighbors(edges, point, num_neigh=3, step=1):
    """Investigates the directional neighbors of a pixel, searching
    for elements of a set into an image.

    Parameters
    ----------
    edges : array
        Binary input image representing the region edge.
    point : list
        Point coordinates of the central pixel.
    num_neigh : int, optional (default : 3)
        Number of neighbors to obtain in each side.
    step : int, optional (default : 1)
        Space given between one point and the other.

    Returns
    -------
    pts_neigh : list
        List containing the coordinates for each neighbor point
        contained in the edges image.
    """
    pts_neigh = []
    x_zero, y_zero = point
    idx = edges.index([x_zero, y_zero])
    pts_neigh.append([x_zero, y_zero])
    for num in range(num_neigh):
        pts_neigh.append(edges[idx - step * num])
        try:
            pts_neigh.append(edges[idx + step * num])
        except IndexError:
            aux_idx = len(edges) - 1 - idx
            pts_neigh.append(edges[aux_idx + step * num])
    return pts_neigh
