Commit Graph

849 Commits

Author SHA1 Message Date
Jan Houska
48e35c147f Removed asserts and replaced by exceptions for checking of runtime errors (#369)
The runtime errors such as zero-length file or disk full.
Unified error message wording.
2019-08-09 10:04:17 +02: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
MIRAL SHAH
ca696ce6d0
Added 2D convolution definitions to numeric extension (#367)
2D convolution tests added

`convolve` function renamed to `convolve_1d`

closes #356
2019-08-09 03:17:09 +05:30
Mateusz Łoskot
499d30ff98
inspect: Add missing Boost license info and copyright notice in conanfile.txt 2019-08-08 22:18:57 +02:00
Mateusz Łoskot
a895b5eb55
Add tests for extension/numeric/pixel_numeric_operations.hpp (#372)
Add new and update existing Doxygen comments describing interfaces in
`extension/numeric/pixel_numeric_operations.hpp`.
2019-08-08 11:10:20 +02:00
Mateusz Łoskot
21fce27b9a
Delete deprecated .github/ISSUE_TEMPLATE.md [ci skip]
Replaced with new templates generated using the templates builder,
recommended by GitHub.

[ci skip]
2019-08-08 00:47:44 +02:00
Mateusz Łoskot
b365cc2339 Update issue templates: feature request [ci skip]
Using the recommended GitHub templates builder

[ci skip]
2019-08-08 00:46:55 +02:00
Mateusz Łoskot
5c5fdc068d Update issue templates: bug report
Using the multiple issue templates builder
2019-08-08 00:42:10 +02:00
Mateusz Łoskot
8b58ef051d
Tidy up comma followed by whitespace 2019-08-08 00:09:37 +02:00
Mateusz Łoskot
2607795221
Add test for three color types of PNG with tRNS chunk (#125)
The tests cover issue #117 and pull request #118, extending the coverage
for all color types that may have tRNS chunks:

  - color type 0 (grayscale), the tRNS chunk contains a single gray level
  - color type 2 (truecolor), the tRNS chunk contains a single RGB color
  - color type 3 (indexed color), the tRNS chunk contains a series of
    one-byte alpha values

Add sample PNG files from the "official" test-suite for PNG
created by Willem van Schaik.

Add <define>BOOST_GIL_IO_TEST_ALLOW_READING_IMAGES to Jamfile for PNG tests.
NOTE: Deliberately not defined BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
as it seems to require some extra configuration, currently it causes
some tests to fail. So, Jamfile likely needs more updates and clean-up.

Closes #120
2019-08-07 22:33:21 +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
8d3d174e4c
[appveyor] Switch all jobs to VS2017 image (#366) 2019-08-05 23:11:47 +02:00
Mateusz Łoskot
308e4eafa4
Fix Sphinx syntax of code-block directive 2019-08-05 12:31:43 +02:00
MIRAL SHAH
11c897bb07
2D kernel support added to numeric extension (#361)
Tests for 2D numeric kernel added
2019-08-04 19:46:47 +05:30
Mateusz Łoskot
5d69ccf987
Cast to int to avoid signed/unsignd mismatch 2019-08-01 01:23:18 +02:00
Mateusz Łoskot
8815ab0554
Clarify correlation as cross-correlation and convolution as spatial convolution (#339) [ci skip]
Discussion at https://lists.boost.org/boost-gil/2019/07/0268.php

[ci skip]
2019-07-30 15:01:41 +02:00
Mateusz Łoskot
8b616b686c
Clarify what flavours of PNM formats can be read and written (#358) 2019-07-30 08:11:26 +02:00
Mateusz Łoskot
67ac10d3ab
Rename test/extension/numeric/convolve_2d.cpp to convolve.cpp (#357)
Accommodate to @miralshah365 's plan in #356 to add `convolve` function.
2019-07-30 08:10:40 +02:00
Mateusz Łoskot
348fd6942e
Include <boost/gil.hpp> in examples (#355)
A typical user is supposed to include the main header and
to not know the library enough to include headers selectively.
2019-07-29 20:49:32 +02:00
Mateusz Łoskot
d0c474eb37
Remove test/extension/io/images/pnm/readme.txt [ci skip]
There is no value in it. Contributors will ask on list or GitHub anyway.
2019-07-27 00:18:12 +02:00
MIRAL SHAH
5f005b0692
Add adaptive threshold algorithm using mean method (#341)
* Mean adaptive threshold implemented with the example
Implements #315
2019-07-26 01:36:43 +05:30
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
Mateusz Łoskot
c2b406d907
Update docs for threshold_binary function and enums [ci skip] (#333)
Prefer C++ style comments for Doxygen.
2019-07-23 07:46:58 +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
Mateusz Łoskot
f2d0958e26
Fix implicitly-declared copy constructor is deprecated in planar_pixel_reference.hpp
Add TODO comment on: What is the purpose of returning via const reference?
2019-07-22 23:24:38 +02:00
Mateusz Łoskot
f0278957e7
Fix implicitly-declared assignment operator is deprecated in planar_pixel_reference.hpp
Rename abbreviated template parameters to more self-descriptive names.
Tidy up formatting and code flow for readability.
2019-07-22 23:12:37 +02:00
Mateusz Łoskot
1bbd9bed37
Fix implicitly-declared assignment operator is deprecated in virtual_locator.hpp
Avoid discouraged naming with leading underscore for class member variables.

Rename cryptic `_p` member variable as `y_pos_` to clearly indicate its
purpose as current position of `y_iterator`.
Rename abbreviated template parameters to more self-descriptive names (e.g.
Deref to DerefFn to indicate it is type of a function object).

Remove superfluous `public` keywords from base types fo struct-s.
Tidy up formatting and code flow for readability.
2019-07-22 23:08:39 +02:00
Mateusz Łoskot
ee7e4b1a5e
Fix implicitly-declared assignment operator is deprecated in channel.hpp 2019-07-22 23:04:36 +02:00
Mateusz Łoskot
793fbbd28d
Fix implicitly-declared assignment operator is deprecated in extension/numeric/kernel.hpp
Avoid discouraged naming with leading underscore for class member variables.
Avoid abbreviations in names.
Add assertions checks for non-empty kernel.
2019-07-22 23:02:39 +02:00
Mateusz Łoskot
ddea00494e
Ignore -Wconversion from Boost.Iterator headers
Fixes annoying warnings from third-party Boost headers.
2019-07-22 22:03:45 +02:00
Mateusz Łoskot
ff82646802
Remove unused result_channel_t type alias from threshold.hpp
Fixes compiler warning:

  typedef `using result_channel_t = typename boost::gil::channel_type<XIt>::type`
    locally defined but not used [-Wunused-local-typedefs]
2019-07-22 21:44:44 +02:00
Mateusz Łoskot
e0f2787312
Prefer x_coord_t and y_coord_t aliases for values of image_view dimensions
Fixes annoying compiler warnings that implicit conversion from `y_coord_t`
`{aka long int}` to `int` may change value `[-Wconversion]`.
Add missing #include <type_traits>.

Rename `rr` to `y` to clarify it is vertical indexing of pixel lines,
it also indicates the correspondence with y_coord_t  better.
Rename CamelCase, incorrectly introduced in 055ee947a0,
for using-declared type aliases to `lower_case_t` convention.

Add Doxygen comments and placeholders for documentation content to fill.
Tidy up formatting and code flow for readability.
2019-07-22 21:12:18 +02:00
Mateusz Łoskot
1d4267d520
Assert user-specified positions within image or image_view are in range (#344)
These assertions validating user-specified x and y values for pixel
positions at run-time should help GIL users to catch basic mistakes
as early as possible, especially during complex processing algorithms.
(Easy to make a mistake calling `view(y, x)` instead of `view(x, y)`!)

The checks are deliberately implemented using assertions as debug-only
tools disabled in `NDEBUG` builds, and not as exceptions to avoid
potentially significant performance hit at run-time in optimised builds.

Add `TODO` comments where certain assumptions are not immediately
obvious and may require further testing to clarify and documenting.
For example, what are constraints on requesting locators with
negative offsets using `image_view::xy_at`?

Tidy up image.hpp and image_view.hpp formatting vertically rather than
horizontally with very long lines, align return statements to left for
immediate display what is calculated and returned, instead of hiding it
behind the right margin.
2019-07-22 19:26:36 +02:00
Mateusz Łoskot
90e5e1738f
Add test for convolve function from Numeric extension (#349)
Minimal test for new function added in #347 (with identity kernel only).
2019-07-22 18:59:21 +02:00
Mateusz Łoskot
055ee947a0
Clean up and refactor extension/numeric/convolve.hpp
- Tidy up formatting and code flow for readability
- Rename parameters for clarify, avoiding abbreviations
- Rename typedefs in CamelCase style instead of UPPER_CASE
- Add Doxygen comments and placeholders for documentation content to fill
2019-07-22 13:23:24 +02:00
Pranam Lashkari
2c4529ed95 Add convolve function in Numeric extension (#347)
This function combines both `convolve_rows` and `convolve_cols` into
single call for user convenience
2019-07-22 11:20:57 +02:00
Mateusz Łoskot
d86e4a4dec
Bump Sphinx version from 1.7.9 to 2.1 (#346)
Fixes #345
2019-07-22 01:49:47 +02:00
Mateusz Łoskot
5c1754bc2f
Link to documentation built from develop in README [ci skip] 2019-07-22 01:43:14 +02:00
Mateusz Łoskot
24468697f5
[travis] Dump version of installed Sphinx 2019-07-22 00:20:11 +02:00
Mateusz Łoskot
6b181acce2
[doc] Split tutorial into separate documents for quickstart section [ci skip] (#325)
Split the table of contents into two section:
  - Quickstart materials
  - Detailed documentation
Move doc/before_after.dox to tutorial/histogram.rst (closes #286).
Tidy up tutorial reST paragraphs, mark-up and code samples.
2019-07-21 20:54:03 +02: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
89436c9cdc
Include boost/core/typeinfo.hpp where used
Refines #338
2019-07-18 19:57:19 +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
Mateusz Łoskot
69adf0e8a5
Fix ENABLE_GRAY_ALPHA macro name to BOOST_GIL_IO_ENABLE_GRAY_ALPHA 2019-07-17 22:05:13 +02:00
MIRAL SHAH
8234329237
New threshold tests added for multi-channel views 2019-07-18 01:32:29 +05:30
Mateusz Łoskot
d7884ee1a6
Fix parameters type of subimage_view functions in core and dynamic_image (#337)
Align with `subsampled_view` overloads accepting `point_t` and `coord_t`
Both types are based on `std::ptrdiff_t`. Fixes compilation warnings.
Tidy up `subimage_view` and `subsampled_view` with trailing return.
Add tests for `subimage_view` in core and dynamic_image extension.
(First tests for the dynamic_image, hurray! :))

Add explicit cast to double in division operator for point<T> to
fix compilation warnings.
2019-07-16 13:05:48 +02:00
Mateusz Łoskot
b1a382c45b
Compare float-pointing value to zero using <= operator (#336) 2019-07-16 02:33:19 +02:00
Mateusz Łoskot
73314b19a6
[numeric] Correct name of BOOST_TEST_MODULE [ci skip] 2019-07-14 23:00:47 +02:00