Image processing method and apparatus, and electronic device and storage medium
By rearranging and synthesizing pixels in the target area in the image, the problem of insufficient types and diversity of image special effects in the prior art is solved, and the addition of diversity and personalized special effects is achieved to meet users' needs for diversity and personalization.
Patent Information
- Application Number
- PCT/CN2024/137484
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-21
- Filing Date
- 2024-12-06
- Publication Date
- 2025-06-26
AI Technical Summary
The prior art has shortcomings in the types and diversity of image special effects, and cannot meet users' needs for diversity and personalization.
By acquiring the image to be processed, determining the target area, and rearranging the pixels in the target area according to preset arrangement rules, a first image is obtained, and then the first image and the to be processed image are synthesized to obtain the processed image.
It has achieved the provision of a new special effect to meet users' needs for diversity and personalized special effect addition, and improved the diversity and personalization level of image processing.
Smart Images

Figure CN2024137484_26062025_PF_FP_ABST
Abstract
Description
Image processing method, device, electronic device and storage medium
[0001] This application claims priority to the Chinese invention patent application entitled “Image processing method, device, electronic device and storage medium” filed on December 21, 2023, with application number 202311768397.4. The entire contents of that application are incorporated by reference into this application. Technical Field
[0002] The present disclosure relates to the field of image processing technology, and in particular to an image processing method, device, electronic device, and storage medium. Background Art
[0003] In today's digital age, images have become an indispensable part of people's daily lives. With the continuous development of technology, people's requirements for image quality and effects are also constantly increasing. The addition of image special effects can not only enhance the artistic effect of images, but also meet people's requirements for image diversity and personalization.
[0004] However, although the technology for adding image special effects has developed, there are still deficiencies in the types and diversity of special effects, which cannot meet users' needs for diversity and personalization. Summary of the Invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an image processing method, apparatus, electronic device and storage medium.
[0006] In a first aspect, the present disclosure provides an image processing method, comprising: acquiring an image to be processed; determining a target area in the image to be processed; rearranging pixels in the target area in the image to be processed according to a preset arrangement rule to obtain a first image; and synthesizing the first image with the image to be processed to obtain a processed image.
[0007] In a second aspect, the present disclosure also provides an image processing device, including: an acquisition module for acquiring an image to be processed; a determination module for determining a target area in the image to be processed; an arrangement module for rearranging pixels in the target area in the image to be processed according to a preset arrangement rule to obtain a first image; and a synthesis module for synthesizing the first image with the image to be processed to obtain a processed image.
[0008] In a third aspect, the present disclosure also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described above.
[0009] In a fourth aspect, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which implements the image processing method described above when the program is executed by a processor.
[0010] In a fifth aspect of the present disclosure, a computer program product is provided, which includes computer-executable instructions, which, when executed by a processor, implement the image processing method described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0012] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0013] FIG1 is a flow chart of an image processing method provided by an embodiment of the present disclosure;
[0014] 2 to 4 are schematic diagrams of the image processing method provided by the embodiments of the present disclosure;
[0015] FIG5 is a schematic structural diagram of an image processing device according to an embodiment of the present disclosure;
[0016] FIG6 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0017] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.
[0018] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0019] The following description will provide a clearer understanding of the technical solution provided by the disclosed embodiments. The solution involves obtaining an image to be processed; determining a target region within the image to be processed; rearranging the pixels in the target region within the image to be processed according to a preset arrangement rule to obtain a first image; and synthesizing the first image with the image to be processed to obtain a processed image. The essence of the solution is to provide a new type of special effect to meet users' demand for diverse and personalized special effects.
[0020] To facilitate understanding, the overall inventive concept of the technical solution provided in this application is first explained.
[0021] In this application, the new special effects provided by this application are referred to as target special effects.
[0022] FIG1 is a flowchart of an image processing method provided by an embodiment of the present disclosure. This embodiment is applicable to situations where special effects are added to images on a client. The method can be executed by an image processing device, which can be implemented using software and / or hardware. The device can be configured in an electronic device, such as a terminal, specifically including but not limited to smartphones, PDAs, tablet computers, wearable devices with displays, desktop computers, laptop computers, all-in-one computers, smart home devices, etc. Alternatively, this embodiment can be applicable to situations where special effects are added to images on a server. The method can be executed by an image processing device, which can be implemented using software and / or hardware. The device can be configured in an electronic device, such as a server.
[0023] As shown in FIG1 , the method may specifically include:
[0024] S110: Acquire an image to be processed.
[0025] The image to be processed can be a single image or an image frame in a video.
[0026] A separate image refers to an image frame that is not part of a video. If the image to be processed is a separate image, it can be an image uploaded, taken, or specified by the user.
[0027] If the image to be processed is an image frame in a video, the video may be recorded by the user or downloaded from the Internet, and this application does not impose any restrictions on this.
[0028] If the image to be processed is an image frame in a video, in practice, one or more frames of images in the video can be used as the image to be processed by the image processing method provided in this application.
[0029] S120: Determine a target area in the image to be processed.
[0030] The target area may be, for example, an area where pixels need to be rearranged in order to achieve a target special effect. This application does not limit the specific shape and size of the target area. For example, the shape of the target area is circular, polygonal, or other irregular shapes.
[0031] In practice, one or more target regions may be determined in the same image to be processed.
[0032] There are many ways to implement this step, which are not limited in this application. For example, an area in the image to be processed can be arbitrarily selected as the target area; or the target area can be determined in the image to be processed based on a preset target area determination rule.
[0033] If the target area is determined in the image to be processed based on the preset target area determination rule, in practice, the present application does not limit the specific content of the preset target area determination rule. For example, the preset target area determination rule may include: taking the area occupied by the target object in the image to be processed as the target area. In some scenarios, the target object may be a certain category of things specified in advance. For example, the target object may be a person, an animal, a building, the sky, the earth, etc. In other scenarios, the target object may be the main thing reflected in the target image to be processed. Here, the judgment of what kind of thing in the image to be processed is the main thing can be determined based on the specific content of the image to be processed or the target video and the information to be expressed. In other scenarios, the target object may be the focus area in the image to be processed. The focus area refers to the area that is clearly captured during the shooting process. The focus point is usually the clearest and most detailed in the target image.
[0034] In other examples, based on preset target area determination rules, determining the target area in the image to be processed includes: determining a first characteristic parameter of a pixel in the image to be processed; and determining the target area based on the first characteristic parameter of the pixel and a preset threshold range.
[0035] A pixel is the smallest unit that makes up an image (in this application, the image to be processed). Specifically, an image can be broken down into many small squares arranged in a matrix (i.e., a pixel grid). Each small square is a pixel, and each pixel can record and display a specific part of the image, such as color, brightness, contrast, etc. All pixels together determine the visual effect presented by the image (in this application, the image to be processed).
[0036] The first characteristic parameter of a pixel may specifically include at least one of the following: pixel brightness, red color value, green color value, blue color value, hue, saturation, contrast, and the average, maximum, and minimum brightness of the unit pixel area where the pixel is located.
[0037] The unit pixel region may be, for example, a region including a preset number of pixels. Any one pixel in the unit pixel region is adjacent to at least one of the other pixels in the unit pixel region.
[0038] If the first characteristic parameter of a pixel includes the brightness, red color value, green color value, blue color value, hue, saturation, or contrast of the pixel, it may refer to considering whether to include the area occupied by the pixel in the target area based on the pixel as the assessment unit. If the first characteristic parameter of a pixel includes the average, maximum, or minimum brightness of the unit pixel area in which the pixel is located, it may refer to considering whether to include the unit pixel area in the target area based on the unit pixel area as the assessment unit.
[0039] The preset threshold range can be predetermined, for example, and is used to determine whether a pixel or a unit pixel area is included in the target area. For example, if the first characteristic parameter of a pixel is within the preset threshold range, the target area is determined to include the area occupied by the pixel. If the first characteristic parameter of a pixel is outside the preset threshold range, the target area is determined to exclude the area occupied by the pixel.
[0040] Exemplarily, the first characteristic parameter of a pixel includes the brightness of the pixel. The preset threshold range is a value range less than 0.4. If the brightness of a pixel is less than 0.4 (i.e., the first characteristic parameter of the pixel is within the preset threshold range), the pixel is marked as 1; if the brightness of the pixel is greater than or equal to 0.4 (i.e., the first characteristic parameter of the pixel is outside the preset threshold range), the pixel is marked as 0. The area occupied by all pixels marked as 1 is regarded as the target area, so that a mask of the target area can be obtained.
[0041] S130 , rearranging the pixels in the target area of the image to be processed according to a preset arrangement rule to obtain a first image.
[0042] The preset arrangement rule may be, for example, a predefined pixel arrangement rule. This application does not limit the specific rules included in the preset arrangement rule. For example, the preset arrangement rule includes randomly arranging pixels in the same row or column.
[0043] The first image may be, for example, an image composed of a pixel queue obtained by rearranging pixels in a target area of the image to be processed.
[0044] There are various specific implementation methods for this step, which are not limited in this application. For example, the implementation method for this step includes: determining a second characteristic parameter of pixels in the target area; and adjusting the positions of the pixels in the target area based on the second characteristic parameter of the pixels in the target area and a preset arrangement rule to obtain a first image.
[0045] The second characteristic parameter of a pixel includes at least one of the following: the pixel's brightness, red color value, green color value, blue color value, hue, saturation, contrast, and the average, maximum, and minimum brightness of the unit pixel area in which the pixel is located. It should be noted that the second characteristic parameter of a pixel may be the same as or different from the first characteristic parameter of the pixel, and this is not limited in this application.
[0046] If the number of the second characteristic parameter of the pixel is one, the preset arrangement rules may include: arranging in the horizontal and / or vertical direction in the order of increasing second characteristic parameter values; or arranging in the horizontal and / or vertical direction in the order of decreasing second characteristic parameter values.
[0047] For example, referring to FIG2 , the original image is an original image of a target area in the image to be processed. In other words, the original image is the image displayed in the target area in the image to be processed, and is the image before the pixels are rearranged. In FIG2 , each square in the original image represents a pixel, and the value in each square represents the brightness of the pixel. Assume that the preset arrangement rule is to arrange the pixels in increasing order of brightness along the horizontal direction. Based on this arrangement rule, the pixels in the target area are rearranged, and the result is shown in the first image in FIG2 .
[0048] Furthermore, based on the second characteristic parameters of the pixels in the target area and the preset arrangement rules, adjusting the positions of the pixels in the target area to obtain the first image may include: determining the serial numbers of the pixels in the target area in the target queue based on the second characteristic parameters of the pixels in the target area and the preset arrangement rules; the target queue is a pixel queue formed after rearranging the pixels in the target area in the processed image according to the preset arrangement rules; based on the serial numbers of the pixels in the target area in the target queue, adjusting the positions of the pixels in the target area to obtain the first image.
[0049] Exemplarily, the second characteristic parameter of the pixel is the brightness of the pixel, and the preset arrangement rule is to arrange them in the order of increasing brightness along the horizontal direction. Take the rearrangement of the first row of pixels in the original image in Figure 2 as an example for explanation. Referring to Figure 3, first, the brightness of each pixel in the first row of the original image is compared, and combined with the preset arrangement rule, the serial number of each pixel in the target queue is determined. The target queue is a queue formed by arranging the pixels in the first row of the original image in the order of brightness from small to large. Then, according to the serial number of each pixel in the first row of pixels in the original image, the position of each pixel is adjusted to obtain the first row of pixels in the first image.
[0050] In addition, the above-mentioned pixel arrangement method determines the serial number of the pixels in the target area in the target queue by setting a second characteristic parameter based on the pixels in the target area and a preset arrangement rule; based on the serial number of the pixels in the target area in the target queue, the position of the pixels in the target area is adjusted to obtain the first image. The pixels can be rearranged only through two renderings (one to determine the serial number and the other to adjust the position of the pixel), which can effectively improve the rendering efficiency and is easy to implement and maintain.
[0051] It should also be noted that this application does not limit the number of target regions determined in the same image to be processed. If multiple target regions are determined in the same image to be processed, the pixels in the target regions in the image to be processed may be rearranged during S130. That is, the pixels in different target regions are not mixed.
[0052] S140: Synthesize the first image and the image to be processed to obtain a processed image.
[0053] There are various methods for implementing this step, which are not limited in this application. Optionally, the method for implementing this step includes replacing the image within the target area of the image to be processed with the first image to obtain a processed image. This arrangement essentially removes the content originally displayed in the target area of the image to be processed. After this removal, the target area of the image to be processed becomes vacant, which is then filled with the first image.
[0054] Alternatively, the first image is superimposed on the target area of the image to be processed to obtain a processed image. "Superimposing the first image on the target area of the image to be processed" means that the first image is covered in the target area of the image to be processed, and the first image will obscure the content originally displayed in the target area of the image to be processed.
[0055] The above technical solution involves obtaining an image to be processed; determining a target region within the image to be processed; rearranging the pixels in the target region of the image to be processed according to a preset arrangement rule to obtain a first image; and synthesizing the first image with the image to be processed to obtain a processed image to be processed. Its essence is to provide a new type of special effect to meet users' demand for diverse and personalized special effects.
[0056] Based on the above technical solution, optionally, when the image to be processed is an image frame in a target video, the area and / or size of the target region corresponding to the image to be processed changes frame by frame in the following manner: increasing frame by frame, decreasing frame by frame, increasing first and then decreasing frame by frame, or decreasing first and then increasing frame by frame.
[0057] It should be emphasized here that if the image to be processed includes multiple target areas, the area and / or size of the same target area in different images to be processed changes frame by frame in the following manner: increasing frame by frame, decreasing frame by frame, increasing first and then decreasing frame by frame, or decreasing first and then increasing frame by frame.
[0058] The following is an example of the area and / or size of the target area corresponding to each image frame in the target video decreasing frame by frame in conjunction with Figure 4. In Figure 4, the area occupied by the dot-filled small squares is within the target area. The area occupied by the unfilled small squares is outside the target area. Assume that the same position of the n-th image frame to the n+6-th image frame in the target video includes the pixel row A in Figure 4. When processing the n-th image frame, the target area of the n-th image frame is determined to be the entire row of pixel row A, and when executing S130, all pixels in pixel row A are rearranged. When processing the n+1-th image frame, the target area of the n+1-th image frame is determined to be the area occupied by pixels numbered 2-12 in pixel row A, and the pixels numbered 2-12 in pixel row A are rearranged. When processing the (n+2)th image frame, the target area of the (n+2)th image frame is determined to be the area occupied by pixels numbered 3-11 in pixel row A, and the pixels numbered 3-11 in pixel row A are rearranged.
[0059] When the target video is played, referring to FIG4 , if no target special effect is added, in the nth image frame to the n+6th image frame, the pixel with a brightness of 1 should be at position 7. However, due to the addition of the target special effect, in the processed nth image frame, the pixel with a brightness of 1 is at position 1; in the processed n+1th image frame, the pixel with a brightness of 1 is at position 2; ... When the target video is played, the pixel with a brightness of 1 is gradually moved from position 1 to position 7 from the processed nth image frame to the n+6th image frame, presenting a visual effect of the pixel with a brightness of 1 gradually "returning to its original position."
[0060] Considering the movement of all pixels in the target area, decreasing the area and / or size of the target area corresponding to each image frame in the target video frame by frame will create a visual effect of pixels transitioning from a chaotic state to an information-transmitting state, as if the pixels are gradually "returning to their original positions." Conversely, increasing the area and / or size of the target area corresponding to each image frame in the target video frame by frame will create a visual effect of pixels transitioning from an information-transmitting state to a chaotic state, as if the pixels are gradually "offside."
[0061] The information conveying state refers to the state of pixels in the image frame before they are rearranged, in which the content of the image frame in the target video can be effectively conveyed.
[0062] The chaotic state refers to the state of pixels in the processed image frame after the pixels are rearranged. In this state, the content of the image frame in the target video cannot be effectively conveyed.
[0063] Similarly, in the target video, the area and / or size of the target region corresponding to each image frame first increases and then decreases frame by frame, which will cause the pixels to present a visual effect of transitioning from an information conveying state to a chaotic state and then to an information conveying state, as if the pixels first gradually "go offside" and then gradually "return to their place".
[0064] In the target video, the area and / or size of the target region corresponding to each image frame first decreases and then increases frame by frame, which will cause the pixels to present a visual effect of transitioning from a chaotic state to an information conveying state and then back to a chaotic state, as if the pixels first gradually "return to their place" and then gradually "go off-side".
[0065] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0066] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0067] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0068] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0069] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0070] FIG5 is a schematic diagram of the structure of an image processing device in an embodiment of the present disclosure. The image processing device provided by the embodiment of the present disclosure can be configured in a client, or can be configured in a server. Referring to FIG5 , the image processing device specifically includes: an acquisition module 310 for acquiring an image to be processed; a determination module 320 for determining a target area in the image to be processed; an arrangement module 330 for rearranging pixels in the target area in the image to be processed according to a preset arrangement rule to obtain a first image; and a synthesis module 340 for synthesizing the first image with the image to be processed to obtain a processed image.
[0071] Furthermore, the determination module 320 is configured to determine a target area in the image to be processed based on a preset target area determination rule.
[0072] Furthermore, the determination module 320 is configured to: determine a first characteristic parameter of a pixel in the image to be processed; and determine a target area based on the first characteristic parameter of the pixel and a preset threshold range.
[0073] Furthermore, the arrangement module 330 is used to: determine the second characteristic parameter of the pixels in the target area; and adjust the position of each pixel in the target area based on the second characteristic parameter of the pixels in the target area and the preset arrangement rule to obtain a first image.
[0074] Furthermore, the arrangement module 330 is used to: determine the serial number of the pixels in the target area in the target queue based on the second characteristic parameter of the pixels in the target area and the preset arrangement rule; the target queue is a pixel queue formed by rearranging the pixels in the target area in the image to be processed according to the preset arrangement rule; based on the serial number of the pixels in the target area in the target queue, adjust the position of the pixels in the target area to obtain a first image.
[0075] Furthermore, the second characteristic parameter of the pixel includes at least one of the following: brightness, red color value, green color value, blue color value, hue, saturation, contrast of the pixel, and the average value, maximum value and minimum value of the brightness of the unit pixel area where the pixel is located.
[0076] Furthermore, the preset arrangement rule includes: arranging in the horizontal and / or vertical direction in the order of increasing values of the second characteristic parameter; or arranging in the horizontal and / or vertical direction in the order of decreasing values of the second characteristic parameter.
[0077] Furthermore, when the image to be processed is an image frame in a target video, the area and / or size of the target region corresponding to the image frame changes frame by frame in the following manner: increasing frame by frame, decreasing frame by frame, increasing first and then decreasing frame by frame, or decreasing first and then increasing frame by frame.
[0078] Furthermore, the synthesis module 340 is used to: replace the image in the target area of the image to be processed with the first image to obtain a processed image; or superimpose the first image on the target area of the image to be processed to obtain a processed image.
[0079] The image processing device provided in the embodiment of the present disclosure can execute the steps executed by the client or server in the image processing method provided in the embodiment of the method of the present disclosure, and has the execution steps and beneficial effects, which will not be repeated here.
[0080] Figure 6 is a schematic diagram of the structure of an electronic device in an embodiment of the present disclosure. Specific reference will be made below to Figure 6, which shows a schematic diagram of the structure of an electronic device 1000 suitable for implementing an embodiment of the present disclosure. The electronic device 1000 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable electronic devices, and the like, as well as fixed terminals such as digital TVs, desktop computers, smart home devices, and the like. The electronic device shown in Figure 6 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0081] As shown in FIG6 , the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes to implement the image processing method of the embodiment described in the present disclosure according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. Various programs and information required for the operation of the electronic device 1000 are also stored in the RAM 1003. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0082] Typically, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange information. Although FIG. 6 shows the electronic device 1000 with various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may alternatively be implemented or have.
[0083] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart, thereby implementing the image processing method described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0084] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include an information signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated information signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0085] In some embodiments, the client and server can communicate using any known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital information communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any known or future developed network.
[0086] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0087] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device is enabled to: obtain an image to be processed; determine a target area in the image to be processed; rearrange the pixels in the target area in the image to be processed according to a preset arrangement rule to obtain a first image; and synthesize the first image with the image to be processed to obtain a processed image.
[0088] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.
[0089] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0090] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0091] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a unit does not necessarily limit the unit itself.
[0092] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0093] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, 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 portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0094] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement any image processing method provided by the present disclosure.
[0095] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any image processing method provided by the present disclosure.
[0096] An embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the image processing method described above is implemented.
[0097] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0098] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein.
Claims
1. An image processing method, comprising: Get the image to be processed; Determining a target area in the image to be processed; Rearranging pixels in the target area in the image to be processed according to a preset arrangement rule to obtain a first image; The first image is synthesized with the image to be processed to obtain a processed image.
2. The method according to claim 1, wherein determining the target area in the image to be processed comprises: Based on a preset target region determination rule, a target region is determined in the image to be processed.
3. The method according to claim 2, wherein the determining the target area in the image to be processed based on a preset target area determination rule comprises: Determining a first characteristic parameter of a pixel in the image to be processed; A target area is determined based on the first characteristic parameter of the pixel and a preset threshold range.
4. The method according to claim 1, wherein the pixels in the target area in the image to be processed are rearranged according to a preset arrangement rule to obtain the first image, comprising: Determine a second characteristic parameter of pixels in the target area; Based on the second characteristic parameters of the pixels in the target area and the preset arrangement rule, the positions of the pixels in the target area are adjusted to obtain a first image.
5. The method according to claim 4, wherein the adjusting the positions of the pixels in the target area based on the second characteristic parameters of the pixels in the target area and the preset arrangement rule to obtain the first image comprises: Determining the sequence number of the pixel in the target area in the target queue based on the second characteristic parameter of the pixel in the target area and the preset arrangement rule; The target queue is a pixel queue formed by rearranging pixels in the target area in the image to be processed according to the preset arrangement rule; Based on the sequence numbers of the pixels in the target area in the target queue, the positions of the pixels in the target area are adjusted to obtain a first image.
6. The method according to claim 4, wherein the second characteristic parameter of the pixel comprises at least one of the following: The brightness, red color value, green color value, blue color value, hue, saturation, and contrast of the pixel, and the average, maximum, and minimum values of the brightness of the unit pixel area where the pixel is located.
7. The method according to claim 1, 4 or 5, wherein the preset arrangement rule comprises: Arrange in the horizontal direction and / or vertical direction in the order of increasing values of the second characteristic parameter; or, The second characteristic parameter values are arranged in descending order in the horizontal direction and / or the vertical direction.
8. The method according to claim 1, wherein when the image to be processed is an image frame in a target video, the area and / or size of the target region corresponding to the image frame changes frame by frame in the following manner: Increase frame by frame, decrease frame by frame, increase first and then decrease frame by frame, or decrease first and then increase frame by frame.
9. The method according to claim 1, wherein synthesizing the first image with the image to be processed to obtain a processed image comprises: Using the first image to replace the image in the target area of the image to be processed to obtain a processed image; or, The first image is superimposed on the target area of the image to be processed to obtain a processed image.
10. An image processing device, comprising: An acquisition module, used for acquiring an image to be processed; A determination module, used for determining a target area in the image to be processed; An arrangement module, used for rearranging the pixels in the target area in the image to be processed according to a preset arrangement rule to obtain a first image; A synthesis module is used to synthesize the first image with the image to be processed to obtain a processed image.
11. An electronic device, comprising: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
13. A computer program product comprising computer executable instructions, wherein the computer executable instructions, when executed by a processor, implement the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Image processing method, mobile terminal and computer readable storage medium
CN107743199A
Target identification method and device
CN111476729A
Video processing method and device, electronic equipment and storage medium
CN112702625A
Map processing method and device, computer equipment and storage medium
CN114419237A
Image processing method and device, electronic equipment and storage medium
CN115713588A