simmplecoder / blazing-gil Goto Github PK
View Code? Open in Web Editor NEWA collection of image processing and computer vision algorithms in C++17 using Boost.GIL and Blaze linear algebra library
A collection of image processing and computer vision algorithms in C++17 using Boost.GIL and Blaze linear algebra library
Add baseline sanity tests for all targets.
For gradient based targets, create simple images with countours. When tested, check if neighboring pixels to contour are non-zero.
For anisotropic diffusion, check with OpenCV or similar for fixed amount of test cases.
For scaling, do the same as for 2.
Add in-code documentation, probably doxygen style to at least allow vscode with clangd and other language servers to parse the documentation and increase usability.
Basic explanation https://gist.github.com/gitaarik/8735255
Examples aren't very user friendly without a good command line arguments parser.
Candidates:
Having only single channel view conversions can be limiting quite a bit, and there are algorithms that work uniformly in both scalar and channeled mode.
boost::gil::rgb8_image_t image = /*initialization*/;
auto view = boost::gil::view(image);
// the type of matrix_view is blaze::CustomMatrix<blaze::StaticVector<std::uint8_t, 3>>
auto matrix_view = flash::as_matrix_channeled(view);
matrix_view(0, 1) = {100, 100 ,100}; //reflected in view(1, 0)
view(2, 3) = boost::gil::rgb8_pixel_t(100, 100, 100); //reflected in matrix_view(3, 2)
Parameters will be duplicated from as_matrix
Resulting CustomMatrix
with StaticVector<ChannelType, num_channel>
as elements.
Images are nice, but things like tracking an object is more interesting and easier to test with video inputs. A simple frame by frame decoder should suffice. libav and ffmpeg are the primary options for the decoder backend.
Although as_matrix
is a good solution, sometimes there is a need for plain old loops. Using as_matrix
is still recommended though (once there will be a compatibility layer for layout incompatible types).
blaze::DynamicMatrix<blaze::StaticVector<std::uint8_t, 3>> matrix(16, 16, {255, 255, 255});
auto image = flash::from_matrix<gil::rgb8_image_t>(matrix); //results in white image
One overload where the image will be returned, one where user needs to pass an out view parameter.
data
- the source to convert into image
view
- the view to write into in the second overload
The converted image, or nothing in second overload.
Data parallel computations, like in case of anisotropic diffusion, could be accelerated with GPU frameworks like CUDA or OpenCL. Candidate library should support matrices, vectors, BLAS operations and some customization options to roll out own operations.
It is often easier to just copy the image into aligned and padded matrix, then just copy back when the processing is done. The proportion of time spend copying around shrinks with processing time, and is usually insignificant amount.
auto image = /*initialization*/;
auto view = boost::gil::view(image);
auto matrix = to_matrix(view);
matrix_view(0, 0) = 12; // does not change the original image
It must have two overloads: one where a new matrix is created and one where there is an out argument matrix passed by reference.
view
- the source view to convert into matrix
result
- an out argument to write the matrix into in overload the supports it
The resulting matrix in overload without out argument and nothing otherwise.
Change interface as described in this docs.
Sometimes one needs an image to behave like a matrix for small computations, changes and writing the result back. It is also useful for sending read-only data into algorithms, as no copy will be made.
This function will be used to model pointer casting behavior, e.g. when doing this:
auto image = /*initialization*/;
auto view = boost::gil::view(image);
auto matrix_view = as_matrix(view);
matrix_view(0, 0) = 12; // will change first pixel in the image
matrix_view(0, 1) = 15; // will change view(1, 0) pixel, note that Blaze has different indexing
Since this is basically pointer cast, there will be no overloads with out parameters, as that would make little sense. Use GIL's copy algorithms for that purpose.
IsAligned
- a template flag parameter for specifying if the resulting CustomMatrix
is aligned (e.g. was the image created in aligned storage upon the start). The default is unaligned.
IsPadded
-a template flag parameter specifies if the image is padded with stub pixels. The default is unpadded.
StorageOrder
- a template bool parameter that specifies whether the image is stored in rowMajor
(if true
, default) or columnMajor
order.
SingleChannelView
- a single channel image view to create CustomMatrix
from.
The resulting CustomMatrix
.
Add at least a simple CI setup that will pull Blaze, GIL and blazing-gil, compile all examples and tests. Running the tests will be left for later.
At the moment, channels are disregarded completely. It is important to have uniform algorithms, thus a common denominator is chosen.
Implement multi-channel image to DynamicMatrix<Vector<ChannelType, NumChannels>>
conversion
Implement DynamicMatrix<Vector<ChannelType, NumChannels>>
to multi-channel image conversion
Port core.hpp
to new functions
Port scaling.hpp
to new functions
Port convolution.hpp
to new functions
Port numeric.hpp
to new functions
This issue will track progress and notes on the scaling algorithms.
This should improve the user interface and be inline with Blaze's recommendations.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.