Skip to content

Time in ROI using Deeplabcut #1192

Answered by bruno-f-cruz
paulagsotres asked this question in Q&A
Discussion options

You must be logged in to vote

Check the attached workflow for a possible solution.
Basically, from a frame extract whatever Point2f you need (in your case the position of the BodyPart). Then, define a RegionIfInterest in the image and pair it up with each point previously generated.
Finally use the ContainsPoint operator that takes a Tuple<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

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by paulagsotres
Comment options

You must be logged in to vote
2 replies
@bruno-f-cruz
Comment options

@paulagsotres
Comment options

Comment options

You must be logged in to vote
2 replies
@bruno-f-cruz
Comment options

@kapilsaxena33
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants