Opencv_contrib: Change psr_threshold parameter for CSRT-tracker in Python

Created on 11 Jun 2019  Â·  7Comments  Â·  Source: opencv/opencv_contrib

A suggestion to add the ability to change the psr_threshold parameter in Python-wrapper for CSRT-tracker, which is currently not available: https://stackoverflow.com/questions/54785230/csrt-algorithm-not-updating-target#comment96385997_54790163

System information (version)
  • OpenCV => 4.1.0
  • Operating System / Platform => Any
  • Compiler => Python 3.x
Detailed description
Steps to reproduce
tracker = cv2.TrackerCSRT_create()

Most helpful comment

Sure, it was a little tricky to figure it out initially.

Write

cstr = cv2.TrackerCSRT_create()
fs = cv2.FileStorage("settings.yaml",cv2.FILE_STORAGE_WRITE) 
cstr.write(fs)
fs.release()

Read

fs_settings = cv2.FileStorage("settings.yaml",cv2.FILE_STORAGE_READ)
tracker = cv2.TrackerCSRT_create()
tracker.read(fs_settings.root())

All 7 comments

Any solution for this? (A separate question) Moreover do this CSRT has cuda 8.0 implementation? I am working on Jetson Tx1 with this algorithm and currently I have installed opencv with cuda enabled but fps is still low it gives fps of 15-20 and GPU performance of max 50%.

Try to replace CV_EXPORTS in Params class with CV_EXPORTS_W_MAP. If it does not help, try to move this class outside of TrackerCSRT.

You can update the parameters with .write() on the tracker.
use .read() to read out the defaults

@unrelatedlabs Thanks! Can you provide an example?

Sure, it was a little tricky to figure it out initially.

Write

cstr = cv2.TrackerCSRT_create()
fs = cv2.FileStorage("settings.yaml",cv2.FILE_STORAGE_WRITE) 
cstr.write(fs)
fs.release()

Read

fs_settings = cv2.FileStorage("settings.yaml",cv2.FILE_STORAGE_READ)
tracker = cv2.TrackerCSRT_create()
tracker.read(fs_settings.root())

@unrelatedlabs,I add psr_threshold in the setting.yaml and chage the value of it,but it do not work

@unrelatedlabs,I add psr_threshold in the setting.yaml and chage the value of it,but it do not work

You'll have to experiment with the values. the psr_threshold value does not have any real world sense. it's an arbitrary value that highly depends on the image and bbox.

Was this page helpful?
0 / 5 - 0 ratings