Image color filling method and device

A color filling and color technology, applied in the field of image processing, can solve the problems of image color filling efficiency reduction, increase, etc.

Active Publication Date: 2016-03-16
INSPUR FINANCIAL INFORMATION TECH CO LTD
4 Cites 5 Cited by

AI-Extracted Technical Summary

Problems solved by technology

With the improvement of resolution, the pixels with differences between each frame image and the key frame image in the video increase exponentially, then, in the prior art...
View more

Method used

1. to pre-establish the corresponding relationship between each pixel point and the color array in the image, and set the color as the basis for the target image, by determining the key image, and according to the corresponding relationship, determine each key image in the key image A first color array of key pixels; according to the set color of the target image and the corresponding relationship, determine a second color array of each target pixel in the target image; The second color array is compared with the first color array of the corresponding key pixels to determine the difference data between the second color array and the first color array. This process is mainly to find out the color array of the target image The difference data between the color array of the key image and the data of these differences are stored; on the basis of the key image, the stored difference data is replaced with the data in the corresponding first color array, that is, the target image color is completed. It does not need to replace all binary data streams corresponding to a certain area of ​​the target image, thereby improving the efficiency of image color filling.
2. in the image color filling method that the embodiment of the present invention provides, set up data space, and set up the multi-dimensional coordinate system that comprises color coordinate axis for described data space; Image is loaded in described data space, determines that The coordinates of each pixel corresponding to the image in the multi-dimensional coordin...
View more

Abstract

The invention provides an image color filling method and device. The method comprises the steps that the corresponding relationship of all pixels and color arrays of an image is established, and the color of a target image is set; a key image is determined, and the first color array of each key pixel point in the key image is determined according to the corresponding relationship; the second color array of each target pixel point in the target image is determined according to the set color of the target image and the corresponding relationship; the second color array of each target pixel point is compared with the first color array of each corresponding key pixel point, difference data of the second color array and the first color array are determined and the difference data are saved; and the corresponding data in the first color array are replaced by the saved difference data when filling is performed on the target image so that efficiency of image color filling is enhanced.

Application Domain

Color signal processing circuits

Technology Topic

Key imagesArray data structure

Image

  • Image color filling method and device
  • Image color filling method and device
  • Image color filling method and device

Examples

  • Experimental program(1)

Example Embodiment

[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Apparently, the described embodiments are only some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
[0048] like figure 1 As shown, the embodiment of the present invention provides an image color filling method, which may include the following steps:
[0049] Step 101: Establish the corresponding relationship between each pixel in the image and the color array, and set the color of the target image;
[0050] Step 102: Determine the key image, and determine the first color array of each key pixel in the key image according to the corresponding relationship;
[0051] Step 103: Determine the second color array of each target pixel in the target image according to the set color and corresponding relationship of the target image;
[0052] Step 104: comparing the second color array of each target pixel with the first color array of each corresponding key pixel, determining the difference data between the second color array and the first color array, and storing the difference data;
[0053] Step 105: When filling the target image, replace the stored difference data with the corresponding data in the first color array.
[0054] In one embodiment of the present invention, in order to accurately extract the pixels in the image and fill the color of the image through the pixels, in step 101, after determining the key image, after determining the first pixel of each key pixel in the key image Before a color array, it further includes: analyzing the information of the image file corresponding to the key image; determining the resolution of the key image according to the information of the image file; and determining each pixel contained in the key image according to the resolution of the key image.
[0055] In one embodiment of the present invention, in order to improve the accuracy of the corresponding relationship between each pixel in the image and the color array and avoid the confusion of the corresponding relationship, the method further includes: establishing a data space, and establishing a color coordinate axis for the data space The multi-dimensional coordinate system; the specific implementation of step 101: load the image into the data space, and determine the coordinates of each pixel corresponding to the image in the multi-dimensional coordinate system including the color coordinate axis. The specific implementation of step 102: determine the first coordinates of each key pixel in the key image in the data space; the specific implementation of step 103: determine the second coordinates of each target pixel in the target image in the data space.
[0056] In one embodiment of the present invention, in order to quickly determine the difference data between the key image and the target image, the specific implementation manner of step 104: the first coordinates of each key pixel point corresponding to the key image and each target image corresponding to the target image The second coordinates of the pixel points are compared to determine the difference pixel point and the difference coordinate value corresponding to the difference pixel point.
[0057] In one embodiment of the present invention, in order to further improve the image color filling efficiency, the coordinate values ​​in the multi-dimensional coordinate system in step 101 include: the position of each pixel point in the data space and the data in the color array; Specific embodiments: determine the position of the difference pixel in the data space; update the key image according to the determined position of the difference pixel in the data space and the difference coordinate value corresponding to the determined difference pixel.
[0058] In one embodiment of the present invention, in order to extract all the data corresponding to the color of the pixel completely, the color array in each step includes: any one of Red value, Green value, Blue value and coordinate storage Alpha value At the same time, in order to quickly complete the color filling of each frame image in the video, in each step, the target image is the current frame image to be loaded in the video; the key image is the image corresponding to the current frame image to be loaded in the video previous frame image.
[0059] like figure 2 As shown, another embodiment of the present invention provides an image color filling method, which may include the following steps:
[0060] Step 200: Establish a data space, and establish a multi-dimensional coordinate system including color coordinate axes for the data space;
[0061] In this step, the coordinate values ​​in the multi-dimensional coordinate system may include the position of each pixel in the data space and the data in the color array; the color array mainly refers to the color values ​​corresponding to all the basic colors contained in the pixel , such as for the color in RGB format, each pixel constitutes the final fill color through the Red value, Green value and Blue value, in this step, such as image 3 As shown, each entity point in the coordinate map is the coordinate of the basic fill color (R, G, B) of the pixel point in the data space, and its zoing, points with the same x, y value correspond to the same pixel point, and at the same time, have The combination of points with the same x and y values ​​is the fill color of the pixel. That is, in the multi-dimensional coordinate system, the x and y axes are the position coordinates of pixels, and the z axis is the color coordinate axis. For the color in RGB format, the z axis can be divided into three areas, and one pixel can correspond to three A z-axis area, that is, the color value of a pixel can form a geometric structure in the data space, as shown in the figure, the position is (x n ,y n ), the corresponding basic color coordinates are P 1 (x n ,y n ,z 1n ), P 2 (x n ,y n ,z 2n ), P 3 (x n ,y n ,z 3n ), the coordinates of these basic colors are the fill colors that make up the pixel points. In addition, for the pixel points that contain the coordinates to store the Alpha value, it can also set the corresponding coordinate value for the Alpha value.
[0062] Step 201: Load the image into the data space, and determine the coordinates of each pixel corresponding to the image in the multi-dimensional coordinate system including the color coordinate axis;
[0063] In this step, taking each frame image in the video as an example, each pixel point of the frame image can have a corresponding position in the data space, and the image can be read by calling the function MDF_ReadPicture(), and the image can be filled by calling the function MDF_FillDataSpace() loaded into the data space. Pixels generally correspond to a color array. For example, for colors in RGB format, the arrays corresponding to pixels are R values, G values, and B values, and sometimes Alpha values. These values ​​can be represented in the form of binary data, while In the embodiment of the present invention, the data in the color array corresponds to the z value of the color coordinate of the pixel point, that is, for the color in RGB format, the R value, G value and B value of a certain pixel point correspond to the z axis respectively The three regions of (z 1 ,z 2 and z 3 ) in the coordinate value.
[0064] Step 202: set the color of the target image, and determine the key image;
[0065] The user can set the corresponding color for the target image according to the requirement. For example, the RGB data can be set for the multi-dimensional color data by calling the function MDF_SetRGB(). For each frame image of the video, the target image is the current frame image to be loaded in the video ; The key image is the previous frame image corresponding to the current frame image to be loaded in the video, because the current frame image to be loaded has a smaller variation range of pixels compared with the previous frame image , so that the data difference is small, then, on the basis of the previous frame image, the process of loading the current frame image requires less data modification.
[0066] Step 203: analyzing the information of the image file corresponding to the key image;
[0067] In this step, the basic information of the image file is mainly analyzed by calling the function MDF_PictureInfo(). Through these basic information, basic information such as the resolution of the image and the basic color value in the color array can be obtained. At the same time, the basic color value can be converted into A standard RGB format, which can be expressed in the form of binary data.
[0068] Step 204: Determine the resolution of the key image according to the information of the image file;
[0069] Step 205: Determine each pixel contained in the key image according to the resolution of the key image;
[0070] Step 206: According to the corresponding relationship, determine the first coordinates of each key pixel in the key image in the data space;
[0071] For example: Determine the color coordinates of the pixel point P as P 1 (x n ,y n ,z 1n ), P 2 (x n ,y n ,z 2n ), P 3 (x n ,y n ,z 3n ), then the coordinates of the pixel point P are (x n ,y n ,z 1n ), (x n ,y n ,z 2n ), (x n ,y n ,z 3n ).
[0072] Step 207: Determine the second coordinates of each target pixel in the target image in the data space according to the set color and corresponding relationship of the target image;
[0073] For example: determine the pixel point Q corresponding to the pixel point P in the key image, its x, y values ​​are consistent with point P, and the coordinates are (x n ,y n ,z 1n ), (x n ,y n ,z 2n ), (x n ,y n ,z 3n+1 ).
[0074] Step 208: comparing the first coordinates of each key pixel point corresponding to the key image with the second coordinates of each target pixel point corresponding to the target image;
[0075] For example: compare the coordinates of the pixel point P (x n ,y n ,z 1n ), (x n ,y n ,z 2n ), (x n ,y n ,z 3n ) and the coordinates of the pixel point Q (x n ,y n ,z 1n ), (x n ,y n ,z 2n ), (x n ,y n ,z 3n+1 ).
[0076] Step 209: Determine and store the difference pixel and the difference coordinate value corresponding to the difference pixel;
[0077] The coordinate value of the difference in pixel point Q is (x n ,y n ,z 3n+1 ), then the Q point and the corresponding (x n ,y n,z 3n+1 ) is stored in the image file of the target image, the difference coordinate value can be stored in the image file in the form of a binary data stream, through x n ,y n Reflects the position of the pixel, z 3n+1 Reflect the basic color value of the change, and the target image can be obtained by loading this set of data into the key image.
[0078] Step 210: Determine the position of the difference pixel in the data space;
[0079] For example: the stored image file contains (x n ,y n ,z 3n+1 ), then by x n ,y n Determine the position of the pixel point, through z 3n+1 Change the corresponding basic color value. For example, for the color in RGB format, the basic color value includes R, G, and B. For the z value, R corresponds to z 1 , G corresponds to z 2 , B corresponds to z 3 , then, for z 3n+1 The value indicates that what it changes is the B value, then only the pixel point P corresponding to the key image (x n ,y n ,z 3n z in ) 3n replace with z 3n+1 That is, it is not necessary to replace all the data corresponding to the entire image area including the pixel point P, and the image color filling efficiency is improved.
[0080] Step 211: update the key image according to the determined position of the difference pixel in the data space and the determined difference coordinate value corresponding to the difference pixel, and complete the filling of the target image.
[0081] like Figure 4 , Figure 5 As shown, the embodiment of the present invention provides an image color filling device. The device embodiments can be implemented by software, or by hardware or a combination of software and hardware. From a hardware perspective, such as Figure 4 As shown, it is a hardware structure diagram of the device where the image color filling device is located in the embodiment of the present invention, except Figure 4 In addition to the shown CPU, memory, network interface, and non-volatile memory, the device where the device in the embodiment is located may generally include other hardware, such as a chip responsible for color filling and the like. Taking software implementation as an example, such as Figure 5 As shown, as a device in a logical sense, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory for execution by the CPU of the device where it is located. The image color filling device 50 provided in this embodiment includes:
[0082] The construction unit 501 is used to establish the corresponding relationship between each pixel in the image and the color array, and set the color of the target image;
[0083] The first determination unit 502 is configured to determine the key image, and determine the first color array of each key pixel in the key image according to the correspondence established by the construction unit 501;
[0084] The second determination unit 503 determines the second color array of each target pixel in the target image according to the color of the target image set by the construction unit 501 and the established corresponding relationship;
[0085] The data processing unit 504 is configured to compare the second color array of each target pixel determined by the second determination unit 503 with the first color array of each key pixel determined by the first determination unit 502, and determine the second color array difference data between the array and the first color array, and store the difference data;
[0086] The filling unit 505 is configured to replace the data in the corresponding first color array with the difference data stored by the data processing unit 504 when filling the target image.
[0087] In another embodiment of the present invention, the first determination unit 502 is further configured to analyze the information of the image file corresponding to the key image; determine the resolution of the key image according to the information of the image file; determine the resolution of the key image according to the resolution of the key image. The individual pixels contained in the image.
[0088] In another embodiment of the present invention, the construction unit 501 is configured to establish a data space, and establish a multi-dimensional coordinate system including color coordinate axes for the data space; load the image into the data space, and determine each pixel corresponding to the image The coordinates of the point in the multi-dimensional coordinate system including the color coordinate axis;
[0089] The first determination unit 502 is configured to determine the first coordinates of each key pixel in the key image in the data space established by the construction unit 501;
[0090] The second determination unit 503 is configured to determine the second coordinates of each target pixel point in the target image in the data space established by the construction unit 501 .
[0091] In yet another embodiment of the present invention, the data processing unit 504 is configured to combine the first coordinates of each key pixel point corresponding to the key image determined by the first determination unit with each target pixel point corresponding to the target image determined by the second determination unit The second coordinates of the difference are compared to determine the difference coordinate value corresponding to the difference pixel point and the difference pixel point;
[0092] The filling unit 505 is used to determine the position of the difference pixel determined by the data processing unit 504 in the data space; according to the determined position of the difference pixel in the data space and the difference coordinate value corresponding to the difference pixel determined by the data processing unit 504 , to update the key image.
[0093] In another embodiment of the present invention, the color array in the correspondence established by the constructing unit 501 includes: any one or more of Red values, Green values, Blue values, and coordinate storage Alpha values.
[0094] In another embodiment of the present invention, the target image determined by the second determination unit 503 is the current frame image to be loaded in the video;
[0095] The key image determined by the first determining unit 502 is the previous frame image corresponding to the current frame image to be loaded in the video.
[0096] The solutions provided by the embodiments of the present invention can at least achieve the following beneficial effects:
[0097] 1. Based on pre-establishing the corresponding relationship between each pixel point in the image and the color array, and setting the color for the target image, by determining the key image, and according to the corresponding relationship, determine each key pixel point in the key image The first color array of the target image; according to the set color of the target image and the corresponding relationship, determine the second color array of each target pixel in the target image; set the second color of each target pixel Arrays are compared with the first color arrays of corresponding key pixels to determine the difference data between the second color array and the first color array. This process is mainly to find out the color array of the target image and the key image The difference data between the color arrays, and store these difference data; on the basis of the key image, replace the stored difference data with the corresponding data in the first color array, that is, complete the color filling of the target image, and There is no need to replace all binary data streams corresponding to a certain area of ​​the target image, thereby improving the efficiency of image color filling.
[0098] 2. In the image color filling method provided by the embodiment of the present invention, a data space is established, and a multi-dimensional coordinate system including color coordinate axes is established for the data space; the image is loaded into the data space, and the corresponding image is determined. The coordinates of each pixel point in the multi-dimensional coordinate system including the color coordinate axis, the coordinates include all the data in the color array, by combining the first coordinates of each key pixel point in the key image in the data space with the target image Compare the second coordinates of each target pixel point in the data space to determine the difference data in the color array corresponding to each pixel point, that is, the difference coordinate value. Based on the key image, directly update only the difference coordinate value to In the key image, the part with the same coordinate value will not change, thus effectively improving the color filling speed.
[0099] 3. The embodiment of the present invention establishes the data space, and the basic color values ​​of each pixel of the image, such as red value, Green value and Blue value, etc., are used as the position of the color of the pixel point in the data space, and the coordinate value according to the difference is the difference The basic color value makes the color filling more accurate.
[0100] 4. In the embodiment of the present invention, in addition to the complete color array of each pixel stored in the key image file, only the color arrays with differences can be stored in the image files corresponding to other images based on the key image. It only needs to load the data with difference based on the key image to complete the color filling of the image, avoiding the storage of redundant color data, thereby reducing the size of the image file, thereby reducing the system load and configuration requirements.
[0101] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is a relationship between these entities or operations. There is no such actual relationship or sequence. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a """""" does not exclude the presence of additional same elements in the process, method, article or apparatus comprising said element.
[0102] The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the present invention. within the scope of protection.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products