SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
BackgroundConvolution.cpp
Go to the documentation of this file.
1
17/*
18 * BackgroundConvolution.cpp
19 *
20 * Created on: Oct 12, 2016
21 * Author: mschefer
22 */
23
28#include <ElementsKernel/Logging.h>
29
30namespace SourceXtractor {
31
32Elements::Logging logger = Elements::Logging::getLogger("Segmentation");
33
36 SeFloat threshold) const {
37
38 if (m_convolution_filter->getWidth() > 5) {
39 logger.debug() << "Using DFT algorithm for the image convolution";
42 );
43 }
44 logger.debug() << "Using direct algorithm for the image convolution";
47 );
48}
49
51 double total = 0;
52
53 for (int y = 0; y < m_convolution_filter->getHeight(); y++) {
54 for (int x = 0; x < m_convolution_filter->getWidth(); x++) {
55 total += m_convolution_filter->getValue(x, y);
56 }
57 }
58
59 for (int y = 0; y < m_convolution_filter->getHeight(); y++) {
60 for (int x = 0; x < m_convolution_filter->getWidth(); x++) {
61 m_convolution_filter->setValue(x, y, m_convolution_filter->getValue(x, y) / total);
62 }
63 }
64
65}
66
67
68}
static Logging getLogger(const std::string &name="")
std::shared_ptr< DetectionImage > processImage(std::shared_ptr< DetectionImage > image, std::shared_ptr< DetectionImage > variance, SeFloat threshold) const
std::shared_ptr< VectorImage< SeFloat > > m_convolution_filter
static std::shared_ptr< BufferedImage< T > > create(std::shared_ptr< const ImageSource > source, std::shared_ptr< TileManager > tile_manager=TileManager::getInstance())
T make_shared(T... args)
static Elements::Logging logger
SeFloat32 SeFloat
Definition Types.h:32