@@ -6,6 +6,7 @@ package contrib
6
6
*/
7
7
import "C"
8
8
import (
9
+ "image"
9
10
"unsafe"
10
11
11
12
"gocv.io/x/gocv"
@@ -107,6 +108,16 @@ func (fr *LBPHFaceRecognizer) PredictExtendedResponse(sample gocv.Mat) PredictRe
107
108
return resp
108
109
}
109
110
111
+ // GetThreshold gets the threshold value of the model, i.e. the threshold
112
+ // applied in the prediction.
113
+ //
114
+ // For further information, see:
115
+ // https://docs.opencv.org/4.x/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#acf2a6993eb4347b3f89009da693a3f70
116
+ func (fr * LBPHFaceRecognizer ) GetThreshold () float32 {
117
+ t := C .LBPHFaceRecognizer_GetThreshold (fr .p )
118
+ return float32 (t )
119
+ }
120
+
110
121
// SetThreshold sets the threshold value of the model, i.e. the threshold
111
122
// applied in the prediction.
112
123
//
@@ -164,3 +175,48 @@ func (fr *LBPHFaceRecognizer) LoadFile(fname string) {
164
175
defer C .free (unsafe .Pointer (cName ))
165
176
C .LBPHFaceRecognizer_LoadFile (fr .p , cName )
166
177
}
178
+
179
+ // SetGridX sets grid's X value
180
+ //
181
+ // For further information, see:
182
+ // https://docs.opencv.org/4.x/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#ad65975baee31dbf3bd2a750feef74831
183
+ func (fr * LBPHFaceRecognizer ) SetGridX (x int ) {
184
+ C .LBPHFaceRecognizer_SetGridX (fr .p , C .int (x ))
185
+ }
186
+
187
+ // SetGridY sets grid's Y value
188
+ //
189
+ // For further information, see:
190
+ // https://docs.opencv.org/4.x/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#a9cebb0138dbb3553b27beb2df3924ae6
191
+ func (fr * LBPHFaceRecognizer ) SetGridY (y int ) {
192
+ C .LBPHFaceRecognizer_SetGridY (fr .p , C .int (y ))
193
+ }
194
+
195
+ // GetGridX gets grid's X value
196
+ //
197
+ // For further information, see:
198
+ // https://docs.opencv.org/4.x/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#ada6839bed931a8f68c5127e1af7a8b83
199
+ func (fr * LBPHFaceRecognizer ) GetGridX () int {
200
+ x := C .LBPHFaceRecognizer_GetGridX (fr .p )
201
+ return int (x )
202
+ }
203
+
204
+ // GetGridY gets grid's Y value
205
+ //
206
+ // For further information, see:
207
+ // https://docs.opencv.org/4.x/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#a22c68c0baf3eb9e852f47ae9241dbf15
208
+ func (fr * LBPHFaceRecognizer ) GetGridY () int {
209
+ y := C .LBPHFaceRecognizer_GetGridY (fr .p )
210
+ return int (y )
211
+ }
212
+
213
+ // SetGrid helper for SetGrid* functions
214
+ func (fr * LBPHFaceRecognizer ) SetGrid (p image.Point ) {
215
+ fr .SetGridX (p .X )
216
+ fr .SetGridY (p .Y )
217
+ }
218
+
219
+ // GetGrid helper for GetGrid* functions
220
+ func (fr * LBPHFaceRecognizer ) GetGrid () image.Point {
221
+ return image.Point {X : fr .GetGridX (), Y : fr .GetGridY ()}
222
+ }
0 commit comments