Commit Graph

14 Commits

Author SHA1 Message Date
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
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
MIRAL SHAH
8234329237
New threshold tests added for multi-channel views 2019-07-18 01:32:29 +05:30
Mateusz Łoskot
0809f2de71
Add color_spaces_are_compatible requirement as static_assert to threshold (#329)
Since use of `gil_function_requires` check is optional, it can be
disabled by not defining `BOOST_GIL_USE_CONCEPT_CHECK`, we need
a mandatory form of the check.
Add compile-time test verifying the static assertion.
Closes #323
2019-07-10 11:20:41 +01:00
Mateusz Łoskot
bf8e0dd1cf
Add threshold_truncate.cpp missing from Jamfile 2019-07-10 09:44:18 +02:00
Mateusz Łoskot
ee169ef104
Unify names of files and targets of image processing tests [skip ci] 2019-07-05 00:20:38 +02:00
Olzhas Zhumabek
cf897c5969
Implementation of lanczos down scaling (#309)
* Simple implementation of lanczos scaling

* Simple implementation of lanczos scaling

* Refactor lanczos into separate header

This commit moves the algorithm
into its own header. It also provides
templated interface now, utilizing
a little bit of decltype and declval
to resolve types for lambdas and stuff

* Zero pixel at start of lanczos_at

This commit fixes a possible bug and
fixes some style incosistencies

* Improve documentation for Lanczos

This commit adds documentation which
describes when to use the algorithm,
a brief description of how it is
supposed to work, and some caution
on the quality of the output

* Address style issues and fix warnings

This commit fixes a style issue realted
to namespace declaration and
fixes a warning in added zeroing of
a pixel at start of lanczos

* text-realign function arguments

* fix formatting issues

* Implement handful of sanity tests

This commit introduces a couple of
sanity tests such as black image
scaling to black image, and lanczos
response being 0 at x = 0

* bracket on newline for for loops

* add lanczos scaling to tests

* more precision in lanczos calculation

This commit migrates integral values
to double precision and uses PI
provided by boost.Math. These changes
solve downscaled image being darker

* Simple implementation of lanczos scaling

* Refactor lanczos into separate header

This commit moves the algorithm
into its own header. It also provides
templated interface now, utilizing
a little bit of decltype and declval
to resolve types for lambdas and stuff

* Zero pixel at start of lanczos_at

This commit fixes a possible bug and
fixes some style incosistencies

* Improve documentation for Lanczos

This commit adds documentation which
describes when to use the algorithm,
a brief description of how it is
supposed to work, and some caution
on the quality of the output

* Address style issues and fix warnings

This commit fixes a style issue realted
to namespace declaration and
fixes a warning in added zeroing of
a pixel at start of lanczos

* text-realign function arguments

* fix formatting issues

* Implement handful of sanity tests

This commit introduces a couple of
sanity tests such as black image
scaling to black image, and lanczos
response being 0 at x = 0

* bracket on newline for for loops

* add lanczos scaling to tests

* more precision in lanczos calculation

This commit migrates integral values
to double precision and uses PI
provided by boost.Math. These changes
solve downscaled image being darker

* Add Jamfile for ip test directory

Add Jamfile for image_processing
test directory and build-project
from outer test directory

* Add IP test directory to ci build

This commit adds a line at the end
of .ci/build-and-test.sh to include
image processing tests in CI builds

* Remove redundant lines from Jamfile

Simplify Jamfile at
test/image_processing

* Rewrite range condition

x > -a && x < a exchange with
-a < x && x < a in lanczos

* Add newline at the end of files

* Add math and lexical_cast to get-boost

As math and lexical_cast are used
in lanczos scaling, both were added
to get-boost

* Revert "Add newline at the end of files"

Since Boost.Math.Constants is
overengineered for use case by
requiring Boost.lexical_cast or
a global define, it is removed

This reverts commit 0743ab072ff3455421853697f7f46aee7d22382c.

* Define pi and use in lanczos

Value of pi is moved out into detail
and used by lanczos

* Move image_processing to test/core

* formatting fixes

* Adjust CMakeLists for moved IP tests

This commit removes image_processing as
subdirectory from test/ and adds to
test/core's CMakeLists

* Remove unused from get-boost

Since lanczos scaling no longer uses
boost.math.constants, lexical_cast
has been removed as well

* Downgrade math to transitive dep

This is a stray change left from
my incorrect resetting of the HEAD
on lanczos branch

* Remove unnecessary includes

io includes are not used in lanczos
scaling test, and they break build

* Fix ambiguous overload issue for min

Since width() and height()  now return
std::ptrdiff_t, call to std::min needs
a cast. There was also shadowing of
pi declared in detail/math.hpp,
which is also fixed

* Apply mloskot's patch

The patch provided by Mateusz changes
all usages of long int into ptrdiff_t,
which is returned by width() and
height() functions of image_view

* Apply .editorconfig rules

This commit is a simple reformat of
affected files

* Use aliases x_coord_t and y_coord_t

The change converges integer handling
in arguments, using view' type aliases.
View arguments have to come first to
avoid non-deduced context problem.
Also replaced long int with ptrdiff_t
in lanczos, in numeric.hpp file

* Apply alias usage for rest of the code

Some places with ptrdiff_t were
left out from previous commit, so they
are changed in this one. Plus a fix for
max call being ambiguous.

* Replace all literals with casted vars

This commit takes extreme stance of
never using an integer literal due to
problems in ambiguity of deduction of
min and max functions

* Fix unenclosed foreach

During rebase of gsoc2019 onto develop,
I didn't enclose first foreach with
matching endforeach, hence tests failed
2019-06-23 13:14:23 +03:00
MIRAL SHAH
716fe9ad8c Implement algorithms for binary and binary inverse thresholding (#313)
Add public functions threshold_binary and threshold_truncate.
Add tests and example.
Closes #310
2019-06-18 21:42:43 +02:00