CATROID-1324: Add height of object with ID reporter function#5165
Open
harshsomankar123-tech wants to merge 1 commit intoCatrobat:developfrom
Open
Conversation
|
Member
Author
|
Hi @wslany, could you please take a look when you have some time? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This pull request implements a new reporter function, "height of object with ID", within the AI Sensors / Object Recognition category of the formula editor.
The function takes a tracking ID (as returned by the "ID of detected object" function) and returns the bounding box height (
Double) of the corresponding object detected by ML Kit. If the ID is not found (e.g., the object is no longer visible or the ID is invalid), it returns0.0.Changes:
Functions.java: Added theHEIGHT_OF_OBJECT_WITH_IDenum constant.ObjectDetectorFunctionProvider.kt: Implemented logic to retrieveboundingBox.height()fromDetectedObject.strings.xml: Added display strings for the function name and parameter hints.InternFormulaKeyboardAdapter.java: Integrated the function into the formula editor keyboard with a default parameter.InternToExternGenerator.java: Mapped the internal function to external string resources.FormulaElementResources.kt: Registered the function as part of the Object Detection AI extension.CategoryListFragment.java: Added the function to the sensor category list UI.ObjectDetectionFunctionTest.kt: Added comprehensive parameterized unit tests to verify behavior with both valid and invalid tracking IDs.https://catrobat.atlassian.net/browse/CATROID-1324
Your checklist for this pull request
Please review the contributing guidelines and wiki pages of this repository.