Open exzos28 opened 2 months ago
Guten Tag, Hans here! 🍻
It looks like you have posted a valid issue regarding the coordinate system in the example. However, I recommend checking your frame processor code and ensuring that it aligns with the documentation you've linked. If the issue persists, please provide additional log output directly from Xcode, especially if there's any runtime error that might clarify the root cause.
Remember, mrousavy maintains this project in his free time, so sponsoring the project can help him prioritize issues and improve the library even further! You can support him by becoming a sponsor here.
Let’s see if we can get this sorted out!
Note: If you think I made a mistake, please ping
@mrousavy
to take a look.
@mrousavy please have a look if you have free time
I don't have free time.
@exzos28 Do you solve this problem? I have the same.
@j0na1han I don't. Try using an older version, like 4.0 - 4.1
4.0.0 working as expected. Thanks for the hint.
I think the docs need to be updated to reflect these changes from this update.
For instance what i did here to center the text vertically when in portrait mode:
frame.save()
const text = 'Centered Text'
const marginTop = 400
frame.translate(frame.width / 2, frame.height / 2)
frame.rotate(270, 0, 0)
frame.translate(-frame.height / 2, -frame.width / 2)
frame.drawText(text, frame.height / 2 - font.measureText(text).width / 2, font.measureText(text).height + marginTop, paint, font)
frame.restore()
Result:
As effectively the top left corner is the corner on the top right when looking at it vertically making the top left corner when looking at it vertically 270 degrees clockwise. The update info sums it up better with the images.
My code could also maybe still be improved.
Also not the frame.orientation is now fixed meaning it won't change. The preview orientation does though.
What's happening?
I've tried to run the example from docs and coordinate system is incorrect, it starts from top right instead of top left as it says here
Reproduceable Code
Image №1 with 0 0 position:
Image №2 with "center" position:
Relevant log output
Camera Device
Device
iPhone 12 (iOS 18.0)
VisionCamera Version
4.5.2
Can you reproduce this issue in the VisionCamera Example app?
Yes, I can reproduce the same issue in the Example app here
Additional information