Skip to content

Commit ec68760

Browse files
committed
Fuzzy module added
fixes fixed compile error and warning Remove AGAST (for merger to upstream opencv) wrapping remaining xfeature2d classes to scripting added test for http://code.opencv.org/issues/3943; replaced "const InputArray" with "InputArray" to avoid warnings about "const const _InputArray&" added test for http://code.opencv.org/issues/3943; replaced "const InputArray" with "InputArray" to avoid warnings about "const const _InputArray&" adding LATCH fixed warnings in LATCH fixed errors fixed warnings fixed warnings2 fixed warnings3 fixed warnings4 fixed warnings5 added description of LATCH and fixed indentation cleaned the code a bit added tests and renamed LATCH Code to grab the red lined polygon from Google Maps added python support and completed documentation figure update added stdout welcome message and fixed warning fixed warning text enhancement trying to fix python wrapper warning on win64 trying to solve pyhton warnings bugfix4269 included remarks in http://answers.opencv.org/question/59293/problem-with-example-motemplcpp/ Replace tab with four space Add rotation invariance option for BRIEF descriptor. Fix docs and repush for buildbot. Bug fix for feature extraction According to CartToPolar() function documentation, result angles could be in range (0..360). To prevent index overflow this check is important. Adding edge-aware disparity filtering Added basic interface and demo for disparity filtering, added unoptimized fast weighted least squares filter implementation. Current demo tests domain transform, guided and weighted least squares filters on a dataset, measures speed and quality. Fix for Bug 4074. This seems to be just a typo-error, because the Tesseract API can handle correctly with RGB images (double-checked and it works). Fix for Bug opencv#3633: do away with "quads [2][3] = 255;" The four lowest bits in each quads[i][j] correspond to the 2x2 binary patterns Q_1, Q_2, Q_3 in the NM paper [1] (see in page 4 at the end of first column). Q_1 and Q_2 have four patterns, while Q_3 has only two. added INRIA pedestrian dataset autowbGrayworld: include+src+test+testdata+sample Add saturation based thresholding to grayworld WB Add basic perf tests for grayworld Add more doxygen comments Suppress uchar conv related warning on Windows Apply fixes suggested by Vadim Be more correct with int types Remove dangling N_good++ Use cvRound to suppress Windows warnings remove floor call vs2010 does not know, ceil, floor, round and friends. also, those are plain integer divisions, that do not need floor at all. New stereo module created and added some relevant files for this module Update README.md made some extra changes to the modules so I receive no warnings moved the opencv2/core/private.hpp from stereo_binary_sgbm.cpp to precomp.hpp fix for issue opencv#195 avoid overflow in histogram access SurfaceMatching: OpenMP indices Fixes compiler error: "index variable in OpenMP 'for' statement must have signed integral type" Adding confidence support and optimizing disparity filtering DisparityWLSFilter demonstrated the best results, so I removed all the other filters. Quality was significantly improved by adding confidence support to the filter (left-right consistency + penalty for areas near depth discontinuities). Filter was optimized using parallel_for_ and HAL intrinsics. Demo application was rewritten for better compliance with OpenCV standards. Added accuracy and performance tests. Documentation was added, as well as references to the original papers. added PASCAL VOC dataset + add KCF Tracker, initial commit, added: tutorial, trackerKCF.cpp, modified: tracker.cpp, tracker.hpp adding the resize feature References for KCF tracker and KCF-CN tracker Unified the formatting Fixed: ROI extraction when the given ROI is out of image; made the max_patch_size to be adjustable; add the CN feature extraction method Removing all shadowing variables, make functions to const, make the table of color-names become static change the color-names table to const Add a framework for choosing the descriptor Added error message for descriptor other than GRAY Added new line at end of file Fixing the ColorNames table initialization Fixed warning: conversion from double to int Updated the support for color-names features and fixing some typos Fixing the tabulation Split the training coefficient into numerator and denumerator Added the feature compression method Fixing some indentations Fixing some indentations Fixing alignments Fixing some alignments Use Doxigen format Remove whitespaces Removing whitespaces in featureColorName.cpp Add an example code for the KCF tracker update the header in example/kcf.cpp Updating the rectangle drawing, avoid warning from variable conversion Added doxygen documentations Fixing warnings remove warnings Fixing some warnings TLD Fixes & Optimizations 1. TLD now have module structure 2. Made some small code optimizations 3. Fixed Ensemble Classifier according to the original paper - 10 randomized ferns 4. Added comments to most of the functions and methods Added test on TLD Dataset Added BSD-compatible license Added BSD-compatible license to some files Fixed header Fixed build error Fix Fix opencv#2 Fix opencv#3 Fix opencv#4 Fixed Warnings opencv#1 Fixed Warnings opencv#2 Fixed Warnings opencv#3 Shadow Fix Fixing whitespaces Fixing whitespaces opencv#2 Fixing whitespaces opencv#3 Adds a first implementation of the OCRBeamSearchDecoder class using the Single Layer CNN character classifier described in Coates, Adam, et al. paper: Text detection and character recognition in scene images with unsupervised feature learning, ICDAR 2011 Add a demo program for the OCRBeamSearchDecoder class and needed data files trailing whitespaces fix compilation warnings fix win64 compilation error: arrays must be defined with compile-time fixed size :) fix doxygen warnings Fix for opencv#278 - core dump in the case of no match results. Modified reported poses by constraining to the number of poses found. ulong -> size_t fixed warnings in the tracking module Added OCL versions of Sr and Sc functions 2-nd level of parallelization + detector remake 1. Added 2-nd level of parallelization of NN on OpenCL 2. Restructured detector - now all filters work independently: Variance Filter->Ensemble->NN, through "buffers" Warnings Fix opencv#1 Fixing Warnings opencv#2 Fixing Warnings opencv#3 Fixing Warnings opencv#4 Fixing Warnings opencv#5 Fixing Warnings opencv#3 Fixing Warnings opencv#4 Fixing Warnings opencv#5 Added OCL version of "integrateAdditional" function Whitespace Fix Transparent API Support Fixing Warnings Fixed bug in LSDDetector where mask doesn't remove all undesired lines Fixing GCC 4.9 warning Fix memory leak bug #4420 Fix bug #4373: Error (Assertion failed in resize) when passing very elongated contours to the recognition module make sources compile again on MSVC 2012 (VC 11) by adding round() fix suffix that was in-compatible with MSVC 2012 (VC 11) eliminate some warnings use better condition for checking if compiler supports round() fixing facerecognizer tutorials and interface Adds createOCRHMMTransitionsTable() utility function to create a tailored language model transitions table from a given list of words (lexicon) update to use the new createOCRHMMTransitionsTable() function, and fix program description in header comments fix Winx64 warnings Better CNN model for character recognition. Trained with an augmented dataset by adding translation/scale variations. Updated the croped word recognition with new class numbering (compatible with previous NM classifier). Overload the run() method in BaseOCR class in order to adapt to different classifier callbacks. The original run() method accepts only one Mat input image, this is expected to be a binarzed image with black and white text and works both with the OCRTesseract class and the OCRHMMDecoder class when the character classifier callback works with binary images (e.g. NM). The new run() method accepts two Mat input parameters. One for the gray scale (or color) source image and the other for a binary mask where each connected component corresponds to a pre-segmented character in the input image. This way the OCRHMMDecoder is able to work with character classifiers that operate in grey scale (or color) images (e.g. a CNN). Adds example on segmented word recognition. Shows the use of the OCRHMMDecoder with the NM and CNN default classifiers. Minor bugfix: removes unwanted space character at the begining of recognition output strings. Fix w64 warnings Fix w64 warnings Improving DisparityWLSFilter interface and adding a tutorial Now the filter natively supports StereoBM and StereoSGBM with no parameter tuning required. Also, now user won't need to set the ROI and the right matcher parameters manually, it is all done in the respective convenience factory method based on the left matcher instance. Tutorial was added to clarify the provided example of use. doc update
1 parent 4d30d09 commit ec68760

File tree

185 files changed

+97702
-20162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+97702
-20162
lines changed

modules/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,7 @@ $ cmake -D OPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules -D BUILD_opencv_re
5151
21. **opencv_xobjdetect**: Integral Channel Features Detector Framework.
5252

5353
22. **opencv_xphoto**: Additional photo processing algorithms: Color balance / Denoising / Inpainting.
54+
55+
23. **opencv_stereo**: Stereo Correspondence done with different descriptors: Census / CS-Census / MCT / BRIEF / MV / RT.
56+
57+
24. **opencv_fuzzy**: New module focused on the fuzzy image processing.

modules/bioinspired/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
set(the_description "Biologically inspired algorithms")
22
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
3-
ocv_define_module(bioinspired opencv_core OPTIONAL opencv_highgui opencv_ocl WRAP java)
3+
ocv_define_module(bioinspired opencv_core OPTIONAL opencv_highgui opencv_ocl WRAP java python)

modules/bioinspired/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Biologically inspired vision models and derivated tools
22
=======================================================
3+
4+
1. A biological retina model for image spatio-temporal noise and luminance changes enhancement
5+
2. A transient areas (spatio-temporal events) segmentation tool to use at the output of the Retina
6+
3. High Dynamic Range (HDR >8bit images) tone mapping to (conversion to 8bit) use cas of the retina

modules/bioinspired/doc/bioinspired.bib

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ @article{Benoit2010
99
publisher={Elsevier}
1010
}
1111

12+
@INPROCEEDINGS{Benoit2014,
13+
author={Strat, S.T. and Benoit, A. and Lambert, P.},
14+
booktitle={Signal Processing Conference (EUSIPCO), 2014 Proceedings of the 22nd European},
15+
title={Retina enhanced bag of words descriptors for video classification},
16+
year={2014},
17+
month={Sept},
18+
pages={1307-1311}
19+
}
20+
1221
@inproceedings{Strat2013,
1322
title={Retina enhanced SIFT descriptors for video indexing},
1423
author={Strat, Sabin Tiberius and Benoit, Alexandre and Lambert, Patrick},
Loading

modules/bioinspired/doc/images/HDRtoneMapping_candleSample.svg

Lines changed: 120 additions & 0 deletions
Loading
Loading

modules/bioinspired/doc/images/HDRtoneMapping_memorialSample.svg

Lines changed: 21675 additions & 0 deletions
Loading
Loading

modules/bioinspired/doc/images/VideoDemo_RGB_PETS2006.svg

Lines changed: 22615 additions & 0 deletions
Loading
Loading

modules/bioinspired/doc/images/VideoDemo_thermal_park.svg

Lines changed: 5275 additions & 0 deletions
Loading

modules/bioinspired/doc/retina.markdown

Lines changed: 370 additions & 75 deletions
Large diffs are not rendered by default.

modules/bioinspired/include/opencv2/bioinspired/retina.hpp

Lines changed: 54 additions & 65 deletions
Large diffs are not rendered by default.

modules/bioinspired/include/opencv2/bioinspired/transientareassegmentationmodule.hpp

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
**
1313
** Maintainers : Listic lab (code author current affiliation & applications)
1414
**
15-
** Creation - enhancement process 2007-2013
15+
** Creation - enhancement process 2007-2015
1616
** Author: Alexandre Benoit ([email protected]), LISTIC lab, Annecy le vieux, France
1717
**
1818
** Theses algorithm have been developped by Alexandre BENOIT since his thesis with Alice Caplier at Gipsa-Lab (www.gipsa-lab.inpg.fr) and the research he pursues at LISTIC Lab (www.listic.univ-savoie.fr).
1919
** Refer to the following research paper for more information:
20-
** Strat S. T. , Benoit A.Lambert P. , Caplier A., "Retina Enhanced SURF Descriptors for Spatio-Temporal Concept Detection", Multimedia Tools and Applications, 2012 (DOI: 10.1007/s11042-012-1280-0)
20+
** Strat, S.T.; Benoit, A.; Lambert, P., "Retina enhanced bag of words descriptors for video classification," Signal Processing Conference (EUSIPCO), 2014 Proceedings of the 22nd European , vol., no., pp.1307,1311, 1-5 Sept. 2014 (http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6952461&isnumber=6951911)
2121
** Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
2222
** This work have been carried out thanks to Jeanny Herault who's research and great discussions are the basis of all this work, please take a look at his book:
2323
** Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891.
@@ -30,7 +30,7 @@
3030
** Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved.
3131
**
3232
** For Human Visual System tools (bioinspired)
33-
** Copyright (C) 2007-2011, LISTIC Lab, Annecy le Vieux and GIPSA Lab, Grenoble, France, all rights reserved.
33+
** Copyright (C) 2007-2015, LISTIC Lab, Annecy le Vieux and GIPSA Lab, Grenoble, France, all rights reserved.
3434
**
3535
** Third party copyrights are property of their respective owners.
3636
**
@@ -74,10 +74,37 @@ namespace cv
7474
{
7575
namespace bioinspired
7676
{
77-
7877
//! @addtogroup bioinspired
7978
//! @{
8079

80+
/** @brief parameter structure that stores the transient events detector setup parameters
81+
*/
82+
struct SegmentationParameters{ // CV_EXPORTS_W_MAP to export to python native dictionnaries
83+
// default structure instance construction with default values
84+
SegmentationParameters():
85+
thresholdON(100),
86+
thresholdOFF(100),
87+
localEnergy_temporalConstant(0.5),
88+
localEnergy_spatialConstant(5),
89+
neighborhoodEnergy_temporalConstant(1),
90+
neighborhoodEnergy_spatialConstant(15),
91+
contextEnergy_temporalConstant(1),
92+
contextEnergy_spatialConstant(75){};
93+
// all properties list
94+
float thresholdON;
95+
float thresholdOFF;
96+
//! the time constant of the first order low pass filter, use it to cut high temporal frequencies (noise or fast motion), unit is frames, typical value is 0.5 frame
97+
float localEnergy_temporalConstant;
98+
//! the spatial constant of the first order low pass filter, use it to cut high spatial frequencies (noise or thick contours), unit is pixels, typical value is 5 pixel
99+
float localEnergy_spatialConstant;
100+
//! local neighborhood energy filtering parameters : the aim is to get information about the energy neighborhood to perform a center surround energy analysis
101+
float neighborhoodEnergy_temporalConstant;
102+
float neighborhoodEnergy_spatialConstant;
103+
//! context neighborhood energy filtering parameters : the aim is to get information about the energy on a wide neighborhood area to filtered out local effects
104+
float contextEnergy_temporalConstant;
105+
float contextEnergy_spatialConstant;
106+
};
107+
81108
/** @brief class which provides a transient/moving areas segmentation module
82109
83110
perform a locally adapted segmentation by using the retina magno input data Based on Alexandre
@@ -96,30 +123,6 @@ class CV_EXPORTS_W TransientAreasSegmentationModule: public Algorithm
96123
{
97124
public:
98125

99-
//! parameters structure
100-
struct CV_EXPORTS_W SegmentationParameters{
101-
SegmentationParameters():
102-
thresholdON(100),
103-
thresholdOFF(100),
104-
localEnergy_temporalConstant(0.5),
105-
localEnergy_spatialConstant(5),
106-
neighborhoodEnergy_temporalConstant(1),
107-
neighborhoodEnergy_spatialConstant(15),
108-
contextEnergy_temporalConstant(1),
109-
contextEnergy_spatialConstant(75){};// default setup
110-
CV_PROP_RW float thresholdON;
111-
CV_PROP_RW float thresholdOFF;
112-
//! the time constant of the first order low pass filter, use it to cut high temporal frequencies (noise or fast motion), unit is frames, typical value is 0.5 frame
113-
CV_PROP_RW float localEnergy_temporalConstant;
114-
//! the spatial constant of the first order low pass filter, use it to cut high spatial frequencies (noise or thick contours), unit is pixels, typical value is 5 pixel
115-
CV_PROP_RW float localEnergy_spatialConstant;
116-
//! local neighborhood energy filtering parameters : the aim is to get information about the energy neighborhood to perform a center surround energy analysis
117-
CV_PROP_RW float neighborhoodEnergy_temporalConstant;
118-
CV_PROP_RW float neighborhoodEnergy_spatialConstant;
119-
//! context neighborhood energy filtering parameters : the aim is to get information about the energy on a wide neighborhood area to filtered out local effects
120-
CV_PROP_RW float contextEnergy_temporalConstant;
121-
CV_PROP_RW float contextEnergy_spatialConstant;
122-
};
123126

124127
/** @brief return the sze of the manage input and output images
125128
*/
@@ -141,19 +144,19 @@ class CV_EXPORTS_W TransientAreasSegmentationModule: public Algorithm
141144
@param fs : the open Filestorage which contains segmentation parameters
142145
@param applyDefaultSetupOnFailure : set to true if an error must be thrown on error
143146
*/
144-
CV_WRAP virtual void setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailure=true)=0;
147+
virtual void setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailure=true)=0;
145148

146149
/** @brief try to open an XML segmentation parameters file to adjust current segmentation instance setup
147150
148151
- if the xml file does not exist, then default setup is applied
149152
- warning, Exceptions are thrown if read XML file is not valid
150153
@param newParameters : a parameters structures updated with the new target configuration
151154
*/
152-
CV_WRAP virtual void setup(SegmentationParameters newParameters)=0;
155+
virtual void setup(SegmentationParameters newParameters)=0;
153156

154157
/** @brief return the current parameters setup
155158
*/
156-
CV_WRAP virtual SegmentationParameters getParameters()=0;
159+
virtual SegmentationParameters getParameters()=0;
157160

158161
/** @brief parameters setup display method
159162
@return a string which contains formatted parameters information
@@ -168,7 +171,7 @@ class CV_EXPORTS_W TransientAreasSegmentationModule: public Algorithm
168171
/** @brief write xml/yml formated parameters information
169172
@param fs : a cv::Filestorage object ready to be filled
170173
*/
171-
CV_WRAP virtual void write( cv::FileStorage& fs ) const=0;
174+
virtual void write( cv::FileStorage& fs ) const=0;
172175

173176
/** @brief main processing method, get result using methods getSegmentationPicture()
174177
@param inputToSegment : the image to process, it must match the instance buffer size !
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
//============================================================================
2+
// Name : retinademo.cpp
3+
// Author : Alexandre Benoit, [email protected]
4+
// Version : 0.1
5+
// Copyright : LISTIC/GIPSA French Labs, May 2015
6+
// Description : Gipsa/LISTIC Labs quick retina demo in C++, Ansi-style
7+
//============================================================================
8+
9+
// include bioinspired module and OpenCV core utilities
10+
#include "opencv2/bioinspired.hpp"
11+
#include "opencv2/imgcodecs.hpp"
12+
#include "opencv2/videoio.hpp"
13+
#include "opencv2/highgui.hpp"
14+
#include <iostream>
15+
#include <cstring>
16+
17+
// main function
18+
int main(int argc, char* argv[]) {
19+
20+
// basic input arguments checking
21+
if (argc>1)
22+
{
23+
std::cout<<"****************************************************"<<std::endl;
24+
std::cout<<"* Retina demonstration : demonstrates the use of is a wrapper class of the Gipsa/Listic Labs retina model."<<std::endl;
25+
std::cout<<"* This retina model allows spatio-temporal image processing (applied on a webcam sequences)."<<std::endl;
26+
std::cout<<"* As a summary, these are the retina model properties:"<<std::endl;
27+
std::cout<<"* => It applies a spectral whithening (mid-frequency details enhancement)"<<std::endl;
28+
std::cout<<"* => high frequency spatio-temporal noise reduction"<<std::endl;
29+
std::cout<<"* => low frequency luminance to be reduced (luminance range compression)"<<std::endl;
30+
std::cout<<"* => local logarithmic luminance compression allows details to be enhanced in low light conditions\n"<<std::endl;
31+
std::cout<<"* for more information, reer to the following papers :"<<std::endl;
32+
std::cout<<"* Benoit A., Caplier A., Durette B., Herault, J., \"USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING\", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011"<<std::endl;
33+
std::cout<<"* Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891."<<std::endl;
34+
std::cout<<"* => reports comments/remarks at [email protected]"<<std::endl;
35+
std::cout<<"* => more informations and papers at : http://sites.google.com/site/benoitalexandrevision/"<<std::endl;
36+
std::cout<<"****************************************************"<<std::endl;
37+
std::cout<<" NOTE : this program generates the default retina parameters file 'RetinaDefaultParameters.xml'"<<std::endl;
38+
std::cout<<" => you can use this to fine tune parameters and load them if you save to file 'RetinaSpecificParameters.xml'"<<std::endl;
39+
40+
if (strcmp(argv[1], "help")==0){
41+
std::cout<<"No help provided for now, please test the retina Demo for a more complete program"<<std::endl;
42+
}
43+
}
44+
45+
std::string inputMediaType=argv[1];
46+
// declare the retina input buffer.
47+
cv::Mat inputFrame;
48+
// setup webcam reader and grab a first frame to get its size
49+
cv::VideoCapture videoCapture(0);
50+
videoCapture>>inputFrame;
51+
52+
// allocate a retina instance with input size equal to the one of the loaded image
53+
cv::Ptr<cv::bioinspired::Retina> myRetina = cv::bioinspired::createRetina(inputFrame.size());
54+
55+
/* retina parameters management methods use sample
56+
-> save current (here default) retina parameters to a xml file (you may use it only one time to get the file and modify it)
57+
*/
58+
myRetina->write("RetinaDefaultParameters.xml");
59+
60+
// -> load parameters if file exists
61+
myRetina->setup("RetinaSpecificParameters.xml");
62+
63+
// reset all retina buffers (open your eyes)
64+
myRetina->clearBuffers();
65+
66+
// declare retina output buffers
67+
cv::Mat retinaOutput_parvo;
68+
cv::Mat retinaOutput_magno;
69+
70+
//main processing loop
71+
bool stillProcess=true;
72+
while(stillProcess){
73+
74+
// if using video stream, then, grabbing a new frame, else, input remains the same
75+
if (videoCapture.isOpened())
76+
videoCapture>>inputFrame;
77+
else
78+
stillProcess=false;
79+
// run retina filter
80+
myRetina->run(inputFrame);
81+
// Retrieve and display retina output
82+
myRetina->getParvo(retinaOutput_parvo);
83+
myRetina->getMagno(retinaOutput_magno);
84+
cv::imshow("retina input", inputFrame);
85+
cv::imshow("Retina Parvo", retinaOutput_parvo);
86+
cv::imshow("Retina Magno", retinaOutput_magno);
87+
88+
cv::waitKey(5);
89+
}
90+
91+
}

0 commit comments

Comments
 (0)