FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CameraSensing/uplugin_face/detection.cpp at master · folkcode/CameraSensing · GitHub
folkcode
/
CameraSensing
Public
forked from
sonnyky/CameraSensing
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
CameraSensing
/
uplugin_face
/
detection.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (30 loc) · 794 Bytes
Breadcrumbs
CameraSensing
/
uplugin_face
/
detection.cpp
Copy path
File metadata and controls
37 lines (30 loc) · 794 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#
include
"
detection.h
"
#
define
SAMPLE_READ_WAIT_TIMEOUT
2000
//
2000ms
#
pragma
once
/*
Calibration methods
*/
const
float
*
_calc_homography
(UPoint * src, UPoint * dst,
int
length) {
vector<Point2f> proj_points;
vector<Point2f> img_points;
vector<
float
> homographyValues;
Point2f point;
for
(
int
i =
0
; i < length; i++) {
Point2f tempSrc, tempDst;
tempSrc.
x
= src->
x
;
tempSrc.
y
= src->
y
;
proj_points.
push_back
(tempSrc);
tempDst.
x
= dst->
x
;
tempDst.
y
= dst->
y
;
img_points.
push_back
(tempDst);
src++;
dst++;
}
Mat homography =
findHomography
(proj_points, img_points);
for
(
int
i =
0
; i < homography.
rows
; i++) {
for
(
int
j =
0
; j < homography.
cols
; j++) {
homographyValues.
push_back
((
float
) homography.
at
<
double
>(i, j));
}
}
return
&homographyValues[
0
];
}
Back
|
FazBrowse Home
|
New Git URL