Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the box or shape real pixel about [x, y, w, h] and points [x, y]. #221

Open
upcfeather opened this issue Aug 14, 2023 · 2 comments

Comments

@upcfeather
Copy link

As mentioned above, I want to get the real px values of box and polygon, and the documentation doesn't show how to get them. I learned from the previous issue that I can use the following formula:

const [x, y, w, h] = image.regions[0];
const { pixelSize } = image; 
const real_px_w = pixelSize.w * w;
const real_px_h = pixelSize.h * h;
const real_px_x = pixelSize.w * w;
const real_px_y = pixelSize.w * h;

I would like to confirm with you whether the above formula is correct. If so, there will be an error of about 10px between the results calculated by the above formula and my actual measurement. Could you please inform box and polygon of the calculation formula of the real pixel?

image-20230814095904742

@FrontDream
Copy link

大佬最后解决了嘛

@FrontDream
Copy link

大佬,能联系一下吗,有偿

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants