File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
shared-bindings/bitmapfilter Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 44
44
//| ) -> displayio.Bitmap:
45
45
//| """Convolve an image with a kernel
46
46
//|
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
+ //|
47
54
//| The ``bitmap``, which must be in RGB565_SWAPPED format, is modified
48
55
//| according to the ``weights``. Then a scaling factor ``mul`` and an
49
56
//| offset factor ``add`` are applied.
53
60
//| Specific weights create different effects. For instance, these
54
61
//| weights represent a 3x3 gaussian blur:
55
62
//|
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.
59
67
//|
60
68
//| ``add`` is a value to add to each convolution pixel result.
61
69
//|
You can’t perform that action at this time.
0 commit comments