Skip to content

Commit

Permalink
Update the ReadMe file.
Browse files Browse the repository at this point in the history
  • Loading branch information
vahancho committed Nov 2, 2022
1 parent 09b7310 commit eb153b8
Showing 1 changed file with 52 additions and 15 deletions.
67 changes: 52 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,50 @@
# Nkar image comparison and differences highlighting C++ API
Nkar (armenian: նկար) is an image processing and comparison utility. The comparison of two images of the same size based on comparing each pixel of one image with the corresponding pixel of another one. After all differences are identified, algorithm generates contours (polygons) that outlines the differences. The API provides both error reporting and differences analysis. For instance results contains information on the number of difference countours generated (see usage example below).

According to [stb single-file public domain libraries](https://github.com/nothings/stb) we use for image loading/decoding/saving the following image formats are supported: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC.
Nkar (Armenian: նկար) is an image processing and comparison utility. The comparison
of two images of the same size based on comparing each pixel of one image with the
corresponding pixel of another one. After all differences are identified, algorithm
generates contours (polygons) that outlines the differences. The API provides both
error reporting and differences analysis. For instance results contains information
on the number of difference contours generated (see usage example below).

According to [stb single-file public domain libraries](https://github.com/nothings/stb)
we use for image loading/decoding/saving the following image formats are supported:
JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC.

[![Build Status](https://travis-ci.org/vahancho/nkar.svg?branch=master)](https://travis-ci.org/vahancho/nkar)
[![Build status](https://ci.appveyor.com/api/projects/status/gh9v3ynrm1dt1w7t/branch/master?svg=true)](https://ci.appveyor.com/project/vahancho/nkar/branch/master)
[![Coverage Status](https://coveralls.io/repos/github/vahancho/nkar/badge.svg)](https://coveralls.io/github/vahancho/nkar)
[![codecov](https://codecov.io/gh/vahancho/nkar/branch/master/graph/badge.svg)](https://codecov.io/gh/vahancho/nkar)

### Installation

No installation required. Just copy and compile *color.h(.cpp), image.h(.cpp), point.h(.cpp) and comparator.h(.cpp)* from the src/ directory in your project and use `nkar::Comparator` class to compare two images.
No installation required. Just incorporate header and source files from *src/* directory
in your project and compile them. Use `nkar::Comparator` class to compare two images.
All library classes are in *nkar* namespace.

#### Integration with `CMake` projects

However, if you use `CMake` and want to integrate the library into your project
you might want to install it first by invoking a `CMake` command from the build directory:

```
cmake --install . --prefix=<install_path> --config=Release
```

Once the library is installed you can use it from in your project by adjusting its
`CMake` script. For example:

```
[..]
find_package(nkar REQUIRED)
add_executable(example main.cpp)
target_link_libraries(example nkar)
[..]
```

### Prerequisites

There are no special requirements and dependencies except *C++11* compliant compiler. The class is tested with *gcc 4.8.4* and *MSVC 12.0* (Visual Studio 2013).
For more details see the CI badges (*Travis CI & AppVeyor CI*).
There are no special requirements and dependencies except *C++11* compliant compiler.
For more details see the CI badges (*AppVeyor CI* etc.).

### Usage Example:

Expand Down Expand Up @@ -68,22 +97,30 @@ To run them you have to build and run the test application. For doing that you m
commands from the terminal, assuming that compiler and environment are already configured:
##### Linux (gcc)
```
cd test
g++ -std=c++11 -I../src main.cpp -o test
./test `pwd`/images/
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=True
cmake --build .
ctest
```
##### Windows
##### Windows (MSVC Toolchain)
```
cd test
cl /W4 /I../srs /EHsc main.cpp /link /out:test.exe
test "%cd%"\images\
mkdir build && cd build
cmake .. -DENABLE_TESTING=True -A x64
cmake --build . --config=Release
ctest -C Release
```
For x86 builds use `-A Win32` option instead.
### Examples
Below are some examples of image comparison with results. Third image in each row represents an image generated by *Comparator* and contains contours (red outlines) that highlight the differences:
Below are some examples of image comparison with results. Third image in each row
represents an image generated by *Comparator* and contains contours (red outlines)
that highlight the differences:
| expected | actual | diff with contours |
| --- | --- | --- |
Expand Down

0 comments on commit eb153b8

Please sign in to comment.