imageruler.regular_shapes#
Regular shapes.
- imageruler.regular_shapes.disc(resolution, phys_size, diameter, center=(0, 0))[source]#
Return a Boolean array where all True elements form a disc.
- Parameters:
resolution (float) – A float that represents the number of points per unit length.
phys_size (Tuple[float, float]) – A tuple with two elements that describe the physical size of the entire pattern.
diameter (float) – A float that represents the diameter of the disc.
center (Tuple[float, float]) – A tuple with two elements that describe the coordinates of the center of the square.
- Returns:
An array with Boolean elements.
- Return type:
ndarray[Any, Any]
- imageruler.regular_shapes.rounded_square(resolution, phys_size, declared_mls, center=(0, 0), angle=0)[source]#
Return a bool array where all True elements form a square with rounded corners.
- Parameters:
resolution (float) – A float that represents the number of points per unit length.
phys_size (Tuple[float, float]) – A tuple with two elements that describe the physical size of the entire pattern.
declared_mls (float) – A float that represents the declared minimum length scale, which is equal to the diameter of round corners.
center (Tuple[float, float]) – A tuple with two elements that describe the coordinates of the center of the square.
angle (float) – A float that represents the angle of rotation in degree.
- Returns:
An array with Boolean elements.
- Return type:
ndarray[Any, Any]
- imageruler.regular_shapes.stripe(resolution, phys_size, width, center=(0, 0), angle=0)[source]#
Return a Boolean array where all True elements form a disc.
- Parameters:
resolution (float) – A float that represents the number of points per unit length.
phys_size (Tuple[float, float]) – A tuple with two elements that describe the physical size of the entire pattern.
width (float) – A float that represents the width of the stripe.
center (Tuple[float, float]) – A tuple with two elements that describe the coordinates of the center of the stripe.
angle (float) – A float that represents the angle of rotation in degree.
- Returns:
An array with Boolean elements.
- Return type:
ndarray[Any, Any]