gev2002 / react-native-vision-camera-v3-text-recognition

https://www.npmjs.com/package/react-native-vision-camera-v3-text-recognition
MIT License
19 stars 6 forks source link

[Bug] Missing line details and element details #11

Closed tfcornerstone closed 6 months ago

tfcornerstone commented 6 months ago

Currently the line details and element details are of the last line and last element with in the block.


  blockFrameBottom: number;
  blockFrameLeft: number;
  blockFrameRight: number;
  blockFrameTop: number;
  blockText: string;
  elementFrameBottom: number;
  elementFrameLeft: number;
  elementFrameRight: number;
  elementFrameTop: number;
  elementText: string;
  lineFrameBottom: number;
  lineFrameLeft: number;
  lineFrameRight: number;
  lineFrameTop: number;
  lineText: string;
  resultText: string;
  size: number;
};

// Should be:

TextData = {
  blockFrameBottom: number;
  blockFrameLeft: number;
  blockFrameRight: number;
  blockFrameTop: number;
  blockText: string;
  lines: array {
               lineFrameBottom: number;
               lineFrameLeft: number;
               lineFrameRight: number;
               lineFrameTop: number;
               lineText: string;
               elements: array {
                       elementFrameBottom: number;
                         elementFrameLeft: number;
                         elementFrameRight: number;
                         elementFrameTop: number;
                         elementText: string;
               }
   }
  resultText: string;
  size: number;
};```
gev2002 commented 6 months ago

Currently the line details and element details are of the last line and last element with in the block.

  blockFrameBottom: number;
  blockFrameLeft: number;
  blockFrameRight: number;
  blockFrameTop: number;
  blockText: string;
  elementFrameBottom: number;
  elementFrameLeft: number;
  elementFrameRight: number;
  elementFrameTop: number;
  elementText: string;
  lineFrameBottom: number;
  lineFrameLeft: number;
  lineFrameRight: number;
  lineFrameTop: number;
  lineText: string;
  resultText: string;
  size: number;
};

// Should be:

TextData = {
  blockFrameBottom: number;
  blockFrameLeft: number;
  blockFrameRight: number;
  blockFrameTop: number;
  blockText: string;
  lines: array {
               lineFrameBottom: number;
               lineFrameLeft: number;
               lineFrameRight: number;
               lineFrameTop: number;
               lineText: string;
               elements: array {
                       elementFrameBottom: number;
                         elementFrameLeft: number;
                         elementFrameRight: number;
                         elementFrameTop: number;
                         elementText: string;
               }
   }
  resultText: string;
  size: number;
};```

It was a bug with types, I already fixed it.