This repository was archived by the owner on Apr 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed
src/mlkit/textrecognition Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -83,13 +83,15 @@ function getResult(firebaseVisionText: any): MLKitRecognizeTextResult {
8383
8484 lns . push ( {
8585 text : line . getText ( ) ,
86+ confidence : line . getConfidence ( ) ,
8687 bounds : boundingBoxToBounds ( line . getBoundingBox ( ) ) ,
8788 elements : elms
8889 } ) ;
8990 }
9091
9192 result . blocks . push ( {
9293 text : textBlock . getText ( ) ,
94+ confidence : textBlock . getConfidence ( ) ,
9395 bounds : boundingBoxToBounds ( textBlock . getBoundingBox ( ) ) ,
9496 lines : lns
9597 } ) ;
Original file line number Diff line number Diff line change @@ -18,12 +18,14 @@ export interface MLKitRecognizeTextResultElement {
1818
1919export interface MLKitRecognizeTextResultLine {
2020 text : string ;
21+ confidence : number ;
2122 bounds : MLKitRecognizeTextResultBounds ;
2223 elements : Array < MLKitRecognizeTextResultElement > ;
2324}
2425
2526export interface MLKitRecognizeTextResultBlock {
2627 text : string ;
28+ confidence : number ;
2729 bounds : MLKitRecognizeTextResultBounds ;
2830 lines : Array < MLKitRecognizeTextResultLine > ;
2931}
Original file line number Diff line number Diff line change @@ -44,13 +44,15 @@ function getResult(visionText: FIRVisionText): MLKitRecognizeTextResult {
4444 const feature : FIRVisionTextBlock = visionText . blocks . objectAtIndex ( i ) ;
4545 const resultFeature = < MLKitRecognizeTextResultBlock > {
4646 text : feature . text ,
47+ confidence : feature . confidence ,
4748 bounds : feature . frame ,
4849 lines : [ ]
4950 } ;
5051
5152 const addLineToResult = ( line : FIRVisionTextLine ) : void => {
5253 const resultLine = < MLKitRecognizeTextResultLine > {
5354 text : feature . text ,
55+ confidence : line . confidence ,
5456 bounds : line . frame ,
5557 elements : [ ]
5658 } ;
You can’t perform that action at this time.
0 commit comments