card-io / card.io-dmz

The core image-processing and machine-learning code for card.io, which is shared between iOS and Android.
Other
141 stars 116 forks source link

llcv_sobel3_dx_dy_c_neon is wrong? #14

Closed qudm closed 9 years ago

qudm commented 9 years ago

Please check line 573 of file card.io-dmz/cv/sobel.cpp. I think it should be: uint16_t row2_index = (row_index == (uint16_t)(src_size.height - 1)) ? src_size.height - 1 : row_index + 1; instead of: uint16_t row2_index = row_index == (uint16_t)(src_size.height - 1 ? src_size.height - 1 : row_index + 1);

josharian commented 9 years ago

That does look wrong. Thanks very much!

Fortunately (phew!), the impact of this bug is minimal. That sobel3 calculation is only used in the calculation of the focus score, which (1) doesn't rely on any fine details, just statistical summaries and (b) was chosen because it seems to work well in practice, not because of any theoretical motivation.