Commit a200e8ab authored by Bellaktris's avatar Bellaktris

merging

parents 0fd48235 eed2ab18
......@@ -5,7 +5,7 @@ Structured forests for fast edge detection
Introduction
------------
Today most digital images and imaging devices use 8 bits per channel thus limiting the dynamic range of the device to two orders of magnitude (actually 256 levels), while human eye can adapt to lighting conditions varying by ten orders of magnitude. When we take photographs of a real world scene bright regions may be overexposed, while the dark ones may be underexposed, so we cant capture all details using a single exposure. HDR imaging works with images that use more that 8 bits per channel (usually 32-bit float values), allowing much wider dynamic range.
Today most digital images and imaging devices use 8 bits per channel thus limiting the dynamic range of the device to two orders of magnitude (actually 256 levels), while human eye can adapt to lighting conditions varying by ten orders of magnitude. When we take photographs of a real world scene bright regions may be overexposed, while the dark ones may be underexposed, so we can't capture all details using a single exposure. HDR imaging works with images that use more that 8 bits per channel (usually 32-bit float values), allowing much wider dynamic range.
There are different ways to obtain HDR images, but the most common one is to use photographs of the scene taken with different exposure values. To combine this exposures it is useful to know your cameras response function and there are algorithms to estimate it. After the HDR image has been blended it has to be converted back to 8-bit to view it on usual displays. This process is called tonemapping. Additional complexities arise when objects of the scene or camera move between shots, since images with different exposures should be registered and aligned.
......
......@@ -42,7 +42,7 @@ Training pipeline
5. Rename models/forest/modelFinal.mat to models/forest/modelFinal.mat.backup
6. Open edgesChns.m and comment lines 26--41. Add after commented lines the following::
6. Open edgesChns.m and comment lines 26--41. Add after commented lines the following: ::
shrink=opts.shrink;
chns = single(getFeatures( im2double(I) ));
......@@ -112,4 +112,4 @@ Just use expanded constructor with above defined class NewRFFeatureGetter
.. code-block:: cpp
cv::StructuredEdgeDetection pDollar
= cv::createStructuredEdgeDetection( modelName, makePtr<NewRFFeatureGetter>() );
\ No newline at end of file
= cv::createStructuredEdgeDetection( modelName, makePtr<NewRFFeatureGetter>() );
set(the_description "Advanced edge-detection algorithms")
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
ocv_define_module(ximpgroc opencv_core opencv_imgproc OPTIONAL opencv_highgui)
\ No newline at end of file
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wshadow)
ocv_define_module(ximpgroc opencv_core opencv_imgproc OPTIONAL opencv_highgui)
......@@ -41,6 +41,7 @@
#include <algorithm>
#include <iterator>
#include <iostream>
#include <cmath>
#include "opencv2/ximpgroc/structured_edge_detection.hpp"
......@@ -217,7 +218,7 @@ static void gradientHist(const cv::Mat &src, cv::Mat &magnitude, cv::Mat &histog
for (int j = 0; j < src.cols*nchannels; j += nchannels)
{
float fMagn = float(-1e-5), fdx, fdy;
float fMagn = float(-1e-5), fdx = 0, fdy = 0;
for (int k = 0; k < nchannels; ++k)
{
float cMagn = CV_SQR( pDx[j + k] ) + CV_SQR( pDy[j + k] );
......@@ -229,7 +230,7 @@ static void gradientHist(const cv::Mat &src, cv::Mat &magnitude, cv::Mat &histog
}
}
pMagnitude[j/nchannels] = std::sqrtf(fMagn);
pMagnitude[j/nchannels] = sqrtf(fMagn);
float angle = cv::fastAtan2(fdy, fdx) / 180.0f - 1.0f * (fdy < 0);
if (std::fabs(fdx) + std::fabs(fdy) < 1e-5)
......@@ -691,4 +692,4 @@ Ptr<StructuredEdgeDetection> createStructuredEdgeDetection(const String &model,
return makePtr<StructuredEdgeDetectionImpl>(model, howToGetFeatures);
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment