Image.Sin#
- classmethod Image.Sin(cycles: int = 2, dir: str = 'x', *, size: int | Sequence[int] | None = None, dtype: Dtype | None = None, colororder: str | None = None, like: Image | None = None) Self[source]#
Create image of sinusoidal intensity pattern
- Parameters:
The short-name aliases
'int','float','double','half'are also accepted and resolve to the Toolbox’s own defaults (uint8,float32,float64,float16respectively) – this matters because NumPy’s ownnp.dtype('float')resolves tofloat64, notfloat32. SeeDTYPE_ALIASES.- Parameters:
- Returns:
sinusoidal pattern
- Return type:
The sinusoids are offset to have a minimum value of zero, and span the range:
float image: 0 to 1
int image: 0 to maximum positive value of the integer type
Examples
>>> from machinevisiontoolbox import Image >>> Image.Sin(cycles=2, size=10).print() 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 0.50 0.98 0.79 0.21 0.02 >>> Image.Sin(cycles=2, size=10, dtype='uint8').print() 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6 127 248 202 52 6
cyclesequal to 1, 4 and 18:(
Source code,png,hires.png,pdf)