#include #include #include #include #include stim::image func_mPb_theta(stim::image lab, float theta, unsigned int w, unsigned int h){ stim::image mPb_theta(w, h, 1); stim::image pic_light, pic_colora, pic_colorb; pic_light = lab.channel(0); pic_colora = lab.channel(1); pic_colorb = lab.channel(2); unsigned int N = w * h; float sigma = 2; unsigned int sigma_n = 3; unsigned r1 = 3; unsigned r2 = 5; unsigned r3 = 10; unsigned r4 = 20; float alpha[9] = {1,1,1,1,1,1,1,1,1}; stim::image l1,l2,l3,a1,a2,a3,b1,b2,b3; l1 = gaussian_derivative_filter_odd(pic_light, sigma, sigma_n, r1 * 2, theta, w, h); l2 = gaussian_derivative_filter_odd(pic_light, sigma, sigma_n, r2 * 2, theta, w, h); l3 = gaussian_derivative_filter_odd(pic_light, sigma, sigma_n, r3 * 2, theta, w, h); a1 = gaussian_derivative_filter_odd(pic_colora, sigma, sigma_n, r2 * 2, theta, w, h); a2 = gaussian_derivative_filter_odd(pic_colora, sigma, sigma_n, r3 * 2, theta, w, h); a3 = gaussian_derivative_filter_odd(pic_colora, sigma, sigma_n, r4 * 2, theta, w, h); b1 = gaussian_derivative_filter_odd(pic_colorb, sigma, sigma_n, r2 * 2, theta, w, h); b2 = gaussian_derivative_filter_odd(pic_colorb, sigma, sigma_n, r3 * 2, theta, w, h); b3 = gaussian_derivative_filter_odd(pic_colorb, sigma, sigma_n, r4 * 2, theta, w, h); for (unsigned i = 0; i