Code Monkey home page Code Monkey logo

colorchecker-detection's Introduction

Fast and Robust Multiple ColorChecker Detection

License: MIT

Pedro D. Marrero Fernandez1, Fidel A. Guerrero-Peña1, Tsang Ing Ren1, Jorge J. G. Leandro2

1Universidade Federal de Pernambuco, 2Motorola Mobility LLC, a Lenovo Company

In Image and Vision Computing 2018

This code implements a multiple colorChecker detection method, as described in the paper Fast and Robust Multiple ColorChecker Detection. The process is divided into two steps: (1) ColorCheckers localization and (2) ColorChecker patches recognition.

Pipeline

  • Results of MCCNetFind for the synthetic dataset
  • Results of MCCNetFind for the real dataset

Requirements

You need OpenCV v3.1.0 or later and NVidia Caffe. This installation package contains support for opencv compilation for Windows in vs.12, vs.14 and mingw.

  • apt-get update
  • apt-get upgrade
  • nvcaffe
  • echo "export PYTHONPATH=/opt/nvcaffe/python" >> ~/.bashrc
  • exho "export PATH=/opt/nvcaffe/build/tools:/opt/nvcaffe/python:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin " >> ~/.bashrc
  • source ~/.bashrc
  • opencv

Installation

Building the project using CMake from the command-line:

export OpenCV_DIR="./extern/opencv"
mkdir build
cd build
cmake -D OpenCV_DIR=$OpenCV_DIR ..
make 

How to use it

Preparing the chart

You should have done a photo or video of the ColorChecker Passport.

Photo of the ColorChecker Passport

Running the MCCFind:

./build/src/mcc ../db/img-colorchecker.jpg -o=../out -t=1 -sh -gt -nc=0
./build/src/mcc ../db/vdo-colorchecker.mp4 -o=../out -t=2 -sh -gt -nc=2
./build/src/mcc ../db/sec-colchecker-0.jpg -o=../out -t=3 -sh -gt -nc=2 -me=10.0

options:

 -t   # application type - 1 single image, 2 video, 3 image sequence
 -o   # output dir - default current dir
 -me  # minimum error
 -nc  # number maximum of checker color in the image
 -sh  # show result
 -gt  # generate table .csv format
  []  # input dir

Running the MCCFindNet:

usage: mccfindnet.py [-h] --configurate C [--no-gpu] [--json] [--no-show]
                 [--draw-cam] [--camdevice N] [--border N]

Citation

If you find this useful for your research, please cite the following paper.

@article{MARREROFERNANDEZ2018,
   title = "Fast and Robust Multiple ColorChecker Detection using Deep Convolutional Neural Networks",
   journal = "Image and Vision Computing",
   year = "2018",
   issn = "0262-8856",
   doi = "https://doi.org/10.1016/j.imavis.2018.11.001",
   url = "http://www.sciencedirect.com/science/article/pii/S0262885618301793",
   author = "Pedro D. Marrero Fernández and Fidel A. Guerrero Peña 
             and Tsang Ing Ren and Jorge J.G. Leandro",
}

Acknowledgments

This work was supported by the research cooperation project between Motorola Mobility (a Lenovo Company) and CIn-UFPE. Tsang Ing Ren, Pedro D. Marrero Fernandez and Fidel A. Guerrero-Peña gratefully acknowledge financial support from the Brazilian government agency FACEPE. The authors would also like to thank Leonardo Coutinho de Mendonça, Alexandre Cabral Mota, Rudi Minghim and Gabriel Humpire for valuable discussions.

colorchecker-detection's People

Contributors

pedrodiamel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

colorchecker-detection's Issues

project deserves better explained installation procedure

Hello,

I would like to install, test and eventually use this project. However, I could not find my way out how to install it on my macOS. It would be really useful to have a step by step guide, for instance:

  • first of all, what are the main dependencies, which python version I should use? (I believe, it is 2.7)
  • step by step guide required to build C++ libraries
    In the other post, I have seen the following instructions. Does the first command imply that we need to first download the OpenCV source package into extern directory? I assumed that and executed the instructions below.
export OpenCV_DIR="./extern/opencv"
mkdir build
cd build
cmake -G Xcode -D OpenCV_DIR=$OpenCV_DIR ..

I believe I also need to run make to install, however, no Makefile is generated. So tried to run cmake -P cmake_install.cmake. I have received to the following error.

-- Install configuration: "Release"
CMake Error at mcclib/cmake_install.cmake:48 (file):
file INSTALL cannot find
"../colorchecker-detection/build/mcclib/Release/libmcclib.dylib".
Call Stack (most recent call first):
cmake_install.cmake:37 (include)

Any idea how to proceed further ? thank you.

--OSError: cannot load library 'build/mcclib/libmcclib.dll': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'build/mcclib/libmcclib.dll'

Thanks to the author for his answer. I'm On Windows, and I've executed :
--set OpenCV_DIR="./extern/opencv"
--mkdir build
--cd build
--cmake -G "Visual Studio 14 2015 Win64" -D OpenCV_DIR=%OpenCV_DIR% ..
And the result of running it is:
-- Selecting Windows SDK version to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.0.23026.0
-- The CXX compiler identification is MSVC 19.0.23026.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/软件安装/VC/bin/x86_amd64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/软件安装/VC/bin/x86_amd64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: D:/colorchecker-detection-master/build

When I run mccfiend.py,
But The mistake happened again:
--OSError: cannot load library 'build/mcclib/libmcclib.dll': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'build/mcclib/libmcclib.dll'

I can't solve this problem. I really hope you can help me. Thanks again!

Confusion about colorchecker.py

In 'build/colorchecker.py' ,there is a line as follows.

mcclib = utils.ffi_module_import( 'build/mcclib/libmcclib' )

I can't find libmcclib.
I hope that you could help solve my problem .
Thank you!

some errors in bound_min.cpp

error lines may be added to get wrong rectangle, so inf is got.
for (int kk = 0; kk < k; kk ++)
{
if (abs(atan2(Lc[kk].y / Lc[kk].z, Lc[kk].x / Lc[kk].z) - atan2(ln.y / ln.z, ln.x / ln.z)) < 0.3)
{
replace = 0;
break;
}
}
the code can be added in CBoundMin::calculate() to control add the lines.

Problem with new detections

I'm trying to detect the colorchecker in the image img-colorchecker.jpg and also in new images taken by me, but the model seems to fail in all of the cases. Does the data need some sort of preprocessing or am I supposed to make a specific preprocessing operation over the RAW format version of my pictures in order to obtain good results? It's strange also that using the code in the notebook is not possible to detect anything from img-colorchecker.jpg.

Thank you in advance

A problem while generating solution in microsoft vs

Hello!
My system is Windows7 and my opencv version is 3.4.5. I've done the cmake already.
However, when I was generating solution with vs, there comes an error which I have no idea how to deal with it.
QQ图片20190322115008
The first one means it couldn't generate the "object" file and the next one means that it couldn't open the file "..\mcclib\Debug\mccliblib".
Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.