boostorg / boostorg/gil

Matrix like type for GIL

Open
#622 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
199
Forks
171
Avg merge
1d 14h
Merged PRs (30d)
10

Description

### Is your feature request related to a problem? Please describe.

Yes. Due to requests in #204 and #615 , it is clear that there is serious need for some sort of matrix like type that is not normalized by default. Image processing and related functionality is in a dire need of this.

### Describe the solution you'd like

#### C++ Example

```cpp
// just 2D matrix of floats
using matrix32f = boost::gil::image>;
using matrix32f_view = decltype(boost::gil::view(std::declval()));

template
float saturate_cast(GrayPixel pixel);
template
GrayPixel saturate_cast(float matrix_cell);

// often needed to convert to/from images read from disk
template
void value_preserving_copy(GrayImageView source, matrix32f_view destination);

template
void saturate_cast_copy(matrix32f_view destination, GrayImageView source);
```

### Describe alternatives you've considered

It is also possible to just implement the following:

```cpp
template
void normalize_copy(GrayImageView source, gray32f_view_t destination);

template
void denormalize_copy(gray32f_view_t source, GrayImageView destination);
```

### Additional context

I believe having just `matrix32f` will be enough for starters. Most of the CV and IP computations are done in floats anyway.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.