Image Processing for Embedded Devices <2>

1.1.1 曝光设置

         如老式电影中,相机数字传感器需要在采集时正确曝光。像素(图片基本要素)是由感光电子设备(光电二极管或光电晶体管)组成,它们收集光子(光线的电磁元素),转化成电信号。信号被储存在累积单元,然后通过模数转化,得到最后像素值。

         这个基本的光采集设备存在一些限制:光的敏感度是固定的并且可能被噪声干扰。通常噪声水平是有限的并且并不严重,只要实际信号强度适当且质量高,如高信噪比。

         为了确保这一基本原则每个像素都必须进行设定,使其能采集到适当水平的光照,因此得到适当水平的信号,通过改变场景的光线强度也可改变sensor采集量,从而存储适当水平光照在像元中。这可以通过曝光时间控制实现。曝光时间是值感光电管采光和转化成电荷的时间。场景光照强度越低所需曝光时间就越大。通过改变曝光时间确定场景的数字采集结果可能曝光不足(太暗,曝光时间太小),曝光过度(太亮,曝光时间太大)或曝光适度。

         有两种情况必须避免或者被认为是极端情况:无累积,即相当于黑图;过度累积(也叫做饱和),即相当于高亮或白图。对于实际黑或白场景,像素呈现上述数值是没有问题的,但是错误的曝光时间也会得到黑白图(曝光不足导致黑图和曝光过大导致亮图)。并且sensor的各个像素的曝光时间不能分别控制,及所有像素公用一个曝光时间,帧间的曝光时间可以改变用以适应现实场景中光照的改变。通常我们设置曝光时间使图片的平均亮度处于全部亮度等级的中间水平(如:对于8位的图像具有256个不同的亮度等级,合适曝光图像平均亮度为128)。

         最后,选择一个合适的曝光时间应对所有场景往往是不太可能的。太大或太小的曝光时间都不太可行,可能会产生其他问题并且影响信噪比。并且曝光时间往往有上限,取决于帧率或运动模糊。运动模糊是由于较大的曝光时间和采集场景中有运动物体或手抖。低光照采集情况下很常见,因此该情况下常常使用闪光灯。

         曝光时间的下限取决于,像元内累计的信息量可被正常读出,使用乘法增益放大信息得到可用值。

         总结一下,一个好的曝光控制模块由如下条件组合而成:

  l  一个合适的模块需要估计场景的光照强度,正确设置相应的曝光时间,避免曝光不足或曝光过度;

  l  一个合适的增益控制可提供支持和作为曝光限制的补偿,当在平衡曝光时间和增益时,优先曝光考虑曝光时间;

  l  一个定义真正的黑白区域的方法,呈现其余部分和一般图像pipeline中余下模块会进行适当的矫正;

  l  其他模块中某一环会给信号增加额外的增益(想自动白平衡);

  l  额外的可选模块用以控制避免运动模糊;通常文献将该方法命名为自动ISO。

1.1.2 白平衡

         正确的颜色重构是最具挑战的图像处理之一,影响数字相机的图像质量。人类视觉系统可以去除色偏:不同光源情况下物体在人眼中呈现同一颜色。恰恰相反的是,sensor简单采集所得裸数据不能够应对现实场景中光源的变化。举个例子一张白纸位于室外室内环境下会被sensor记录成偏蓝或偏红的颜色。

         为了应付这些问题创造了很多技术方法。高端相机提供多种较通用光源(钨丝灯,日光灯,白天日光,闪光灯等)相关的预设。此外未来相片的白平衡参数可通过在同一光源下给已知灰度的参考物采集一帧图像来设置(客户端白平衡)。

         上述的所有技术方法需要用户密切配合从而正常使用。正相反的,自动白平衡技术方法尝试在不需要用户配合的情况下估计得到正确的光照特征并且去除色偏。这些技术方法基于对场景反射分布的强预估,也应用在低消费设备(如智能手机),将会在第5章详细介绍。

1.1.3 降噪

         图像噪声(用不需要的声音作类比来命名)很大程度上影响着图像质量。这些不需要的波动,若未被适当处理,严重影响图像质量。不同的噪声源,具有不同特征,堆叠在图像信号上:光子噪声,黑电平噪声,读出噪声,重置噪声,量化噪声等。

         虽然制造商做了很多努力减少图像设备中的噪声,对于高要求情况下噪声依旧存在且被认为不可避免。举个例子,低照条件且低曝光时间,产生非常低的信噪比,采集到非常少的光子,很难得到令人满意的图片。这一物理现在不仅取决于sensor特性,还和光的本质有关。此外嵌入式设备有限的尺寸下像素个数的不断增加,即像素尺寸减小,带来更多地问题。和大像素相比小像素采集更少的光子,更少有效信号意味着更大噪声的图像。

         为了应付这些问题必须设计智能滤波器。这些滤波器可以估计图像噪声特征(如高斯模型下的均值和标准差),然后在不影响图像细节下前提下去除掉不需要的噪声。

         最后,应该指出的是降噪可作用在pipeline的各个阶段。有的作用在RGB图像上,也有的直接作用在Bayer数据上。后者具有几个明显优势(去马赛克处理通常会引入非线性特征,这会加大降噪难度)。更多降噪算法介绍详见第6章。

转载于:https://www.cnblogs.com/yhszjm/p/11179593.html

Preface xi Acknowledgements xvii 1 Image Processing 1 1.1 Basic Definitions 2 1.2 Image Formation 3 1.3 Image Processing Operations 7 1.4 Example Application 9 1.5 Real-Time Image Processing 11 1.6 Embedded Image Processing 12 1.7 Serial Processing 12 1.8 Parallelism 14 1.9 Hardware Image Processing Systems 18 2 Field Programmable Gate Arrays 21 2.1 Programmable Logic 21 2.1.1 FPGAs vs. ASICs 24 2.2 FPGAs and Image Processing 25 2.3 Inside an FPGA 26 2.3.1 Logic 27 2.3.2 Interconnect 28 2.3.3 Input and Output 29 2.3.4 Clocking 30 2.3.5 Configuration 31 2.3.6 Power Consumption 32 2.4 FPGA Families and Features 33 2.4.1 Xilinx 33 2.4.2 Altera 38 2.4.3 Lattice Semiconductor 44 2.4.4 Achronix 46 2.4.5 SiliconBlue 47 2.4.6 Tabula 47 2.4.7 Actel 48 2.4.8 Atmel 49 2.4.9 QuickLogic 50 2.4.10 MathStar 50 2.4.11 Cypress 51 2.5 Choosing an FPGA or Development Board 51 3 Languages 53 3.1 Hardware Description Languages 56 3.2 Software-Based Languages 61 3.2.1 Structural Approaches 63 3.2.2 Augmented Languages 64 3.2.3 Native Compilation Techniques 69 3.3 Visual Languages 72 3.3.1 Behavioural 73 3.3.2 Dataflow 73 3.3.3 Hybrid 74 3.4 Summary 77 4 Design Process 79 4.1 Problem Specification 79 4.2 Algorithm Development 81 4.2.1 Algorithm Development Process 82 4.2.2 Algorithm Structure 83 4.2.3 FPGA Development Issues 86 4.3 Architecture Selection 86 4.3.1 System Level Architecture 87 4.3.2 Computational Architecture 89 4.3.3 Partitioning between Hardware and Software 93 4.4 System Implementation 96 4.4.1 Mapping to FPGA Resources 97 4.4.2 Algorithm Mapping Issues 100 4.4.3 Design Flow 101 4.5 Designing for Tuning and Debugging 102 4.5.1 Algorithm Tuning 102 4.5.2 System Debugging 104 5 Mapping Techniques 107 5.1 Timing Constraints 107 5.1.1 Low Level Pipelining 107 5.1.2 Process Synchronisation 110 5.1.3 Multiple Clock Domains 111 5.2 Memory Bandwidth Constraints 113 5.2.1 Memory Architectures 113 5.2.2 Caching 116 5.2.3 Row Buffering 117 5.2.4 Other Memory Structures 118 vi Contents 5.3 Resource Constraints 122 5.3.1 Resource Multiplexing 122 5.3.2 Resource Controllers 125 5.3.3 Reconfigurability 130 5.4 Computational Techniques 132 5.4.1 Number Systems 132 5.4.2 Lookup Tables 138 5.4.3 CORDIC 142 5.4.4 Approximations 150 5.4.5 Other Techniques 152 5.5 Summary 154 6 Point Operations 155 6.1 Point Operations on a Single Image 155 6.1.1 Contrast and Brightness Adjustment 155 6.1.2 Global Thresholding and Contouring 159 6.1.3 Lookup Table Implementation 162 6.2 Point Operations on Multiple Images 163 6.2.1 Image Averaging 164 6.2.2 Image Subtraction 166 6.2.3 Image Comparison 170 6.2.4 Intensity Scaling 171 6.2.5 Masking 173 6.3 Colour Image Processing 175 6.3.1 False Colouring 175 6.3.2 Colour Space Conversion 176 6.3.3 Colour Thresholding 192 6.3.4 Colour Correction 193 6.3.5 Colour Enhancement 197 6.4 Summary 197 7 Histogram Operations 199 7.1 Greyscale Histogram 199 7.1.1 Data Gathering 201 7.1.2 Histogram Equalisation 206 7.1.3 Automatic Exposure 210 7.1.4 Threshold Selection 211 7.1.5 Histogram Similarity 219 7.2 Multidimensional Histograms 219 7.2.1 Triangular Arrays 220 7.2.2 Multidimensional Statistics 222 7.2.3 Colour Segmentation 226 7.2.4 Colour Indexing 229 7.2.5 Texture Analysis 231 Contents vii 8 Local Filters 233 8.1 Caching 233 8.2 Linear Filters 239 8.2.1 Noise Smoothing 239 8.2.2 Edge Detection 241 8.2.3 Edge Enhancement 243 8.2.4 Linear Filter Techniques 243 8.3 Nonlinear Filters 248 8.3.1 Edge Orientation 250 8.3.2 Non-maximal Suppression 251 8.3.3 Zero-Crossing Detection 252 8.4 Rank Filters 252 8.4.1 Rank Filter Sorting Networks 255 8.4.2 Adaptive Histogram Equalisation 260 8.5 Colour Filters 261 8.6 Morphological Filters 264 8.6.1 Binary Morphology 264 8.6.2 Greyscale Morphology 269 8.6.3 Colour Morphology 270 8.7 Adaptive Thresholding 271 8.7.1 Error Diffusion 271 8.8 Summary 273 9 Geometric Transformations 275 9.1 Forward Mapping 276 9.1.1 Separable Mapping 277 9.2 Reverse Mapping 282 9.3 Interpolation 285 9.3.1 Bilinear Interpolation 286 9.3.2 Bicubic Interpolation 288 9.3.3 Splines 290 9.3.4 Interpolating Compressed Data 292 9.4 Mapping Optimisations 292 9.5 Image Registration 294 9.5.1 Feature-Based Methods 295 9.5.2 Area-Based Methods 299 9.5.3 Applications 305 10 Linear Transforms 309 10.1 Fourier Transform 310 10.1.1 Fast Fourier Transform 311 10.1.2 Filtering 318 10.1.3 Inverse Filtering 320 10.1.4 Interpolation 321 10.1.5 Registration 322 viii Contents 10.1.6 Feature Extraction 323 10.1.7 Goertzel’s Algorithm 324 10.2 Discrete Cosine Transform 325 10.3 Wavelet Transform 328 10.3.1 Filter Implementations 330 10.3.2 Applications of the Wavelet Transform 335 10.4 Image and Video Coding 336 11 Blob Detection and Labelling 343 11.1 Bounding Box 343 11.2 Run-Length Coding 346 11.3 Chain Coding 347 11.3.1 Sequential Implementation 347 11.3.2 Single Pass Algorithms 348 11.3.3 Feature Extraction 350 11.4 Connected Component Labelling 352 11.4.1 Random Access Algorithms 353 11.4.2 Multiple-Pass Algorithms 353 11.4.3 Two-Pass Algorithms 354 11.4.4 Single-Pass Algorithms 356 11.4.5 Multiple Input Labels 358 11.4.6 Further Optimisations 358 11.5 Distance Transform 359 11.5.1 Morphological Approaches 360 11.5.2 Chamfer Distance 360 11.5.3 Separable Transform 362 11.5.4 Applications 365 11.5.5 Geodesic Distance Transform 365 11.6 Watershed Transform 366 11.6.1 Flow Algorithms 366 11.6.2 Immersion Algorithms 367 11.6.3 Applications 369 11.7 Hough Transform 370 11.7.1 Line Hough Transform 371 11.7.2 Circle Hough Transform 373 11.7.3 Generalised Hough Transform 374 11.8 Summary 375 12 Interfacing 377 12.1 Camera Input 378 12.1.1 Camera Interface Standards 378 12.1.2 Deinterlacing 383 12.1.3 Global and Rolling Shutter Correction 384 12.1.4 Bayer Pattern Processing 384 Contents ix 12.2 Display Output 387 12.2.1 Display Driver 387 12.2.2 Display Content 390 12.3 Serial Communication 393 12.3.1 PS2 Interface 393 12.3.2 I2C 395 12.3.3 SPI 397 12.3.4 RS-232 397 12.3.5 USB 398 12.3.6 Ethernet 398 12.3.7 PCI Express 399 12.4 Memory 400 12.4.1 Static RAM 400 12.4.2 Dynamic RAM 401 12.4.3 Flash Memory 402 12.5 Summary 402 13 Testing, Tuning and Debugging 405 13.1 Design 405 13.1.1 Random Noise Sources 406 13.2 Implementation 409 13.2.1 Common Implementation Bugs 410 13.3 Tuning 412 13.4 Timing Closure 412 14 Example Applications 415 14.1 Coloured Region Tracking 415 14.2 Lens Distortion Correction 418 14.2.1 Characterising the Distortion 419 14.2.2 Correcting the Distortion 421 14.3 Foveal Sensor 424 14.3.1 Foveal Mapping 425 14.3.2 Using the Sensor 429 14.4 Range Imaging 429 14.4.1 Extending the Unambiguous Range 431 14.5 Real-Time Produce Grading 433 14.5.1 Software Algorithm 434 14.5.2 Hardware Implementation 436 14.6 Summary 439 References 441 Index 475 x Content
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值