Time in ROI using Deeplabcut #1192
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Check the attached workflow for a possible solution. Hope it helps, |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for your fast answer! I think I am missing something because I don't understand how can I create a CreatePoint2f with the dynamic coordinates that GetBodyPart gives me...Can I link the coordinates from GetBodyPart somehow by externalizing them to the coordinates that form the Point2f? Sorry if these are naive questions! |
Beta Was this translation helpful? Give feedback.
-
Hi Bruno, Is there a way to count the number of entries in the ROI as well in the above workflow and timestamp them (or Frame Number with 0/1)? |
Beta Was this translation helpful? Give feedback.
Check the attached workflow for a possible solution.
Basically, from a frame extract whatever
Point2f
you need (in your case the position of theBodyPart
). Then, define aRegionIfInterest
in the image and pair it up with each point previously generated.Finally use the
ContainsPoint
operator that takes aTuple<Rect, Point2f>
and returns whether the point is inside the specified region or not.You can then simply count the number of frames that this condition evaluates to True and multiply it by your frame rate to get time spent in the selected area.
Hope it helps,
Bruno
ROI_POINT_detection.zip