Skip to content
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

NameError: name 'x_center' is not defined #93

Open
smritijha03 opened this issue Mar 20, 2020 · 3 comments
Open

NameError: name 'x_center' is not defined #93

smritijha03 opened this issue Mar 20, 2020 · 3 comments

Comments

@smritijha03
Copy link

Hi,
I'm trying to run ex_particle_filter_object_tracking_video.py file on another sample video. I have changed the template.png image with another subframe as per my sample video for the filter. But, I am unable to find the contour with largest area using the binary mask and obtain its centre coordinates. I am getting the following error:

Traceback (most recent call last): File "ex_particle_filter_object_tracking_video.py", line 110, in <module> my_particle.update(x_center, y_center) NameError: name 'x_center' is not defined

Any idea how this can be resolved.

@mpatacchiola
Copy link
Owner

Hi @Smritijha369 which version of Deepgaze are you using? Is the resolution of the video the same of the example (1920x1080) ?

@smritijha03
Copy link
Author

Hi, @mpatacchiola I am using Deepgaze 2.0.
My video resolution is 720x480. Do you think this could be an issue? Does it work for 1920x1080 only?

@mpatacchiola
Copy link
Owner

This error should be due to the fact that you are using a different video.

For a different video you need to set new versions of the images template.png. The template.png should be a sub-frame of the target you want to follow. You can get the template by simply using a cropping tool on your video to cut a portion of the target element you want to track. If the template has not been set then it is not be possible for the detector to find the target color in the image, and as a consequence it will not be able to find center_x and center_y (centers of the target) resulting in the error that you got.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants