Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/Itseez/opencv into ocl_hough
Browse files Browse the repository at this point in the history
  • Loading branch information
pclove1 committed Jan 15, 2013
2 parents 269ccaa + 084b1c7 commit 06da75f
Show file tree
Hide file tree
Showing 36 changed files with 1,162 additions and 395 deletions.
3 changes: 3 additions & 0 deletions cmake/OpenCVModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ macro(ocv_module_disable module)
set(HAVE_${__modname} OFF CACHE INTERNAL "Module ${__modname} can not be built in current configuration")
set(OPENCV_MODULE_${__modname}_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "Location of ${__modname} module sources")
set(OPENCV_MODULES_DISABLED_FORCE "${OPENCV_MODULES_DISABLED_FORCE}" CACHE INTERNAL "List of OpenCV modules which can not be build in current configuration")
if(BUILD_${__modname})
# touch variable controlling build of the module to suppress "unused variable" CMake warning
endif()
unset(__modname)
return() # leave the current folder
endmacro()
Expand Down
3 changes: 3 additions & 0 deletions doc/check_docs2.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def compareSignatures(f, s):
sarg = arg[1]
ftype = re.sub(r"\b(cv|std)::", "", (farg[0] or ""))
stype = re.sub(r"\b(cv|std)::", "", (sarg[0] or ""))
ftype = re.sub(r"\s+(\*|&)$", "\\1", ftype)
stype = re.sub(r"\s+(\*|&)$", "\\1", stype)
if ftype != stype:
return False, "type of argument #" + str(idx+1) + " mismatch"
fname = farg[1] or "arg" + str(idx)
Expand Down Expand Up @@ -151,6 +153,7 @@ def formatSignature(s):
if idx > 0:
_str += ", "
argtype = re.sub(r"\bcv::", "", arg[0])
argtype = re.sub(r"\s+(\*|&)$", "\\1", arg[0])
bidx = argtype.find('[')
if bidx < 0:
_str += argtype + " "
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/contrib/doc/retina/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Retina::getMagno
Retina::getParameters
+++++++++++++++++++++

.. ocv:function:: Retina::RetinaParameters Retina::getParameters()
.. ocv:function:: struct Retina::RetinaParameters Retina::getParameters()
Retrieve the current parameters values in a *Retina::RetinaParameters* structure

Expand Down
8 changes: 4 additions & 4 deletions modules/contrib/include/opencv2/contrib/retina.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ class CV_EXPORTS Retina {
*/
void setup(RetinaParameters newParameters);

/**
* @return the current parameters setup
*/
struct Retina::RetinaParameters getParameters();
/**
* @return the current parameters setup
*/
struct Retina::RetinaParameters getParameters();

/**
* parameters setup display method
Expand Down
5 changes: 3 additions & 2 deletions modules/core/include/opencv2/core/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1277,12 +1277,13 @@ template<typename _Tp> class CV_EXPORTS Ptr
operator _Tp* ();
operator const _Tp*() const;

bool operator==(const Ptr<_Tp>& ptr) const;

_Tp* obj; //< the object pointer.
int* refcount; //< the associated reference counter
};

template<class T, class U> bool operator==(Ptr<T> const & a, Ptr<U> const & b);
template<class T, class U> bool operator!=(Ptr<T> const & a, Ptr<U> const & b);


//////////////////////// Input/Output Array Arguments /////////////////////////////////

Expand Down
9 changes: 5 additions & 4 deletions modules/core/include/opencv2/core/operations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2691,10 +2691,11 @@ template<typename _Tp> template<typename _Tp2> inline const Ptr<_Tp2> Ptr<_Tp>::
return p;
}

template<typename _Tp> inline bool Ptr<_Tp>::operator==(const Ptr<_Tp>& _ptr) const
{
return refcount == _ptr.refcount;
}
template<class _Tp, class _Tp2> inline bool operator==(const Ptr<_Tp>& a, const Ptr<_Tp2>& b) { return a.refcount == b.refcount; }
template<class _Tp, class _Tp2> inline bool operator!=(const Ptr<_Tp>& a, const Ptr<_Tp2>& b) { return a.refcount != b.refcount; }




//// specializied implementations of Ptr::delete_obj() for classic OpenCV types

Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/persistence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5519,7 +5519,7 @@ void read( const FileNode& node, SparseMat& mat, const SparseMat& default_mat )
return;
}
Ptr<CvSparseMat> m = (CvSparseMat*)cvRead((CvFileStorage*)node.fs, (CvFileNode*)*node);
CV_Assert(CV_IS_SPARSE_MAT(m));
CV_Assert(CV_IS_SPARSE_MAT(m.obj));
SparseMat(m).copyTo(mat);
}

Expand Down
4 changes: 2 additions & 2 deletions modules/core/test/test_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2430,8 +2430,8 @@ class Core_PhaseTest : public cvtest::BaseTest
}

Mat convertedRes = resInRad * 180. / CV_PI;
double normDiff = norm(convertedRes - resInDeg);
if(normDiff > FLT_EPSILON)
double normDiff = norm(convertedRes - resInDeg, NORM_INF);
if(normDiff > FLT_EPSILON * 180.)
{
ts->printf(cvtest::TS::LOG, "There are incorrect result angles (in radians)\n");
ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_OUTPUT);
Expand Down
4 changes: 2 additions & 2 deletions modules/features2d/src/matchers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ void FlannBasedMatcher::write( FileStorage& fs) const
{
fs << "indexParams" << "[";

if (indexParams != 0)
if (indexParams)
{
std::vector<std::string> names;
std::vector<int> types;
Expand Down Expand Up @@ -667,7 +667,7 @@ void FlannBasedMatcher::write( FileStorage& fs) const

fs << "]" << "searchParams" << "[";

if (searchParams != 0)
if (searchParams)
{
std::vector<std::string> names;
std::vector<int> types;
Expand Down
3 changes: 3 additions & 0 deletions modules/highgui/src/grfmt_jpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
typedef unsigned char boolean;
#endif

#undef FALSE
#undef TRUE

extern "C" {
#include "jpeglib.h"
}
Expand Down
32 changes: 32 additions & 0 deletions modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,38 @@ These values are proved to be invariants to the image scale, rotation, and refle

.. seealso:: :ocv:func:`matchShapes`

connectedComponents
-----------------------
computes the connected components labeled image of boolean image ``image`` with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 represents the background label. ltype specifies the output label image type, an important consideration based on the total number of labels or alternatively the total number of pixels in the source image.

.. ocv:function:: int connectedComponents(InputArray image, OutputArray labels, int connectivity = 8, int ltype=CV_32S)
.. ocv:function:: int connectedComponentsWithStats(InputArray image, OutputArray labels, OutputArray stats, OutputArray centroids, int connectivity = 8, int ltype=CV_32S)
:param image: the image to be labeled

:param labels: destination labeled image

:param connectivity: 8 or 4 for 8-way or 4-way connectivity respectively

:param ltype: output image label type. Currently CV_32S and CV_16U are supported.

:param statsv: statistics output for each label, including the background label, see below for available statistics. Statistics are accessed via statsv(label, COLUMN) where available columns are defined below.

* **CC_STAT_LEFT** The leftmost (x) coordinate which is the inclusive start of the bounding box in the horizontal
direction.

* **CC_STAT_TOP** The topmost (y) coordinate which is the inclusive start of the bounding box in the vertical
direction.

* **CC_STAT_WIDTH** The horizontal size of the bounding box

* **CC_STAT_HEIGHT** The vertical size of the bounding box

* **CC_STAT_AREA** The total area (in pixels) of the connected component

:param centroids: floating point centroid (x,y) output for each label, including the background label


findContours
----------------
Expand Down
14 changes: 14 additions & 0 deletions modules/imgproc/include/opencv2/imgproc/imgproc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,20 @@ enum { TM_SQDIFF=0, TM_SQDIFF_NORMED=1, TM_CCORR=2, TM_CCORR_NORMED=3, TM_CCOEFF
CV_EXPORTS_W void matchTemplate( InputArray image, InputArray templ,
OutputArray result, int method );

enum { CC_STAT_LEFT=0, CC_STAT_TOP=1, CC_STAT_WIDTH=2, CC_STAT_HEIGHT=3, CC_STAT_AREA=4, CC_STAT_MAX = 5};

// computes the connected components labeled image of boolean image ``image``
// with 4 or 8 way connectivity - returns N, the total
// number of labels [0, N-1] where 0 represents the background label.
// ltype specifies the output label image type, an important
// consideration based on the total number of labels or
// alternatively the total number of pixels in the source image.
CV_EXPORTS_W int connectedComponents(InputArray image, OutputArray labels,
int connectivity = 8, int ltype=CV_32S);
CV_EXPORTS_W int connectedComponentsWithStats(InputArray image, OutputArray labels,
OutputArray stats, OutputArray centroids,
int connectivity = 8, int ltype=CV_32S);

//! mode of the contour retrieval algorithm
enum
{
Expand Down
13 changes: 0 additions & 13 deletions modules/imgproc/perf/perf_houghLines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,5 @@ PERF_TEST_P(Image_RhoStep_ThetaStep_Threshold, HoughLines,

TEST_CYCLE() HoughLines(image, lines, rhoStep, thetaStep, threshold);

#ifdef WIN32
//FIXME: ugly fix to make sanity check pass on Win32, must be investigated, issue #2617
if (lines.cols == 2015)
{
lines = lines(Rect(0, 0, lines.cols - 1, lines.rows));
SANITY_CHECK(lines, 800.0);
}
else
{
SANITY_CHECK(lines);
}
#else
SANITY_CHECK(lines);
#endif
}
Loading

0 comments on commit 06da75f

Please sign in to comment.