refactor!: use Point struct across the native vision stack#1130
refactor!: use Point struct across the native vision stack#1130
Conversation
|
First question, does this handle the scope of this pr: #1126, if so I will close it and you can mark another issue to close ;) EDIT: Ok, I see it's not handling this one, so maybe you can incorporate these changes into your PR? |
|
ok, so I'll cherry-pick commits from #1126 PR and then we'll close it? does it sound fine? @msluszniak |
Yes, probably this would need some tweaking since I hadn't used Point struct. |
Resolves #760. The OCR and VerticalOCR pipelines previously exposed all four rotated-rectangle corners in OCRDetection.bbox. Two points (top-left and bottom-right of the axis-aligned bounding box) are sufficient for downstream rendering and are simpler to consume. Changes: - Types.h: shrink OCRDetection.bbox from std::array<Point,4> to std::array<Point,2> - RecognitionHandler.cpp: compute AABB (min/max x,y) over the four detector corners instead of forwarding them verbatim - VerticalOCR.cpp: same AABB reduction in _processSingleTextBox - OCR.cpp / VerticalOCR.cpp generateFromFrame: re-normalize the two bbox corners after inverseRotatePoints to guarantee bbox[0] <= bbox[1] - JsiConversions.h: serialize 2 points instead of 4 to JavaScript - OCRTest.cpp / VerticalOCRTest.cpp: assert size==2 and that bbox[1] >= bbox[0] - ocr.ts: narrow TypeScript type from Point[] to [Point,Point] and update docs
|
Also could you write some basic testing instructions, namely which models are affected, what I specifically need to check? |
i think other than running demo apps for object detection and ocr we're good |

Description
Refactors the native code so it uses unified Point instead of random structures and pair arrays that were scattered all over the codebase.
Introduces a breaking change?
Changes the bbox member of OCRDetection to Bbox type instead of Point[]
Type of change
Tested on
Testing instructions
Screenshots
Related issues
#760
#1110
Checklist
Additional notes