opencv cv2.LUT()(使用查找表中的值填充输出数组)
from cv2.__init__.py
def LUT(src, lut, dst=None): # real signature unknown; restored from __doc__"""LUT(src, lut[, dst]) -> dst. @brief Performs a look-up table transform of an array.對數(shù)組執(zhí)行查找表轉(zhuǎn)換。. . The function LUT fills the output array with values from the look-up table. Indices of the entries. are taken from the input array. That is, the function processes each element of src as follows:函數(shù)LUT使用查找表中的值填充輸出數(shù)組。 條目的索引取自輸入數(shù)組。 也就是說,該函數(shù)按以下方式處理src的每個元素:. \f[\texttt{dst} (I) \leftarrow \texttt{lut(src(I) + d)}\f]. where. \f[d = \fork{0}{if \(\texttt{src}\) has depth \(\texttt{CV_8U}\)}{128}{if \(\texttt{src}\) has depth \(\texttt{CV_8S}\)}\f]. @param src input array of 8-bit elements. 8位元素的輸入數(shù)組。. @param lut look-up table of 256 elements; in case of multi-channel input array, the table should. either have a single channel (in this case the same table is used for all channels) or the same. number of channels as in the input array.256個元素的查詢表; 如果是多通道輸入數(shù)組,則該表應具有單個通道(在這種情況下,所有通道都使用相同的表)或與輸入陣列中的通道數(shù)相同。. @param dst output array of the same size and number of channels as src, and the same depth as lut.輸出數(shù)組,其大小和通道數(shù)與src相同,深度與lut相同。. @sa convertScaleAbs, Mat::convertTo"""pass示例:
使用gamma_table填充數(shù)組
結(jié)果:
gamma_table:
[ 0 3 5 7 9 11 13 14 16 18 19 21 22 24 25 26 28 29
31 32 33 35 36 37 39 40 41 42 44 45 46 47 48 50 51 52
53 54 56 57 58 59 60 61 63 64 65 66 67 68 69 70 71 73
74 75 76 77 78 79 80 81 82 83 84 85 86 88 89 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 122 123 123 124 125 126 127
128 129 130 131 132 133 134 135 136 137 138 139 140 140 141 142 143 144
145 146 147 148 149 150 151 151 152 153 154 155 156 157 158 159 160 161
161 162 163 164 165 166 167 168 169 169 170 171 172 173 174 175 176 177
177 178 179 180 181 182 183 183 184 185 186 187 188 189 190 190 191 192
193 194 195 196 196 197 198 199 200 201 202 202 203 204 205 206 207 207
208 209 210 211 212 212 213 214 215 216 217 217 218 219 220 221 222 222
223 224 225 226 227 227 228 229 230 231 232 232 233 234 235 236 236 237
238 239 240 240 241 242 243 244 245 245 246 247 248 249 249 250 251 252
253 253 254 255]
img_gamma:
[[ 3]
[ 5]
[ 7]
[ 9]
[11]
[13]]
參考文章:python opencv Intel Realsense 使用滑動條調(diào)整圖片的曝光率
總結(jié)
以上是生活随笔為你收集整理的opencv cv2.LUT()(使用查找表中的值填充输出数组)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python opencv 等比例调整(
- 下一篇: windows上不同版本的CUDA、cu