cc_contour#

Cayula-Cornillon contour processing.

Contour is a list of iy, ix, angle: position of the pixel, current angle of the contour line (as an int between -180 and 180??). The list is used as a stack, last added elements are inserted at the start of the list.

_contour(edges, field, output)#

Create and extend contours using previously detected edges and gradients.

Parameters:
find_best_front(contour, edges)#

Compiled with Numba

  • Options: nopython: True

Select best pixel to add to the front.

Of the bins neighboring the last bin on the contour, this function selects the best front bin to add to the contour. Going through all the neighboring bins, the function identifies the next bin that will change the direction of the contour the least. However, if adding the selected bin would result in the contour changing direction by more than 90 degrees over the course of 5 bins, the bin is rejected as a possible addition to the contour. If the provided contour point is the first point in the contour and thus has no direction, the selection is biased towards higher numbered bins as they are the least likely to be contained in other contours.

Parameters:
Returns:

  • Point to add to the contour. None if there is no previously identified edge pixel to

  • add to the contour.

Return type:

tuple[int, int, float] | None

turn_too_sharp(next_angle, contour)#

Compiled with Numba

  • Options: nopython: True

Wheter adding a point with next_angle to contour would be too sharp a turn.

Too sharp if it turns more than 90° over the 5 last points.

Parameters:
Return type:

bool