Commit 736b42b3 authored by Olexa Bilaniuk's avatar Olexa Bilaniuk

Refactorings and renamings.

- Deleted "RefC" from names of external-interface functions.
- Renamed rhorefc.[cpp|hpp] to rho.[cpp|hpp]
- Introduced RHO_HEST base class, from which RHO_HEST_REFC inherits.
- rhoInit() currently only returns a Ptr<RHO_HEST_REFC>, but in the
future it will be allowed to return pointers to other derived classes,
depending on the values returned by cv::checkHardwareSupport().
parent 3a4d9a77
......@@ -41,7 +41,7 @@
//M*/
#include "precomp.hpp"
#include "rhorefc.h"
#include "rho.h"
#include <iostream>
namespace cv
......@@ -303,7 +303,7 @@ static bool createAndRunRHORegistrator(double confidence,
* initialized, used, then finalized.
*/
Ptr<RHO_HEST_REFC> p = rhoRefCInit();
Ptr<RHO_HEST> p = rhoInit();
/**
* Optional. Ideally, the context would survive across calls to
......@@ -311,7 +311,7 @@ static bool createAndRunRHORegistrator(double confidence,
* to pay is marginally more computational work than strictly needed.
*/
rhoRefCEnsureCapacity(p, npoints, beta);
rhoEnsureCapacity(p, npoints, beta);
/**
* The critical call. All parameters are heavily documented in rhorefc.h.
......@@ -324,7 +324,7 @@ static bool createAndRunRHORegistrator(double confidence,
* this behaviour is too problematic.
*/
result = !!rhoRefC(p,
result = !!rhoHest(p,
(const float*)src.data,
(const float*)dst.data,
(char*) tempMask.data,
......
......@@ -44,13 +44,14 @@
*/
/* Include Guards */
#ifndef __OPENCV_RHOREFC_H__
#define __OPENCV_RHOREFC_H__
#ifndef __OPENCV_RHO_H__
#define __OPENCV_RHO_H__
/* Includes */
#include <opencv2/core.hpp>
#include <stdint.h>
......@@ -84,8 +85,8 @@ namespace cv{
* Homography Estimation context.
*/
struct RHO_HEST_REFC;
typedef struct RHO_HEST_REFC RHO_HEST_REFC;
struct RHO_HEST;
typedef struct RHO_HEST RHO_HEST;
/* Functions */
......@@ -97,7 +98,7 @@ typedef struct RHO_HEST_REFC RHO_HEST_REFC;
* @return A pointer to the context if successful; NULL if an error occured.
*/
Ptr<RHO_HEST_REFC> rhoRefCInit(void);
Ptr<RHO_HEST> rhoInit(void);
/**
......@@ -112,10 +113,10 @@ Ptr<RHO_HEST_REFC> rhoRefCInit(void);
* internal table is of at least this size, reallocating if
* necessary.
* @param [in] beta The beta-factor to use within the table.
* @return 0 if successful; non-zero if an error occured.
* @return 0 if unsuccessful; non-zero otherwise.
*/
int rhoRefCEnsureCapacity(Ptr<RHO_HEST_REFC> p, unsigned N, double beta);
int rhoEnsureCapacity(Ptr<RHO_HEST> p, unsigned N, double beta);
......@@ -130,7 +131,7 @@ int rhoRefCEnsureCapacity(Ptr<RHO_HEST_REFC> p, unsigned N, double beta);
* @param [in] seed The 64-bit integer seed.
*/
void rhoRefCSeed(Ptr<RHO_HEST_REFC> p, unsigned long long seed);
void rhoSeed(Ptr<RHO_HEST> p, uint64_t seed);
/**
......@@ -240,20 +241,20 @@ void rhoRefCSeed(Ptr<RHO_HEST_REFC> p, unsigned long long seed);
* inliers for acceptance was reached; 0 otherwise.
*/
unsigned rhoRefC(Ptr<RHO_HEST_REFC> p, /* Homography estimation context. */
const float* src, /* Source points */
const float* dst, /* Destination points */
char* inl, /* Inlier mask */
unsigned N, /* = src.length = dst.length = inl.length */
float maxD, /* 3.0 */
unsigned maxI, /* 2000 */
unsigned rConvg, /* 2000 */
double cfd, /* 0.995 */
unsigned minInl, /* 4 */
double beta, /* 0.35 */
unsigned flags, /* 0 */
const float* guessH, /* Extrinsic guess, NULL if none provided */
float* finalH); /* Final result. */
unsigned rhoHest(Ptr<RHO_HEST> p, /* Homography estimation context. */
const float* src, /* Source points */
const float* dst, /* Destination points */
char* inl, /* Inlier mask */
unsigned N, /* = src.length = dst.length = inl.length */
float maxD, /* 3.0 */
unsigned maxI, /* 2000 */
unsigned rConvg, /* 2000 */
double cfd, /* 0.995 */
unsigned minInl, /* 4 */
double beta, /* 0.35 */
unsigned flags, /* 0 */
const float* guessH, /* Extrinsic guess, NULL if none provided */
float* finalH); /* Final result. */
......
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