Ask Your Question

alireza.kenarang's profile - activity

2020-06-24 03:59:44 -0600 received badge  Famous Question (source)
2020-04-15 16:52:01 -0600 received badge  Notable Question (source)
2019-04-04 08:04:18 -0600 received badge  Notable Question (source)
2018-12-22 07:24:28 -0600 received badge  Popular Question (source)
2018-07-23 02:57:31 -0600 received badge  Popular Question (source)
2016-11-22 01:40:27 -0600 received badge  Student (source)
2016-11-10 23:12:02 -0600 commented question clear ROI history from kcf tracking in opencv

yes, that won't clear, i solved it. i use Ptr<tracker> tracker = Tracker::create("KCF") every where need to reset.

2016-11-09 22:38:24 -0600 commented answer How to reset or update KCF tracker ROI when it lose the target

thanks for your reply, even though none of these ways aren't a certain and accurate method, but i will try for your second offer. thanks for your guidance.

2016-11-08 00:25:51 -0600 commented answer How to reset or update KCF tracker ROI when it lose the target

what should i do now? have you any new way? it is meaningless and useless if i can't solve this problem. in fact using this algorithm is useless.

2016-11-08 00:21:11 -0600 received badge  Enthusiast
2016-11-07 11:32:28 -0600 commented answer How to reset or update KCF tracker ROI when it lose the target

indeed my target will exit from frame and update function will return true continuous.

2016-11-07 10:46:25 -0600 commented answer How to reset or update KCF tracker ROI when it lose the target

i checked it, when a object was detected it was true but when the tracker lost object it returns true again. it can't understand that it lost object. Do you have check it ever?

2016-11-05 16:53:37 -0600 received badge  Editor (source)
2016-11-05 16:32:10 -0600 asked a question How to reset or update KCF tracker ROI when it lose the target

Hello I am using KCF tracking algorithm, my problem is when the target exit from window, the tracker won't reset and show it's rectangle on edge of window wrongly. in ideal state tracker should delete the rectangle when it lose the target.

These are my codes:

int main(int argc, char** argv) {
        Rect2d roi;
        Mat frame;

        // create a tracker object
        Ptr<Tracker> tracker = Tracker::create("KCF");

        VideoCapture cap("C2_0002.mp4");

        cap >> frame;
        resize(frame, frame, Size(frame.cols / 2, frame.rows / 2));
        roi = selectROI("tracker", frame);
        //quit if ROI was not selected
        if (roi.width == 0 || roi.height == 0)
            return 0;
        // initialize the tracker
        tracker->init(frame, roi);
        // perform the tracking process
        printf("Start the tracking process, press ESC to quit.\n");
        for (;; ) {

                // get frame from the video
            cap >> frame;
            resize(frame, frame, Size(frame.cols / 2, frame.rows / 2));
            // stop the program if no more images
            if (frame.rows == 0 || frame.cols == 0)
                break;
            // update the tracking result
            tracker->update(frame, roi);

            rectangle(frame, roi, Scalar(255, 0, 0), 2, 1);

            imshow("tracker", frame);
            if (waitKey(1) == 27)break;
        }
}

Also you can see a short video of my simulation and see the problem:

www.0up.ir/do.php?downf=4_e2aa9.mp4

(if you can't download it, please copy link and paste it in your browser address bar)

2016-11-05 11:39:02 -0600 asked a question clear ROI history from kcf tracking in opencv

I am using KCF tracking in OpenCV. everything is okay and i can track an object as well, but i have a problem: i set a ROI and algorithm work fine, sometimes i need change my ROI. there for tracker should reset and track my new ROI but it won't. in fact last ROI will remain in history and it effect on new location.

also this is my codes summary, i wrote important lines:

Rect2d roi;
Mat frame;
Ptr<Tracker> tracker = Tracker::create("KCF");
VideoCapture cap("C1_0001.mp4");
cap >> frame;
roi = selectROI("tracker", frame);

if (Condition = true)
{
roi = selectROI("tracker", frame);
}

tracker->init(frame, roi);
for (;; ) 
{
        cap >> frame;
        tracker->update(frame, roi);
}

i want change ROI when Condition is true.

if need i can upload a video clip for more explanation.

2016-08-06 13:21:57 -0600 commented answer tracker errors in opencv3

thanks for your helps, i reinstall it and the problem solve, my tracking module didn't install completely.

2016-08-04 09:11:21 -0600 commented answer tracker errors in opencv3

thanks for your reply, there is 3 question i want ask you:

1- i dont know how i can rebuild from src. could you please show me how i can do it?

2- in opencv_contrib repo i passed all of steps instead of step 8. is it mentioning add lib and include folders to visual stadio?

3- there is a point that is suspicious. after building the install item in opencv.sln , i have just tracking.hpp in ...build\install\include\opencv2\video location (it exist in video folder and i don't have any tracking folder individually). also i don't have tracker module. is it normal?

2016-08-04 04:33:01 -0600 asked a question tracker errors in opencv3

I want to use TLD tracker. So, I installed OpenCV contrib (master), same as here.

I installed OpenCV 3.x on VS2015. Installation process finished completely and, for tracking, it created just tracking.hpp and tracking_c.hpp in ...\include\opencv2\video location.

Also, in lib folder, I just have opencv_ts310d.lib and opencv_world310d.lib.

Now I want to run this tracker algorithm but this line make error:

Ptr < Tracker > tracker = Tracker::create(tracker_algorithm);

In other words, the compiler can't find tracker.