metrics
greyscale(master_chunk, tile_arrays, **kwargs)
Compute the greyscale distance.
This metric ignores colours and compares greyscale values. Should provide better photomosaics when using few tiles images.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
master_chunk |
ndarray
|
array containing the RGB pixels with values between 0 and 255. |
required |
tile_arrays |
ndarray
|
array tile pixel arrays, values between 0 and 255. |
required |
**kwargs |
passed to |
{}
|
Returns:
Type | Description |
---|---|
ndarray
|
Colour distance approximation between the master chunk and all the tiles arrays. |
Source code in phomo/metrics.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
luv_approx(master_chunk, tile_arrays, **kwargs)
Distance metric using a LUV space approximation.
This metric should provide more accurate colour matching.
Reference
https://www.compuphase.com/cmetric.htm
Parameters:
Name | Type | Description | Default |
---|---|---|---|
master_chunk |
ndarray
|
array containing the RGB pixels with values between and 255. |
required |
tile_arrays |
ndarray
|
array containing the RGB pixels with values between 0 and 255. |
required |
**kwargs |
passed to |
{}
|
Returns:
Type | Description |
---|---|
ndarray
|
Colour distance approximation between the master chunk and all the tiles arrays. |
Source code in phomo/metrics.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
norm(master_chunk, tile_arrays, **kwargs)
Distance metric using np.linalg.norm
.
Quick distance metric in RGB space.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
master_chunk |
ndarray
|
array containing the RGB pixels with values between 0 and 255. |
required |
tile_arrays |
ndarray
|
list of tile pixel arrays, values between 0 and 255. |
required |
**kwargs |
passed to |
{}
|
Returns:
Type | Description |
---|---|
ndarray
|
Colour distance approximation between the master chunk and all the tiles arrays. |
Source code in phomo/metrics.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|