当前位置:网站首页>Four commonly used techniques for anti aliasing
Four commonly used techniques for anti aliasing
2022-07-06 00:51:00 【Hydrion-Qlz】
This paper is compiled from the school of software, Xi'an Jiaotong University Mr. Zhu Jihua Computer graphics courseware , Do not reprint
List of articles
When displaying graphics on raster display , Line segments or graphic boundaries are more or less jagged

The graphic signal is continuous , In raster display system , The graphics are represented by discrete pixels
Anamorphosis : The distortion caused by continuous quantity is represented by discrete quantity .
Stepped boundary ;

Distortion of graphic details ;

The narrow figure is missing ( Left ): In the animation sequence , Produce flicker ( Right ).

Anti aliasing
In the process of graphic display , A method or technique for reducing or eliminating aliasing
Several methods of anti aliasing :
- Methods to improve resolution ;
- Unweighted area sampling ;
- Weighted area sampling ;
- Halftone technology .
Improve resolution
Set the display resolution ( level 、 vertical ) Double

The frame buffer capacity is increased to the original 4 times , Scanning and converting graphics of the same size takes 4 Times as long
evaluation : Simple method , But the price is very high , It's not economical
Area sampling
- The contribution of a straight line segment to the brightness of a pixel :
- It is proportional to the area of the area where the two intersect ;
- It is inversely proportional to the distance between the pixel center point and the straight line segment .
- When a line segment does not intersect a pixel , It has no effect on the brightness of the pixel ;
- The intersection area of the same area contributes the same to the brightness of the pixel , It has nothing to do with the position of the intersection area in the pixel .
Unweighted area sampling
Suppose the slope of a straight line segment is m(0≤m≤1), And the drawn line is a pixel unit , Then there are five situations when the straight line segment intersects with the pixel .

Area calculation :
- situation (1)(5) The shadow area is : D 2 / 2 m D^2/2m D2/2m;
- situation (2)(4) The shadow area is : D − m / 2 D-m/2 D−m/2;
- situation (3) The shadow area is : 1 − [ ( 1 − D ) 2 + E 2 ] / 2 m , E = D + m − s q r t ( 1 + m 2 ) 1-[(1-D)^2+E^2]/2m,E=D+m-sqrt(1+m^2) 1−[(1−D)2+E2]/2m,E=D+m−sqrt(1+m2).
The actual gray value displayed by the pixel = Area obtained (0-1 between )* The maximum gray value of this pixel
In order to simplify the calculation, we can use discrete Methods

- First, divide the screen pixels into n Sub pixels ;
- Then calculate the number of sub pixels whose center point falls in the straight line segment k;
- Setting the brightness of the pixel on the screen as the approximate value of the area of the intersecting area can k/n.
Weighted area sampling
thought : The second step of improving the unweighted region sampling method 3 Article nature , The contribution of object pixel brightness in the intersection region depends on the distance between the region and the pixel center
Discrete calculation method can be adopted
- Divide pixels into n Sub pixels of equal area , Calculate the contribution of each sub-pixel to the original pixel , And save it in a two-dimensional weighting table ;
- Find all sub pixels whose centers fall in the straight line segment ;
- Calculate the sum of the contributions of all these sub pixels to the brightness of the original pixel ;
- This value is multiplied by the maximum gray value of the pixel as the display gray value of the pixel .
Yes n=9 The situation of :

Yes n=25 The situation of :

Example

Halftone technology
For a given resolution , The multi-level gray level is obtained by combining several pixels into a unit ;
example : In a display, four pixels form a unit , Can produce 5 Light intensity .

evaluation
- For a two-level gray-scale display, the number of gray levels that may be formed is equal to the number of pixels in the unit plus 1;
- If you have any m Grey level , n × n n\times n n×n Pixels form a unit , Then the number of gray levels is n × n × ( m − 1 ) + 1 n\times n\times (m-1)+1 n×n×(m−1)+1;
- The larger the unit , The higher the gray level ;
- It is at the expense of spatial resolution .
• example : Gray level =4, Each unit =2*2

边栏推荐
- [EI conference sharing] the Third International Conference on intelligent manufacturing and automation frontier in 2022 (cfima 2022)
- KDD 2022 | EEG AI helps diagnose epilepsy
- Basic introduction and source code analysis of webrtc threads
- Data analysis thinking analysis methods and business knowledge - analysis methods (III)
- NLP text processing: lemma [English] [put the deformation of various types of words into one form] [wet- > go; are- > be]
- The relationship between FPGA internal hardware structure and code
- 95后CV工程师晒出工资单,狠补了这个,真香...
- 关于#数据库#的问题:(5)查询库存表中每本书的条码、位置和借阅的读者编号
- [simple implementation of file IO]
- Calculate sha256 value of data or file based on crypto++
猜你喜欢

Idea远程提交spark任务到yarn集群

Four dimensional matrix, flip (including mirror image), rotation, world coordinates and local coordinates

uniapp开发,打包成H5部署到服务器

Cve-2017-11882 reappearance

What is the most suitable book for programmers to engage in open source?

Spark SQL null value, Nan judgment and processing

BiShe - College Student Association Management System Based on SSM

Exciting, 2022 open atom global open source summit registration is hot

Ffmpeg captures RTSP images for image analysis

Leetcode:20220213 week race (less bugs, top 10% 555)
随机推荐
Differences between standard library functions and operators
The value of applet containers
[groovy] compile time meta programming (AST syntax tree conversion with annotations | define annotations and use groovyasttransformationclass to indicate ast conversion interface | ast conversion inte
几百行代码实现一个 JSON 解析器
Anconda download + add Tsinghua +tensorflow installation +no module named 'tensorflow' +kernelrestart: restart failed, kernel restart failed
After 95, the CV engineer posted the payroll and made up this. It's really fragrant
[groovy] compile time metaprogramming (compile time method injection | method injection using buildfromspec, buildfromstring, buildfromcode)
The detailed page returns to the list and retains the original position of the scroll bar
DD's command
Mobilenet series (5): use pytorch to build mobilenetv3 and learn and train based on migration
Ffmpeg captures RTSP images for image analysis
The population logic of the request to read product data on the sap Spartacus home page
猿桌派第三季开播在即,打开出海浪潮下的开发者新视野
cf:D. Insert a Progression【关于数组中的插入 + 绝对值的性质 + 贪心一头一尾最值】
数据分析思维分析方法和业务知识——分析方法(三)
Exciting, 2022 open atom global open source summit registration is hot
Curlpost PHP
Basic introduction and source code analysis of webrtc threads
What is the most suitable book for programmers to engage in open source?
Cf:h. maximum and [bit operation practice + K operations + maximum and]