File tree Expand file tree Collapse file tree
shared-bindings/bitmapfilter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444//| ) -> displayio.Bitmap:
4545//| """Convolve an image with a kernel
4646//|
47+ //| The name of the function comes from
48+ //| `OpenMV <https://docs.openmv.io/library/omv.image.html#image.Image.morph>`_.
49+ //|
50+ //| For background on how this kind of image processing, including some
51+ //| useful ``weights`` values, see `wikipedia's article on the
52+ //| subject <https://en.wikipedia.org/wiki/Kernel_(image_processing)>`_.
53+ //|
4754//| The ``bitmap``, which must be in RGB565_SWAPPED format, is modified
4855//| according to the ``weights``. Then a scaling factor ``mul`` and an
4956//| offset factor ``add`` are applied.
5360//| Specific weights create different effects. For instance, these
5461//| weights represent a 3x3 gaussian blur:
5562//|
56- //| ``mul`` is number to multiply the convolution pixel results by. When
57- //| not set it defaults to a value that will prevent scaling in the
58- //| convolution output.
63+ //| ``mul`` is number to multiply the convolution pixel results by.
64+ //| If `None` (the default) is passed, the value of ``1/sum(weights)``
65+ //| is used (or ``1`` if ``sum(weights)`` is 0). For most weights, his
66+ //| default value will preserve the overall image brightness.
5967//|
6068//| ``add`` is a value to add to each convolution pixel result.
6169//|
You can’t perform that action at this time.
0 commit comments