Git Product home page Git Product logo

blazing-gil's People

Contributors

ac130kz avatar akylzhan avatar simmplecoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ac130kz akylzhan

blazing-gil's Issues

Add tests

Add baseline sanity tests for all targets.

  1. For gradient based targets, create simple images with countours. When tested, check if neighboring pixels to contour are non-zero.

  2. For anisotropic diffusion, check with OpenCV or similar for fixed amount of test cases.

  3. For scaling, do the same as for 2.

Add documentation

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.

Implement as_matrix_channeled

Movitvation

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.

Behavior

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

Parameters will be duplicated from as_matrix

Return value

Resulting CustomMatrix with StaticVector<ChannelType, num_channel> as elements.

Implement video decoder

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.

Implement from_matrix

Motivation

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).

Behavior

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

Overloads

One overload where the image will be returned, one where user needs to pass an out view parameter.

Parameters

data - the source to convert into image
view - the view to write into in the second overload

Return value

The converted image, or nothing in second overload.

Explore GPU compute opportunities

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.

Implement to_matrix

Motivation

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.

Behavior

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

Overloads

It must have two overloads: one where a new matrix is created and one where there is an out argument matrix passed by reference.

Parameters

view - the source view to convert into matrix

result - an out argument to write the matrix into in overload the supports it

Return value

The resulting matrix in overload without out argument and nothing otherwise.

Implement and test as_matrix

Motivation

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.

Behavior

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

Overloads

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.

Parameters

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.

Return value

The resulting CustomMatrix.

Improve anisotropic diffusion features

  • Add tests (heat loss test)
  • Add more diffusion functions with test (test should be the output being between 0 and 1)
  • Add more laplacian stencils (related to another PR)
  • Better docs
  • Better demo

Add CI setup

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.

Convert image_matrix from Matrix<T> to Matrix<Vector<T, ChannelCount>>

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.