当前位置:网站首页>理解corners_align,两种看待像素的视角
理解corners_align,两种看待像素的视角
2022-07-24 18:28:00 【blanklog】
像素的 aligning corners 概念一般在图像Resize插值过程中会遇到。其实这对应着两种不同看待像素的视角,影响最终坐标映射过程。
1. 如何看待像素
假设有一个5x5的图像
Centers-aligned:将像素看作一个有面积的方格,方格中心点位置代表这个像素。这样图像的宽度就等于像素的数量
。Corners-aligned:将像素看作一个理想的点,这个点的位置就代表这个像素。这样图像的宽度就等于像素的数量减一


不同看待像素的视角
2. Resize
当进行Resize时,两者缩放比例关系是不同的
Centers-aligned:

Corners-aligned:


3X3 resize到 5X5
3. 插值
Centers-aligned:在降/升采样过程中,会出现映射的坐标超过图像边界的情况,这些点的插值规则会有所不同。如上图上采样过程中,目标图像第一个像素(绿点)超出原图第一个像素(红点)边界之外。

Corners-aligned: 由于四个角的像素位置是对应的,不会存在超出边界的情况。
总结:
centers-gligned | corners-aligned | |
|---|---|---|
像素 | 带面积方格 | 理想点 |
图像宽度 | 等同像素数量 | 等于像素数量减一 |
指定比例缩放 | 像素数量保持比例 | 像素数量不保持比例 |
边界插值问题 | 边界可能超图像范围,插值可能存在问题 | 四个点完美对齐,不存在插值问题 |
边栏推荐
- 猜JWT关键字
- Baidu touch.js
- Namespace:集群环境共享与隔离
- 数组扁平化.flat(Infinity)
- 2. JS variable type conversion, automatic conversion, manual conversion, what is the difference between parseint(), parsefloat(), number()?
- Getaverse,走向Web3的远方桥梁
- Array object methods commonly used traversal methods & higher-order functions
- About the writing method of interface 1 chain interpretation 2. Method execution (finally) must be executed
- Missing value processing
- Number of times a number appears in an ascending array
猜你喜欢

剑指 Offer 21. 调整数组顺序使奇数位于偶数前面

About the writing method of interface 1 chain interpretation 2. Method execution (finally) must be executed

Emerging potential of interactive virtual reality technology in drug discovery

The 5th Digital China Construction summit opened in Fuzhou, Fujian

Simulation implementation vector

Inoic4 learning notes 2

Go language file operation

Maximum sum and promotion of continuous subarrays (2)

关于接口的写法 1链式判读 ?. 2方法执行 (finally)一定会执行

Typora 它依然是我心中的YYDS 最优美也是颜值最高的文档编辑神器 相信你永远不会抛弃它
随机推荐
9. BOM object?
Inoic4 learning notes 2
微信小程序逆向
jmeter -- prometheus+grafana服务器性能可视化
Revocable search board
字符串常用方法(2)
Emerging potential of interactive virtual reality technology in drug discovery
JS to achieve progress steps (small exercise)
EasyUI adds row level buttons to the DataGrid
XSS绕过姿势总结
The 5th Digital China Construction summit opened in Fuzhou, Fujian
Custom web framework
web渗透经验汇总ing
Baidu touch.js
Ionic4 learning notes 11 - popular goods display of an East Project
Oracle EBS form common objects and their relationships
Example of single table query in ORM student management system
【微信小程序开发】自定义tabBar案例(定制消息99+小红心)
缺失值处理
Ionic4 learning notes 10 rotation map of an East Project
。

