Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useBackgroundBufferMutex = 0 is default #10

Open
mhantke opened this issue Oct 10, 2014 · 3 comments
Open

useBackgroundBufferMutex = 0 is default #10

mhantke opened this issue Oct 10, 2014 · 3 comments
Labels

Comments

@mhantke
Copy link
Contributor

mhantke commented Oct 10, 2014

Why do we use useBackgroundBufferMutex = 0 as a default? Isn't that risky? This was probably done in the sake of backwards compatibility. I suggest to change it to 1.

@cnettel
Copy link
Contributor

cnettel commented Oct 10, 2014

It’s a bit risky. It is also slow to turn it on. I seem to remember that the mutex is held for quite a while. One should at least do a benchmark to see how severe the effect is with heavy threading.

/Carl

Från: Max Hantke [mailto:[email protected]]
Skickat: den 10 oktober 2014 13:34
Till: antonbarty/cheetah
Ämne: [cheetah] useBackgroundBufferMutex = 0 is default (#10)

Why do we use useBackgroundBufferMutex = 0 as a default? Isn't that risky? This was probably done in the sake of backwards compatibility. I suggest to change it to 1.


Reply to this email directly or view it on GitHubhttps://github.com/antonbarty/cheetah/issues/10.

@antonbarty
Copy link
Owner

It is risky for a perfect calculation.

It also slows things down. And since the running background is an average over the last few events presumably it doesn’t matter much from one pixel to the next whether the average/median is calculated over events [n-1:n-51] or [n:n-50]. So in the interests of speed I often get by with it turned off…

But you are right - strictly speaking this could result in things getting out of sync, for example with different parts of the background calculated over different sets of images. Whether it really matters in this case is another question.

A

On 10 Oct 2014, at 04:34, Max Hantke [email protected] wrote:

Why do we use useBackgroundBufferMutex = 0 as a default? Isn't that risky? This was probably done in the sake of backwards compatibility. I suggest to change it to 1.


Reply to this email directly or view it on GitHub.

@mhantke
Copy link
Contributor Author

mhantke commented Oct 11, 2014

I agree with you that we should keep the option to increase performance if
needed. But I would like to set the default value to controlled conditions.
Especially for the naive user would be more intuitive.
/Max

On Sat, Oct 11, 2014 at 4:21 AM, Anton Barty [email protected]
wrote:

It is risky for a perfect calculation.

It also slows things down. And since the running background is an average
over the last few events presumably it doesn’t matter much from one pixel
to the next whether the average/median is calculated over events [n-1:n-51]
or [n:n-50]. So in the interests of speed I often get by with it turned
off…

But you are right - strictly speaking this could result in things getting
out of sync, for example with different parts of the background calculated
over different sets of images. Whether it really matters in this case is
another question.

A

On 10 Oct 2014, at 04:34, Max Hantke [email protected] wrote:

Why do we use useBackgroundBufferMutex = 0 as a default? Isn't that
risky? This was probably done in the sake of backwards compatibility. I
suggest to change it to 1.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
https://github.com/antonbarty/cheetah/issues/10#issuecomment-58735045.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants