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

CN102280096B - Method for combining image scaling and color space switching - Google Patents

Method for combining image scaling and color space switching Download PDF

Info

Publication number
CN102280096B
CN102280096B CN 201110197973 CN201110197973A CN102280096B CN 102280096 B CN102280096 B CN 102280096B CN 201110197973 CN201110197973 CN 201110197973 CN 201110197973 A CN201110197973 A CN 201110197973A CN 102280096 B CN102280096 B CN 102280096B
Authority
CN
China
Prior art keywords
color space
value
window
space conversion
convergent
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.)
Expired - Fee Related
Application number
CN 201110197973
Other languages
Chinese (zh)
Other versions
CN102280096A (en
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.)
HANGZHOU NO IMAGE TECHNOLOGY Co Ltd
Original Assignee
HANGZHOU NO IMAGE TECHNOLOGY Co Ltd
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 HANGZHOU NO IMAGE TECHNOLOGY Co Ltd filed Critical HANGZHOU NO IMAGE TECHNOLOGY Co Ltd
Priority to CN 201110197973 priority Critical patent/CN102280096B/en
Publication of CN102280096A publication Critical patent/CN102280096A/en
Application granted granted Critical
Publication of CN102280096B publication Critical patent/CN102280096B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)

Abstract

The invention discloses a method for combining image scaling and color space switching, which aims at solving the technical problems that the image scaling and the color space switching occupy system resources seriously and the calculation expense is high in an embedded image video processing system in the prior art. In the provided method for combining the image scaling and the color space switching, luma and chroma (YUV) color space scaling is performed and switching from a YUV 420 color space to a red-green-blue (RGB) 565 color space is finished by using a color space switching algorithm at the same time. By the method, the system resource occupation and the system expense are reduced; meanwhile, the system performance of embedded equipment is enhanced greatly through measures, such asscaling sequence optimization, sheet combination, algorithm preference and the like.

Description

The method of a kind of fused images convergent-divergent and color space conversion
Technical field
The present invention relates to a kind of computer image processing technology, relate in particular to a kind of fused images convergent-divergent for embedded device and the method for color space conversion.
Background technology
In the embedded image processing system for video, image convergent-divergent and color space conversion are the modules of occupying system resources very.Mode commonly used is that image is handled at the YUV color space, is image transitions the rgb space demonstration handling after.Such as when being displayed in full screen, image being amplified processing, then the image after amplifying is carried out the conversion of rgb space.Can certainly do color space conversion earlier again at RGB territory zoomed image, computing cost is the same in theory, but in fact the latter will consume more cpu resource.
Open day be that on 02 16th, 2005, publication number are that the patent documentation of CN1581280 discloses such technical scheme: a kind of color conversion apparatus and method, in order to one first color space conversion is become one second color space, include a plurality of question blanks, it is in order to the corresponding relation of record about this first color space and this second color space, with a transducer, it utilizes this question blank so that this first color conversion is become this second color, and a gamma correction circuit is used to carry out the gamma correction.But this scheme is fit to realize with hardware circuit, and the multistage look-up table that its inside arranges on software is realized, does not have substantial performance boost with general usefulness look-up tables'implementation YUV to the RGB color space conversion.
And for example open day be that on 07 18th, 2007, publication number are the patent documentation of CN101000686, disclosed technical scheme is: a kind of color adjustment method based on principal component analysis, and the method is made up of three steps: the color space principal component axle that at first extracts Target Photo with pca method; Secondly the difference of color scaling is carried out cubic spline interpolation, form look-up table, utilize lookup table technology that picture pixel to be processed is shone upon one by one, finish the color adjustment.Carry out pivot analysis by the color space to Target Photo, thereby realize the specific aim of color adjustment method, make the method can be suitable for different colors and adjust demand.And the employing Technique of Cubic Spline Interpolation makes the color adjustment have more controllability, the cross-color of avoiding single color adjustment method to cause.Thisly do the colored method of adjusting with principal component analysis (PCA), the computation complexity height will need more system resources and expense.
Summary of the invention
The present invention solves existing in prior technology in the embedded image processing system for video, technical problem such as the serious occupying system resources of image convergent-divergent and color space conversion, computing cost are big, the method of a kind of image convergent-divergent and color space conversion is provided, its fused images convergent-divergent and color space conversion are one, at embedded device systematic function are increased dramatically.
The present invention is directed to the prior art problem is mainly solved by following technical proposals, the method of a kind of fused images convergent-divergent and color space conversion, when carrying out YUV color space convergent-divergent, use the color space conversion algorithm to finish the YUV420 color space to the conversion of RGB565 color space, this method may further comprise the steps:
A) input source image brightness data pY, chroma data pU, pV and source images width and height dimension;
B) input target image dimension width and height;
C) according to source images, target image size computed image level and vertically scale ratio;
D) to the per two columns certificates in per two line data of target image, according to scaling, calculate convergent-divergent chromatic component d_U, d_V afterwards with linear interpolation respectively;
E) according to scaling, from first 2x2 window, calculate convergent-divergent brightness value d_L11, d_L12, d_L21, the d_L22 afterwards of the 2x2 window upper left corner, the upper right corner, the lower left corner, 4 points in the lower right corner respectively with bilinear interpolation;
F) carry out color space conversion according to d_U, d_V, d_L11 with look-up table, calculate upper left corner corresponding points in the current 2x2 window r, g, b value;
G) carry out color space conversion according to d_U, d_V, d_L12 with look-up table, calculate upper right corner corresponding points in the current 2x2 window r, g, b value;
H) carry out color space conversion according to d_U, d_V, d_L21 with look-up table, calculate lower left corner corresponding points in the current 2x2 window r, g, b value;
I) carry out color space conversion according to d_U, d_V, d_L22 with look-up table, calculate lower right corner corresponding points in the current 2x2 window r, g, b value;
J) respectively r, g, the b value of four points in the current 2x2 window is assemblied into 4 RGB565 forms again, and is stored in the inside, current RGB565 data pointer address;
K) current window is moved to next 2x2 window;
In the r of corresponding points, g, the b value, r is red value, and g is green value, and b is blue valve.
The present invention finishes color space conversion when finishing the color space convergent-divergent.Consider the image sampling form of YUV420,4 public 1 couple of U of Y component, V component, U, V data volume are half of Y, therefore, after finishing U, V component convergent-divergent, can once carry out the convergent-divergent of 4 Y components.Convergent-divergent leaves 6 interim variablees the insides (4 Y temporary variables and U, V temporary variable) after finishing in.These 6 temporary variables have been represented the YUV component of 4 pixels after the convergent-divergent respectively, use look-up table to carry out the conversion of color space afterwards immediately, one takes turns the color space conversion that the current 2x2 window upper left corner, the upper right corner, the lower left corner, 4 points in the lower right corner are finished in circulation, also namely finish the calculating of the object pixel of 4 points, be assembled into the RGB565 form afterwards, calculating, the assembly unit of other object pixels finished in circulation successively.In order more effectively to utilize the register resources of system, avoid stack operation frequently, when carrying out 4 luminance signals and two carrier chrominance signal U, V convergent-divergent, the convergent-divergent of advanced circumstances in which people get things ready for a trip degree signal U, V, carry out the convergent-divergent of 4 brightness signal Y again, can avoid the dependence between the data like this, significantly raise the efficiency.Simultaneously, consider human eye to the insensitivity of chromatic component, chromatic component d_U, d_V are adopted linear interpolation, but not bilinear interpolation has reduced by 4 sublinear interpolation arithmetics altogether.
In such processing procedure, except having saved a big spatial cache (memory space of a two field picture), by measures such as preferred convergent-divergent order, chroma interpolation algorithms, through actual test on platform, overall performance is increased dramatically.
As preferably, the color space conversion algorithm is
r = Y + 1.4075 *(V-128)
g = Y – 0.3455 *(U –128) – 0.7169 *(V –128)
b = Y + 1.779 *(U – 128)
The YUV color space adopts above-mentioned formula to carry out to the conversion of RGB color space, and computing formula is simple, for realizing fast algorithm, adopts and tables look-up to replace multiplication, at last result of calculation is saturated between 0 to 255.The mode of look-up table is also adopted in saturated operation, can omit the expense of judging redirect like this, can improve processing speed on the platform that cache memory (Cache Memory) arranged.
As preferably, the employed form of look-up table is that floating number is converted to integer operation, and the value of form the inside is each value in integer and a constant multiplied result of-128 to 127, each element employing short type variable of table.The structure of form is that floating-point is converted to fixed-point operation and multiply operation.Because the color conversion process relates to 4 multiplication, so need 4 forms altogether.The value of form the inside is each value in integer and a constant multiplied result of-128 to 127, has so also avoided the subtraction operation.Each element of table adopts short type variable, and then 4 total sizes of form are 2K.
As preferably, the employed form of look-up table is that 4 forms that are used for the constant multiplication are merged into a form.These 4 forms that are used for the constant multiplication are 4 multiplication forms that the color conversion process relates to, and merge into the load operation that only needs a form behind the form, and the skew that only need add a constant in the time of actual tabling look-up gets final product, and further improves treatment effeciency.
The beneficial effect that the present invention brings is, fused images convergent-divergent and color space conversion are one, reduce effectively that system resource takies and overhead, by optimizing measures such as convergent-divergent order, form merging, optimization algorithm, the embedded device systematic function is significantly promoted simultaneously.
Description of drawings
Fig. 1 is a kind of image convergent-divergent of the present invention and color space conversion process chart.
Embodiment
Below by embodiment, and by reference to the accompanying drawings, technical scheme of the present invention is further described in detail.
Embodiment: present embodiment carries out at the embedded platform based on ARM.As shown in Figure 1, the present invention is the method for a kind of fused images convergent-divergent and color space conversion, is when carrying out YUV color space convergent-divergent, finishes the YUV420 color space to the conversion of RGB565 color space.Step is as described below: 1) obtain 3 components and the width s_width of brightness, chroma data pY, pU, pV by video image decoding, height s_height sized data; 2) input target image width d_width and height d_height size; 3) according to width s_width and height s_height, width d_width and height d_height computed image level and vertically scale ratio; 4) to the per two columns certificates (2x2 window) in per two line data of target image, according to scaling, calculate convergent-divergent chromatic component d_U, d_V afterwards with linear interpolation respectively; 5) according to scaling, calculate convergent-divergent brightness value d_L11, d_L12, d_L21, the d_L22 afterwards of the current 2x2 window upper left corner, the upper right corner, the lower left corner, 4 points in the lower right corner respectively with bilinear interpolation; 6) carry out color space conversion according to d_U, d_V, d_L11 with look-up table, calculate upper left corner corresponding points in the current 2x2 window r, g, b value; 7) carry out color space conversion according to d_U, d_V, d_L12 with look-up table, calculate upper right corner corresponding points in the current 2x2 window r, g, b value; 8) carry out color space conversion according to d_U, d_V, d_L21 with look-up table, calculate lower left corner corresponding points in the current 2x2 window r, g, b value; 9) carry out color space conversion according to d_U, d_V, d_L22 with look-up table, calculate lower right corner corresponding points in the current 2x2 window r, g, b value; 10) respectively r, g, the b value of four points in the current 2x2 window is assemblied into 4 RGB565 forms again, and is stored in the inside, current RGB565 data pointer address; 11) current window is moved to next 2x2 window continuation above-mentioned steps and calculate next group target image point.
The algorithm of color space conversion adopts r=Y+1.4075 * (V-128), and (result of calculation is saturated between 0 to 255 g=Y – 0.3455 * for U – 128) – 0.7169 * (V – 128), b=Y+1.779 * (U – 128).The mode of look-up table is all adopted in the operation of multiplication and saturated operation.Need 5 look-up tables altogether, wherein 4 operations that are used for replacing multiplication, one is used for saturation arithmetic.
The multiplication table lattice is made: at first being that floating-point is converted to fixed-point operation, secondly is multiply operation.4 multiplication need 4 forms altogether.The value of form the inside is each value in integer and a constant multiplied result of-128 to 127.So also avoided the subtraction operation.Each element of table adopts short type variable, and then 4 total sizes of form are 2K.On the embedded platform based on ARM, 4 forms are merged into a form, so only need the load operation of a form, only need add the skew of a constant in the time of actual tabling look-up, and just can realize with an ARM instruction.
Adopt full ARM assembler language to realize.
So the present invention has the fused images convergent-divergent and color space conversion is one, reduce effectively that system resource takies and overhead, make features such as the embedded device systematic function significantly promotes.

Claims (4)

1. the method for a fused images convergent-divergent and color space conversion, it is characterized in that: when carrying out YUV color space convergent-divergent, use the color space conversion algorithm to finish the YUV420 color space to the conversion of RGB565 color space, this method may further comprise the steps:
Input source image brightness data pY, chroma data pU, pV and source images width and height dimension;
Input target image dimension width and height;
According to source images, target image size computed image level and vertically scale ratio;
To the per two columns certificates in per two line data of target image, according to scaling, calculate convergent-divergent chromatic component d_U, d_V afterwards with linear interpolation respectively;
According to scaling, from first 2x2 window, calculate convergent-divergent brightness value d_L11, d_L12, d_L21, the d_L22 afterwards of the 2x2 window upper left corner, the upper right corner, the lower left corner, 4 points in the lower right corner respectively with bilinear interpolation;
Carry out color space conversion according to d_U, d_V, d_L11 with look-up table, calculate upper left corner corresponding points in the current 2x2 window r, g, b value;
Carry out color space conversion according to d_U, d_V, d_L12 with look-up table, calculate upper right corner corresponding points in the current 2x2 window r, g, b value;
Carry out color space conversion according to d_U, d_V, d_L21 with look-up table, calculate lower left corner corresponding points in the current 2x2 window r, g, b value;
Carry out color space conversion according to d_U, d_V, d_L22 with look-up table, calculate lower right corner corresponding points in the current 2x2 window r, g, b value;
R, g, b value with four points in the current 2x2 window is assemblied into 4 RGB565 forms again respectively, and is stored in the inside, current RGB565 data pointer address;
Current window is moved to next 2x2 window;
In the r of described corresponding points, g, the b value, r is red value, and g is green value, and b is blue valve.
2. according to the method for the described a kind of fused images convergent-divergent of claim 1 and color space conversion, it is characterized in that: described color space conversion algorithm is
r = Y + 1.4075 *(V-128) g = Y – 0.3455 *(U –128) – 0.7169 *(V –128) b = Y + 1.779 *(U – 128)。
3. according to the method for the described a kind of fused images convergent-divergent of claim 1 and color space conversion, it is characterized in that: the employed form of described look-up table is that floating number is converted to integer operation, the value of form the inside is each value in integer and a constant multiplied result of-128 to 127, each element employing short type variable of table.
4. according to the method for claim 1 or 3 described a kind of fused images convergent-divergents and color space conversion, it is characterized in that: the employed form of described look-up table is that 4 forms that are used for the constant multiplication are merged into a form.
CN 201110197973 2011-07-15 2011-07-15 Method for combining image scaling and color space switching Expired - Fee Related CN102280096B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110197973 CN102280096B (en) 2011-07-15 2011-07-15 Method for combining image scaling and color space switching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110197973 CN102280096B (en) 2011-07-15 2011-07-15 Method for combining image scaling and color space switching

Publications (2)

Publication Number Publication Date
CN102280096A CN102280096A (en) 2011-12-14
CN102280096B true CN102280096B (en) 2013-09-18

Family

ID=45105512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110197973 Expired - Fee Related CN102280096B (en) 2011-07-15 2011-07-15 Method for combining image scaling and color space switching

Country Status (1)

Country Link
CN (1) CN102280096B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014045506A1 (en) * 2012-09-24 2014-03-27 Sharp Kabushiki Kaisha Video compression with color space scalability
CN103809972B (en) * 2014-02-10 2018-03-27 联想(北京)有限公司 A kind of information processing method and electronic equipment
US10134360B2 (en) * 2014-11-25 2018-11-20 Intel Corporation Compressing the size of color lookup tables
CN105681800B (en) * 2016-01-27 2019-02-05 桂林长海发展有限责任公司 A kind of device and method that YUV420 quickly changes into rgb format
CN108076336A (en) * 2016-11-14 2018-05-25 北京航天长峰科技工业集团有限公司 A kind of rapid color space conversion method based on AVX technologies
CN109447928B (en) * 2018-10-16 2020-11-06 西安邮电大学 Image Alpha mixing method based on fixed-point pixel data
WO2020087377A1 (en) * 2018-10-31 2020-05-07 深圳市大疆创新科技有限公司 Method and device for processing image data
CN109636863B (en) * 2018-12-03 2022-10-21 新视家科技(北京)有限公司 Color space conversion circuit
CN114493987A (en) * 2020-10-27 2022-05-13 西安诺瓦星云科技股份有限公司 Image processing method and device and video processing equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1571990A (en) * 2001-10-19 2005-01-26 皇家飞利浦电子股份有限公司 Method of and display processing unit for displaying a colour image and a display apparatus comprising such a display processing unit
CN101345887A (en) * 2007-07-13 2009-01-14 英业达股份有限公司 Improved RGB image zooming method
CN101795350A (en) * 2010-04-07 2010-08-04 浙江大学 Non-linear image double amplifying method based on relevance detection
CN101873503A (en) * 2009-12-09 2010-10-27 杭州海康威视软件有限公司 Method and device for adjusting image property

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100373912C (en) * 2006-07-10 2008-03-05 宁波大学 Quick double linear interpolating method in image amplification process

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1571990A (en) * 2001-10-19 2005-01-26 皇家飞利浦电子股份有限公司 Method of and display processing unit for displaying a colour image and a display apparatus comprising such a display processing unit
CN101345887A (en) * 2007-07-13 2009-01-14 英业达股份有限公司 Improved RGB image zooming method
CN101873503A (en) * 2009-12-09 2010-10-27 杭州海康威视软件有限公司 Method and device for adjusting image property
CN101795350A (en) * 2010-04-07 2010-08-04 浙江大学 Non-linear image double amplifying method based on relevance detection

Also Published As

Publication number Publication date
CN102280096A (en) 2011-12-14

Similar Documents

Publication Publication Date Title
CN102280096B (en) Method for combining image scaling and color space switching
US8452094B2 (en) Real-time image generator
US9947258B2 (en) Image processing method and image processing apparatus
US20050248590A1 (en) Method and system for scaling, filtering, scan conversion, panoramic scaling, YC adjustment, and color conversion in a display controller
GB2520406A (en) Tone mapping
EP1676254A2 (en) Method and apparatus for converting from a source color space to a target color space
WO2018223498A1 (en) Dynamic backlight control and display method and device
US20110134291A1 (en) Image-processing device for color image data and method for the image processing of color image data
WO2024027287A1 (en) Image processing system and method, and computer-readable medium and electronic device
CN108282647A (en) Color correcting method and device, computer readable storage medium, terminal
CN101729913A (en) Method and system for adjusting image saturation
US7751642B1 (en) Methods and devices for image processing, image capturing and image downscaling
US20220030202A1 (en) Efficient and flexible color processor
WO2022042754A1 (en) Image processing method and apparatus, and device
US9858889B2 (en) Color compensation circuit, display apparatus, and color compensation method
CN102456223B (en) Device and method for carrying out enhancement and scaling on image details
CN115004220B (en) Neural network for raw low-light image enhancement
CN115088252A (en) Image processing method and related device
CN104680484A (en) Image enhancement method and device
CN106296614B (en) Image processing apparatus and image processing method
CN107358904A (en) RGB image is included into the method and device on RGBW panels
Liu et al. A fast algorithm for color space conversion and rounding error analysis based on fixed-point digital signal processors
CN116453470A (en) Image display method, device, electronic equipment and computer readable storage medium
JP2001197321A (en) Color picture processing method and picture processor
CN106657945B (en) A kind of gamma correction implementation method of non-linear piecewise

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130918

Termination date: 20170715