-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Area detector #187
Comments
Hi ! Thanks for this, could you detail a bit more the use case you are looking to solve ? not sure I understand it fully. |
If detection is required in a specific area of the image, Use case 1 pedestrian detection for loitering. An area would be created to only output via the API in this area. Use case 2 Vehicle break down. Draw an area detector in a lane and output via the API. The higher level system would deal with what to do. Use case 3 Bicycle priority. Detect in an area if a bicycle is present and output via the API. The higher level system would deal with what to do. |
Thanks ! Yes I see this could be a handy feature to add in the future.. We also had some report from users telling us that it would be nice to just restrict the tracking to some part of the frame for privacy issues. |
Hi, I wanted to clear up some points regarding the area detector feature (mentioned here). I know you are busy with the v3 development. I can take up the task of development of this feature. I you have time, please do walk me though how would you @tdurand develop this? in the the current project. I want to know if you see it as an extension feature of the current tracker logic, or any particular pointers I should consider. |
Hi @shams3049 Honestly I didn't think it over.. What are the use case you are looking to solve with something like this ? In the best of the world how do you see this feature ? |
One of the use case that it solves for our project at harbor: sometimes there are parking spots next to the road, if we draw a polygon, we can then keep a counter of cars or truck inside the polygon, I was of the mind that we can generate data on how long the parking is occupied and around which times (for example when was the polygon object count turned from zero to one and then zero again). This data in our case is really helpful to the port authorities. Brainstorming: |
I see, I will get back to you next week on some thoughts I have on this.. right now trying to wrap up stuff for the week-end ! Have a nice one .. |
I have a very rough alpha version that allows polygons to be drawn. If you think it would be helpful I can copy here for you to look at? |
Yeah please do, could be helpfull.
No hurry, once you have time, we can also discuss over zoom or something. Have a nice weekend. |
You can get the area detector from this link https://www.dropbox.com/s/38fgtfowxne9rc4/Area%20detector%202.rar?dl=0 |
@BarcaBear Thanks for sharing, could you showcase us what you have built with a few screenshot or a quick demo screencast ? I see, it is for sure possible but not that straightforward to implement.. I guess we can think of it as a Counting Area and not a Counting Line and we would need to
not easy to limit the scope of this feature |
You can see from these two videos how it is currently working https://www.dropbox.com/s/vk52ryo1xov2eps/Screencast%20from%2006-05-20%2011%3A38%3A05.webm?dl=0 Drawing multiple area detectors. Issue 1. Only the last drawn area detector changes the bounding box colour. My comments:-
BarcaBear- Ideally there would be one location that could allow both a count and area detector to be drawn. Selecting with a button which to draw. You can see in the videos that there is a "count" and "area" option. These two could be one.
Barcabear- My thoughts are to have the count detector stay as a count detector. And the area detector output tracking information as does today. But add an ID for the area detector. For example below:- The count detector could be drawn on top of the area dteector/ or bottom. "trackerDataForLastFrame": {
Barcabear-- Yes, as i suggest above.
Barcabear- https://www.dropbox.com/s/xygvbpd6s2e537y/Screencast%20from%2006-05-20%2012%3A01%3A01.webm?dl=0 If we use the polygon to detect/track only inside the polygon. Would this not take care of ignoring certain areas for privacy issues? |
@BarcaBear Nice work, I see detection inside the polygone. do you have implementation for the the count inside the polygon? |
No, I would use the count detector for that. And the area detector for tracking information. |
@tdurand @BarcaBear's solution looks like a good start, what do you think, if we pull it to current opendatacam and work on it further to reach a polished version. |
I just looked at the videos, if I summarize the current state of the work of @BarcaBear :
I kind of like this minimal approach to this.... we could add something to restrict the tracker to only the polygons drawned and we would also have the "privacy" feature. @BarcaBear Could you do a pull request so we can look into polishing/improving the implementation ? (I didn't downloaded / looked into the code yet) |
I think from the usability, I think we can add drawing polygone next to drawing lines and present it with a different icon. |
I would actually lean towards keeping this as an "extra" mode because it is actually a different concept from the counting. You can have counting lines and polygons areas... So in my opinion it is much clearer to have Areas as another distinct mode. In the minimalistict approach those polygons won't enable you to "count" stuff... so maybe also this doesn't solve your use case @shams3049 .. |
@tdurand I think it's fine with me as well to approach it as distinct node. we can see how much counting logic can be integrating for the use case, in any case I can always look for a higher level solution using the API. Having the polygone integrated into opendatacam, definitely sounds like feature that will enable new use cases. |
yes this is how I see it also. We don't want to bloat OpenDataCam with lots of features we need to implement and support / maintain / improve in the future. I think this minimalistic approach makes a lot of sense, because it uses the "power" of the nice UI editor of OpenDataCam to help people define easily areas and adds minimal logic to enrich the API with them. I see lots of benefits also to be able to say that we can restrict the tracker to a certain part of the frame for privacy issues also. |
If I may give my input here For some similar use/request I think the area is more suitable for detection/messaging/alert. Assuming the parking example, you want to know if there is a car or not there, and if something is on that area you can get a message/email/etc. you can emulate a "zone" by putting different lines around the area. I think the zone will be very useful, for these kind of scenarios and you can mixed/used in parallel with the counting lines. Meaning and object entering into the zone (just that for this feature) and you add a counting line inside the zone for that to be counted In this way you minimize changes and maintenance on the code and can keep the current setup/code. |
Could you do a pull request so we can look into polishing/improving the implementation ? (I didn't downloaded / looked into the code yet BarcaBear- I'm not familiar on how to do this here, and don't have the time to learn how to at the moment. If someone is more familiar than me and can use the code I sent the link to. Then please go ahead. |
@BarcaBear I can do it. |
Have you made any progress on this shams3049? |
@BarcaBear there are some conflicts with the current branch, Didn't had to time to resolve it. its good that you reminded me here, I'll get on it this Saturday. |
FYI @rantgithub funded me 💰️ to work on this.. I did something a a bit different that the one specified here, which enables to count things in polygons and not only enhance the tracker with wheter the object is inside a zone or not.
See implementation here: #237 . BTW I won't do any release of OpenDataCam with this feature so you need to pull the I'm leaving this open as in the future we might want to have a separated "Area" tab like @BarcaBear to use areas not for counting but for filtering the objects for privacy reasons.. let's see. |
Yay! Very cool! |
Great work. I'm getting an error when trying to run in demo mode "Config.json version doesn't match Opendatacam package.json" Any ideas why? |
Make sure the version in the |
I did check that and they match. The master branch is working fine. I will test it in a tx2 rather on my dev machine. |
hum.. strange.. you can uncomment this line if really it does not work: https://github.com/opendatacam/opendatacam/blob/development/server.js#L21 |
Commenting that line out worked. |
this is implemented on |
Could an area detector be added? And output the position via the API. This would allow one to count and output the direction. As well as Output the location within the area detector.
The text was updated successfully, but these errors were encountered: