Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fiin_sdk_ios
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyen Van An
fiin_sdk_ios
Commits
10b7da10
Commit
10b7da10
authored
Oct 16, 2020
by
Nguyen Huy Nhat Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add frame
parent
6316f203
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
221 additions
and
62 deletions
+221
-62
OCR-SDK.xcworkspace/xcuserdata/itsol.xcuserdatad/UserInterfaceState.xcuserstate
...userdata/itsol.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
OCR-SDK/SB_KYC_SDK.swift
OCR-SDK/SB_KYC_SDK.swift
+3
-3
OCR-SDK/UI/SBKCaptureCard/SBKValidateCardView.swift
OCR-SDK/UI/SBKCaptureCard/SBKValidateCardView.swift
+21
-5
OCR-SDK/UI/SBKCaptureCard/SBKValidateCardView.xib
OCR-SDK/UI/SBKCaptureCard/SBKValidateCardView.xib
+73
-17
OCR-SDK/UI/SBKRecordFace/SBKRecordFaceView.swift
OCR-SDK/UI/SBKRecordFace/SBKRecordFaceView.swift
+122
-36
OCR-SDK/UI/SBKRecordFace/SBKRecordFaceView.xib
OCR-SDK/UI/SBKRecordFace/SBKRecordFaceView.xib
+2
-1
No files found.
OCR-SDK.xcworkspace/xcuserdata/itsol.xcuserdatad/UserInterfaceState.xcuserstate
View file @
10b7da10
No preview for this file type
OCR-SDK/SB_KYC_SDK.swift
View file @
10b7da10
...
...
@@ -78,12 +78,12 @@ public class SB_KYC_SDK {
//Call API face
//input: UIImage
public
func
eKycFaceMatch
(
imageFace
:
CVPixelBuffer
,
imageCardFront
:
CVPixelBuffer
,
imageCardBack
:
CVPixelBuffer
,
completion
:
@escaping
CompletionHandle
)
{
public
func
eKycFaceMatch
(
imageFace
:
Data
,
imageCardFront
:
Data
,
imageCardBack
:
Data
,
completion
:
@escaping
CompletionHandle
)
{
SBKValidateInput
.
shared
.
validateFace
(
imageFace
:
imageFace
)
{[
weak
self
]
data
in
guard
self
!=
nil
else
{
return
}
if
data
{
Global
.
imageCard1
=
SBKValidateInput
.
shared
.
convertCVPixelToUIImage
(
pixelBuffer
:
imageCardFront
)
.
pngData
()
Global
.
imageCard2
=
SBKValidateInput
.
shared
.
convertCVPixelToUIImage
(
pixelBuffer
:
imageCardFront
)
.
pngData
()
Global
.
imageCard1
=
imageCardFront
Global
.
imageCard2
=
imageCardBack
let
imageFaceUI
=
SBKValidateInput
.
shared
.
convertCVPixelToUIImage
(
pixelBuffer
:
imageFace
)
.
pngData
()
SBOCRRequest
.
shared
.
processFace
(
image
:
imageFaceUI
!
,
pathURL
:
Global
.
url_face
,
idBack
:
""
,
idFront
:
""
)
{(
errorCode
,
data
)
->
Void
in
...
...
OCR-SDK/UI/SBKCaptureCard/SBKValidateCardView.swift
View file @
10b7da10
...
...
@@ -13,8 +13,15 @@ public class SBKValidateCardView: UIView, AVCapturePhotoCaptureDelegate {
let
nibName
=
"SBKValidateCardView"
var
contentView
:
UIView
?
// @IBOutlet public weak var viewCamera: UIView!
// @IBOutlet public weak var btnTakePhoto: UIButton!
@IBOutlet
public
weak
var
viewCamera
:
UIView
!
@IBOutlet
public
weak
var
btnTakePhoto
:
UIButton
!
@IBOutlet
public
weak
var
lbDescription
:
UILabel
!
@IBOutlet
public
weak
var
lbCopyright
:
UILabel
!
@IBOutlet
public
weak
var
lbStep
:
UILabel
!
@IBOutlet
public
weak
var
btnCapture
:
UIButton
!
@IBOutlet
public
weak
var
imgCaution
:
UIImageView
!
public
var
captureSession
:
AVCaptureSession
=
AVCaptureSession
()
public
var
stillImageOutput
:
AVCapturePhotoOutput
=
AVCapturePhotoOutput
()
...
...
@@ -64,6 +71,14 @@ public class SBKValidateCardView: UIView, AVCapturePhotoCaptureDelegate {
}
self
.
loadCamera
()
let
label
=
UILabel
()
label
.
frame
=
CGRect
(
x
:
self
.
center
.
x
-
50
,
y
:
self
.
frame
.
size
.
height
/
8
+
self
.
viewCamera
.
frame
.
origin
.
y
-
40
,
width
:
100
,
height
:
20
)
label
.
textAlignment
=
.
center
label
.
text
=
self
.
typeCamera
==
TypeCard
.
FRONT
?
"Use front"
:
"Use back"
label
.
textColor
=
UIColor
.
white
self
.
addSubview
(
label
)
}
func
loadViewFromNib
()
->
UIView
?
{
...
...
@@ -80,7 +95,7 @@ public class SBKValidateCardView: UIView, AVCapturePhotoCaptureDelegate {
let
topLeft
=
CGPoint
(
x
:
fWidth
/
2
-
squareWidth
/
3
,
y
:
fHeight
/
4
)
if
iconTakeCard
!=
nil
{
self
.
btn
TakePhoto
.
setImage
(
iconTakeCard
,
for
:
.
normal
)
self
.
btn
Capture
.
setImage
(
iconTakeCard
,
for
:
.
normal
)
}
if
iconFrameTopLeft
!=
nil
{
...
...
@@ -212,8 +227,8 @@ public class SBKValidateCardView: UIView, AVCapturePhotoCaptureDelegate {
// self.captureSession.stopRunning()
// self.captureSession.removeOutput(self.videoDataOutput)
// self.captureSession.removeOutput(self.stillImageOutput)
let
cropImage
=
self
.
cropImage
(
image
:
UIImage
(
data
:
imageData
)
!
,
rect
:
CGRect
(
x
:
UIImage
(
data
:
imageData
)
!.
size
.
width
/
20
,
y
:
UIImage
(
data
:
imageData
)
!.
size
.
height
*
6
/
20
,
width
:
self
.
viewCamera
.
frame
.
size
.
width
*
18
/
20
,
height
:
self
.
viewCamera
.
frame
.
size
.
width
*
18
*
3
/
20
/
4
),
scale
:
1.0
)
self
.
completionSuccessCardStep
(
nil
,
cropImage
!.
pngData
()
!
,
nil
)
let
cropImage
=
self
.
cropImage
(
image
:
UIImage
(
data
:
imageData
)
!
,
rect
:
CGRect
(
x
:
UIImage
(
data
:
imageData
)
!.
size
.
width
/
20
,
y
:
UIImage
(
data
:
imageData
)
!.
size
.
height
*
4.5
/
20
,
width
:
self
.
viewCamera
.
frame
.
size
.
width
*
18
/
20
,
height
:
self
.
viewCamera
.
frame
.
size
.
width
*
18
*
3
/
20
/
4
),
scale
:
1.0
)
self
.
completionSuccessCardStep
(
nil
,
cropImage
!.
pngData
()
!
,
nil
)
}
//Xử lý ảnh hiển thị
...
...
@@ -249,7 +264,7 @@ public class SBKValidateCardView: UIView, AVCapturePhotoCaptureDelegate {
if
UIDevice
.
current
.
userInterfaceIdiom
==
.
pad
{
imageOutput
=
validateView
.
cropImage
(
image
:
imageInput
,
rect
:
CGRect
(
x
:
imageInput
.
size
.
width
/
20
,
y
:
imageInput
.
size
.
height
*
2
/
7
,
width
:
imageInput
.
size
.
width
-
imageInput
.
size
.
width
/
10
,
height
:
(
imageInput
.
size
.
width
-
imageInput
.
size
.
width
/
10
)
*
3
/
4
),
scale
:
1.0
)
}
else
{
imageOutput
=
validateView
.
cropImage
(
image
:
imageInput
,
rect
:
CGRect
(
x
:
imageInput
.
size
.
width
/
20
,
y
:
imageInput
.
size
.
height
*
2
/
7
,
width
:
imageInput
.
size
.
width
-
imageInput
.
size
.
width
/
10
,
height
:
(
imageInput
.
size
.
width
-
imageInput
.
size
.
width
/
10
)
*
3
/
4
),
scale
:
1.0
)
imageOutput
=
validateView
.
cropImage
(
image
:
imageInput
,
rect
:
CGRect
(
x
:
imageInput
.
size
.
width
/
20
,
y
:
imageInput
.
size
.
height
*
1.5
/
7
,
width
:
imageInput
.
size
.
width
-
imageInput
.
size
.
width
/
10
,
height
:
(
imageInput
.
size
.
width
-
imageInput
.
size
.
width
/
10
)
*
3
/
4
+
7
),
scale
:
1.0
)
}
let
ciimage
=
CIImage
(
image
:
imageOutput
!
)
...
...
@@ -286,6 +301,7 @@ extension SBKValidateCardView: AVCaptureVideoDataOutputSampleBufferDelegate {
self
.
completionSuccessCardStep
(
validateImageCard
,
nil
,
nil
)
self
.
statusValidateImage
=
validateImageCard
self
.
lbDescription
.
text
=
validateImageCard
.
rawValue
}
}
}
OCR-SDK/UI/SBKCaptureCard/SBKValidateCardView.xib
View file @
10b7da10
This diff is collapsed.
Click to expand it.
OCR-SDK/UI/SBKRecordFace/SBKRecordFaceView.swift
View file @
10b7da10
This diff is collapsed.
Click to expand it.
OCR-SDK/UI/SBKRecordFace/SBKRecordFaceView.xib
View file @
10b7da10
...
...
@@ -13,6 +13,7 @@
<connections>
<outlet
property=
"imageDescription"
destination=
"qAP-z1-ph6"
id=
"4WK-9l-Hhw"
/>
<outlet
property=
"lbDescription"
destination=
"l4S-dU-FVT"
id=
"7qE-CY-e4c"
/>
<outlet
property=
"stackView"
destination=
"lfu-gT-avH"
id=
"UPQ-PC-13s"
/>
<outlet
property=
"viewBackground"
destination=
"vtt-nP-K7e"
id=
"p2H-QE-FHN"
/>
<outlet
property=
"viewCheckStep1"
destination=
"Ikb-Rh-oGt"
id=
"gg1-L1-h5k"
/>
<outlet
property=
"viewCheckStep2"
destination=
"q10-fa-3fY"
id=
"YaT-X4-UMq"
/>
...
...
@@ -57,7 +58,7 @@
<subviews>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Ikb-Rh-oGt"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"68"
height=
"6"
/>
<color
key=
"backgroundColor"
red=
"0.20000000000000001"
green=
"0.20000000000000001"
blue=
"0.20000000000000001"
alpha=
"1"
colorSpace=
"c
ustom"
customColorSpace=
"s
RGB"
/>
<color
key=
"backgroundColor"
red=
"0.20000000000000001"
green=
"0.20000000000000001"
blue=
"0.20000000000000001"
alpha=
"1"
colorSpace=
"c
alibrated
RGB"
/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute
type=
"number"
keyPath=
"cornerRadius"
>
<integer
key=
"value"
value=
"3"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment