Ask Your Question
1

Inconsistent results in DNN - image gets different detections [closed]

asked 2017-11-04 07:25:18 -0600

rhoolwerf gravatar image

Hi all,

I'm having inconsistent results when detecting a cat through OpenCV version 3.3.1 using DNN. I'll explain:

I have two frames, one one with a cat and the without a cat. I've gotten some detection source from PyImageSearch to detect my cat in these frames. However, the detection sometimes is inconsistent. With this I mean that if I first detect frame-without-cat and then frame-with-cat, I get the expected result (no cat found, cat found). However, if I first detect frame-with-cat and then frame-without-cat, I get wrong results (cat detected, cat detected). If I then process frame-without-cat -> frame-with-cat -> frame-without-cat I get the following results: cat not detected, cat detected, cat detected.

I fear that I am either having a memory-overlap issue, or that net.forward() works different from what I expect it to do. However, I have multiple other test-files which do not have this issue, I think about 5% do however so it's still quite a bit.

This is the source I'm working on so far: http://ibibe.nl/opencv/detect-images.py

Anyone who can shed a light on what's going on? I'm really looking forward to your answers.

(Little background information: I'm trying to use OpenCV DNN to detect whether my cat is going inside or outside, so I'm detecting frames whether they contain a cat and specifically where they contain a cat, so that I can determine direction)

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by rhoolwerf
close date 2017-11-05 03:35:50.763921

Comments

3

might be related to this ?

berak gravatar imageberak ( 2017-11-04 07:36:06 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-11-05 03:35:05 -0600

rhoolwerf gravatar image

Thanks for your answer, that did the trick. I just installed OpenCV from master-branch and got 3.3.1-dev and now the third detection correctly returns "cat not detected". Thanks again!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-11-04 07:25:18 -0600

Seen: 284 times

Last updated: Nov 04 '17