tesseract
v4.0.0-17-g361f3264
Open Source OCR Engine
quadlsq.h
1
/**********************************************************************
2
* File: quadlsq.h (Formerly qlsq.h)
3
* Description: Code for least squares approximation of quadratics.
4
* Author: Ray Smith
5
* Created: Wed Oct 6 15:14:23 BST 1993
6
*
7
* (C) Copyright 1993, Hewlett-Packard Ltd.
8
** Licensed under the Apache License, Version 2.0 (the "License");
9
** you may not use this file except in compliance with the License.
10
** You may obtain a copy of the License at
11
** http://www.apache.org/licenses/LICENSE-2.0
12
** Unless required by applicable law or agreed to in writing, software
13
** distributed under the License is distributed on an "AS IS" BASIS,
14
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
** See the License for the specific language governing permissions and
16
** limitations under the License.
17
*
18
**********************************************************************/
19
20
#ifndef QUADLSQ_H
21
#define QUADLSQ_H
22
23
#include "points.h"
24
25
class
QLSQ
26
{
27
public
:
28
QLSQ
() {
//constructor
29
clear
();
//set to zeros
30
}
31
void
clear
();
//initialize
32
33
void
add
(
//add element
34
double
x,
//coords to add
35
double
y);
36
void
remove
(
//delete element
37
double
x,
//coords to delete
38
double
y);
39
int32_t
count
() {
//no of elements
40
return
n
;
41
}
42
43
void
fit
(
//fit the given
44
int
degree);
//return actual
45
double
get_a
() {
//get x squard
46
return
a
;
47
}
48
double
get_b
() {
//get x squard
49
return
b
;
50
}
51
double
get_c
() {
//get x squard
52
return
c
;
53
}
54
55
private
:
56
int32_t
n
;
//no of elements
57
double
a
,
b
,
c
;
//result
58
double
sigx
;
//sum of x
59
double
sigy
;
//sum of y
60
double
sigxx
;
//sum x squared
61
double
sigxy
;
//sum of xy
62
double
sigyy
;
//sum y squared
63
long
double
sigxxx
;
//sum x cubed
64
long
double
sigxxy
;
//sum xsquared y
65
long
double
sigxxxx
;
//sum x fourth
66
};
67
#endif
QLSQ::add
void add(double x, double y)
Definition:
quadlsq.cpp:56
QLSQ::sigy
double sigy
Definition:
quadlsq.h:59
QLSQ::sigxxx
long double sigxxx
Definition:
quadlsq.h:63
QLSQ::get_b
double get_b()
Definition:
quadlsq.h:48
QLSQ::get_c
double get_c()
Definition:
quadlsq.h:51
QLSQ::sigxxy
long double sigxxy
Definition:
quadlsq.h:64
QLSQ::fit
void fit(int degree)
Definition:
quadlsq.cpp:100
QLSQ::a
double a
Definition:
quadlsq.h:57
QLSQ::count
int32_t count()
Definition:
quadlsq.h:39
QLSQ::c
double c
Definition:
quadlsq.h:57
QLSQ::sigx
double sigx
Definition:
quadlsq.h:58
QLSQ::n
int32_t n
Definition:
quadlsq.h:56
QLSQ::b
double b
Definition:
quadlsq.h:57
QLSQ::get_a
double get_a()
Definition:
quadlsq.h:45
QLSQ::sigxy
double sigxy
Definition:
quadlsq.h:61
QLSQ
Definition:
quadlsq.h:25
QLSQ::sigxx
double sigxx
Definition:
quadlsq.h:60
QLSQ::sigxxxx
long double sigxxxx
Definition:
quadlsq.h:65
QLSQ::clear
void clear()
Definition:
quadlsq.cpp:34
QLSQ::QLSQ
QLSQ()
Definition:
quadlsq.h:28
QLSQ::sigyy
double sigyy
Definition:
quadlsq.h:62
src
tesseract
src
ccstruct
quadlsq.h
Generated on Wed Nov 7 2018 13:45:43 for tesseract by
1.8.13