};
//! Variants of Line Segment Detector
-enum lsd_refine_lvl
- { LSD_REFINE_NONE = 0,
+enum { LSD_REFINE_NONE = 0,
LSD_REFINE_STD = 1,
LSD_REFINE_ADV = 2
};
* Create an LSD object. Specifying scale, number of subdivisions for the image, should the lines be refined and other constants as follows:
*
* @param _refine How should the lines found be refined?
- * REFINE_NONE - No refinement applied.
- * REFINE_STD - Standard refinement is applied. E.g. breaking arches into smaller line approximations.
- * REFINE_ADV - Advanced refinement. Number of false alarms is calculated,
- * lines are refined through increase of precision, decrement in size, etc.
+ * LSD_REFINE_NONE - No refinement applied.
+ * LSD_REFINE_STD - Standard refinement is applied. E.g. breaking arches into smaller line approximations.
+ * LSD_REFINE_ADV - Advanced refinement. Number of false alarms is calculated,
+ * lines are refined through increase of precision, decrement in size, etc.
* @param _scale The scale of the image that will be used to find the lines. Range (0..1].
* @param _sigma_scale Sigma for Gaussian filter is computed as sigma = _sigma_scale/_scale.
* @param _quant Bound to the quantization error on the gradient norm.
* @param _density_th Minimal density of aligned region points in rectangle.
* @param _n_bins Number of bins in pseudo-ordering of gradient modulus.
*/
- LSD(lsd_refine_lvl _refine = LSD_REFINE_STD, double _scale = 0.8,
+ LSD(int _refine = LSD_REFINE_STD, double _scale = 0.8,
double _sigma_scale = 0.6, double _quant = 2.0, double _ang_th = 22.5,
double _log_eps = 0, double _density_th = 0.7, int _n_bins = 1024);
int roix, roiy;
const double SCALE;
- const lsd_refine_lvl doRefine;
+ const int doRefine;
const double SIGMA_SCALE;
const double QUANT;
const double ANG_TH;
//
//M*/
-#include <vector>
-
#include "precomp.hpp"
+#include <vector>
+
using namespace cv;
/////////////////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
-LSD::LSD(lsd_refine_lvl _refine, double _scale, double _sigma_scale, double _quant,
+LSD::LSD(int _refine, double _scale, double _sigma_scale, double _quant,
double _ang_th, double _log_eps, double _density_th, int _n_bins)
:SCALE(_scale), doRefine(_refine), SIGMA_SCALE(_sigma_scale), QUANT(_quant),
ANG_TH(_ang_th), LOG_EPS(_log_eps), DENSITY_TH(_density_th), N_BINS(_n_bins)
flsd(lines, w, p, n);
Mat(lines).copyTo(_lines);
- if (w) Mat(*w).copyTo(_width);
- if (p) Mat(*p).copyTo(_prec);
- if (n) Mat(*n).copyTo(_nfa);
+ if(w) Mat(*w).copyTo(_width);
+ if(p) Mat(*p).copyTo(_prec);
+ if(n) Mat(*n).copyTo(_nfa);
delete w;
delete p;
const double rho = QUANT / sin(prec); // gradient magnitude threshold
std::vector<coorlist> list;
- if (SCALE != 1)
+ if(SCALE != 1)
{
Mat gaussian_img;
const double sigma = (SCALE < 1)?(SIGMA_SCALE / SCALE):(SIGMA_SCALE);
}
else
{
- angles_data[addr] = double(cv::fastAtan2(gx, -gy)) * DEG_TO_RADS; // gradient angle computation
+ angles_data[addr] = cv::fastAtan2(float(gx), float(-gy)) * DEG_TO_RADS; // gradient angle computation
if (norm > max_grad) { max_grad = norm; }
}