Ask Your Question

Michael Burdinov's profile - activity

2020-02-19 04:30:36 -0500 received badge  Famous Question (source)
2019-12-17 21:43:08 -0500 received badge  Taxonomist
2019-10-31 21:04:42 -0500 received badge  Nice Answer (source)
2019-09-16 15:35:00 -0500 marked best answer Is there penalty for reference counting in Mat?

Recently I read Herb Sutter's paper Optimizations That Aren't (In a Multithreaded World) and discovered that reference counting (that should be an optimization) may cause huge performance loss if program is multithread-safe (even if it is running in single thread). That is exactly my situation: I write programs that run in single thread but they are part of complex multithreaded process.

So my questions are: Is Mat multithread safe? Is there penalty for reference counting? If yes, how big it is?

2019-04-29 12:16:37 -0500 received badge  Nice Answer (source)
2019-04-18 06:04:44 -0500 received badge  Nice Answer (source)
2018-12-13 05:29:23 -0500 received badge  Good Answer (source)
2018-08-09 04:59:37 -0500 received badge  Nice Answer (source)
2018-02-04 06:53:04 -0500 received badge  Nice Answer (source)
2018-01-06 05:09:17 -0500 received badge  Good Answer (source)
2017-10-22 13:02:41 -0500 received badge  Good Answer (source)
2017-05-29 05:06:00 -0500 received badge  Nice Answer (source)
2016-11-03 04:37:06 -0500 received badge  Nice Answer (source)
2016-09-14 03:38:27 -0500 received badge  Good Answer (source)
2016-05-27 15:19:44 -0500 received badge  Nice Answer (source)
2016-04-23 22:51:16 -0500 received badge  Nice Answer (source)
2016-03-28 12:53:06 -0500 received badge  Good Answer (source)
2016-01-28 01:08:53 -0500 received badge  Notable Question (source)
2016-01-25 17:39:16 -0500 received badge  Nice Answer (source)
2015-10-03 02:46:01 -0500 received badge  Nice Answer (source)
2015-09-26 07:23:12 -0500 received badge  Nice Answer (source)
2015-08-26 11:23:53 -0500 received badge  Good Answer (source)
2015-08-02 15:52:56 -0500 received badge  Guru (source)
2015-08-02 15:52:56 -0500 received badge  Great Answer (source)
2015-06-18 08:20:10 -0500 received badge  Nice Answer (source)
2015-06-05 02:21:26 -0500 received badge  Good Answer (source)
2015-06-03 05:03:04 -0500 marked best answer How to enable vectorization in OpenCV?

I have 2 questions:

  1. I want the OpenCV to use vectorization whenever possible. How can i do that? (I don't have IPP).

  2. If I enable TBB option in OpenCV build, are resulting programs will try to create multiple threads by default? Is there a way to control it (sometimes the program must run in single thread, and sometimes it can use more)?

2015-05-22 14:41:49 -0500 received badge  Nice Answer (source)
2015-05-09 05:24:27 -0500 received badge  Good Answer (source)
2015-02-13 15:26:28 -0500 marked best answer How to use parallel_for?

In release notes for version 2.4.3 I discovered that OpenCV has build in parallel_for, but I can't find any documentation for it. Anyone know about its documentation or examples of use?

2015-02-04 00:09:35 -0500 commented answer Filling elements

You are welcome. What was that another way that you found?

2015-02-02 08:00:57 -0500 received badge  Nice Answer (source)
2015-02-02 03:48:43 -0500 answered a question FindHomography

FindHomography need to calculate perspective transform. Perspective transform has 8 parameters. This means that it requires at least 8 equations to get single solution. In other words you need to provide at least 4 pairs of points to FindHomography.

Edit: Just having 4 pairs of points is not enough. System of 8 equations with 8 unknown variables can't be solved if there linear dependence between equations. The points you used are on the same line. This create linear dependence and makes the system unsolvable. You should not use co-linear segments.

2015-02-02 02:53:51 -0500 answered a question Filling elements

What you actually need is to find outermost contours in black-white image and then draw them. This way you won't have holes in objects. First task can be done by findContours function. Second, by drawContours function.

vector<vector<Point> > contours;
findContours(bwImage, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE);
drawContours(bwImage, contours, -1, Scalar(255), CV_FILLED);