HackerShackOfficial / Smart-Security-Camera

IoT security camera running open-cv for object detection 📹
561 stars 276 forks source link

main.py is Runnning Fine But No object Detection #34

Open hacha0929 opened 4 years ago

hacha0929 commented 4 years ago

I tried to move in front of the camera, No movement detection and email sending, the live stream is working fine. Please help.

matancarmeli7 commented 4 years ago

same happens to me

icerchill commented 4 years ago

the problem is because only the frame return from get_object() get painted in green rectangle check_for_objects() function, which I guess author's purpose is to only send email detection rectangle?
if you want to see the green grid in realtime you need to modify the code a little bit in gen() function to yield the returned frame. A simple if statement should do the trick.

AWadehra commented 4 years ago

@icerchill do you have any idea as to what to exactly add?

icerchill commented 4 years ago

@icerchill do you have any idea as to what to exactly add?

so the video_camera.get_object(object_classifier) function inside check_for_objects_and_notify() will return the exact detected "green grid" frame with and a boolean tuple(frame and boolean). so if you put this line inside the get() function. check for this boolean and use the returned frame to yield then it renders that green frame if found_obj is true on the web. its really depend how you want to implement, the catch is the video_camera.get_object() returns THE actual frame detection frame. In the author's code it just renders every frame that camera captures.

prajwal2319 commented 4 years ago

Try to change the cascade classifiers in models section , there are many other classifiers in opencv libraries which you can use.