From 1ad814a1913d837d529ae33412b21fd3a6b87bea Mon Sep 17 00:00:00 2001 From: Sui Libin Date: Mon, 12 Feb 2018 21:07:56 +0800 Subject: [PATCH] fix faster_rcnn sample crashed at PoolingInvoker on Windows7(x64). (#10724) * fix faster_rcnn sample crashed at PoolingInvoker operator() of pooling_layer. * find_odj onmouse bug about find matched point status. * reverted AutoBuffer back to std::vector --- modules/dnn/src/layers/pooling_layer.cpp | 2 +- samples/python/find_obj.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/dnn/src/layers/pooling_layer.cpp b/modules/dnn/src/layers/pooling_layer.cpp index 73d919f708..7cd8a341fb 100644 --- a/modules/dnn/src/layers/pooling_layer.cpp +++ b/modules/dnn/src/layers/pooling_layer.cpp @@ -320,7 +320,7 @@ public: bool compMaxIdx = computeMaxIdx; #if CV_SIMD128 - const int* ofsptr = &ofsbuf[0]; + const int* ofsptr = ofsbuf.empty() ? 0 : (const int*)&ofsbuf[0]; v_float32x4 idx00(0.f, (float)stride_w, (float)(stride_w*2), (float)(stride_w*3)); v_float32x4 ones = v_setall_f32(1.f); v_float32x4 idx_delta = v_setall_f32((float)(inp_width - kernel_w)); diff --git a/samples/python/find_obj.py b/samples/python/find_obj.py index 12f51d9183..c5cd7c66a9 100755 --- a/samples/python/find_obj.py +++ b/samples/python/find_obj.py @@ -120,10 +120,11 @@ def explore_match(win, img1, img2, kp_pairs, status = None, H = None): r = 8 m = (anorm(np.array(p1) - (x, y)) < r) | (anorm(np.array(p2) - (x, y)) < r) idxs = np.where(m)[0] + kp1s, kp2s = [], [] for i in idxs: (x1, y1), (x2, y2) = p1[i], p2[i] - col = (red, green)[status[i]] + col = (red, green)[status[i][0]] cv.line(cur_vis, (x1, y1), (x2, y2), col) kp1, kp2 = kp_pairs[i] kp1s.append(kp1)