Skip to content

Latest commit

 

History

History
172 lines (133 loc) · 4.03 KB

README.md

File metadata and controls

172 lines (133 loc) · 4.03 KB

Gazo-san

logo

Version CircleCI

Detect difference between two images.

By separating each image into few parts, Gazo-san only detects difference on matched parts between two images. Optional shows decrease or increase part on two images.

Quick Start

You can use Gazo-san with docker.

Get image from docker hub

docker pull lifullsetg/gazo-san

Clone this repository

git clone https://github.com/lifull-dev/Gazo-san.git

Go into the repository

cd Gazo-san

Execute Gazo-san by container

docker run --rm -it -v `pwd`:/app lifullsetg/gazo-san gazosan tests/images/test_image_new.png tests/images/test_image_old.png output
Input Input
test_image_old.png test_image_new.png
Output
output_diff.png

With option --create-change-image

docker run --rm -it -v `pwd`:/app lifullsetg/gazo-san gazosan tests/images/test_image_new.png tests/images/test_image_old.png output --create-change-image
Output Output
output_delete.png output_add.png
Output
output_diff.png

Output file:

  • output_diff.png: Show the difference on matched parts, it's created base on old image.
  • output_delete.png: Show the decrease parts to new image, it's created base on old image.
  • output_add.png: Show the increase parts to old image, it's created base on new image.

Each color stands for:

  • Green rectangle:
    • The parts decrease to new image.
    • The parts increase to old image.
  • Red rectangle: Matched parts in both image.
  • Color in red : Difference in matched part.

Built With

How to build Gazo-san

  1. Build Gazo-san by CMake
mkdir build
cd build
cmake ..
make
cd ..
  1. Binary file is in bin directory
cd bin
./gazosan

Execute Gazo-san

Execute image difference calculate.

Usage: ./gazosan PATH_TO_NEW_FILE PATH_TO_OLD_FILE OUTPUT_NAME [options]

  options

  -v, --verbose              Enable verbose output message
      --create-change-image  Create increase and decrease part image
  -h, --help                 Print help

You will get a png file which named "OutputName_diff.png", showing the difference between new and old image.

Tests

Download Google Test and Build

sh .circleci/build_googletest.sh

Run test

Unit test

  1. Build unit tests by CMake
mkdir build
cd build
cmake .. -DGTEST=ON -DTEST_LEVEL=unit
make
cd ..
  1. Execute unit tests
./gazosan_unit_test

Integration test

  1. Build integration tests by CMake
mkdir build
cd build
cmake .. -DGTEST=ON -DTEST_LEVEL=integration
make
cd ..
  1. Execute integration tests
./gazosan_integration_test

System test

  1. Build system tests by CMake
mkdir build
cd build
cmake .. -DGTEST=ON -DTEST_LEVEL=system
make
cd ..
  1. Execute system tests
./gazosan_system_test

License

Apache 2.0 license

Contributors

(In alphabetical order)