Ask Your Question

Kroll's profile - activity

2018-07-30 03:13:23 -0600 received badge  Supporter (source)
2018-07-30 03:13:20 -0600 marked best answer How to sort std::vector<cv::Rect>?

Trying to sort ROI rectangles from left to right.

auto compare = [](const void* p1, const void* p2) -> int
{
    const int* p1x = &(((const cv::Rect*)p1)->width);
    const int* p2x = &(((const cv::Rect*)p2)->width);
    return (*p2x) - (*p1x);
};
qsort(&vec, vec.size(), sizeof(cv::Rect), compare);

But ->width gives the wrong values.

2018-07-30 03:13:20 -0600 received badge  Scholar (source)
2018-07-30 03:12:59 -0600 commented answer How to sort std::vector<cv::Rect>?

Broke my head :) Forgot about return :) About app crash: now I change the comparator from int to bool and crash is gone

2018-07-30 03:12:38 -0600 commented answer How to sort std::vector<cv::Rect>?

Broke my head :) Forgot about return :) About app crash: now I change the comparator from int to bool and crash is gone

2018-07-30 02:16:23 -0600 commented answer How to sort std::vector<cv::Rect>?

I try this: auto compare = [](const cv::Rect &a, const cv::Rect &b) -> int { a.x - b.x;

2018-07-30 02:15:58 -0600 commented answer How to sort std::vector<cv::Rect>?

I try this: auto compare = -> int { a.x - b.x; }; std::sort(empty_and_right_props.b

2018-07-29 23:23:45 -0600 asked a question How to sort std::vector<cv::Rect>?

How to sort std::vector<cv::rect>? Trying to sort ROI rectangles from left to right. auto compare = [](const void

2018-07-24 09:36:56 -0600 commented answer How to call imshow("", cv::Mat) from a function passed to void* ptr of trackbar callback?

@StevenPuttemans I know that OpenCV with Qt support but just noted it is 100% not my Qt error. I don't know in which cas

2018-07-24 09:20:58 -0600 received badge  Editor (source)
2018-07-24 09:20:58 -0600 edited question Why does the namedWindow in member constructor freeze the application?

Why does the namedWindow in member constructor freezes the application? I prepared some working code for reproduce the i

2018-07-24 09:09:47 -0600 asked a question Why does the namedWindow in member constructor freeze the application?

Why does the namedWindow in member constructor freezes the application? I prepared some working code for reproduce the i

2018-07-24 03:40:32 -0600 commented answer How to call imshow("", cv::Mat) from a function passed to void* ptr of trackbar callback?

I have no Qt in this project. I find out intresting thing for my purpose. Basicaly I need to wedge to a part of code and

2018-07-24 02:01:53 -0600 commented answer How to call imshow("", cv::Mat) from a function passed to void* ptr of trackbar callback?

Like this QObject::startTimer: Timers cannot be started from another thread if i call cv::waitKey(30).

2018-07-24 01:54:15 -0600 commented answer How to call imshow("", cv::Mat) from a function passed to void* ptr of trackbar callback?

Like this QObject::startTimer: Timers cannot be started from another if i call cv::waitKey(30).

2018-07-24 01:53:44 -0600 commented answer How to call imshow("", cv::Mat) from a function passed to void* ptr of trackbar callback?

It is qite bit complicated to provide it clean and interesting part. I create a member cv::VideoCapture in first object

2018-07-24 01:33:21 -0600 marked best answer How to call imshow("", cv::Mat) from a function passed to void* ptr of trackbar callback?

I have a local cv::Mat image in my class member function. Then I make some settings to create a named window and a trackbar.

I need to pass contents of this local image variable to the handler function for threshold it by slider and cv::imshow("window", thrshld);

My tries gave me only segfaults. I used lambdas, std::function and std::shared_ptr<cv::mat>.

Please, help!

2018-07-23 07:39:35 -0600 commented answer How to call imshow("", cv::Mat) from a function passed to void* ptr of trackbar callback?

I catched the void* param and this image have 0x0 size. With same momory address of class member cv::Mat I passed to voi

2018-07-23 05:52:37 -0600 asked a question How to call imshow("", cv::Mat) from a function passed to void* ptr of trackbar callback?

How to call imshow("", cv::Mat) from a function passed to void* ptr of trackbar callback? I have a local cv::Mat image i