minor fixes in ximpgroc/doc/* + fixes gcc & clang build problem

pull/25/head
Bellaktris 11 years ago
parent 62c4145c34
commit eed2ab18cd
  1. 2
      doc/tutorials/ximpgroc/prediction/prediction.rst
  2. 4
      doc/tutorials/ximpgroc/training/training.rst
  3. 4
      modules/ximpgroc/CMakeLists.txt
  4. 18
      modules/ximpgroc/doc/structured_edge_detection/index.rst
  5. 7
      modules/ximpgroc/src/structured_edge_detection.cpp

@ -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 camera’s 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>() );
= cv::createStructuredEdgeDetection( modelName, makePtr<NewRFFeatureGetter>() );

@ -1,3 +1,3 @@
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)
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wshadow)
ocv_define_module(ximpgroc opencv_core opencv_imgproc OPTIONAL opencv_highgui)

@ -3,7 +3,8 @@ Structured forests for fast edge detection
.. highlight:: cpp
...
This module contains implementations of modern structured edge detection algorithms,
i.e. algorithms which somehow takes into account pixel affinities in natural images.
StructuredEdgeDetection
-----------------------
@ -40,12 +41,12 @@ StructuredEdgeDetection::detectEdges
++++++++++++++++++++++++++++++++++++
.. ocv:function:: void detectEdges(const Mat src, Mat dst)
The function detects edges in src and draw them to dst. The algorithm underlies this function
is much more robust to texture presence, than common approaches, e.g. Sobel
The function detects edges in src and draw them to dst. The algorithm underlies this function
is much more robust to texture presence, than common approaches, e.g. Sobel
:param src : source image (RGB, float, in [0;1]) to detect edges
:param dst : destination image (grayscale, float, in [0;1])
where edges are drawn
:param src: source image (RGB, float, in [0;1]) to detect edges
:param dst: destination image (grayscale, float, in [0;1])
where edges are drawn
.. seealso::
@ -56,14 +57,11 @@ createStructuredEdgeDetection
+++++++++++++++++++++++++++++
.. ocv:function:: Ptr<cv::StructuredEdgeDetection> createStructuredEdgeDetection(String model)
The only available constructor
The only available constructor
:param model: model file name
Literature
----------
.. [Dollar2013] Dollár P., Zitnick C. L., "Structured forests for fast edge detection",
IEEE International Conference on Computer Vision (ICCV), 2013,
pp. 1841-1848. `DOI <http://dx.doi.org/10.1109/ICCV.2013.231>`_

@ -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 = -1e-5, fdx, fdy;
float fMagn = -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);
}
}
}

Loading…
Cancel
Save