Boost logo

Boost :

From: prathamesh tagore (prathameshtagore_at_[hidden])
Date: 2021-06-21 17:27:14


Week 2 (14/06/21 - 21/06/21)
1. I sketched a benchmark for comparing opencv's correlation API with Gil's
API. This (
https://github.com/meshtag/gil/blob/benchmark_opencv/benchmark/celero/convolve_2d.cpp)
is the link to that file.This(
https://github.com/meshtag/gil/blob/benchmark_opencv/benchmark/celero/Screenshot%20from%202021-06-21%2022-33-31.png)
is the screenshot of output obtained from the benchmark.

Note : Please install opencv on your system and link opencv related
dependencies manually while building. Code for obtaining additional
dependencies used in benchmark is added in CmakeLists.txt of the root
folder in the same branch. Used images are also available in the same
directory as benchmark.

2. Improved performance of this(
https://github.com/meshtag/gil/blob/rotate_buffer/include/boost/gil/extension/numeric/convolve_novel.hpp)
version from 60-65 iterations/sec to 80-85 iterations/sec. Benchmark file
for obtaining above mentioned figures is present here(
https://github.com/meshtag/gil/blob/rotate_buffer/benchmark/celero/convolve_2d.cpp
).
Since performance of these initial primitive versions is not anywhere close
to what we would want, I have not documented their approach in a .RST file
or something similar at the moment. I think mentioning them while
documenting the final approach would be better. Is that fine?

3. I studied opencv's approach used in "filter2D()" as instructed by
Olzhas. This will probably help us to determine our next step on the path
of optimization.
Currently, I am stuck and need help deciding how to optimise further. We
will be discussing this in our next meeting and hopefully will solve the
issue.

On Mon, Jun 14, 2021 at 10:42 PM prathamesh tagore <
prathameshtagore_at_[hidden]> wrote:

> Week 1 (07/06/21 - 14/06/21) :
> 1. I wrote a celero benchmark for existing implementation of 2D
> convolution which will be considered as a baseline for comparing all
> different versions of modifications. Source code for this benchmark can be
> found here(
> https://github.com/meshtag/gil/blob/benchmark_convolve_2D/benchmark/celero/convolve_2d.cpp
> ).
>
> 2. I implemented this(
> https://github.com/meshtag/gil/blob/testing/Screenshot%20from%202021-06-03%2012-20-07.png)
> version for 2D correlation and compared it with the current version.
> Performance of the modified version is not what I expected (probably due to
> slow traversal of 1D view pixel iterators). This (
> https://github.com/meshtag/gil/blob/conv2D_1st_Version/benchmark/celero/convolve_2d.cpp)
> file contains a celero benchmark comparing the modified and existing
> version. Source code of the modified version is present here(
> https://github.com/meshtag/gil/blob/conv2D_1st_Version/include/boost/gil/extension/numeric/convolve_novel.hpp)
> in the same branch.
>
> 3. I also tried a modified version of the previous algorithm. Major
> difference between this version and the previous one is that the former
> does not capture all individual elements of a subimage_view while
> calculating the correlation output for a new pixel in dst_view. Instead, it
> rotates the buffer vector and updates it with values of one new column
> only. Its source code is present here (
> https://github.com/meshtag/gil/blob/rotate_buffer/include/boost/gil/extension/numeric/convolve_novel.hpp).
> The benchmark file comparing this version with the original version is here
> (
> https://github.com/meshtag/gil/blob/rotate_buffer/benchmark/celero/convolve_2d.cpp
> ).
>
> Performance of both modified versions is nowhere close to what we would
> want, however we can improve their structure iteratively. I have not
> cleaned(add comments/remove debug statements etc.) from source files as
> they are currently under heavy experimentation.
> As of now, modified versions are not yet tested extensively on all types
> of images.
>
> Note :
> We need additional dependencies for compiling benchmark files, I have
> added them in CMakeLists.txt of the root folder in the same branch.
> Specifying build type while building benchmarks is also necessary.
>
> On Mon, Jun 14, 2021 at 10:39 PM prathamesh tagore <
> prathameshtagore_at_[hidden]> wrote:
>
>> This thread will contain weekly updates for my work during coding period
>> of GSoC 2021.
>>
>


Boost list run by Boost-Gil-Owners