alanlukezic / csr-dcf

Discriminative Correlation Filter with Channel and Spatial Reliability
226 stars 73 forks source link

Source code of CSR-DCF++ #3

Open YaqiLYU opened 6 years ago

YaqiLYU commented 6 years ago

Do you have a plan to make the source code of CSR-DCF++ public available ?

alanlukezic commented 6 years ago

Yes, we plan to release the code in the near future. I will made an announcement here when it will be available.

Survial53 commented 6 years ago

Hello, could you tell me when you are about to publish the source code of CSR-DCF++? The point is that I started migrating the matlab version to c ++ with opencv 3.3.1. And i get two problems:

  1. The conversion of RGB image to HSV in opencv function cv::cvtColor() return slightly different results than matlab function.

  2. For extraction HOG features i use FHOG implementation by Joao Faro or function computeHOG32D() from opencv cv::dpm::DPMDetector Class. And i get result which absolutely does not match matlab fhog() function for same image.

I wonder how you solved these problems in your implementation of CSR-DCF++?

alanlukezic commented 6 years ago

Hi, I hope that it will be available within a month.

1.) Matlab converts an RGB image (all channels from range 0-255) to HSV so that image channels become on range 0-1, therefore the image is multiplied with 255 after it is converted in the tracker source code. According to this page: https://docs.opencv.org/3.3.1/de/d25/imgproc_color_conversions.html OpenCV converts so that S and V channels are on the range 0-1 and H is on 0-360. If you want to use the C++ segmentation code which is available here, you have to put all three channels on the range 0-255.

2.) We used the fhog feature extractor from Piotr Dollar's toolbox, but the code is used via MEX Matlab interface, therefore we wrote a C++ wrapper so that it can be called from C++ source. I think that the HoG feature extractor from OpenCV contrib tracking module could be used as well, but I haven't tested it yet.

dbs0412247 commented 6 years ago

Hi, is there any updates on releasing CSR-DCF++?

alanlukezic commented 6 years ago

The source code for the C++ implementation of the tracker is now available in OpenCV contrib repository (in the tracking module - CSRT tracker)

mmxuan18 commented 6 years ago

i tryed opencv tracking module and read the impl, the update will always return true, i can't get the lost status , is this can be solved?

Survial53 commented 6 years ago

@mlinxiang , In the opencv csr tracker version, this feature is not implemented. You can try implement it as same as in base opencv trackers (like MOSSE). Simple way is add some threshold for tracking window. MOSSE tracker has psrThreshold variable (line 30 in mosseTracker.cpp):

const double psrThreshold=5.7; // no detection, if PSR is smaller than this

And compare (line 198):

Point delta_xy;
double PSR = correlate(image_sub, delta_xy);
if (PSR < psrThreshold)
return false;

Maybe it help you.

mmxuan18 commented 6 years ago

@Survial53 i test the example, the tracking window size change not very immediately, and not auccurate response to camera zoom in or out,, i think the thresh limit may need used to other indicator such as current window region similar to the init window region, but i'm not very familiar to this tracking algorithm, will be implement by official?

mmxuan18 commented 6 years ago

i test this tracker in low texture or repeat texture scene, is very sensitive and position is very insability , bbox shake high frequencey, and position not correct, does any parameters influence the performance?

Survial53 commented 6 years ago

@mlinxiang Ok, first. You do not need to use MOSSE, because it's a bad tracker =) Second. If you look at image CSR-DCF approach from paper Discriminative Correlation Filter Tracker with Channel and Spatial Reliability, you can see there is a peak on final response image (maximum weights in feature map by tracking window). Similar to the approach for Mosse (Visual Object Tracking using Adaptive Correlation Filters, 3.5 Failure Detection and PSR), you can try implement similar method for CSR-DCF algorithm (use weights of response map).

I have plan to implement this method in near future.

mmxuan18 commented 6 years ago

@Survial53 very thanks for reply, i only test csr-dcf not mosse, csr-dcf is very robust for ego-motion, but my case has some low and repeat texture, work not very well