diff --git a/CMakeLists.txt b/CMakeLists.txt index dae803f99a565ff3b51b874f39ef4affe2af1b98..e02b236619a40272065df3cc556aca6d2405e2a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -282,8 +282,6 @@ target_sources(petrack_core PRIVATE include/autoCalib.h include/filter.h include/brightContrastFilter.h - include/brightFilter.h - include/contrastFilter.h include/blurFilter.h include/borderFilter.h include/backgroundFilter.h @@ -335,8 +333,6 @@ target_sources(petrack_core PRIVATE src/autoCalib.cpp src/filter.cpp src/brightContrastFilter.cpp - src/brightFilter.cpp - src/contrastFilter.cpp src/blurFilter.cpp src/borderFilter.cpp src/backgroundFilter.cpp diff --git a/include/brightFilter.h b/include/brightFilter.h deleted file mode 100644 index e82e41fcc74aae1556c5404aade56c0fe89a021e..0000000000000000000000000000000000000000 --- a/include/brightFilter.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * PeTrack - Software for tracking pedestrians movement in videos - * Copyright (C) 2010-2020 Forschungszentrum Jülich GmbH, - * Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand, - * Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -#ifndef BRIGHTFILTER_H -#define BRIGHTFILTER_H - -#include "filter.h" - -class BrightFilter : public Filter -{ -private: - Parameter mB; - -public: - BrightFilter(); -#ifndef STEREO_DISABLED - IplImage* act(IplImage *img, IplImage *res); -#endif - -// bool changed(); - - Parameter *getBrightness(); -}; - -#endif diff --git a/include/contrastFilter.h b/include/contrastFilter.h deleted file mode 100644 index 10f72d1d5b733e3db6d483a7f87dd3599c25b187..0000000000000000000000000000000000000000 --- a/include/contrastFilter.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * PeTrack - Software for tracking pedestrians movement in videos - * Copyright (C) 2010-2020 Forschungszentrum Jülich GmbH, - * Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand, - * Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -#ifndef CONTRASTFILTER_H -#define CONTRASTFILTER_H - -#include "filter.h" -#include "helper.h" - -class ContrastFilter : public Filter -{ -private: - Parameter mC; - -public: - ContrastFilter(); -#ifndef STEREO_DISABLED - IplImage* act(IplImage *img, IplImage *res); -#endif - -// bool changed(); - - Parameter *getContrast(); -}; - -#endif diff --git a/src/brightFilter.cpp b/src/brightFilter.cpp deleted file mode 100644 index 10287a7133a9bc0806d5ef9deb0a8f7f2693c48b..0000000000000000000000000000000000000000 --- a/src/brightFilter.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * PeTrack - Software for tracking pedestrians movement in videos - * Copyright (C) 2010-2020 Forschungszentrum Jülich GmbH, - * Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand, - * Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -#include "brightFilter.h" - -BrightFilter::BrightFilter() - :Filter() -{ - mB.setMinimum(0.); - mB.setMaximum(255.); - mB.setValue(0.); - mB.setFilter(this); -} - -#ifndef STEREO_DISABLED -IplImage* BrightFilter::act(IplImage *img, IplImage *res) -{ - int x, y; - // Pointer to the data information in the IplImage - unsigned char *dataIn = (unsigned char *) img->imageData; - unsigned char *dataOut = (unsigned char *) res->imageData; - // int channels = img->nChannels; - - // set poiner to value before array, because ++i is more effective than i++ - --dataIn; --dataOut; - - // Contrast factor - float b = mB.getValue(); - float fac = (255.-b)/255.; - // cout << CHAR_MIN << " " << CHAR_MAX<<endl - // leider oft von -128..127, so dass umwandlung in unsigned char bei berechung noetig - - // This loop is optimized so it has to calculate the least amount of indexes - // Optimizing the access to the pointer data is useless (no difference in performance when tested) - for (y = 0; y < img->height; ++y) - { - for (x = 0; x < img->width; ++x) - { - *(++dataOut) = (char) (*(++dataIn) * fac + b); - *(++dataOut) = (char) (*(++dataIn) * fac + b); - *(++dataOut) = (char) (*(++dataIn) * fac + b); - // so wuerde man durchschleifen -// *(++dataOut) = *(++dataIn); -// *(++dataOut) = *(++dataIn); -// *(++dataOut) = *(++dataIn); - // dataIn+=channels; // es wird von 3 kanaelen ausgegenagen - } - } -// // parameter was used, so it is now set to unchanged -// // also enabling/disabling will be reset -// mC.setChanged(false); -// Filter::setUnchanged(); - - return res; -} - -// bool BrightFilter::changed() -// { -// return Filter::changed() || mB.changed(); -// } -#endif -Parameter* BrightFilter::getBrightness() -{ - return &mB; -} diff --git a/src/contrastFilter.cpp b/src/contrastFilter.cpp deleted file mode 100644 index 693684da17c26fed0ec3acf735afefa55e77fded..0000000000000000000000000000000000000000 --- a/src/contrastFilter.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - * PeTrack - Software for tracking pedestrians movement in videos - * Copyright (C) 2010-2020 Forschungszentrum Jülich GmbH, - * Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand, - * Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - */ - -#include "contrastFilter.h" - -ContrastFilter::ContrastFilter() - :Filter() -{ - mC.setMinimum(0.); - mC.setMaximum(255.); - mC.setValue(0.); - mC.setFilter(this); -} -#ifndef STEREO_DISABLED -IplImage* ContrastFilter::act(IplImage *img, IplImage *res) -{ - int x, y; - float val; - // Pointer to the data information in the IplImage - // using (unsigned char *) garantees values 0..255 (mingw under windows results -128..127 for char) - unsigned char *dataIn = (unsigned char *) img->imageData; - unsigned char *dataOut = (unsigned char *) res->imageData; - // int channels = img->nChannels; - - // set poiner to value before array, because ++i is more effective than i++ - --dataIn; --dataOut; - - // Contrast factor - float fac = 256./(256.-mC.getValue()); - - // This loop is optimized so it has to calculate the least amount of indexes - // Optimizing the access to the pointer data is useless (no difference in performance when tested) - -// int maxval = -1000; -// int minval = 1000; -// for (y = 0; y < img->height; ++y) -// { -// for (x = 0; x < img->width; ++x) -// { -// if (*(dataIn+x+y*img->width) > maxval) -// maxval = *(dataIn+x+y*img->width); -// if (*(dataIn+x+y*img->width) < minval) -// minval = *(dataIn+x+y*img->width); -// } -// } -// cout << minval << " " <<maxval <<endl; - - for (y = 0; y < img->height; ++y) - { - for (x = 0; x < img->width; ++x) - { - val = (*(++dataIn)-128) * fac; // (signed char) to move to -128..127 - *(++dataOut) = (unsigned char) MAX(MIN(val+128, 255), 0); - val = (*(++dataIn)-128) * fac; - *(++dataOut) = (unsigned char) MAX(MIN(val+128, 255), 0); - val = (*(++dataIn)-128) * fac; - *(++dataOut) = (unsigned char) MAX(MIN(val+128, 255), 0); - // so wuerde man durchschleifen -// *(++dataOut) = *(++dataIn); -// *(++dataOut) = *(++dataIn); -// *(++dataOut) = *(++dataIn); - // dataIn+=channels; // es wird von 3 kanaelen ausgegenagen - } - } - - return res; -} -#endif -Parameter* ContrastFilter::getContrast() -{ - return &mC; -}