What is the fastest way to eliminate noise in the frames ?
1 次查看(过去 30 天)
显示 更早的评论
What is the fastest way to eliminate noise in frames for real time applications?
I am asking specifically what is the fastest for noisy pixels for real time app?
7 个评论
Walter Roberson
2023-10-4
Are we to understand that this is a question related to Simulink Real-time Toolbox for running on Speedgoat hardware? Or are you using the Linux distribution that was designed to support real-time extensions and you are using MATLAB Coder to generate the code framework with dynamic memory allocation turned off? (You can't do real-time work when there is a variable amount of time needed to allocate memory.)
回答(1 个)
Walter Roberson
2023-10-9
What is the fastest way to eliminate noise in frames for real time applications?
The fastest way is to use zeros() to set the output to a constant value.
When you use zeros() specifically (no other function!) then internal short-cuts are used which save time in memory allocation.
But you should do timing tests comparing to calling https://www.mathworks.com/matlabcentral/fileexchange/31362-uninit-create-an-uninitialized-variable-like-zeros-but-faster which just might be slightly faster... not necessarily. Although uninitialized arrays should in theory be faster (since the operating system just needs to return the pointer to the area), it is common for memory controllers to have a Demand Zero memory allocation function that uses hardware assistance to zero the memory.
To be more explicit: the fastest way is to set the output to a constant without looking at the input at all -- and it is common for the special constant 0 to be the fastest constant to use to initialize.
If you want the input to somehow control the output, then the fastest thing to do is to use as little as the input as possible and do as little calculation with it as possible. Depending on the hardware, keeping all of the calculation within 8 bytes (one doublee) or 64 bytes or 128 bytes (varies with CPU) is fastest (a single "cache-line")
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing and Computer Vision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!