CN108683899A - A kind of color space conversion optimization method of Embedded image processing system - Google Patents

A kind of color space conversion optimization method of Embedded image processing system Download PDF

Info

Publication number
CN108683899A
CN108683899A CN201810465324.0A CN201810465324A CN108683899A CN 108683899 A CN108683899 A CN 108683899A CN 201810465324 A CN201810465324 A CN 201810465324A CN 108683899 A CN108683899 A CN 108683899A
Authority
CN
China
Prior art keywords
color space
image processing
processing system
space conversion
optimization method
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201810465324.0A
Other languages
Chinese (zh)
Inventor
唐伟
韦晓林
朱恩
雷阳
买博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Southeast University
Original Assignee
Southeast University
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 Southeast University filed Critical Southeast University
Priority to CN201810465324.0A priority Critical patent/CN108683899A/en
Publication of CN108683899A publication Critical patent/CN108683899A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals

Abstract

The invention discloses a kind of color space conversion optimization method of Embedded image processing system, the specific steps are:Multiplication table makes;Threshold value table makes;Obtain the data group of yuv format;Multiplication table is looked into, respective components is obtained and carries out arithmetical operation;Using the result of arithmetical operation as index, threshold value table is looked into, RGB component is obtained.The floating-point operation that conversion is used is converted into the process tabled look-up by the invention, is reduced taking for image color space conversion, is accelerated embedded system image preprocessing process, and then enhance the real-time of embedded system.

Description

A kind of color space conversion optimization method of Embedded image processing system
Technical field
The present invention is a kind of color space conversion optimization method, and in particular to a kind of Embedded image processing system Color space conversion optimization method.
Background technology
RGB and YUV is more common two kinds of color spaces in Digital Image Processing, there is specific conversion between them Relationship.And the camera commonly based on UVC agreements usually can not directly provide unpressed rgb format video data, therefore Color space conversion operation must be executed in the pre-processing image data stage.
In conventional solution, the conversion operation of YUY to rgb color space is realized by software program completely, i.e., by YUV To the conversion formula software code realization of RGB, this method is simple and is well used.
But traditional color space switching software programming has the shortcomings that as follows:
1) it is related to high-precision fractional arithmetic.Fractional arithmetic is that longest operation is taken in single cycle.
2) cycle-index is more.So-called cycle-index is not necessarily referring to number specified in for cycles, but needed for transformational relation The number for executing operation, for the image of specified resolution, the constant number for image slices vegetarian refreshments of cycle-index, therefore at this It can not be optimized substantially on direction.Cycle-index is related with image resolution ratio, with the raising of resolution ratio, image interior pixels It counts out and increases therewith, therefore the time expended needed for color space conversion will be extended, this whole system directly affected Real-time process performance.
3) it needs to carry out threshold decision.Threshold decision realizes that threshold decision refers to completing color by the judgement of if sentences The numberical range of tri- components of RGB is defined after color space conversion, the value that will be greater than 255 is set as 255 while will be small Numerical value in 0 is revised as 0.In initial program design, which is mainly judged by if sentences to realize, a frame The color space transfer process of image needs * 3 if sentences judgements of N (pixel number).
Directly realize that the transfer process can be than relatively time-consuming by way of software calculating on embedded platform.With 640* For the image of 360 resolution ratio, the image datas of YUV422 formats needs to execute 640* during being converted to rgb format altogether 360/2 calculating, therefore can also be stepped up with the increase of image resolution ratio the time required to the conversion of this color space.
Invention content
Goal of the invention:For overcome the deficiencies in the prior art, the present invention provides a kind of color of Embedded processing system Color space converts optimization method, and this method solve embedded image system image pre-treating speed is slow, image color space turns Change that time-consuming, the problem of embedded system real-time difference.
Technical solution:The color space of Embedded processing system of the present invention converts optimization method, this method Include the following steps:
(1) four multiplication tables are defined, rv_table, gv_table, gu_table, bu_table are respectively designated as;According to Floating-point coefficient in the conversion formula is expanded certain multiple so that it becomes integer, will adjust by the conversion formula of YUV to RGB Coefficient after whole may be multiplied with 256 kinds of values of U, V component to be put into corresponding multiplication table;
(2) threshold value table is defined, Threshold_Table is named as;In view of possible data can overflow, therefore will be described Threshold_Table is divided into 5 sections, and the value of preceding 512 elements is 0, and intermediate 256 element values are passed successively from 0 to 255 Increase, the value of rear 512 elements is 255;
(3) data frame that yuv format is obtained from camera, obtains yuv format data group;
(4) be directed to any group of yuv format data, search the multiplication table and obtain coefficient operation values, be denoted as rv, gv, gu and Described rv, gv, gu, bu are carried out plus and minus calculation by bu with Y respectively according to the conversion formula;
(5) arithmetic operation results for obtaining step (4) are described to index corresponding element as the index of the threshold value table Value is the end value of pixel RGB component.
Preferably, in step (1), the multiplication table is the one-dimension array that four length are 256.
Preferably, the widened multiple of the floating-point coefficient is to expand 256 times.
Preferably, the threshold value is the one-dimension array that a length is 256*5.
Further, the present invention is suitable for the storage of yuv data stream YUV422, YUV420 and YUV444 Installed System Memory Form.
Advantageous effect:The present invention uses a kind of optimization design based on look-up table, and the floating-point operation that conversion is used is converted At the process tabled look-up, reduces taking for image color space conversion, accelerate embedded system image preprocessing process, in turn Enhance the real-time of embedded system.
Description of the drawings
Fig. 1 is the YUV based on look-up table to rgb color space transition diagram;
Fig. 2 is the storage format figure of yuv data in systems;
Fig. 3 is YUV422 to rgb color space transition diagram.
Specific implementation mode
Embodiment
As shown in Figure 1, being that a kind of optimization that the YUV of Embedded image processing system is converted to RGB color space is set Meter, this method have been abandoned original direct inflexible method for carrying out arithmetical operation, have been replaced, that is, passed through using cleverly method The floating-point operation that conversion is used is converted into the process tabled look-up by the method for look-up table, greatly reduces the conversion of image color space Take, accelerate embedded system image preprocessing process, and then enhance the real-time of embedded system.
Color space transfer principle:
RGB and YUV is more common two kinds of color spaces in Digital Image Processing.YUV is a color space race, Inside includes a variety of different types of color spaces.Component Y is used to indicate the brightness of image and UV is then used to describe the color of image Color and saturation degree, the color of specified pixel.There are many storage forms in Installed System Memory for yuv data stream, as shown in Fig. 2, wherein It is common to have tri- kinds of YUV422, YUV420 and YUV444:1)YUV444:Each Y-component corresponds to one group of UV component;2)YUV422: Each two Y-component shares one group of UV component;3)YUV420:Every four Y-components share one group of UV component.YUV and rgb color space Between transformational relation be fixed, the wherein conversion formula of YUV422 is as follows:
Since multiplication of decimals part only relates to 4 kinds of floating-point coefficient operations related with U, V component, and the value of U, V component There are 256 kinds of situations respectively, therefore 4 kinds can be pre-established for the different values of U, V component and carry out decimal for different coefficients Multiplication look-up table.Original floating-point multiplication is become reading the value of the specific numbers in look-up table by this method, separately Outside, substitution threshold judges by way of threshold value table, so as to the time required to substantially reducing color space conversion.
Look-up table making step:
The present invention uses a kind of optimum design method based on look-up table, so firstly the need of look-up table is made.Look-up table Including multiplication table and threshold value table.Realize that step is:
Step 1:First, define 4 multiplication tables, be length be 256 one-dimension array, be respectively designated as rv_table, gv_table、gu_table、bv_table;Then, according to the conversion formula of YUV to RGB, the floating-point coefficient in formula is carried out Adjustment expands certain multiple (moving to left) so that it becomes integer, to which original fractional arithmetic is become integer arithmetic;Finally, Coefficient after adjustment may be multiplied with 256 kinds of values of U, V component and be put into corresponding multiplication table.
Step 2:First, threshold value table is defined, is the one-dimension array that length is 256*5, is named as Threshold_ Table;Then, Threshold_Table is divided into 5 sections:The value of preceding 512 elements is 0;Intermediate 256 element values are from 0 It is incremented by successively to 255;The value of 512 elements is 255 afterwards.
Color space conversion step:
Step 1:The data frame for intercepting the yuv format got from camera, obtains yuv data group.
Step 2:For any group of yuv format data, 4 coefficient operation values are obtained by searching for multiplication table, respectively Rv, gv, gu and bu;Then, rv, gv, gu, bu are subjected to simple arithmetical operation with Y respectively.
Step 3:Using two obtained operation result of above-mentioned steps as the index of threshold value table, corresponding element value is For the end value of pixel RGB component.
By taking the conversion of the color space of YUV422 to RGB as an example, by conversion formula floating-point coefficient 1.370705, 0.698001,0.337633 and 1.732446 expand 256 times it are made to become integer, then by integer quotient and U, V component 256 Kind may be multiplied and be stored in corresponding multiplication table in advance respectively.Equally, threshold value table is made by certain format, be length is 256* 5 one-dimension array, is named as Threshold_Table;Then, Threshold_Table is divided into 5 sections:First 512 The value of element is 0;Intermediate 256 element values are incremented by successively from 0 to 255;The value of 512 elements is 255 afterwards.Later can To carry out the formal transfer process of color space.For any group of YUYV formatted data, 4 coefficients are obtained by searching for multiplication table Operation values, respectively rv, gv, gu and bu;Then, rv, gv, gu, bu are subjected to simple arithmetical operation with Y0 and Y1 respectively.Most Afterwards using obtained operation result as the index of threshold value table, corresponding element value is the end value of pixel RGB component, with For the conversion of YUV422 to RGB, such as R in conversion formula0=Y0+(1.370705*(V0- 128)), first 1.370705 It is expanded to integer, then by (1.370705* (V0- 128) 256 kinds) may be stored in multiplication table, because of V0There are 256 kinds of values, when V0Multiplication table of arriving when taking different value takes corresponding value, that is, calculates rv, then adds V0Just obtain R0.Y0, Y1Share U0With V0, therefore equally calculate R1=Y1+(1.370705*(V0-128))。
As shown in figure 3, the figure is the transition diagram of YUV422 to RGB, Y0And Y1Share U0And V0, conversion formula is as follows:
Table 1 lists under same target image resolution ratio, uses the pretreating scheme test result after optimization.From table As can be seen that color space conversion rate can be significantly improved with the method for look-up table, it is several under the premise of equal resolution It is consistent with the image data acquiring rate converted without color space, and conversion speed will not be with target image resolution ratio Change and reduces.Therefore it is effective that the prioritization scheme can be verified, and can greatly improve the reality of whole image coding/decoding system Shi Xing.
1 image preprocessing prioritization scheme test result of table compares (single frames/ms)
Using the pretreatment prioritization scheme based on look-up table, table is limited with threshold value and multiplication table substitutes in original scheme more The cumbersome judgement of if sentences and the operation of complicated multiplication of decimals, is converted into the process tabled look-up by the floating-point operation that conversion is used, subtracts Lack taking for image color space conversion, accelerates embedded system image preprocessing process, and then enhance embedded system The real-time of system, is with a wide range of applications.

Claims (5)

1. a kind of color space conversion optimization method of Embedded image processing system, which is characterized in that this method includes Following steps:
(1) four multiplication tables are defined, rv_table, gv_table, gu_table, bu_table are respectively designated as;It is arrived according to YUV Floating-point coefficient in the conversion formula is expanded certain multiple so that it becomes integer, after adjustment by the conversion formula of RGB Coefficient may be multiplied with 256 kinds of values of U, V component to be put into corresponding multiplication table;
(2) threshold value table is defined, Threshold_Table is named as;The Threshold_Table is divided into 5 sections, preceding 512 The value of a element is 0, and intermediate 256 element values are incremented by successively from 0 to 255, and the value of rear 512 elements is 255;
(3) data frame that yuv format is obtained from camera, obtains yuv format data group;
(4) any group of yuv format data are directed to, the multiplication table is searched and obtains coefficient operation values, be denoted as rv, gv, gu and bu, it will Described rv, gv, gu, bu carry out plus and minus calculation with Y respectively according to the conversion formula;
(5) arithmetic operation results for obtaining step (4) are as the index of the threshold value table, and the corresponding element value of the index is The end value of pixel RGB component.
2. the color space conversion optimization method of Embedded image processing system according to claim 1, feature It is, in step (1), the multiplication table is the one-dimension array that four length are 256.
3. according to the color space conversion optimization method of claim 1 Embedded image processing system, which is characterized in that step Suddenly in (1), the widened multiple of floating-point coefficient is to expand 256 times.
4. the color space conversion optimization method of Embedded image processing system according to claim 1, feature It is, in step (2), the threshold value is the one-dimension array that a length is 256*5.
5. the color space conversion optimization method of Embedded image processing system according to claim 1, feature It is, the present invention is suitable for the storage form of yuv data stream YUV422, YUV420 and YUV444 Installed System Memory.
CN201810465324.0A 2018-05-16 2018-05-16 A kind of color space conversion optimization method of Embedded image processing system Pending CN108683899A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810465324.0A CN108683899A (en) 2018-05-16 2018-05-16 A kind of color space conversion optimization method of Embedded image processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810465324.0A CN108683899A (en) 2018-05-16 2018-05-16 A kind of color space conversion optimization method of Embedded image processing system

Publications (1)

Publication Number Publication Date
CN108683899A true CN108683899A (en) 2018-10-19

Family

ID=63806497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810465324.0A Pending CN108683899A (en) 2018-05-16 2018-05-16 A kind of color space conversion optimization method of Embedded image processing system

Country Status (1)

Country Link
CN (1) CN108683899A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113591878A (en) * 2021-07-09 2021-11-02 杭州当虹科技股份有限公司 Dynamic HDR image feature extraction method
CN114449231A (en) * 2020-10-31 2022-05-06 荣耀终端有限公司 Image conversion method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080285852A1 (en) * 2007-05-17 2008-11-20 Sunplus Technology Co., Ltd. Preference color adjusting system and method
CN103079079A (en) * 2013-01-23 2013-05-01 中国人民解放军装备学院 Subword parallel method for color spatial transformation
CN106128412A (en) * 2016-08-30 2016-11-16 南京巨鲨显示科技有限公司 A kind of YUV based on embedded device and RGB color territory conversion method
CN107612523A (en) * 2017-08-25 2018-01-19 西安交通大学 A kind of FIR filter implementation method based on software checking book method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080285852A1 (en) * 2007-05-17 2008-11-20 Sunplus Technology Co., Ltd. Preference color adjusting system and method
CN103079079A (en) * 2013-01-23 2013-05-01 中国人民解放军装备学院 Subword parallel method for color spatial transformation
CN106128412A (en) * 2016-08-30 2016-11-16 南京巨鲨显示科技有限公司 A kind of YUV based on embedded device and RGB color territory conversion method
CN107612523A (en) * 2017-08-25 2018-01-19 西安交通大学 A kind of FIR filter implementation method based on software checking book method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114449231A (en) * 2020-10-31 2022-05-06 荣耀终端有限公司 Image conversion method and device
CN114449231B (en) * 2020-10-31 2023-11-24 荣耀终端有限公司 Image conversion method and device
CN113591878A (en) * 2021-07-09 2021-11-02 杭州当虹科技股份有限公司 Dynamic HDR image feature extraction method

Similar Documents

Publication Publication Date Title
CN103081468B (en) Method and system for illumination compensation and transition for video coding and processing
CN110197463B (en) High dynamic range image tone mapping method and system based on deep learning
US20060294174A1 (en) Hardware-based CABAC decoder
CN109862389B (en) Video processing method, device, server and storage medium
KR20080067888A (en) Apparatus and method for compensating chromatic aberration of image
CN110717868B (en) Video high dynamic range inverse tone mapping model construction and mapping method and device
CN108683899A (en) A kind of color space conversion optimization method of Embedded image processing system
CN103065334A (en) Color cast detection and correction method and device based on HSV (Hue, Saturation, Value) color space
CN102883168A (en) White balance processing method directed towards atypical-feature image
CN113706412A (en) SDR-HDR conversion method
CN109658330A (en) A kind of color development method of adjustment and device
CN105825489A (en) Infrared image enhancement method based on combination of gray translation and linear stretching
CN109816608A (en) A kind of low-light (level) image adaptive brightness enhancement based on noise suppressed
KR20230133388A (en) Configuration method of compensation lookup table, compensation method of display panel, and configuration device of compensation lookup table
CN113781321B (en) Information compensation method, device and equipment for image highlight region and storage medium
CN113706393A (en) Video enhancement method, device, equipment and storage medium
KR20100029148A (en) Image signal processing device
CN105791710A (en) Signal lamp image enhancement processing method
CN111563854A (en) Particle swarm optimization method for underwater image enhancement processing
CN115205157B (en) Image processing method and system, electronic device and storage medium
CN109035178B (en) Multi-parameter value tuning method applied to image denoising
CN113487525B (en) Self-iterative infrared image enhancement method based on double-platform histogram
JP2011193437A (en) Encoding system, and decoding system
TWI734501B (en) Method and apparatus of video coding
RU2016135261A (en) METHOD AND SYSTEM OF SUPERRESOLUTION BY MEANS OF COMBINED SPARED APPROXIMATION

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181019