当前位置:网站首页>Image interpolation (nearest neighbor, bilinear)
Image interpolation (nearest neighbor, bilinear)
2022-06-22 07:14:00 【A rookie comes to study】
( digital image processing )- Image interpolation
Interpolation is an image resampling method , Used for image enlargement , narrow , Rotation and geometric correction , In essence, interpolation is a numerical process that uses known data to estimate unknown positions .
1. Nearest neighbor interpolation algorithm

Will a 2x2 Image src(w_s=2,h_s=2) Zoom in to 3x3 Images dst(w_d=3,h_d=3):
According to the formula :
ratio = The source image / Target image
Horizontal axis scale factor vx=w_src / w_dst=2/3
Longitudinal axis scale factor vy=h_src / h_dst=2/3
The value of the target image dst[x,y]=src[x * vx,y * vh]
x * vx,y * vh It could be a decimal , rounding

Finally, as shown in the figure , Summary is scaling
The advantage of this method is that it is simple , But the downside is that it's too rough , Precision will be lost , Causes discontinuities in the grayscale of the scaled image , There may be obvious zigzags in the changing places .
2. Bilinear interpolation algorithm

Bilinear is to use two straight lines parallel to the coordinate axis to decompose the decimal coordinates into the sum of four adjacent integer coordinates , Weight is distance .
P Points are decimal coordinates ,Q Is the adjacent four integer coordinates
Calculation R1 R2
1. First, according to Q11 = (0,1) and Q21 = (1,1) The pixel values of these two pixels are calculated R1=(x,y1) Pixel value of pixel point
2. And then according to Q12 = (0,0) and Q22 = (1,0) The pixel values of these two pixels are calculated R2=(x,y2) Pixel value of pixel point 
Again by R1,R2 Get the results 
The concept of weight is used , A lot of improvement
边栏推荐
- Assembly learning Chapter 4 of assembly language (Third Edition) written by Wang Shuang
- Thousands of sails pass by the side of the sunken boat, and thousands of trees spring before the diseased tree
- Introduction to 51 Single Chip Microcomputer -- digital tube
- vue连接mysql数据库失败
- Tpflow V6.0.6 正式版发布
- antd——a-upload-dragger拖拽上传组件——基础积累
- Yolov1 (training process)
- Canoe learning notes (1) illustration of new project and channel configuration steps
- Fundamentals of neural network (notes, for personal use)
- Process engine solves complex business problems
猜你喜欢

ROS Qt环境搭建

RT-Thread临界段的保护

Vue failed to connect to MySQL database

Real MySQL interview question (18) -- practical operation analysis
![[anomaly detection] malware detection: mamadroid (dnss 2017)](/img/dd/37a443fce627f7f38e3fe1767cb10e.jpg)
[anomaly detection] malware detection: mamadroid (dnss 2017)

Up sampling and down sampling (notes, for personal use)

校招路上的坑

Introduction to 51 Single Chip Microcomputer -- minimum system of single chip microcomputer

Canoe uses tricks to export data from logging file/trace to Matlab for analysis
![[Gan] Introduction to Gan basics and dcgan](/img/93/f0287f93283707b7082630cb89daf1.jpg)
[Gan] Introduction to Gan basics and dcgan
随机推荐
生成字符串方式
JS中对数组进行去重的几种方法
The solution of word document being locked and unable to edit
[internship] cross domain problems
js实现随机生成16位的密钥——基础积累
【GAN】SentiGAN IJCAI’18 Distinguished Paper
【实习】跨域问题
[distributed external detection] Odin ICLR '18
TypeScript & 详细解释 in、keyof、extends、索引签名、Record、typeof 的含义(不定时更新)
6. 安装ssh连接工具(用于我们连接实验室的服务器)
Site pre cache code
首次用DBeaver连接mysql报错
PIP for source changing and accelerated downloading
Up sampling and down sampling (notes, for personal use)
5g NR PWS system
Introduction to 51 Single Chip Microcomputer -- the use of Proteus 8 professional
From violent recursion to dynamic programming
C language - deep understanding of arrays
校招路上的坑
JS中如何阻止事件的传播