[SciPy-User] Help optimizing an algorithm

Zachary Pincus zachary.pincus@yale....
Wed Jan 30 23:17:11 CST 2013


> Another thing I should note is that the nonlinearity in the camera response is fairly localized -- there's one region about 20 counts wide, and another about 500 counts wide, and the rest of the response is basically linear. So outside of those two regions, we can just linearly interpolate and be confident we're getting the right value.

Aah, just noticed this. In that case, then the per-pixel lookup table might still work. Do one simple lookup with a single transfer function as I initially described, and then patch that output just in the error-prone regions with per-pixel lookup results, using much smaller x,y-sized lookup tables (either via fancy indexing, or scipy.ndimage.map_coordinates).

Of course, if map_coordinates is fast enough for the whole image (and it should be), then there's no advantage to doing the above as it's a bit less general and more hacky.

Zach


More information about the SciPy-User mailing list