Commit e166b01b774b32f61831d9b13a6bee44a5876efc
1 parent
95272d90
simple mask test
Showing
11 changed files
with
9 additions
and
6 deletions
Show diff stats
fun_mPb_theta.cpp
@@ -28,8 +28,8 @@ stim::image<float> func_mPb_theta(stim::image<float> lab, float theta, unsigned | @@ -28,8 +28,8 @@ stim::image<float> func_mPb_theta(stim::image<float> lab, float theta, unsigned | ||
28 | 28 | ||
29 | stim::image<float> l1,l2,l3,a1,a2,a3,b1,b2,b3; | 29 | stim::image<float> l1,l2,l3,a1,a2,a3,b1,b2,b3; |
30 | 30 | ||
31 | - l1 = gaussian_derivative_filter_odd(pic_light, sigma, sigma_n, r1 * 2, theta, w, h); | ||
32 | - stim::cpu2image(l1.data(), "data_output/l1_tex2.bmp", w, h, stim::cmBrewer); | 31 | + l1 = gaussian_derivative_filter_odd(pic_light, sigma, sigma_n, r3 * 2, theta, w, h); |
32 | + stim::cpu2image(l1.data(), "data_output/testl_tex5.bmp", w, h, stim::cmBrewer); | ||
33 | l2 = gaussian_derivative_filter_odd(pic_light, sigma, sigma_n, r2 * 2, theta, w, h); | 33 | l2 = gaussian_derivative_filter_odd(pic_light, sigma, sigma_n, r2 * 2, theta, w, h); |
34 | stim::cpu2image(l2.data(), "data_output/l2_tex.bmp", w, h, stim::cmBrewer); | 34 | stim::cpu2image(l2.data(), "data_output/l2_tex.bmp", w, h, stim::cmBrewer); |
35 | l3 = gaussian_derivative_filter_odd(pic_light, sigma, sigma_n, r3 * 2, theta, w, h); | 35 | l3 = gaussian_derivative_filter_odd(pic_light, sigma, sigma_n, r3 * 2, theta, w, h); |
gauss_derivative_odd.cpp
@@ -12,12 +12,14 @@ void array_multiply(float* lhs, float rhs, unsigned int N); | @@ -12,12 +12,14 @@ void array_multiply(float* lhs, float rhs, unsigned int N); | ||
12 | // winsize = 2 * r, side of mask = winsize + 1 | 12 | // winsize = 2 * r, side of mask = winsize + 1 |
13 | stim::image<float> gaussian_derivative_filter_odd(stim::image<float> image, float sigma, unsigned int sigma_n, unsigned int winsize, float theta, unsigned int w, unsigned int h){ | 13 | stim::image<float> gaussian_derivative_filter_odd(stim::image<float> image, float sigma, unsigned int sigma_n, unsigned int winsize, float theta, unsigned int w, unsigned int h){ |
14 | 14 | ||
15 | - stim::image<float> mask_x(winsize+1, winsize+1), mask_y(winsize+1, winsize+1), mask_theta(winsize+1, winsize+1), derivative_x, derivative_y, derivative_theta(w, h); | 15 | + stim::image<float> mask_x(winsize+1, winsize+1), mask_y(winsize+1, winsize+1), mask_theta(winsize+1, winsize+1), mask_test(winsize+1, winsize+1, 1), derivative_x, derivative_y, derivative_theta(w, h); |
16 | //float* ptr = mask_x.data(); | 16 | //float* ptr = mask_x.data(); |
17 | 17 | ||
18 | - //mask_x.load("101087.bmp"); | ||
19 | - //float s[169]; | ||
20 | - //float *ptr = s; | 18 | + |
19 | + memset ( mask_test.data(), 0, mask_test.size() * sizeof(float)); | ||
20 | + mask_test.data()[winsize*(winsize+2)/2] = 1; | ||
21 | + stim::cpu2image(mask_test.data(), "data_output/mask_test.bmp", winsize+1, winsize+1, stim::cmBrewer); | ||
22 | + | ||
21 | 23 | ||
22 | // set parameters | 24 | // set parameters |
23 | unsigned N = w * h; | 25 | unsigned N = w * h; |
@@ -51,6 +53,7 @@ stim::image<float> gaussian_derivative_filter_odd(stim::image<float> image, floa | @@ -51,6 +53,7 @@ stim::image<float> gaussian_derivative_filter_odd(stim::image<float> image, floa | ||
51 | // 2D convolution | 53 | // 2D convolution |
52 | //derivative_theta = image.convolve2(mask_theta); | 54 | //derivative_theta = image.convolve2(mask_theta); |
53 | //stim::cpu2image(derivative_theta.data(), "data_output/derivative_theta1.bmp", w, h, stim::cmBrewer); | 55 | //stim::cpu2image(derivative_theta.data(), "data_output/derivative_theta1.bmp", w, h, stim::cmBrewer); |
56 | + //conv2(image.data(), mask_test.data(), derivative_theta.data(), w, h, winsize+1); | ||
54 | conv2(image.data(), mask_theta.data(), derivative_theta.data(), w, h, winsize+1); | 57 | conv2(image.data(), mask_theta.data(), derivative_theta.data(), w, h, winsize+1); |
55 | //stim::cpu2image(derivative_theta.data(), "data_output/derivative_theta_tex1.bmp", w, h, stim::cmBrewer); | 58 | //stim::cpu2image(derivative_theta.data(), "data_output/derivative_theta_tex1.bmp", w, h, stim::cmBrewer); |
56 | 59 |
test result/0829_01_vs_gradient_theta=0.PNG deleted
193 KB
test result/0829_02_vs_gradient_theta=0.PNG deleted
381 KB
test result/0829_03_vs_gradient_theta=0_r=3,5,10.PNG deleted
583 KB
test result/0829_03_vs_gradient_theta=90_r=3,5,10.PNG deleted
542 KB
test result/0829_04_compare_colora_theta=90_r=3,5,10.PNG deleted
559 KB
test result/0829_04_compare_colorb_theta=90_r=3,5,10.PNG deleted
719 KB
test result/0829_04_compare_vs_gradient_theta=90_r=3,5,10.PNG deleted
702 KB
test result/0831_01_compare_vs_mPb.PNG deleted
416 KB
test result/0831_01_compare_vs_mPb_time.PNG deleted
6.56 KB