2
0
mirror of https://github.com/boostorg/gil.git synced 2026-01-24 18:02:17 +00:00
Commit Graph

63 Commits

Author SHA1 Message Date
Mateusz Łoskot
0a21d741ce test: Verify core IO headers are self-contained
Looks like skipped by mistake
2021-05-06 23:06:24 +02:00
meshtag
bc3a6c0db9 Add rasterizer support for ellipse (#585)
* Added all standard morphological transformations
* Should handle grayscale dilation/erosion
* Added test cases and improved code structure
* Should handle multichannel images
2021-03-28 21:00:12 +02:00
meshtag
1e8526797e Added all standard morphological transformations (#541)
* Added all standard morphological transformations

* Improved comments and some other things

* Applied adviced changes

* Applied adviced changes

* Should handle grayscale dilation/erosion

* Checking

* Added test cases and improved code structure

* Added command line control

* Added command line control

* Rectified some things

* Rectified some more things

* Improved comments

* Improved comments

* Improved doxygen comments and added more test cases

* Improved compatibility for builds and rectifying whitespace use

* Minor improvement in comments

* Did clang formatting

* pushed enum class inside namespace 'detail' and some other things

* Should handle multichannel images

* Clang formatting attempt

* got rid of if/else comparators for target_element

* Adds morphology.hpp declaration in boost/gil.hpp

* Fix newline

* (std::max)(a, b) instead of std::max(a, b)

* Improved Formatting
2021-02-13 22:01:22 +06:00
theroyn
2e2764225f Support constructing a planar image from interleaved image (#552)
Fixes #478
2021-01-30 21:11:51 +01:00
Cypre55
422ca82fe5 Removed two instaces of boost.mpl (#551)
Removed "#include <boost/mp11/mpl.hpp>"
at include/boost/gil/detail/mp11/hpp
and test/core/pixel/test_fixture.hpp
2021-01-28 22:42:30 +01:00
Mateusz Łoskot
6007d74667 Fix some clang -Wunused-variable warnings 2021-01-28 22:43:31 +01:00
Mateusz Łoskot
063385398f Fix warnings about abs called without std qualification 2021-01-28 22:32:43 +01:00
Olzhas Zhumabek
a37f12b3e9 Add implementation of Hough transforms (#512)
Support construction from step_size, step_count, and a function for angles

Implement angle and radious version of Hough line transform and adds a demo
with static line that goes over secondary diagonal.

Implement incremental line raster
Implement naive line raster
Implement Bresenham line raster
Leave only Bresenham line rasterization

Naive and incremental algorithms were removed because they are supposed
to produce the same results anyway.
The reason for diverging results is inaccuracy of floating point numbers

Add circle rendering through trigonometric functions, using
arctan(1 / (radius + 1)) as minimal angle step.

Trigonometric circle rasterizer does not follow circle equation, but still
produces very round shapes.
A new testing methodology needs to be devised for this rasterizer.

The new version accepts start and points inclusively and tries to use
canonic representation during computations.

Slope decided to be is (diff_y + 1) / (diff_x + 1).
2021-01-25 23:31:39 +01:00
Mateusz Łoskot
81b4dc08bd ci: Add configuration for GitHub Actions (#544)
Add basic GitHub Actions configuration based on mp11
Remove Actions jobs using GCC 4.7 and 4.8 - unsupported compilers
Run b2 with --abbreviate-paths on Windows
The -std=c++1z is broken for clang-4.0 but no need to test it
Add -mbig-obj to GCC on Windows
  - That is to avoid string table overflow and file too big
Define _GLIBCXX_USE_CXX11_ABI=0 for clang 3.5, 3.6, 3.7
  - Should help avoid linker error:
    `undefined reference to std::ios_base::failure::failure(char const*, std::error_code const&)`
Disable certain check in algorithm_channel_relation test for clang<3.8
2021-01-25 02:34:04 +01:00
Debabrata Mandal
a68a95d5f4 Add code for ahe algorithm (#516) 2021-01-24 23:22:48 +01:00
Debabrata Mandal
77255e9e61 Add histogram matching algorithm (#515) 2021-01-24 21:33:38 +01:00
Debabrata Mandal
fb7512c29f Add histogram equalization feature (#514)
Co-authored-by: codejaeger <dhabalm1@>
2021-01-24 21:32:39 +01:00
Debabrata Mandal
3e729e5dae Add histogram class and related functionality (#499)
A new histogram class proposed with close suport for gil
image constructs.

Shift the stl support implmentation to extension to
serve as example for overloading fill_histogram.

Add cumulative histogram and histogram normalization.

Co-authored-by: debabrata1 <debabrata@goodhealthapp.com>
2021-01-24 00:02:51 +01:00
Olzhas Zhumabek
cb5bc9d8c2 Add Perona–Malik anisotropic diffusion algorithm (#500)
The output type must be floating point, thus a check was added to make sure it
is the case. Though I had to add specific cases for float32_t as std::is_floating_point does not
consider it a floating point type

The accumulate part was wrong, it multiplied by delta_t on every sum, which is wrong

Use 8 way nabla compute.
This is just different discretization of Laplace operator
https://en.wikipedia.org/wiki/Discrete_Laplace_operator

Laplace stencils are now the same as in mathematical notation

The new function will provide a uniform way to generate stencils
by making sure directions are indexed properly

Add only required stencil points:
The 5 points Laplace stencil is now adding only required points and not assuming that others are zero
2021-01-22 23:55:17 +01:00
Mateusz Łoskot
470923be36 Fix default ctor of homogeneous_color_base for reference pixel elements (#542)
If `Element` is a reference, then Element v{} is ill-formed.

Refines #273 which aimed to correctly value-initialize channel and pixel value members
2021-01-22 18:01:54 +01:00
Samuel Debionne
f374a672a0 Add image constructor from compatible view (#520)
* Use pixels_are_compatible instead of std::is_convertible
2020-10-11 21:38:36 +02:00
harshitpant1
f7e83e0baf Fix conversion of rgb to signed cmyk(boostorg#479) (#522)
* Fix conversion of rgb to signed cmyk(boostorg#479)

* changed naming of dst_us_t to uint_t and undid the formatting change

* test for conversion of rgb to cmyk, PR #522.

* small formatting changes/fixes

* Build configuration update for PR #522

* removed unused header file
2020-10-10 15:17:47 +02:00
Giovanni Mascellani
f6a35532f0 Fix typo in copyright headers (#521) 2020-10-05 19:40:35 +02:00
Samuel Debionne
05ee4c8cc6 Fix image constructor from other image (#477)
Add image constructor test for constructor from other image type
that exercises the template constructor.
2020-04-11 13:21:21 +02:00
Mateusz Łoskot
446c1a2132 Fix overflow in RGB to CMYK32 conversion (#470)
Correct calculation to correctly map CMYK 0 to minimum
and 1 to maximum of input and output channel types.

If float-point division is necessary, use double instead of float
which may be too narrow for large operands. cmyk32_pixel_t is based on
uint32_t which multiplication by its maximum may yield result too
large to fit 32-bit float.

For example, (uint32_t(c) -  uint32_t(k)) * float(s) for
  c = 4294967295, k = 0, s = 1.0
results in 4294967300 value which does not fit uint32_t.

Fixes #406, but does not fix #479
2020-04-10 19:11:33 +02:00
Samuel Debionne
9b055f285b Add move semantics to image class (#457)
Since we do not require C++17 yet with its `if constexpr
that would discard instantiation of allocator's `operator=`
when the statement is not active, we have to use the tag
dispatching with appropriate used of
`propagate_on_container_move_assignment` and
rebound `allocator_type` to choose the POCMA.

Minor coding style fixes.
2020-04-06 23:50:01 +02:00
Mateusz Łoskot
b9011e10da Replace uses of abs with fabs where applicable 2020-04-06 23:32:38 +02:00
Mateusz Łoskot
c8e77a5636 Test: do not value-initialize member of type of pixel reference 2020-04-06 22:31:12 +02:00
Olzhas Zhumabek
c887d3b60d Move math.hpp constants to detail namespace (#473) 2020-04-01 13:45:28 +02:00
Mateusz Łoskot
f641190948 Replace BOOST_TEST with BOOST_TEST_EQ for streamable operands (#472)
Improve utilities sending channels, pixels and other GIL objects to
output stream for logging of test errors.

Fix missing namespace qualification in IO tests.

Comment TARGA test case with FIXME that was accidentally
uncommented in cc64bdd1a4
2020-04-01 01:54:12 +02:00
Mateusz Łoskot
28a99d7bd7 Add basic tests for default_color_converter_impl specializations
Add static_assert to fail clearly for color space combinations
for which conversions are not supported.
2020-03-31 17:59:28 +02:00
Mateusz Łoskot
dda885e5ff Replace Boost.Test with Boost.LightweightTest in test/ (#459)
Motivation is to:
- use on simpler and light test framework,
- eliminate dependency on libraries like Boost.MPL,
- achieve faster compilation times for CI builds (20% seems feasible)
- have test programs easy to run and debug
- avoid macros

Remove outdated FIXME-s for bugs that have been already fixed.
Fix off-by-one bug in test/core/test_fixture.hpp generators.
Minor corrections and tidying up.

Add missing test assertions to numeric extension tests.
Fixes #458
2020-03-21 22:53:09 +01:00
Mateusz Łoskot
d2b560de74 Remove faber build system scripts as unmaintained 2020-03-20 21:42:36 +01:00
Mateusz Łoskot
54f011476f Add tests for image_view locator and iterators (#452)
* Add tests for image_view locator and iterators

Update follows PR #450 extending tests coverage and
still includes test case for fix of issue #432

* Comment UB if specified increment advances non-incrementable iterator

Add TODO comments asking about clarification of valid pixel range specification
for end iterators, especially of empty view (image).
2020-03-17 00:31:41 +01:00
Olzhas Zhumabek
fba9b062df Fix incorrect assert caught in image_view::col_end (#450)
There may be more assertions that need similar correction.
There are also very basic tests that will check for regression.
2020-03-15 17:14:34 +01:00
Mateusz Łoskot
5f3c00244b Fix missing alignment default value in image constructor (#429)
Fixes #424 blocking PR #423
2020-02-01 18:02:43 +01:00
Mateusz Łoskot
d527916db0 Add test for pixel types with std::uninitialized_fill (#418)
Since `std::uninitialized_fill` performs a placement new on each
element in the range, it is important to ensure core and packed
pixel types behave correctly.

Split general purpose test fixtures into core/test_fixture.hpp.
2020-01-18 11:03:17 +01:00
Mateusz Łoskot
3915c3c030 Move operator<< for packed_pixel to unit_test.hpp 2020-01-13 22:56:47 +01:00
Mateusz Łoskot
cd40a87b83 Replace use of boost/core/lightweight_test.hpp with Boost.Test (#417)
Refactoring to unify use of the common framework across GIL tests.
Merge `unit_test_utility.hpp` into `unit_test.hpp` for convenience.
Add several test cases to `gil::point` tests.
2020-01-13 22:38:06 +01:00
Mateusz Łoskot
79ad37f75a Clean up BOOST_TEST_MODULE values for naming of test suites (#415)
Fix some Jamfile-s to not just `compile` some tests but also `run`, where applicable.
Remove redundant `project` definition from Jamfile-s.
2020-01-09 11:44:25 +01:00
Thiago Henrique Hüpner
94cd5680c2 Prefixed macros with BOOST (#411)
Rename test suite of legacy tests to avoid confusing macro-like `GIL_` prefix.

This is source files only part of fix for #410
2019-12-17 11:43:16 +01:00
Olzhas Zhumabek
62379dd5b9 Implement Sobel and Scharr operators (#392)
* Implement Sobel and Scharr operators

This commit adds Sobel and Scharr
operators with support for 0th and 1st
degrees with other degrees planned for
later

* Migrate and fix Harris example

Generate Harris entries now uses
signed image view.
The Harris corner detector example
now uses the Scharr filter generator
and convolve_2d to reduce amount
of code needed.

* Fix and migrate Hessian example

The Hessian example now uses signed
image views and uses newly added kernel
generators to compute gradients

* Fix Harris and Hessian tests

The tests broke due to migration to
signed views in algorithms, but tests
were not adjusted

* Fix Jamfile for example/sobel_scharr.cpp

* Cosmetic changes

* Commented out fail tests

* Fixed pixel16 used in image16s

In Harris and Hessian tests, unsigned
pixel values was used to construct
signed image, which was causing
appveyor to error out.

* Reenable failing targets

* Unify kernel generator interface

This commit makes all kernel
generator functions to return kernel_2d
and adapts dependant threshold
function to use the new interface

* Migrate Hessian and Harris tests

Migrate Hessian and Harris tests to new
interface for kernel generators

* Migrate Harris and Hessian examples

Harris and Hessian examples now use
new interface for kernel generation

* Migrate simple_kernels tests

simple_kernels are now using kernel_2d
interface

* Add missing return

Normalized mean generation had missing
return at the end of the function

* Adapt code to namespace move

This commit reacts to kernel_2d,
convolve_2d being moved to
namespace detail
2019-10-29 22:38:04 +06:00
MIRAL SHAH
8f1bd53fec Implemented median_filter (#393)
tests for median_filter added
2019-10-15 10:12:54 +05:30
MIRAL SHAH
124f621914 implemented box_filter (#383)
implemented `blur` function

tests added for `box_filter`

closes #382
2019-08-22 00:26:36 +05:30
Olzhas Zhumabek
5c52dff369 Hessian corner detector (#364)
* Hessian plain determinant

This commit partially implements
Hessian corner detector, but only
uses determinant as Hessian response

* Implement full Hessian corner detector

This commit complements last one
by summing in a window and applying
det - k * trace * trace formula to
final Hessian response

* Add docs and make code align with docs

This commit adds docs to new functions,
and makes function and variable names
align with docs to not confuse readers

* Use determinant as response function

A-KAZE uses only determinant in it's
response, and since for now Hessian
is only a mean to advance A-KAZE
implementation, response function is
adjusted to use only determinant

* Create simple test for Hessian detector

This commit adds an s at the end of
function name to make it uniform with
another detector, and adds a simple
test for sanity check

* Improve documentations for d params

dx and similar naming seems to be
confusing, improved documentation
to explain the naming convention

* Address minor comments about style

* Address type based issues

Mostly changes to constness and
integral types, with small cosmetic
changes mixed in

* Fix typo and address review comment

Fixes typo in call for Hessian and
addresses a review comment about
replacing multiple exact indexing
calls to one with a reference

* Reorder includes in Hessian example

* Address review comments

Add literature reference to luminosity
computation, and perform some cosmetic
changes.
2019-08-21 09:37:53 +03:00
Olzhas Zhumabek
65fda3cf7b Harris response computation (#350)
* Restore previous state of Harris

This is a fresh start of branch
Harris with manual copying and
placement of code from previous
versions

* Use supplied weights in Harris

Weights passed as arguments were not
used prior to this commit

* Address review comments

Mostly moving brackets and adding
const, but also address MSVC's
max macro

* Make namespace qualification consistent

In file numeric.hpp, there is
full qualification, but harris.hpp
didn't have full qualification,
thus full qualification is added to
harris.hpp

* Add copyright and license notice
2019-08-21 06:06:29 +03:00
Olzhas Zhumabek
64ceb37b91 Fix inspection issues in image_processing sources and tests (#377)
Add copyright notice and license text
Add protection from the min/max macro.
Closes #374
Closes #375
2019-08-09 10:01:10 +02:00
Mateusz Łoskot
bd12f3cc7d [test] Split pixel_types fixture to integer and float pixel types (#365) 2019-08-06 08:16:11 +02:00
Mateusz Łoskot
5d69ccf987 Cast to int to avoid signed/unsignd mismatch 2019-08-01 01:23:18 +02:00
Mateusz Łoskot
5d3208ec57 Add tests for extension/numeric/channel_numeric_operations.hpp (#340)
Add static assertions to verify channel types are convertible to
expected result type.

Add new and update existing Doxygen comments describing interfaces in
`extension/numeric/channel_numeric_operations.hpp`.
2019-07-25 09:18:51 +02:00
Olzhas Zhumabek
01c39629f8 Filter generation (#342)
* Implement generation of simple kernels

This commits implements mean and
Gaussian kernel generators,
roughly documents them, and has
tests. But tests for Gaussian have
accuracy problem

* Use difference for testing Gaussian

This commit applies percentage based
difference check on generation of
Gaussian kernels, as exact values are
dependant on platform. The error margin
is set to 5% in this commit

* Remove debugging code

In simple_kernels.cpp, there was
some debugging code, mostly streams
related stuff and commented out code,
which is now removed.

* Address review comments

This commit adds inline to kernel
generator functions, uses
std::ptrdiff_t instead of long int,
resolves some conversion warnings
and does small cosmetic changes

* Remove useless iostream include

There was stray include from debugging
code, now removed

* Use \code and \endcode for formula

This commit applies formatting to
formula of normalized mean

* Change are_equal to is_equal

Change a function name in
simple_kernels.cpp test

* Remove redundant function

In simple_kernels.cpp test there was
a function that was not used at all,
now removed

* Cosmetic changes

Mostly opening brackets moved
2019-07-23 06:14:02 +06:00
MIRAL SHAH
6bdc48c615 Otsu threshold implemented (#314)
closes #311
2019-07-20 03:10:25 +05:30
Mateusz Łoskot
516ee84f1c Include <iostream> only if BOOST_GIL_TEST_DEBUG defined [ci skip] 2019-07-18 23:01:20 +02:00
Mateusz Łoskot
584cdd4e23 Modify random_value fixture test to cope with repeated values (seeding issue) 2019-07-18 21:37:39 +02:00
Mateusz Łoskot
dafcaa169e Extract GIL-specific Boost.Test utilities from test/unit_test.hpp (#338)
Add separate header `test/unit_test_utility.hpp` for printers and
other utilities for better integration of GIL types with Boost.Test.
2019-07-18 17:49:05 +02:00