CN115761079A - Image processing method, device, equipment and storage medium - Google Patents

Image processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115761079A
CN115761079A CN202211333483.8A CN202211333483A CN115761079A CN 115761079 A CN115761079 A CN 115761079A CN 202211333483 A CN202211333483 A CN 202211333483A CN 115761079 A CN115761079 A CN 115761079A
Authority
CN
China
Prior art keywords
image
current
color
pixel
mapping table
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
CN202211333483.8A
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.)
Huizhou Desay SV Automotive Co Ltd
Original Assignee
Huizhou Desay SV Automotive 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 Huizhou Desay SV Automotive Co Ltd filed Critical Huizhou Desay SV Automotive Co Ltd
Priority to CN202211333483.8A priority Critical patent/CN115761079A/en
Publication of CN115761079A publication Critical patent/CN115761079A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses an image processing method, an image processing device, image processing equipment and a storage medium, wherein the method comprises the following steps: acquiring a current image to be processed and acquiring current image data information of the current image; determining a current color-to-pixel mapping table that matches the given image transformation target; and converting the current image according to the current image data information and the current color-pixel mapping table to obtain a target picture frame of the current image. When the method is applied to animation presentation of the original image, the storage cost of continuous picture frames in the animation can be effectively reduced, and meanwhile, the orderly management of a plurality of images is avoided.

Description

Image processing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an image processing method, an image processing apparatus, an image processing device, and a storage medium.
Background
With the continuous development of computer technology, the new function display in the vehicle instrument device is in a infinite number, and the requirements for animation display and image processing of the instrument device are higher and higher.
In order to obtain a smooth transition effect during playing, at present, as many sequence frames as possible need to be used, each frame needs to store one picture, and if a frame-by-frame mode needs to be realized for the pictures, a drawing method needs to be called periodically, and an animation object drawing each frame is displayed by a human-computer interface. The continuity and smoothness of the sequence frame playing pictures depends on how many continuous pictures exist, a large number of pictures generate more storage cost, and the pictures need to be managed orderly according to the gradual change of colors.
Disclosure of Invention
The invention provides an image processing method, an image processing device, image processing equipment and a storage medium, which are used for realizing flexible conversion of image data information and saving storage space during animation display.
In a first aspect, an embodiment of the present disclosure provides an image processing method, including:
acquiring a current image to be processed and acquiring current image data information of the current image;
determining a current color-to-pixel mapping table that matches the given image conversion target;
and converting the current image according to the data information of the current image and the current color-pixel mapping table to obtain a target picture frame of the current image.
In a second aspect, an embodiment of the present disclosure provides an image processing apparatus, including:
the first acquisition module is used for acquiring a current image to be processed and acquiring current image data information of the current image;
a second obtaining module for determining a current color-to-pixel mapping table matched with the given image conversion target;
and the third acquisition module is used for converting the current image according to the current image data information and the current color-pixel mapping table to acquire a target picture frame of the current image.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the image processing method as provided by the embodiments of the first aspect described above.
In a fourth aspect, the present disclosure provides a computer-readable storage medium, where computer instructions are stored, and the computer instructions are configured to, when executed, cause a processor to implement the image processing method provided in the foregoing first aspect.
The image processing method, the image processing device, the image processing equipment and the storage medium of the embodiment of the invention acquire a current image to be processed and acquire current image data information of the current image; determining a current color-to-pixel mapping table that matches the given image transformation target; and converting the current image according to the current image data information and the current color-pixel mapping table to obtain a target picture frame of the current image. According to the technical scheme, the image data information conversion of one image can be flexibly realized, so that the picture frame of the other image data form of the image is obtained. If the image processing method is iterated on the basis of one original image, the original image can present the driving picture frames of different image data in an animation mode in the iteration process, so that no additional storage space is occupied in the whole animation presenting process.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of an image processing method according to an embodiment of the present invention;
FIG. 2 is a flowchart of an image processing method according to a second embodiment of the present invention;
fig. 3 is an exemplary illustration of an original mapping table involved in an image processing method according to a second embodiment of the present invention;
fig. 4 is a schematic diagram illustrating an example of an initial mapping vector generation table involved in an image processing method according to a second embodiment of the present invention;
fig. 5 is an exemplary illustration of a vector matrix generation table involved in an image processing method according to a second embodiment of the present invention;
fig. 6 is an exemplary illustration of a current mapping vector generation table involved in an image processing method according to a second embodiment of the present invention;
fig. 7 is a schematic structural diagram of an image processing apparatus according to a third embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and "object" and the like in the description and claims of the invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of an image processing method according to an embodiment of the present invention, where the embodiment is applicable to a situation of an animation display at startup of a meter device, and the method may be executed by an image processing apparatus, and the image processing apparatus may be implemented in a form of hardware and/or software.
In the image display of the vehicle instrument device, when the vehicle is powered on and started, the instrument panel displays a continuous animation display process from the black screen to the logo image and back to the black screen, wherein the animation display process can be an image data processing process with gradually changed color depth. In this embodiment, the image data processing process may be implemented by using a gray scale mapping method.
The gray scale is obtained by dividing the brightness change between the brightest brightness and the darkest brightness into a plurality of parts, and represents the degree of the display from the brightest brightness to the darkest brightness. Each digital image is composed of a plurality of dots, also called pixels, each of which can usually exhibit a plurality of different colors, and is composed of three sub-pixels of red, green and blue (RGB). Each sub-pixel, the light source behind it, may exhibit a different brightness level. And the gray levels represent gradation levels of different brightness from the darkest to the brightest. The more the intermediate levels are, the more exquisite the picture effect can be presented. Taking 4 bits as an example, the display can represent 2 to the power of 4, which is equal to 16 brightness levels, called 16 gray levels. The color change of each point on the screen is caused by the gray scale change of the three RGB sub-pixels forming the point. The higher the gray scale, the better the picture effect, the invention uses 4 bits with 16-step brightness variation.
As shown in fig. 1, the method includes:
s101, acquiring a current image to be processed, and acquiring current image data information of the current image.
In this embodiment, before performing the image processing, the current image to be processed needs to be acquired, where the current image to be processed may be an original image that has not been subjected to any processing initially, or may be an image obtained after performing one or more image processing operations by using the image processing method provided in this embodiment.
The current image data information for the current image may include image data and a footprint size for the image. The image data may include data such as color and pixel information and resolution of the image, for example, information such as color, pixel value size and resolution height and resolution width of the current image. One pixel comprises 8 bits, and the image with the size of 4 bits is adopted in the embodiment and is divided into two pixel points for representing, wherein the upper four bits represent one pixel point, and the lower four bits represent one pixel point. The size of the occupied space can be obtained by using the resolution high-resolution wide (4 bits/8 bits) of the image, and the size is set as a fixed value and is stored in the code in advance.
Specifically, based on an MCU (micro controller Unit), a memory address is randomly obtained according to a system-allocated RAM (random access memory), and the memory address can completely store the current image data and can be used to store the changed image data.
S102, determining a current color-pixel mapping table matched with the given image conversion target.
In this embodiment, in order to realize the conversion between the current image and the target image, a color-pixel mapping table needs to be constructed, and the given image conversion target may include the conversion from the original image picture to the black picture, and may also include the conversion from the black picture to the original image picture.
The color-to-pixel mapping table may use a memory sized for gray scale length and store values of data from zero to gray scale length minus one, each digital value representing a color. The gray scale length is obtained according to the information amount occupied by the given image, for example, if the current given image is a 4-bit image, the gray scale length of the image is a 4-power of 2, that is, the gray scale length is 16, and a value of 0-15 can be stored. The current given image may also be 8 bits or other images occupying a large amount of information, which is not limited in this embodiment. In the present embodiment, hexadecimal notation may be used to represent the above values, for example, 0 is represented as 0x00, 1 is represented as 0x01 \823014, 14 is represented as 0x0E, and 15 is represented as 0x0F.
And after the color value of the current image is determined, determining the color value of the target image corresponding to the current image according to the given image conversion target, and obtaining the pixel value of the target image.
S103, converting the current image according to the current image data information and the current color-pixel mapping table to obtain a target picture frame of the current image.
In this embodiment, a method of performing gray-scale mapping conversion on one image, that is, a current image, is adopted to implement an animation process, and the frame number of the current image is obtained according to image data information, for example, the frame number of a 4-bit image is 16 frames at most.
The target picture frame of the current image may be data information of the current image, and the data information of the corresponding target image is determined according to a current color-pixel mapping table to realize conversion between two frames of images, wherein the target picture frame of the current image is usually the next frame of the current image until the current image is converted into the last frame after image processing.
In the embodiment, a current image to be processed is obtained, and current image data information of the current image is obtained; determining a current color-to-pixel mapping table that matches the given image transformation target; and converting the current image according to the current image data information and the current color-pixel mapping table to obtain a target picture frame of the current image. According to the technical scheme, the image processing method of replacing the gradient color sequence frame with the gray scale mapping based on the MCU is used, so that the image data information conversion of one image can be flexibly realized, and the picture frame of the image in another image data form can be obtained. If the image processing method is iterated on the basis of one original image, the original image can present the driving picture frames of different image data in an animation form in the iteration process, so that no additional storage space is occupied in the whole animation presenting process.
As a first alternative embodiment of the embodiment, on the basis of the above embodiment, the first alternative embodiment further optimizes and adds:
a1 Replacing the current image with the target picture frame for display.
In this optional embodiment, the target picture frame may be a target image obtained after the current image is subjected to mapping conversion by the color-pixel mapping table. For example, the first frame image may be converted into the second frame image after image processing is performed on the first frame image, that is, the second frame image replaces the current first frame image for display.
b1 If the processing end condition is not satisfied currently, determining a new current image according to the image conversion target, and returning to re-execute the obtaining operation of the current image data information.
In this alternative embodiment, the image subjected to image processing is a 4-bit size image, and there are 16 variable images at the maximum. The processing end condition may be that the current image has become the last frame.
For example, in the image processing process, when the current image is the last frame, there is no target color and pixel value for the current image to continue data conversion, and the next conversion cannot be performed according to the current color-pixel mapping table, that is, the processing end condition is satisfied. If the current image is not the last frame, for example, the mth frame images (0 < -m < -16), mapping conversion of data can be performed according to the current color-pixel mapping table according to the image data information of the current mth frame image, so as to obtain the image data information of the target frame image, and the target frame image is converted into the target frame image, that is, the target frame image replaces the mth frame image, thereby realizing continuous animation display.
Further, the first current image is an original image, and correspondingly, determining a new current image according to the image conversion target includes:
b11 If the given image conversion target is a conversion from an original image picture to a black picture, the target picture frame is taken as a new current image.
In this alternative embodiment, the original image may be a first frame image, and if the given image conversion target is a conversion from an original image picture to a black picture, the target picture frame of the image of the current image processed according to the current color-pixel mapping table is taken as a new current image whose picture frame number is next to the picture frame number of the last current image.
Illustratively, the current image is an mth frame image, if the given image conversion target is conversion from an original image to a black image, mapping conversion of data can be performed according to the current color-pixel mapping table according to image data information of the current mth frame image, and the acquired target frame image obtained after conversion is an m +1 th frame, and replaces the mth frame image, thereby realizing continuous animation display. That is, the frame number of the current image is m, and the frame number of the target frame obtained after conversion is m +1.
b12 If the given image conversion target is the conversion from a black image to an original image, the original image is continuously taken as a new current image, and the frame number is accumulated as the current frame number of the current image.
In this alternative embodiment, the original image may be a first frame image and continues as a current image, and if the given image conversion target is a black-to-original-image conversion, the target image frame of the image processed by the current image according to the current color-pixel mapping table is taken as a new current image whose frame number is the next frame to the frame number of the target image subjected to the image processing last time, and the frame numbers are accumulated.
In this optional embodiment, the current image is replaced with the target screen frame for display, and if the processing end condition is not satisfied currently, a new current image is determined according to the image conversion target, and the operation of obtaining the current image data information is returned to be executed again. According to the technical scheme, before the processing end condition is met, the current image is continuously processed according to the current color-pixel mapping table, the image processed by the image is used for replacing the current image, the current image is circularly processed, and the original image can present the picture frames of different image data in an animation mode in the iteration process. Compared with the prior art, the image processing method is iterated on the basis of one original image without orderly managing a plurality of images required by animation presentation, so that the storage cost of continuous picture frames in the animation can be effectively reduced, and the orderly management of the plurality of images is avoided.
Example two
Fig. 2 is a flowchart of an image processing method according to an embodiment of the present invention, where the embodiment is applicable to a situation of an animation display at startup of a meter device, and the method may be executed by an image processing apparatus, and the image processing apparatus may be implemented in a form of hardware and/or software.
In this embodiment, the present image processing method is further described by determining a current color-pixel mapping table matching a given image conversion target, and converting the current image according to the current image data information and the current color-pixel mapping table to obtain a target frame of the current image.
The current color-pixel mapping table further includes color data corresponding to each pixel value under the RGB color standard. Each color of the three color channels is divided into 256-order brightness, and when the gray values of three colors are the same, gray tones with different gray values are generated, namely when the gray values of the three colors are all 0, the darkest black tone is generated; when the three colors are 255, the brightest white tone is generated.
As shown in fig. 2, the method includes:
s201, acquiring a current image to be processed, and acquiring current image data information of the current image.
S202, determining a current color-pixel mapping table matched with the given image conversion target.
In this embodiment, if the given image conversion target is the conversion from original image frame to black frame, step 203 is executed to determine the current color-pixel mapping table. If the given image conversion target is a black picture to original image picture conversion, step 204 is performed to determine the current color-to-pixel mapping table. The color-pixel mapping table comprises an original mapping table, the original mapping table is shown in fig. 3 and comprises a set number of color data, each color data corresponds to one pixel color in a pixel color sequence, the color data is represented in a hexadecimal form, the brightest color corresponds to 0x0F, the darkest color, namely black corresponds to 0x01, and corresponding data values are gradually changed from 0x0F to 0x0E,0x 0D, 0x0C \ 8230and 0x01 along the gradual change process of the color from white to light gray to dark gray and then to black.
S203, taking the initial color-pixel mapping table determined in advance based on the original mapping table as the current color-pixel mapping table.
In this embodiment, the initial color-pixel mapping table may be a color-pixel mapping table formed by mapping color data in the original mapping table according to a set mapping rule in a process of converting an original image frame into a black frame.
And mapping and converting the color data of the current image based on each color data corresponding to the pixel color in each pixel color sequence in the original mapping table according to a preset mapping mode from the original image picture to the black picture, and constructing a current color-pixel mapping table based on the conversion from the original image picture to the black picture.
S204, determining a current color-pixel mapping table based on the given original mapping table and the current frame serial number corresponding to the current image.
In this embodiment, the current frame number may be obtained by adding one frame to the accumulated image processing times after several image processing operations are performed in the process of converting the black image into the original image, for example, if the current image is subjected to 3 image processing operations, the frame number of the current image is 4.
Based on each color data corresponding to the pixel color in each pixel color sequence in the original mapping table, mapping conversion is carried out on the color data of the current image according to a preset mapping mode for converting from a black image to an original image, and a current color-pixel mapping table based on the conversion from the black image to the original image is constructed according to the current frame serial number corresponding to the current image.
And S205, acquiring the pixel value of each pixel point in the current image from the data information of the current image.
In this embodiment, the current image data information may include information such as image data and a size of an occupied space of the image. The image data may include data such as color, pixel information, resolution, and the like of the image, and in the current image, one pixel is eight-bit data, where the upper four bits are one pixel and the fourth bit is one pixel, and coexist in two pixels, and a pixel value of each pixel is determined, and the pixel value is converted into hexadecimal data within a range of 0 to 16, and may be represented as 0x00, 0x01, 0x02, 82300 x0D, 0x0e, and 0x0f.
S206, aiming at each pixel point, searching a current color-pixel mapping table, and determining target color data corresponding to the pixel value.
In this embodiment, according to the data of each pixel point, and according to whether the current image is converted from the original image frame to the black frame or from the black frame to the original image frame, the current color-pixel mapping table corresponding to the conversion is searched, and the target color data corresponding to the pixel value is determined according to the current color-pixel mapping table.
And S207, determining the pixel color corresponding to the target color data, and taking the pixel color as the target pixel color of the pixel point.
In this embodiment, the pixel color corresponding to the data value of the target color data is determined according to the current color-pixel mapping table, and is used as the target pixel color to be subjected to the next image processing.
S208, forming the target picture frame of the current image based on each target pixel color.
In this embodiment, the target pixel color may be determined as a target frame of a current image obtained after data processing of a previous frame of image.
In the embodiment, a current image to be processed is obtained, current image data information of the current image is obtained, a current color-pixel mapping table matched with a given image conversion target is determined, the given image conversion target is converted from an original image picture to a black picture, an initial color-pixel mapping table determined in advance based on the original mapping table is used as the current color-pixel mapping table, the given image conversion target is converted from the black picture to the original image picture, the current color-pixel mapping table is determined based on the given original mapping table and a current frame serial number corresponding to the current image, a pixel value of each pixel point in the current image is obtained from the current image data information, for each pixel point, the current color-pixel mapping table is searched, target color data corresponding to the pixel value is determined, a pixel color corresponding to the target color data is determined and used as a target pixel color of the pixel point, and a target picture frame of the current image is formed based on the target pixel color. According to the technical scheme, the color-pixel mapping table is constructed in different modes for different image conversion processes, animation logo display in the starting process of the instrument equipment is successfully achieved, pictures do not need to be sequenced in the image conversion processing process, frame-by-frame color gradient is achieved through one picture, space memory occupied by multiple sequence frame pictures is saved, the step of orderly managing the pictures is eliminated, and the storage cost of system hardware is effectively reduced.
As a first optional embodiment of the embodiments, on the basis of the above embodiments, the first optional embodiment further optimizes and adds the step of determining the initial color-pixel mapping table when the original image picture is converted into the black picture, including:
a2 Obtain the color data in the given original mapping table.
In this optional embodiment, as shown in fig. 3, each color data in the given original mapping table is mapped in a one-to-one correspondence manner between a pixel color and a color data, and each color data in the given original mapping table is obtained.
b2 Respectively determining the difference value between each color data and the reference gray scale difference value, and recording as a first difference value.
In this alternative embodiment, the reference gray scale difference value may be a fixed value, for example, 1, and the color data and the reference gray scale difference value are subjected to difference calculation to obtain a first difference value, where the first difference value may be data that decreases to zero, and at the same time, negative data is returned to 0.
For example, as shown in fig. 4, if the color data of the current image is 0x0F, the gray scale difference value is 1, the first difference value is 0x0E, and when 0x0E is used as the color data of the current image, the first difference value may be 0x0D, and so on, the first difference value may be data starting from 0x0E and continuously decreasing to 0, and if a certain image data is 0x00, the difference value from the gray scale difference value is calculated to obtain a negative number, and the negative number is returned to 0, that is, 0x00.
c2 Forming an initial mapping vector based on each first difference value, and obtaining a first vector matrix obtained by self-multiplying the initial mapping vector;
in this optional embodiment, performing mapping processing on the image data requires generating an initial mapping vector, where the initial mapping vector may be the first difference, and self-multiplying the initial mapping vector with the first difference to obtain a first vector matrix. The self-multiplication can be that 2 pixel points exist according to 1 byte, and can be divided into a pixel point with high 4 bits and a pixel point with low 4 bits. The method comprises the steps that 0x0E (u 8_ up) is obtained by a high pixel point 0x0F-1, 0x0E (u 8_ low) is obtained by a low pixel point 0x0F-1, the 2 pixel points are combined into one pixel, the high pixel point needs to be shifted left by 4 bits, and then the high pixel point is pressed or pressed to be lower, namely data = (u 8_ up < < 4) | u8_ low), and the first vector matrix has 256 data vectors.
Illustratively, as shown in fig. 5, the first difference may be 16 data including 0-15, and the first difference is self-multiplied to obtain a first vector matrix consisting of 256 vectors, which may be represented as 0x00, 0x01, 0x02 \82300, 0xEC, 0xED, 0xEE in hexadecimal.
d2 Constitute the initial color-pixel mapping table based on values of elements in the first vector matrix.
In this optional embodiment, the initial color-to-pixel mapping table may include a pixel color of the current image, initial color data corresponding to the pixel color, an initial mapping vector obtained through a gray-scale difference operation, and a first vector matrix obtained by self-multiplying according to the initial mapping vector.
As a second optional embodiment of the embodiment, on the basis of the above embodiment, when a black picture is converted into an original picture, the second optional embodiment further optimizes and adds a step of determining the current color-pixel mapping table based on a given original mapping table and a current frame number corresponding to the current picture, including:
a3 Obtaining each color data in the given original mapping table, and determining the current gray scale difference value corresponding to the frame number.
In this optional embodiment, the current gray scale difference may be a decreasing gray scale difference, and may be matched with the current frame according to the frame number of the current frame. The gray scale difference is decreased progressively until the gray scale difference used by the current image is F, the gray scale difference used when the next frame of image is processed is E, and so on until the gray scale difference is 0.
For example, when the first frame image is subjected to image processing, the gray scale difference value of the current image is F, when the second frame image is subjected to image processing, the gray scale difference value of the current image is E, when the third frame image is subjected to image processing, the gray scale difference value of the current image is C, and the current gray scale difference value may be determined according to the current frame number.
b3 Respectively determining the difference value between each color data and the current gray scale difference value, and recording as a second difference value.
In this embodiment, the difference between the color data and the current gray scale difference may be calculated by using a decreasing current gray scale difference, for example, the gray scale difference used by the current image is F, a derived color map (0 00 00 00 00 00 00 00 00 0) is obtained from the original color (F E D C B9 a 8 7 6 5 4 3 2 0), when the next frame of image is processed, the gray scale difference used is E, a derived color map (1 00 00 00 00 00 00 00 00 00 0) is obtained, and so on until the last frame of image is restored to the original color (F E D C B9 a 8 7 6 4 3 2 0), a second difference corresponding to each color data is obtained.
c3 Based on each second difference value, forming a current mapping vector, and obtaining a second vector matrix obtained by self-multiplying the current mapping vector.
In this embodiment, performing the mapping process on the image data requires generating a current mapping vector, where the current mapping vector may be the second difference. In this alternative embodiment, the second vector matrix is obtained by self-multiplying the vector matrices. The self-multiplication can be the pixel of the second difference value, and the second vector matrix consisting of 256 vectors is obtained according to the self-multiplication of the high four-bit pixel point and the fourth bit pixel point.
For example, as shown in fig. 6, a difference calculation is performed on the color data according to the current gray scale difference value to obtain a second difference value, i.e. a current mapping vector. The current mapping vector obtained in the first mapping is (0 00 00 00 00 00 00 00 0), and the current mapping vector obtained in the sixteenth mapping is (fd C B9 a 8 7 6 4 3 2 0).
d3 Constitute the current color-pixel mapping table based on values of elements in the second vector matrix.
In this optional embodiment, the current color-pixel mapping table may include a pixel color of the current image, initial color data corresponding to the pixel color, an initial mapping vector obtained through a gray-scale difference operation, and a first vector matrix obtained by self-multiplying according to the initial mapping vector.
EXAMPLE III
Fig. 7 is a schematic structural diagram of an image processing apparatus according to a third embodiment of the present invention. As shown in fig. 7, the apparatus includes:
a first obtaining module 71, configured to obtain a current image to be processed, and obtain current image data information of the current image;
a second obtaining module 72 for determining a current color-to-pixel mapping table matching the given image conversion target;
a third obtaining module 73, configured to convert the current image according to the current image data information and the current color-pixel mapping table, and obtain a target picture frame of the current image.
The image processing device adopted by the technical scheme can effectively reduce the storage cost of continuous picture frames in the animation when being applied to the animation presentation of the original image, and simultaneously avoids the orderly management of a plurality of images.
The second obtaining module 72 includes:
a first mapping unit configured to take an initial color-pixel mapping table determined in advance based on an original mapping table as the current color-pixel mapping table if a given image conversion target is a conversion from an original image picture to a black picture;
a second mapping unit, configured to determine the current color-pixel mapping table based on a given original mapping table and a current frame number corresponding to the current image if the given image conversion target is a black image to original image conversion;
the original mapping table includes a set number of color data, each color data corresponding to a pixel color in a pixel color sequence.
The first mapping unit is specifically applied to:
acquiring each color data in the given original mapping table;
respectively determining the difference value between each color data and the reference gray scale difference value, and recording as a first difference value;
forming an initial mapping vector based on each first difference value, and obtaining a first vector matrix obtained by self-multiplying the initial mapping vector;
constructing the initial color-to-pixel mapping table based on values of elements in the first vector matrix.
The second mapping unit is specifically applied to:
acquiring each color data in the given original mapping table, and determining the current gray scale difference value corresponding to the frame number;
respectively determining the difference value between each color data and the current gray scale difference value, and recording as a second difference value;
forming a current mapping vector based on each second difference value, and obtaining a second vector matrix obtained by self-multiplying the current mapping vector;
forming the current color-pixel mapping table based on values of elements in the second vector matrix.
Optionally, the current color-pixel mapping table includes color data corresponding to each pixel value under an RGB color standard, and the third obtaining module 73 is specifically applied to:
acquiring the pixel value of each pixel point in the current image from the current image data information;
searching the current color-pixel mapping table for each pixel point, and determining target color data corresponding to the pixel value;
determining pixel colors corresponding to the target color data, and taking the pixel colors as target pixel colors of the pixel points;
and forming a target picture frame of the current image based on each target pixel color.
Optionally, the apparatus further comprises:
the image replacement module is used for replacing the current image with the target picture frame for displaying;
and the image determining module is used for determining a new current image according to the image conversion target if the processing ending condition is not met currently, and returning to the operation of re-executing the acquisition of the current image data information.
Optionally, the first current image is an original image, and correspondingly, the image determining module is specifically applied to:
if the given image conversion target is the conversion from an original image picture to a black picture, taking the target picture frame as a new current image;
and if the given image conversion target is the conversion from a black image to an original image, continuously taking the original image as a new current image, and accumulating the frame number to be used as the current frame number of the current image.
Example four
FIG. 8 shows a schematic block diagram of an electronic device 80 that may be used to implement an embodiment of the invention. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein. The electronic device 80 may be a vehicle having a processing and computation capability.
As shown in fig. 8, the electronic device 80 includes at least one processor 81, and a memory communicatively connected to the at least one processor 81, such as a Read Only Memory (ROM) 82, a Random Access Memory (RAM) 83, and the like, wherein the memory stores computer programs executable by the at least one processor, and the processor 81 can perform various suitable actions and processes according to the computer programs stored in the Read Only Memory (ROM) 82 or the computer programs loaded from the storage unit 88 into the Random Access Memory (RAM) 83. In the RAM 83, various programs and data necessary for the operation of the electronic apparatus 80 can also be stored. The processor 81, the ROM 82, and the RAM 83 are connected to each other by a bus 84. An input/output (I/O) interface 85 is also connected to bus 84.
A number of components in the electronic device 80 are connected to the I/O interface 85, including: an input unit 86 such as a keyboard, a mouse, and the like; an output unit 88 such as various types of displays, speakers, and the like; a storage unit 88 such as a magnetic disk, an optical disk, or the like; and a communication unit 89 such as a network card, modem, wireless communication transceiver, etc. The communication unit 89 allows the electronic device 80 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Processor 81 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of processor 81 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 81 performs the various methods and processes described above, such as an image processing method.
In some embodiments, the image processing method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 88. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 80 via the ROM 82 and/or the communication unit 89. When the computer program is loaded into the RAM 83 and executed by the processor 81, one or more steps of the image processing method described above may be performed. Alternatively, in other embodiments, the processor 81 may be configured to perform the image processing method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. An image processing method, comprising:
acquiring a current image to be processed and acquiring current image data information of the current image;
determining a current color-to-pixel mapping table that matches the given image transformation target;
and converting the current image according to the current image data information and the current color-pixel mapping table to obtain a target picture frame of the current image.
2. The method of claim 1, wherein determining a current color-to-pixel mapping table that matches the given image conversion target comprises:
if the given image conversion target is the conversion from an original image picture to a black picture, taking an initial color-pixel mapping table determined in advance based on an original mapping table as the current color-pixel mapping table;
if the given image conversion target is the conversion from a black image to an original image, determining the current color-pixel mapping table based on the given original mapping table and the current frame serial number corresponding to the current image;
the original mapping table includes a set number of color data, and each color data corresponds to a pixel color in a pixel color sequence.
3. The method of claim 2, wherein the step of determining the initial color-to-pixel mapping table comprises:
acquiring each color data in the given original mapping table;
respectively determining the difference value between each color data and the reference gray scale difference value, and recording as a first difference value;
forming an initial mapping vector based on each first difference value, and obtaining a first vector matrix obtained by self-multiplying the initial mapping vector;
constructing the initial color-to-pixel mapping table based on values of elements in the first vector matrix.
4. The method of claim 2, wherein determining the current color-to-pixel mapping table based on the given original mapping table and the current frame number corresponding to the current image comprises:
acquiring color data in a given original mapping table, and determining a current gray scale difference value corresponding to the frame serial number;
respectively determining the difference value between each color data and the current gray scale difference value, and recording as a second difference value;
forming a current mapping vector based on each second difference value, and obtaining a second vector matrix obtained by self-multiplying the current mapping vector;
forming the current color-pixel mapping table based on values of elements in the second vector matrix.
5. The method of claim 1, wherein the current color-to-pixel mapping table includes color data corresponding to each pixel value under RGB color standard;
the converting the current image according to the current image data information and the current color-pixel mapping table to obtain the target picture frame of the current image includes:
acquiring the pixel value of each pixel point in the current image from the current image data information;
searching the current color-pixel mapping table for each pixel point, and determining target color data corresponding to the pixel value;
determining pixel color corresponding to the target color data, and using the pixel color as the target pixel color of the pixel point;
and forming a target picture frame of the current image based on each target pixel color.
6. The method of any one of claims 1-5, further comprising:
replacing the current image with the target picture frame for display;
and if the current image does not meet the processing end condition, determining a new current image according to the image conversion target, and returning to re-execute the obtaining operation of the current image data information.
7. The method of claim 6, wherein the first current picture is an original picture;
correspondingly, the determining a new current image according to the image conversion target includes:
if the given image conversion target is the conversion from an original image picture to a black picture, taking the target picture frame as a new current image;
and if the given image conversion target is the conversion from a black image to an original image, continuously taking the original image as a new current image, and accumulating the frame number as the current frame number of the current image.
8. An image processing apparatus characterized by comprising:
the first acquisition module is used for acquiring a current image to be processed and acquiring current image data information of the current image;
a second obtaining module for determining a current color-to-pixel mapping table matched with the given image conversion target;
and the third acquisition module is used for converting the current image according to the current image data information and the current color-pixel mapping table to acquire a target picture frame of the current image.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the image processing method of any one of claims 1-7.
10. A computer-readable storage medium, having stored thereon computer instructions for causing a processor, when executed, to implement the image processing method of any one of claims 1-7.
CN202211333483.8A 2022-10-28 2022-10-28 Image processing method, device, equipment and storage medium Pending CN115761079A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211333483.8A CN115761079A (en) 2022-10-28 2022-10-28 Image processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211333483.8A CN115761079A (en) 2022-10-28 2022-10-28 Image processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115761079A true CN115761079A (en) 2023-03-07

Family

ID=85355728

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211333483.8A Pending CN115761079A (en) 2022-10-28 2022-10-28 Image processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115761079A (en)

Similar Documents

Publication Publication Date Title
JPH06309146A (en) Apparatus for conversion of floating-point representation of number into integer representation and method for generation of value of pixel
EP0580302A2 (en) Method and apparatus for generating a color palette
JP2021174530A (en) Video frame processing method and device, electronic equipment, storage medium, and computer program
CN107465939B (en) Method and device for processing video image data stream
US8044960B2 (en) Character display apparatus
CN108322722B (en) Image processing method and device based on augmented reality and electronic equipment
JP2009140487A (en) Converting method, conversion system and computer readable storage medium
CN111551348B (en) Gamma debugging method and device
CN112714357A (en) Video playing method, video playing device, electronic equipment and storage medium
CN115761079A (en) Image processing method, device, equipment and storage medium
CN107767327B (en) Image rendering method and device, computing equipment and display equipment
CN109614064A (en) A kind of image display method, image display apparatus and terminal device
US20040125238A1 (en) Image converting apparatus and method thereof
CN116823700A (en) Image quality determining method and device
CN112331143A (en) Segmented adjustable gamma correction method for silicon-based OLED micro-display
US8630488B2 (en) Creating a duotone color effect using an ICC profile
CN112258541A (en) Video boundary detection method, system, device and storage medium
US20080154999A1 (en) Compressed Floating Point Representation Of Points On Monotonic Curves Which Can Be Specified By High Order Equations
CN112862110B (en) Model generation method and device and electronic equipment
CN113627363B (en) Video file processing method, device, equipment and storage medium
CN116264056A (en) Display device brightness adjustment method and device, electronic device and storage medium
CN116957985A (en) Image restoration method, device, electronic equipment and storage medium
JP2018106238A (en) Image processing apparatus, image processing method and program
JP3952804B2 (en) Data processing method and data processing apparatus
JP3566568B2 (en) Sample data string conversion method, distribution point value calculation method, sample data division method, and program recording medium

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