Nothing Special   »   [go: up one dir, main page]

WO2018126485A1 - 并行图像色彩增强方法和装置 - Google Patents

并行图像色彩增强方法和装置 Download PDF

Info

Publication number
WO2018126485A1
WO2018126485A1 PCT/CN2017/070671 CN2017070671W WO2018126485A1 WO 2018126485 A1 WO2018126485 A1 WO 2018126485A1 CN 2017070671 W CN2017070671 W CN 2017070671W WO 2018126485 A1 WO2018126485 A1 WO 2018126485A1
Authority
WO
WIPO (PCT)
Prior art keywords
parallel
buffer
lookup
lookup table
data
Prior art date
Application number
PCT/CN2017/070671
Other languages
English (en)
French (fr)
Inventor
刘壮
郭若杉
谭吉来
李瑞玲
韩睿
李晨
Original Assignee
中国科学院自动化研究所
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国科学院自动化研究所 filed Critical 中国科学院自动化研究所
Priority to PCT/CN2017/070671 priority Critical patent/WO2018126485A1/zh
Publication of WO2018126485A1 publication Critical patent/WO2018126485A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/14Picture signal circuitry for video frequency region
    • H04N5/20Circuitry for controlling amplitude response
    • H04N5/202Gamma control

Definitions

  • the invention belongs to the field of video image processing, and in particular relates to a parallel image color enhancement method and device.
  • one of the mainstream development directions of video technology is ultra high definition (4K resolution) display technology.
  • 4K resolution 4K resolution
  • the number of pixels in 4K video is increased from 2M to 8M, which puts higher requirements on the image quality and performance of image enhancement algorithms.
  • the image color enhancement technology is basically based on three-dimensional interpolation.
  • color conversion is needed by table lookup and interpolation.
  • the traditional scheme faces two difficulties in the ultra-high-definition era. 1
  • the traditional scheme usually adopts a dedicated hardware circuit of the solidification algorithm, and it is difficult to flexibly modify the algorithm. When the algorithm needs to be modified, the reflow is required, and the cost pressure is huge; In the implementation of parallel table lookup, the program usually uses multiple memory access channels to work in parallel, which increases the hardware cost.
  • the present invention proposes a parallel image color enhancement device and method, which is mainly used for realizing low-cost, high-speed parallel table lookup, and supports reconstruction of hardware according to image processing algorithms; Interpolation weight real-time calculations for different resolutions and lookup tables and parallel gray-scale mapping operations.
  • a parallel image color enhancement method including the following steps:
  • Step 1 loading image data, calculating a three-dimensional look-up table coefficient and an interpolation weight;
  • the three-dimensional look-up table coefficient is an index coefficient corresponding to an entry of a lookup table of each individual color channel;
  • Step 2 based on the lookup table, obtain the RGB three-channel lookup table result of the interpolation by using a table lookup operation;
  • Step 3 Calculate the RGB value of each interpolation point based on the look-up result of step 2 and the interpolation weight, and output the result.
  • step 1 is further provided with a parameter pre-loading step, including: loading a three-dimensional RGB spatial color lookup table and calculating parameters required for interpolation weights into a buffer; the three-dimensional RGB spatial color lookup table is R, G, and B. A lookup table for separate color channels.
  • the RGB three-channel look-up table result obtained by the interpolation is obtained by the table look-up operation, and the gray-scale transform is performed by using the segment look-up table, and the following steps are included:
  • Step 22 Perform a table lookup on the M sub-lookup tables of size N by the lower byte of the pixel gray value;
  • step 23 the M table lookup results are filtered by the high order byte, and finally the lookup table data is obtained as a result of the gray scale transformation.
  • the buffer unit size in the buffer is N pixels; the buffer is equipped with 4 read ports and 4 write ports.
  • the buffer supports direct reading and writing of the buffer unit therein using the serial number; the buffer operates in synchronization with the computing unit.
  • a parallel image color enhancement apparatus comprising a local memory, a memory access control unit, a buffer, a parallel arithmetic logic unit ALU, a parallel multiply accumulator MAC, a state machine, and a data interleaving unit SHU ;
  • the local memory is configured to save input and output image data and parameters required by a parallel video image contrast enhancement algorithm, and the memory supports parallel access;
  • the memory access control unit is configured to exchange data between the local memory and the buffer
  • the buffer is used to buffer all data and intermediate results required for a complete processing flow, and the buffer can be directly indexed by an address;
  • the parallel arithmetic logic unit is configured to perform non-multiplication-like arithmetic and logic operations involved in a parallel video image contrast enhancement algorithm
  • the parallel multiply accumulator is configured to perform a multiplication correlation operation
  • the state machine for generating control signals for all functional components
  • the data interleaving unit is configured to perform a parallel table lookup operation
  • the state machine is respectively connected to the data interleaving unit, the buffer, the parallel multiply accumulator, the parallel arithmetic logic unit, and the memory access control unit through a communication line;
  • the local memory is connected to the memory access control unit through a communication line;
  • the buffer Connected to the memory access control unit, the data interleaving unit, the parallel arithmetic logic unit, and the parallel multiply accumulator respectively through a communication line;
  • the data interleaving unit is respectively connected to the parallel arithmetic logic unit and the parallel multiply accumulator via a communication line;
  • the parallel arithmetic The logic unit is connected to the parallel multiplier accumulator via a communication line.
  • the data buffered by the buffer further includes a three-dimensional RGB spatial color lookup table; the three-dimensional RGB spatial color lookup table is a lookup table of three color independent channels of R, G, and B colors.
  • FIG. 1 is a schematic structural view of a parallel image color enhancement device of the present invention
  • FIG. 2 is a schematic flow chart of a parallel image color enhancement method of the present invention
  • FIG. 3 is a schematic diagram of a buffer of a buffer according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a three-dimensional look-up table and three-dimensional interpolation according to an embodiment of the present invention.
  • a parallel image color enhancement device of the present invention includes a local memory, a memory access control unit, a buffer, an parallel arithmetic logic unit (ALU), a parallel multiply accumulator (MAC), a state machine, and a data interleaving. Unit (SHU);
  • ALU parallel arithmetic logic unit
  • MAC parallel multiply accumulator
  • SHU data interleaving. Unit
  • the local memory is configured to save input and output image data and parameters required by a parallel video image contrast enhancement algorithm, and the memory supports parallel access;
  • the memory access control unit is used for data exchange between the local memory and the buffer; in this embodiment, three memory access control units with the same function are completely used, which breaks through the bottleneck of the memory of the memory;
  • the buffer is configured to buffer all data and intermediate results required for a complete processing flow, and the buffer may be directly indexed by an address; the data buffered by the buffer further includes a three-dimensional RGB space color lookup table;
  • the three-dimensional RGB space color lookup table is a lookup table of three color channels of R, G, and B;
  • the parallel arithmetic logic unit is configured to perform non-multiplication-like arithmetic and logic operations involved in a parallel video image contrast enhancement algorithm
  • the parallel multiply accumulator is configured to perform a multiplication correlation operation
  • the state machine for generating control signals for all functional components
  • the data interleaving unit is configured to perform a parallel table lookup operation
  • the state machine is respectively connected to the data interleaving unit, the buffer, the parallel multiply accumulator, the parallel arithmetic logic unit, and the memory access control unit through a communication line;
  • the local memory is connected to the memory access control unit through a communication line;
  • the buffer Connected to the memory access control unit, the data interleaving unit, the parallel arithmetic logic unit, and the parallel multiply accumulator respectively through a communication line;
  • the data interleaving unit is respectively connected to the parallel arithmetic logic unit and the parallel multiply accumulator via a communication line;
  • the parallel arithmetic The logic unit is connected to the parallel multiplier accumulator via a communication line.
  • the device When the enhancement algorithm needs to be changed, the device only needs to reprogram the SPU and the state machine, generate new gray mapping functions and control signals, and update the algorithm parameters in the local memory to quickly implement the algorithm iteration without Redesigned and manufactured hardware circuits.
  • the parallel image color enhancement method proposed by the invention realizes image color saturation improvement by utilizing the RGB color space three-dimensional lookup table and three-dimensional interpolation.
  • the invention can fully utilize the high-speed universal buffer and the data interleaving unit, so that the image data only needs to perform a reading and writing operation on the local memory, which significantly reduces the requirement for the memory access bandwidth.
  • the efficiency is improved, and the data interleaving unit can improve the efficiency of the table lookup operation to N times of the traditional table lookup method, and N is the parallelism of the system.
  • a parallel image color enhancement method proposed by the present invention includes the following steps:
  • Step 1 parameter calculation: loading image data, calculating a three-dimensional look-up table coefficient and an interpolation weight; the three-dimensional look-up table coefficient is an index coefficient corresponding to an entry of a lookup table of each individual color channel;
  • Step 2 Obtain the result of the table lookup: based on the lookup table, obtain the RGB three-channel lookup table result of the interpolation by the table lookup operation;
  • Step 3 three-dimensional interpolation: Calculate the RGB value of each interpolation point based on the result of the look-up of step 2 and the interpolation weight, and output the result.
  • Step 1 is further provided with a parameter pre-loading step, comprising: loading a three-dimensional RGB spatial color lookup table and parameters required for calculating the interpolation weight into the buffer; the three-dimensional RGB spatial color lookup table is a separate color of R, G, and B colors.
  • the lookup table for the channel is further provided with a parameter pre-loading step, comprising: loading a three-dimensional RGB spatial color lookup table and parameters required for calculating the interpolation weight into the buffer; the three-dimensional RGB spatial color lookup table is a separate color of R, G, and B colors.
  • the lookup table for the channel is further provided with a parameter pre-loading step, comprising: loading a three-dimensional RGB spatial color lookup table and parameters required for calculating the interpolation weight into the buffer; the three-dimensional RGB spatial color lookup table is a separate color of R, G, and B colors. The lookup table for the channel.
  • the three-dimensional RGB spatial color lookup table and a number of parameters required for calculating the interpolation weight are loaded into the general-purpose buffer; the three-dimensional RGB spatial color lookup table is a look-up table of three color channels of R, G, and B.
  • the buffer (represented by a capital letter M) coexists with NM buffer units of size N pixels, equipped with four read ports (r0, r1, r2, r3) and 4 writes.
  • the ingress port (w0, w1, w2, w3) can carry high-speed read and write operations.
  • the buffer M supports direct reading and writing of NM buffer units by using serial numbers, which facilitates repeated use of data.
  • the buffer used in the present invention operates in synchronization with the arithmetic unit, avoiding the problem that the high speed computing unit waits for the low speed storage unit.
  • the present invention adopts a three-dimensional interpolation method to implement color mapping in the RGB space.
  • P point is the point to be inserted in the RGB space
  • P000, P001, P010, P011, P100, P101, P110, P111 are the points corresponding to the table item data obtained by looking up the table
  • Pt and Pb are respectively P points.
  • 8 points of P000 ⁇ P111 are nearest to P and exist in the lookup table.
  • the RGB value of point P needs to be obtained by weighting the RGB values of these 8 points.
  • an equally divided 5 ⁇ 5 ⁇ 5 lookup table is used, that is, there are three lookup tables of 125 item data (corresponding to R, G, and B respectively). aisle).
  • the index coefficient corresponding to the lookup table entry of each individual color channel ie, the lookup table coefficient
  • index kr ⁇ 25+kg ⁇ 5+kb, and the index values of the RGB three channels are the same; kr ⁇ [0,4],kg ⁇ [0,4], kb ⁇ [0, 4];
  • the method of calculating the index coefficients of the eight entries corresponding to each pixel is to first calculate the corresponding kr, kg, kb:
  • r, g, b indicate corresponding color channel pixel values
  • kr0, kg0, kb0, kr1, kg1, kb1 are intermediate variables for calculating the eight point positions of P000-P111, passing the P point to be mapped
  • the RGB three-channel value is calculated.
  • look-up factor of P000 can be calculated; similarly, it can be calculated in turn.
  • indexABC krA ⁇ 25+kgB ⁇ 5+kbC
  • the image data is first loaded into the arithmetic logic unit (ALU), and the shift and addition operations are performed in the ALU to obtain the six parameters of kr0, kg0, kb0, kr1, kg1, and kb1. Then, these six parameters are sent to the multiply accumulator MAC, and the corresponding 8 index coefficients are calculated and temporarily stored in the buffer M for call.
  • ALU arithmetic logic unit
  • % means modulo, r, g, b represent corresponding color channel pixel values
  • the interpolation coefficients of the eight entry points are calculated as follows:
  • W010 wr0*wg1*wb0
  • the image data is first loaded into the ALU, and the modulo and subtraction operations are performed in the ALU; the calculation result is sent to the MAC and the multiplication operation is performed to obtain the interpolation weight; the interpolation weight is also temporarily stored in the buffer M.
  • the RGB three-channel lookup table result of the interpolation is obtained by the lookup table operation
  • the method of the present invention implements parallelization of table lookup operations by a data interleaving unit.
  • the data interleaving unit (SHU) has a degree of parallelism of N, that is, a table for supporting N pairs of pixels having a size of N (may not be N, specifically set according to requirements, and is merely exemplified herein).
  • N a degree of parallelism of N
  • each register of the SHU can store 64 table item data.
  • the SHU unit for performing table lookup operations can look up the LUT of length 64 items at a time, so it is necessary to have a length of 125.
  • the LUT is divided into two sub-LUTs.
  • the index coefficient is first loaded into the ALU, and the table lookup coefficient (lower 6 bits) and the screening flag (7th bit) are calculated; then the table lookup coefficients are sent to the data interleaving unit SHU to complete the parallel lookup table, and two checks are performed. The result of the table is returned to the ALU; finally, the data filtering is completed in the ALU, and the screening result is saved to the general buffer M.
  • the device is not only suitable for the case where the lookup table size is 125, but is generally applicable to various sizes of three-dimensional lookup tables involved in the field of image processing.
  • R000 is the r channel value corresponding to P000, and the remaining color channel is the same as the corresponding table item point, for example, g000, g001, g010, g011, g100, g101, g110, g111 are P000, P001, P010, P011, P100, P101, respectively.
  • This step needs to simultaneously load the interpolation weight and the corresponding color channel pixel value to the MAC, and perform a multiply and accumulate operation.
  • Each pixel needs to perform 3 ⁇ 8 multiply and accumulate calculations, and finally obtains the RGB channel data of the interpolation point to achieve color saturation enhancement.
  • the above process explains the complete processing flow of the present invention.
  • the invention realizes the reuse of hardware resources by programming the state machine and using the general buffer design, and avoids the design of the traditional dedicated circuit scheme when running the complex algorithm.
  • the shortcomings of long stream period and high version iteration cost are the shortcomings of long stream period and high version iteration cost.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Color Image Communication Systems (AREA)
  • Image Processing (AREA)

Abstract

一种并行图像色彩增强方法,包括:步骤1,加载图像数据,计算三维查表系数和插值权重;所述三维查表系数为每个单独色彩通道的查找表的表项对应的索引系数;步骤2,基于查找表,通过查表操作获取插值所需RGB三通道查表结果;步骤3,基于步骤2的查表结果以及所述插值权重计算每个插值点的RGB值,并输出结果。一种并行图像色彩增强装置,包括局部存储器、访存控制单元、缓冲器、并行算术逻辑单元、并行乘累加器、状态机、数据交织单元。上述方法增强了图像色彩,提高了数据的使用效率,减少了运算部件与外围存储器之间的数据交互,降低了访存带宽压力,实现了硬件资源的重复利用。

Description

并行图像色彩增强方法和装置 技术领域
本发明属于视频图像处理领域,具体涉及一种并行图像色彩增强方法和装置。
背景技术
目前,视频技术的主流发展方向之一为超高清(4K分辨率)显示技术。相对于高清(1920*1080)视频,4K视频的像素数从2M提升到8M,因此对图像增强算法的画质和效能提出了更高的要求。
当前,图像色彩增强技术基本上以三维插值为基础,在进行增强时,需要通过查表和插值实现色彩变换,对于RGB图像,每个像素对应RGB三个通道,需要查表3×8=24次,并且需要计算8个权重,每个权重需要进行两次乘法运算,计算量较大,在面对4K图像处理需求时,很有可能处理能力不足的问题。
因此,传统方案在超高清时代面临两个困难,1传统方案通常采用固化算法的专用硬件电路,难以对算法进行灵活修改,当需要修改算法时,需要重新设计流片,成本压力巨大;2传统方案在实现并行查表时,通常采用多个访存通道并行工作,增加了硬件成本。
针对这两个问题,本发明提出了一种并行的图像色彩增强装置以及方法,该装置主要用于实现低成本,高速并行查表,同时支持根据图像处理算法对硬件进行重构;该方法实现了针对不同分辨率和查找表的插值权重实时计算以及并行的灰度映射操作。
发明内容
为了解决现有技术中的上述问题,即为了进一步提升超高清图像的色彩增强处理速度,本发明的一方面,提出了一种并行图像色彩增强方法,包括以下步骤:
步骤1,加载图像数据,计算三维查表系数和插值权重;所述三维查表系数为每个单独色彩通道的查找表的表项对应的索引系数;
步骤2,基于查找表,通过查表操作获取插值所需RGB三通道查表结果;
步骤3,基于步骤2的查表结果以及所述插值权重计算每个插值点的RGB值,并输出结果。
优选地,步骤1之前还设置有参数预加载步骤,包括:将三维RGB空间颜色查找表以及计算插值权重所需参数加载至缓冲器;所述三维RGB空间颜色查找表为R、G、B三色单独色彩通道的查找表。
优选地,所述通过查表操作获取插值所需RGB三通道查表结果,采用分段查表进行灰度变换,包括以下步骤:
步骤21,将所述灰度映射查找表拆分为M个子查找表;M=L/N,M值会向上取整,其中,L为所述灰度映射查找表的大小,N为预设的并行度;
步骤22,通过像素灰度值的低位字节对M个大小为N的子查找表进行查表;
步骤23,通过高位字节对M个查表结果进行筛选,最终获得查表数据作为灰度变换的结果。
优选地,所述缓冲器中缓冲单元大小为N个像素;所述缓冲器配备有4个读取端口和4个写入端口。
优选地,缓冲器支持直接使用序号对其中的缓冲单元进行读写;缓冲器与运算部件同步运行。
本发明的另一方面,提出了一种并行图像色彩增强装置,该装置包括局部存储器、访存控制单元、缓冲器、并行算术逻辑单元ALU、并行乘累加器MAC、状态机、数据交织单元SHU;
所述局部存储器,用于保存输入输出图像数据以及并行视频图像对比度增强算法所需参数,该存储器支持并行访问;
所述访存控制单元,用于局部存储器与缓冲器之间的数据交换;
所述缓冲器,用于缓冲一次完整的处理流程所需要的全部数据以及中间结果,该缓冲区可以通过地址直接索引;
所述并行算术逻辑单元,用于执行并行视频图像对比度增强算法中涉及的非乘法类算术与逻辑运算;
所述并行乘累加器,用于对执行乘法相关运算;
所述状态机,用于产生所有功能部件的控制信号;
所述数据交织单元,用于并行查表操作;
所述状态机分别通过通信线路与数据交织单元、缓冲器、并行乘累加器、并行算术逻辑单元、访存控制单元连接;所述局部存储器通过通信线路与访存控制单元连接;所述缓冲器分别通过通信线路与访存控制单元、数据交织单元、并行算术逻辑单元、并行乘累加器连接;所述数据交织单元分别通过通信线路与并行算术逻辑单元、并行乘累加器连接;所述并行算术逻辑单元通过通信线路与并行乘累加器连接。
优选地,所述缓冲器所缓存的数据还包括三维RGB空间颜色查找表;所述三维RGB空间颜色查找表为R、G、B三色单独色彩通道的查找表。
从上述技术方案可以看出,本发明具有以下有益效果:
(1)增强了图像色彩,使画面更加鲜艳;
(2)易于对图像处理算法进行后期优化升级;
(3)提高了数据的使用效率,减少了运算部件与外围存储器之间的数据交互,降低了访存带宽压力;
(4)通过使用通用缓冲区和状态机对功能部件进行控制,实现了硬件资源的重复利用。
附图说明
图1是本发明的并行图像色彩增强装置结构示意图;
图2是本发明的并行图像色彩增强方法的流程示意图;
图3是本发明一实施例的缓冲器的缓冲区示意图;
图4是本发明一实施例的三维查表以及三维插值示意图示意图。
具体实施方式
下面参照附图来描述本发明的优选实施方式。本领域技术人员应当理解的是,这些实施方式仅仅用于解释本发明的技术原理,并非旨在限制本发明的保护范围。
本发明的一种并行图像色彩增强装置,如图1所示,包括局部存储器、访存控制单元、缓冲器、并行算术逻辑单元(ALU)、并行乘累加器(MAC)、状态机、数据交织单元(SHU);
所述局部存储器,用于保存输入输出图像数据以及并行视频图像对比度增强算法所需参数,该存储器支持并行访问;
所述访存控制单元,用于局部存储器与缓冲器之间的数据交换;本实施例中采用三个功能完全一致的访存控制单元,突破了访存资源瓶颈;
所述缓冲器,用于缓冲一次完整的处理流程所需要的全部数据以及中间结果,该缓冲区可以通过地址直接索引;所述缓冲器所缓存的数据还包括三维RGB空间颜色查找表;所述三维RGB空间颜色查找表为R、G、B三色单独色彩通道的查找表;
所述并行算术逻辑单元,用于执行并行视频图像对比度增强算法中涉及的非乘法类算术与逻辑运算;
所述并行乘累加器,用于对执行乘法相关运算;
所述状态机,用于产生所有功能部件的控制信号;
所述数据交织单元,用于并行查表操作;
所述状态机分别通过通信线路与数据交织单元、缓冲器、并行乘累加器、并行算术逻辑单元、访存控制单元连接;所述局部存储器通过通信线路与访存控制单元连接;所述缓冲器分别通过通信线路与访存控制单元、数据交织单元、并行算术逻辑单元、并行乘累加器连接;所述数据交织单元分别通过通信线路与并行算术逻辑单元、并行乘累加器连接;所述并行算术逻辑单元通过通信线路与并行乘累加器连接。
当需要更改增强算法时,该装置仅需要对SPU和状态机进行重新编程,产生新的灰度映射函数和控制信号,同时更新局部存储器中的算法参数,即可快速实现算法迭代,而不需要重新设计制造硬件电路。
本发明提出的一种并行图像色彩增强方法,通过利用RGB色彩空间三维查找表以及三维插值,实现图像色彩饱和度提升。本发明可以充分利用高速通用缓冲区和数据交织单元,使得图像数据仅需要对局部存储器进行一次读取与写入操作,显著降低了对访存带宽的需求, 提高了效率,同时数据交织单元可以使查表操作的效率提高至传统查表方法的N倍,N为系统的并行度。
本发明提出的一种并行图像色彩增强方法,如图2所示,包括以下步骤:
步骤1,参数计算:加载图像数据,计算三维查表系数和插值权重;所述三维查表系数为每个单独色彩通道的查找表的表项对应的索引系数;
步骤2,获取查表结果:基于查找表,通过查表操作获取插值所需RGB三通道查表结果;
步骤3,三维插值:基于步骤2的查表结果以及所述插值权重计算每个插值点的RGB值,并输出结果。
步骤1之前还设置有参数预加载步骤,包括:将三维RGB空间颜色查找表以及计算插值权重所需参数加载至缓冲器;所述三维RGB空间颜色查找表为R、G、B三色单独色彩通道的查找表。
1、参数预加载
将三维RGB空间颜色查找表以及计算插值权重需要的若干参数加载至通用缓冲区;所述三维RGB空间颜色查找表为R、G、B三色单独色彩通道的查找表。
图3为本发明一实施例的缓冲器。如图3所示,所述缓冲器(用大写字母M代表)共存在NM个大小为N个像素的缓冲单元,配备有4个读取端口(r0、r1、r2、r3)和4个写入端口(w0、w1、w2、w3),可以承载高速读写操作。缓冲器M支持直接使用序号对其NM个缓冲单元进行读写,便于对数据的重复使用。本发明所采用的缓冲器与运算部件同步运行,避免了高速运算部件等待低速存储部件的问题。
2、参数计算
基于加载图像数据,计算三维查表系数和插值权重;如图4所示,本发明采用了三维插值方法实现RGB空间内的色彩映射。
图4中P点为RGB空间中待插值点,P000、P001、P010、P011、P100、P101、P110、P111八个点为查表获得的表项数据对应的点,Pt、Pb分别为P点到立方体顶部面和底部面垂线的焦点,P000~P111的8点与P最近邻且存在于查找表中,P点的RGB值需要通过对这8个点的RGB值进行加权获得。
在本发明一实施例中,在8bit量化的RGB空间中,采用了等分的5×5×5查找表,即存在3个125个表项数据的查找表(分别对应R、G、B三通道)。每个单独色彩通道的查找表表项对应的索引系数(即查表系数)index=kr×25+kg×5+kb,RGB三通道的index值相同;kr∈[0,4],kg∈[0,4],kb∈[0,4];计算每个像素点所对应8个表项的索引系数的方法是,首先计算出相应的kr,kg,kb:
kr0=r>>6  kg0=g>>6  kb0=b>>6
kr1=kr0+1  kg1=kg0+1  kb1=kb0+1
其中>>表示右移,r、g、b表示对应的颜色通道像素值;kr0、kg0、kb0、kr1、kg1、kb1是计算P000-P111八个点位置的中间变量,通过待映射的P点的RGB三通道值计算得到。
当计算P000的查表索引系数时,将kr0、kg0、kb0带入索引系数计算公式index=kr×25+kg×5+kb,即可算出P000的查表系数;同理,可以依次计算出所需8个表项的相应索引系数,公式为indexABC=krA×25+kgB×5+kbC,例如P000的索引系数index000=kr0×25+kg0×5+kb0,P001的索引系数index001=kr0×25+kg0×5+kb1。
计算索引系数时,首先要将图像数据加载至算术逻辑单元(ALU),在ALU中完成移位和加法运算,从而求得所需要kr0、kg0、kb0、kr1、kg1、kb1六个参数。然后将这六个参数发送至乘累加器MAC中,计算出相应的8个索引系数并暂存于缓冲器M中,以备调用。
计算插值权重时,首先计算P点三通道像素值在各自色彩轴方向上的线性插值系数:
wr0=64-r%6  wg0=64-g%6  wb0=64-b%6
wr1=64-wr0  wg1=64-wg0   wb1=64-wb0
其中%表示取模,r、g、b表示对应的颜色通道像素值;
进而计算出8个插值权重,如下所示
8个表项点的插值系数通过如下方法计算:
w000=wr0*wg0*wb0
w001=wr0*wg0*wb1
w010=wr0*wg1*wb0
w011=wr0*wg1*wb1
w100=wr1*wg0*wb0
w101=wr1*wg0*wb1
w110=wr1*wg1*wb0
w111=wr1*wg1*wb1
计算插值权重时,首先要将图像数据加载至ALU,在ALU中完成取模和减法运算;计算结果发送至MAC并完成乘法运算从而求得插值权重;插值权重同样暂存于缓冲器M中。
3、获取查表结果
基于查找表,通过查表操作获取插值所需RGB三通道查表结果;
本发明所述方法通过数据交织单元实现查表操作的并行化。数据交织单元(SHU)的并行度为N,即支持N个像素对大小为N(也可以不为N,具体根据需求设定,此处仅为举例说明)的表进行查表操作。通常情况下,整个查找表(LUT)的大小L会大于N,因此,所述方法采用了分段查表实现灰度变换:首先将整个查找表分为M个子查找表,M=L/N,M值会向上取整。同时通过像素灰度值的低位字节对M个大小为N的子查找表进行查表,并通过高位字节对M个查表结果进行筛选,最终获得查表数据。为使这一步骤的工作方式更清晰,下面以本实施例为例进行说明:在本实施例中,运算并行度N=32,查找表大小为125,其2进制表示为1个7位二进制数,SHU每个的寄存器可以保存64个表项数据,本实施例中用于进行查表操作的SHU单元每次可以对长度为64项的LUT进行查表,故需要将长度为125的LUT分割为两个子LUT,因此,对每个色彩通道进行查表,需要进行两次查找和一次结果筛选:查表时,首先根据index的低6位数从两个子LUT中分别获取对应位置的数据,再通过第7位对结果进行筛选选取真正的有效数据,从而获得所需查表值。对三个通道重复此操作,即可完成RGB三维查找。
该步骤总共需要进行3×8×2=48次并行查表和24次筛选。执行过程中,索引系数首先加载至ALU,计算查表系数(低6位)和筛选标志(第7位);然后将查表系数发送至数据交织单元SHU完成并行查表,并将两个查表结果返回ALU;最后在ALU中完成数据筛选,筛选结果保存至通用缓冲区M。
上述过程以N=32,L=125为例,但本领域技术人员可以了解,本发明并不仅仅限于该情况,即本发明还可以改变所述装置的并行度N,以获得新的并行色彩增强装置;同时,所述装置也不仅适用于查找表大小为125的情况,而是普遍适用于图像处理领域所涉及的各种大小的三维查找表。
4、三维插值
利用上述步骤获得的查表结果以及插值权重,即可计算出每个插值点的RGB值:
r=w000*r000+w001*r001+...+w111*r111
g=w000*g000+w001*g001+...+w111*g111
b=w000*b000+w001*b001+...+w111*b111
r000为P000对应的r通道值,剩余颜色通道和对应表项点同理,例如g000、g001、g010、g011、g100、g101、g110、g111分别为P000、P001、P010、P011、P100、P101、P110、P111对应的g通道值。
该步骤需要同时将插值权重以及对应的色彩通道像素值加载至MAC,并进行乘累加运算。每个像素点需要进行3×8次乘累加计算,并最终求得插值点的RGB通道数据,实现色彩饱和度增强。
上述过程对本发明的完整处理流程进行了解释说明,本发明通过对状态机的编程以及使用通用缓冲区设计,实现了硬件资源的重复利用,在运行复杂算法时,避免了传统的专用电路方案设计流片周期长且版本迭代成本高的不足之处。
所属技术领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置的具体工作过程及有关说明,可以参考前述方法实施例中的对应过程,在此不再赘述。
本领域技术人员应该能够意识到,结合本文中所公开的实施例描述的各示例的单元及方法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明电子硬件和软件的可互换性,在上 述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以电子硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
至此,已经结合附图所示的优选实施方式描述了本发明的技术方案,但是,本领域技术人员容易理解的是,本发明的保护范围显然不局限于这些具体实施方式。在不偏离本发明的原理的前提下,本领域技术人员可以对相关技术特征作出等同的更改或替换,这些更改或替换之后的技术方案都将落入本发明的保护范围之内。

Claims (7)

  1. 一种并行图像色彩增强方法,其特征在于,包括以下步骤:
    步骤1,加载图像数据,计算三维查表系数和插值权重;所述三维查表系数为每个单独色彩通道的查找表的表项对应的索引系数;
    步骤2,基于查找表,通过查表操作获取插值所需RGB三通道查表结果;
    步骤3,基于步骤2的查表结果以及所述插值权重计算每个插值点的RGB值,并输出结果。
  2. 根据权利要求1所述的方法,其特征在于,步骤1之前还设置有参数预加载步骤,包括:将三维RGB空间颜色查找表以及计算插值权重所需参数加载至缓冲器;所述三维RGB空间颜色查找表为R、G、B三色单独色彩通道的查找表。
  3. 根据权利要求1所述的方法,其特征在于,所述通过查表操作获取插值所需RGB三通道查表结果,采用分段查表进行灰度变换,包括以下步骤:
    步骤21,将所述灰度映射查找表拆分为M个子查找表;M=L/N,M值会向上取整,其中,L为所述灰度映射查找表的大小,N为预设的并行度;
    步骤22,通过像素灰度值的低位字节对M个大小为N的子查找表进行查表;
    步骤23,通过高位字节对M个查表结果进行筛选,最终获得查表数据作为灰度变换的结果。
  4. 根据权利要求3所述的方法,其特征在于,所述缓冲器中缓冲单元大小为N个像素;所述缓冲器配备有4个读取端口和4个写入端口。
  5. 根据权利要求4所述的方法,其特征在于,缓冲器支持直接使用序号对其中缓冲单元进行读写;缓冲器与运算部件同步运行。
  6. 一种并行图像色彩增强装置,其特征在于,该装置包括局部存储 器、访存控制单元、缓冲器、并行算术逻辑单元、并行乘累加器、状态机、数据交织单元;
    所述局部存储器,用于保存输入输出图像数据以及并行视频图像对比度增强算法所需参数,该存储器支持并行访问;
    所述访存控制单元,用于局部存储器与缓冲器之间的数据交换;
    所述缓冲器,用于缓冲一次完整的处理流程所需要的全部数据以及中间结果,该缓冲区可以通过地址直接索引;
    所述并行算术逻辑单元,用于执行并行视频图像对比度增强算法中涉及的非乘法类算术与逻辑运算;
    所述并行乘累加器,用于对执行乘法相关运算;
    所述状态机,用于产生所有功能部件的控制信号;
    所述数据交织单元,用于并行查表操作;
    所述状态机分别通过通信线路与数据交织单元、缓冲器、并行乘累加器、并行算术逻辑单元、访存控制单元连接;所述局部存储器通过通信线路与访存控制单元连接;所述缓冲器分别通过通信线路与访存控制单元、数据交织单元、并行算术逻辑单元、并行乘累加器连接;所述数据交织单元分别通过通信线路与并行算术逻辑单元、并行乘累加器连接;所述并行算术逻辑单元通过通信线路与并行乘累加器连接。
  7. 根据权利要求6所述的装置,其特征在于,所述缓冲器所缓存的数据还包括三维RGB空间颜色查找表;所述三维RGB空间颜色查找表为R、G、B三色单独色彩通道的查找表。
PCT/CN2017/070671 2017-01-09 2017-01-09 并行图像色彩增强方法和装置 WO2018126485A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/070671 WO2018126485A1 (zh) 2017-01-09 2017-01-09 并行图像色彩增强方法和装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/070671 WO2018126485A1 (zh) 2017-01-09 2017-01-09 并行图像色彩增强方法和装置

Publications (1)

Publication Number Publication Date
WO2018126485A1 true WO2018126485A1 (zh) 2018-07-12

Family

ID=62788900

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/070671 WO2018126485A1 (zh) 2017-01-09 2017-01-09 并行图像色彩增强方法和装置

Country Status (1)

Country Link
WO (1) WO2018126485A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111242872A (zh) * 2020-01-20 2020-06-05 中国科学院西安光学精密机械研究所 一种基于msr的实时rgb图像增强方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101090449A (zh) * 2007-06-19 2007-12-19 华为技术有限公司 色彩空间转换方法及其装置
CN101179650A (zh) * 2007-11-23 2008-05-14 西安交通大学 一种视频图像对比度增强方法及装置
US20090196494A1 (en) * 2008-02-01 2009-08-06 Seiko Epson Corporation Color conversion device, image output device, and color conversion method
CN105657386A (zh) * 2016-01-04 2016-06-08 北京时代奥视科技股份有限公司 基于fpga的图像色彩校正方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101090449A (zh) * 2007-06-19 2007-12-19 华为技术有限公司 色彩空间转换方法及其装置
CN101179650A (zh) * 2007-11-23 2008-05-14 西安交通大学 一种视频图像对比度增强方法及装置
US20090196494A1 (en) * 2008-02-01 2009-08-06 Seiko Epson Corporation Color conversion device, image output device, and color conversion method
CN105657386A (zh) * 2016-01-04 2016-06-08 北京时代奥视科技股份有限公司 基于fpga的图像色彩校正方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111242872A (zh) * 2020-01-20 2020-06-05 中国科学院西安光学精密机械研究所 一种基于msr的实时rgb图像增强方法
CN111242872B (zh) * 2020-01-20 2023-04-11 中国科学院西安光学精密机械研究所 一种基于msr的实时rgb图像增强方法

Similar Documents

Publication Publication Date Title
CN106910168B (zh) 并行图像色彩增强方法
WO2018126486A1 (zh) 并行视频图像对比度增强方法和装置
JP3623972B2 (ja) 図形描画処理装置
JPH04204496A (ja) 表示制御方法
US7679619B2 (en) Data outputting method, data outputting device, liquid crystal panel driving device, and liquid crystal display device
JP5785256B2 (ja) テキストレンダリングのためのルックアップテーブル
US8565519B2 (en) Programmable pattern-based unpacking and packing of data channel information
WO2018126485A1 (zh) 并行图像色彩增强方法和装置
US20160203790A1 (en) Acceleration of color conversion
US20120281915A1 (en) Decoding system and method operable on encoded texture element blocks
CN101640795B (zh) 一种视频解码优化方法及装置
CN106878586B (zh) 可重构的并行图像细节增强方法和装置
WO2018126484A1 (zh) 可重构的并行图像细节增强方法和装置
CN104618717A (zh) 行与块的整合转换方法及其计算机可读取存储介质
JP2003224862A (ja) グラフィックコントローラ及び表示メモリ容量低減方式
CN106709889A (zh) 并行视频图像对比度增强方法和装置
US9412147B2 (en) Display pipe line buffer sharing
CN112132765A (zh) 一种并行视频图像动态范围增强装置及方法
JP3055390B2 (ja) 画像処理装置
US10306200B2 (en) Efficient 10-bit pixel formatting of uncompressed 4K video signals for distributed processing
US12079898B2 (en) Method, computing device and computer readable storage medium for computing
JP4381778B2 (ja) テクスチャ処理装置
CN118214820B (zh) 一种图像数据处理方法、产品、设备及介质
JP5499203B2 (ja) ブロックマッチング回路及びデータ更新方法
JPH1098743A (ja) 輝度信号の計算装置及びその方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17890373

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17890373

Country of ref document: EP

Kind code of ref document: A1