首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将像素坐标转换为offset_height offset_width

将像素坐标转换为offset_height offset_width
EN

Stack Overflow用户
提问于 2017-12-16 01:27:28
回答 1查看 37关注 0票数 1

我正在尝试使用以下工具裁剪图像

代码语言:javascript
复制
 tf.image.crop_to_bounding_box(image,
offset_height,
offset_width,
target_height,
target_width)

函数。我有像素坐标裁剪为x1,y1,x2,y2。如何将此坐标转换为offset_height、offset_width、target_height、target_width

EN

回答 1

Stack Overflow用户

发布于 2017-12-16 01:47:12

我猜,您想要将点转换为长度?

代码语言:javascript
复制
offset_height = y1; //y1 - 0
offset_width = x1; //x1 - 0
target_height = y2 - y1;
target_width = x2 - x1;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47837165

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档