Image processing method and device, electronic equipment and storage medium

By rearranging and synthesizing pixels in the target area in the image, a new image special effect is provided, which solves the problem of insufficient types and diversity of special effects in the prior art, and meets users' needs for diversity and personalization.

CN120198535APending Publication Date: 2025-06-24BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311768397.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-21
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

The prior art has shortcomings in the types and diversity of image special effects, and cannot meet users' needs for diversity and personalization.

Method used

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.

Benefits of technology

It provides a new special effect to meet users' needs for diversity and personalized special effects, and improves the diversity and personalization level of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120198535A_ABST
    Figure CN120198535A_ABST
Patent Text Reader

Abstract

The invention relates to an image processing method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a to-be-processed image; determining a target area in the to-be-processed image; rearranging pixels in the target area in the to-be-processed image according to a preset arrangement rule to obtain a first image; and synthesizing the first image and the to-be-processed image to obtain a processed image. The essence of the method is to provide a brand new special effect so as to meet the requirements of users on diversified and personalized special effect addition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technologies, and in particular, to an image processing method, apparatus, electronic device, and storage medium. Background Art

[0002] 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 the quality and effect of images have also been continuously improved. 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.

[0003] However, although the technology for adding image special effects has developed to some extent, there are still deficiencies in the types and diversity of special effects, which cannot meet the user's requirements for diversity and personalization. 。 Summary of the Invention

[0004] 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.

[0005] In a first aspect, the present disclosure provides an image processing method, including:

[0006] Obtain an image to be processed;

[0007] Determine a target area in the image to be processed;

[0008] Rearrange the pixels in the target area of the image to be processed according to a preset arrangement rule to obtain a first image;

[0009] Synthesize the first image and the image to be processed to obtain a processed image.

[0010] In a second aspect, the present disclosure further provides an image processing apparatus, including:

[0011] An obtaining module, configured to obtain an image to be processed;

[0012] A determining module, configured to determine a target area in the image to be processed;

[0013] An arranging module, configured to rearrange the pixels in the target area of the image to be processed according to a preset arrangement rule to obtain a first image;

[0014] A synthesizing module, configured to synthesize the first image and the image to be processed to obtain a processed image.

[0015] In a third aspect, the present disclosure further provides an electronic device, where the electronic device includes:

[0016] One or more processors;

[0017] A storage device for storing one or more programs;

[0018] 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.

[0019] In a fourth aspect, the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the image processing method as described above is implemented.

[0020] The technical solution provided by the embodiments of the present disclosure has the following advantages compared with the prior art:

[0021] The technical solution provided by the embodiments of the present disclosure includes obtaining an image to be processed; determining a target area in the image to be processed; rearranging the pixels in the target area of the image to be processed according to a preset arrangement rule to obtain a first image; and synthesizing the first image and the image to be processed to obtain a processed image. Its essence is to provide a brand-new special effect to meet the user's needs for diverse and personalized special effect addition. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure.

[0023] To more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

[0024] Figure 1 It is a flowchart of an image processing method provided by an embodiment of the present disclosure;

[0025] Figures 2 - 4 It is a schematic diagram of the principle of the image processing method provided by an embodiment of the present disclosure;

[0026] Figure 5 It is a schematic structural diagram of an image processing device in an embodiment of the present disclosure;

[0027] Figure 6 It is a schematic structural diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0028] To better understand the above objects, features, and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that, without conflict, the embodiments of the present disclosure and the features in the embodiments may be combined with each other.

[0029] In the following description, many specific details are set forth to facilitate a thorough understanding of the present disclosure, but the present disclosure may be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only a part of the embodiments of the present disclosure, rather than all the embodiments.

[0030] For ease of understanding, the overall inventive concept of the technical solution provided in this application will be described first.

[0031] In this application, the new special effect provided in this application is referred to as the target special effect.

[0032] Figure 1 FIG. is a flowchart of an image processing method provided for an embodiment of the present disclosure. This embodiment is applicable to the case of adding a special effect to an image in a client. This method can be executed by an image processing device, which can be implemented in software and / or hardware, and the device can be configured in an electronic device, such as a terminal, specifically including but not limited to a smart phone, a personal digital assistant, a tablet computer, a wearable device with a display screen, a desktop computer, a laptop computer, an all-in-one computer, a smart home device, etc. Alternatively, this embodiment is applicable to the case of adding a special effect to an image in a server. This method can be executed by an image processing device, which can be implemented in software and / or hardware, and the device can be configured in an electronic device, such as a server.

[0033] As Figure 1 shown, the method may specifically include:

[0034] S110. Obtain an image to be processed.

[0035] The image to be processed may be a single image or an image frame in a video.

[0036] A single image refers to an image frame that is not in a video. If the image to be processed is a single image, it may be an image uploaded, taken, or specified by a user.

[0037] If the image to be processed is an image frame in a video, the video may be recorded by a user or downloaded from the network, and this application does not limit this.

[0038] If the image to be processed is an image frame in a video. In practice, one or more image frames in the video may be used as the image to be processed in the image processing method provided in this application.

[0039] S120. Determine a target area in the image to be processed.

[0040] The target area can be, for example, an area where the pixels inside need to be rearranged to achieve a target special effect. The present application does not limit the specific shape and size of the target area. Exemplarily, the shape of the target area is circular, polygonal, or other irregular shapes.

[0041] In practice, one or more target areas can be determined in the same image to be processed.

[0042] There are various implementation methods for this step, and the present application does not limit this. Exemplarily, an area can be arbitrarily selected in the image to be processed as the target area; or, based on a preset target area determination rule, the target area is determined in the image to be processed.

[0043] If the target area is determined in the image to be processed based on a preset target area determination rule, in practice, the present application does not limit the specific content included in the preset target area determination rule. Exemplarily, the preset target area determination rule can 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 can be a certain type of thing specified in advance. Exemplarily, the target object can be a person, an animal, a building, the sky, the earth, etc. In some other scenarios, the target object can be the main thing reflected in the target image to be processed. Here, to determine which thing in the image to be processed is the main thing, it can be determined according to the specific content of the image to be processed or the target video and the information to be expressed and transmitted. In some other scenarios, the target object can be the focused area in the image to be processed. The focused area refers to the area that is clearly captured during the shooting process. The focus point is usually the clearest and has the richest details in the target image.

[0044] In some other examples, determining the target area in the image to be processed based on a preset target area determination rule includes: determining the first feature parameter of the pixels in the image to be processed; and determining the target area based on the first feature parameter of the pixels and a preset threshold range.

[0045] A pixel is the smallest unit that constitutes an image (in the present application, it is the image to be processed). Specifically, an image can be decomposed into many small squares arranged in a matrix (that is, 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 the present application, it is the image to be processed).

[0046] The first feature parameter of the pixel can specifically include at least one of the following: the brightness of the pixel, the red color value, the green color value, the blue color value, the hue, the saturation, the contrast, the average value, the maximum value, and the minimum value of the brightness of the unit pixel area where the pixel is located.

[0047] A unit pixel region can 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.

[0048] 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 can refer to taking the pixel as the assessment unit and considering whether to include the region occupied by the pixel in the target region. If the first characteristic parameter of a pixel includes the average value, maximum value, or minimum value of the brightness of the unit pixel region where the pixel is located, it can refer to taking the unit pixel region as the assessment unit and considering whether to include the unit pixel region in the target region.

[0049] The preset threshold range can be, for example, predetermined and used to measure whether to include a pixel or a unit pixel region in the target region. Exemplarily, if the first characteristic parameter of a pixel is within the preset threshold range, it is determined that the target region includes the region occupied by the pixel. If the first characteristic parameter of a pixel is outside the preset threshold range, it is determined that the target region does not include the region occupied by the pixel.

[0050] 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 the 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 region occupied by all the pixels marked as 1 is used as the target region, and thus the mask of the target region can be obtained.

[0051] S130. Rearrange the pixels in the target region of the image to be processed according to a preset arrangement rule to obtain a first image.

[0052] The preset arrangement rule can be, for example, a pixel arrangement rule specified in advance. This application does not limit what specific rules the preset arrangement rule includes. Exemplarily, the preset arrangement rule includes randomly arranging the pixels in the same row or the same column.

[0053] The first image can be, for example, an image composed of a pixel queue obtained by rearranging the pixels in the target region of the image to be processed.

[0054] There are various specific implementation methods for this step, and this application does not limit this. Exemplarily, the implementation method of this step includes: determining the second characteristic parameter of the pixels in the target region; adjusting the positions of the pixels in the target region based on the second characteristic parameter of the pixels in the target region and the preset arrangement rule to obtain the first image.

[0055] Among them, the second characteristic parameter of the pixel includes at least one of the following: the brightness of the pixel, the red color value, the green color value, the blue color value, the hue, the saturation, the contrast, the average value, the maximum value and the minimum value of the brightness of the unit pixel area where the pixel is located. It should be noted that the second characteristic parameter of the pixel and the first characteristic parameter of the pixel may be the same or different, and the present application does not limit this.

[0056] If the number of the second characteristic parameters of the pixel is one, the preset arrangement rule may include: arranging along the horizontal direction and / or the vertical direction in ascending order of the second characteristic parameter value; or arranging along the horizontal direction and / or the vertical direction in descending order of the second characteristic parameter value.

[0057] Exemplarily, referring to Figure 2 , the original image is the original image of a target area in the image to be processed. In other words, the original image is the image shown in the target area of the image to be processed, and it is the image before the pixels are rearranged. In Figure 2 , 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 in ascending order of brightness along the horizontal direction. Based on this arrangement rule, the pixels in the target area are rearranged, and the result is as shown in the first image in Figure 2 .

[0058] Furthermore, based on the second characteristic parameter of the pixels in the target area and the preset arrangement rule, 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 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 of the image to be processed according to the preset arrangement rule; adjusting the positions of the pixels in the target area based on the serial numbers of the pixels in the target area in the target queue to obtain the first image.

[0059] Exemplarily, the second characteristic parameter of the pixel is the brightness of the pixel, and the preset arrangement rule is to arrange in ascending order of brightness along the horizontal direction. Taking the rearrangement of the first row of pixels in the original image in Figure 2 as an example for illustration. Referring to Figure 3 , first, compare the brightness of each pixel in the first row of the original image, and combine the preset arrangement rule to determine the serial numbers of each pixel in the target queue. The target queue is a queue formed by arranging the pixels in the first row of the original image in ascending order of brightness. Then, according to the serial numbers of each pixel in the first row of pixels in the original image, adjust the positions of each pixel to obtain the first row of pixels in the first image.

[0060] In addition, the above pixel arrangement method determines the serial number of the pixels in the target area in the target queue by setting the second characteristic parameter of the pixels in the target area and the preset arrangement rule; based on the serial number of the pixels in the target area in the target queue, adjusts the positions of the pixels in the target area to obtain the first image. The rearrangement of the pixels can be achieved only through two renderings (one is to determine the serial number and the other is to adjust the positions of the pixels), which can effectively improve the rendering efficiency and is easy to implement and maintain.

[0061] It should also be noted that the present application does not limit the number of target areas determined in the same image to be processed. When the number of target areas determined in the same image to be processed is multiple, when executing S130, the pixels in the target areas in the image to be processed can be rearranged. That is, the pixels in different target areas are not mixed.

[0062] S140. Synthesize the first image and the image to be processed to obtain the processed image.

[0063] There are various implementation methods for this step, and the present application does not limit this. Optionally, the implementation method of this step includes: using the first image to replace the image in the target area of the image to be processed to obtain the processed image. The essence of such a setting is to remove the content originally displayed in the target area of the image to be processed. After removal, a vacancy is formed in the target area of the image to be processed, and the first image is used to fill this vacancy.

[0064] Alternatively, superimpose the first image on the target area of the image to be processed to obtain the processed image. "Superimposing the first image on the target area of the image to be processed" means covering the first image on the target area of the image to be processed, and the first image will block the content originally displayed in the target area of the image to be processed.

[0065] The above technical solution obtains the image to be processed; determines the target area in the image to be processed; rearranges the pixels in the target area in the image to be processed according to the preset arrangement rule to obtain the first image; synthesizes the first image and the image to be processed to obtain the processed image to be processed. Its essence is to provide a brand-new special effect to meet the user's demand for adding diverse and personalized special effects.

[0066] On the basis of the above technical solution, optionally, when the image to be processed is an image frame in the target video, the area and / or size of the target area corresponding to the image to be processed change frame by frame in the following ways: increasing frame by frame, decreasing frame by frame, first increasing and then decreasing frame by frame, or first decreasing and then increasing frame by frame.

[0067] It should be emphasized here that if the image to be processed includes multiple target regions, the area and / or size of the same target region in different images to be processed change frame by frame in the following ways: 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.

[0068] The following combines Figure 4 , taking the example where the area and / or size of the target region corresponding to each image frame in the target video decrease frame by frame. In Figure 4 , the area occupied by the small squares filled with dots is within the target region. The area occupied by the unfilled small squares is outside the target region. Assume that the pixel row A in Figure 4 is included at the same position in the nth to (n + 6)th image frames of the target video. When processing the nth image frame, the target region of the nth image frame is determined to be the entire row of pixel row A. When executing S130, all the pixels in pixel row A are rearranged. When processing the (n + 1)th image frame, the target region of the (n + 1)th image frame is determined to be the region occupied by the 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 region of the (n + 2)th image frame is determined to be the region occupied by the pixels numbered 3 - 11 in pixel row A, and the pixels numbered 3 - 11 in pixel row A are rearranged. And so on.

[0069] When playing this target video, continue to refer to Figure 4 , if no target special effect is added, among the nth to (n + 6)th image frames, the pixels with a brightness of 1 should be at the position numbered 7. However, due to the addition of the target special effect, in the processed nth image frame, the pixels with a brightness of 1 are at the position numbered 1; in the processed (n + 1)th image frame, the pixels with a brightness of 1 are at the position numbered 2;... When playing the target video and continuously viewing the processed nth to (n + 6)th image frames, the pixels with a brightness of 1 gradually move from the position numbered 1 to the position numbered 7, presenting a visual effect that the pixels with a brightness of 1 are gradually "returning to their positions".

[0070] Considering the movement of all the pixels in the target region, in the target video, decreasing the area and / or size of the target region corresponding to each image frame frame by frame will make the pixels present a visual effect of changing from a chaotic state to an information transfer state, just like the pixels are gradually "returning to their positions". On the contrary, in the target video, increasing the area and / or size of the target region corresponding to each image frame frame by frame will make the pixels present a visual effect of changing from an information transfer state to a chaotic state, just like the pixels are gradually "going out of position".

[0071] Among them, the information transfer state refers to the state of pixels in the image frame before pixel rearrangement. In this state, the content to be displayed in the image frame of the target video can be effectively conveyed.

[0072] The chaotic state refers to the state of pixels in the processed image frame after pixel rearrangement. In this state, the content to be displayed in the image frame of the target video cannot be effectively conveyed.

[0073] Similarly, in the target video, if the area and / or size of the target region corresponding to each image frame first increase and then decrease frame by frame, it will cause the pixels to present a visual effect of changing from the information transfer state to the chaotic state and then back to the information transfer state, just like the pixels gradually "offside" first and then gradually "return to their positions".

[0074] In the target video, if the area and / or size of the target region corresponding to each image frame first decrease and then increase frame by frame, it will cause the pixels to present a visual effect of changing from the chaotic state to the information transfer state and then back to the chaotic state, just like the pixels gradually "return to their positions" first and then gradually "offside".

[0075] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in the present 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.

[0076] For example, when responding to receiving an active request from the user, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application program, server, or storage medium that executes the operation of the technical solution of the present disclosure according to the prompt message.

[0077] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving an active request from the user can be, for example, in the form of a pop-up window. The prompt message can be presented in text in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0078] It can be understood that the above process of notifying and obtaining the user's authorization is only illustrative and does not limit the implementation manner of the present disclosure. Other manners that meet relevant laws and regulations can also be applied to the implementation manner of the present disclosure.

[0079] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0080] Figure 5 FIG. is a schematic structural diagram of an image processing apparatus in an embodiment of the present disclosure. The image processing apparatus provided in the embodiment of the present disclosure can be configured in a client or can be configured in a server. Refer to Figure 5 , the image processing apparatus specifically includes:

[0081] An acquisition module 310, configured to acquire an image to be processed;

[0082] A determination module 320, configured to determine a target area in the image to be processed;

[0083] An arrangement module 330, configured to rearrange pixels in the target area of the image to be processed according to a preset arrangement rule to obtain a first image;

[0084] A synthesis module 340, configured to synthesize the first image and the image to be processed to obtain a processed image.

[0085] Further, the determination module 320 is configured to:

[0086] Determine a target area in the image to be processed based on a preset target area determination rule.

[0087] Further, the determination module 320 is configured to:

[0088] Determine a first feature parameter of pixels in the image to be processed;

[0089] Determine a target area based on the first feature parameter of the pixels and a preset threshold range.

[0090] Further, the arrangement module 330 is configured to:

[0091] Determine a second feature parameter of pixels in the target area;

[0092] Adjust the positions of the pixels in the target area based on the second feature parameter of the pixels in the target area and the preset arrangement rule to obtain a first image.

[0093] Further, the arrangement module 330 is configured to:

[0094] Determine the serial number of the pixels in the target area in the target queue based on the second feature 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 to-be-processed image according to the preset arrangement rule;

[0095] Adjust the positions of the pixels in the target area based on the serial numbers of the pixels in the target area in the target queue to obtain a first image.

[0096] Further, the second feature parameter of the pixel includes at least one of the following:

[0097] The brightness, red color value, green color value, blue color value, hue, saturation, and 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.

[0098] Further, the preset arrangement rule includes:

[0099] Arrange along the horizontal and / or vertical directions in ascending order of the second feature parameter value; or,

[0100] Arrange along the horizontal and / or vertical directions in descending order of the second feature parameter value.

[0101] Further, when the to-be-processed image is an image frame in a target video, the area and / or size of the target area corresponding to the image frame change frame by frame in the following manner:

[0102] Increment frame by frame, decrement frame by frame, increase first and then decrease frame by frame, or decrease first and then increase frame by frame.

[0103] Further, the synthesis module 340 is used for:

[0104] Replace the image in the target area of the to-be-processed image with the first image to obtain a processed image; or,

[0105] Overlay the first image on the target area of the to-be-processed image to obtain a processed image.

[0106] The image processing device provided by the embodiments of the present disclosure can execute the steps performed by the client or the server in the image processing method provided by the method embodiments of the present disclosure, and has the execution steps and beneficial effects, which will not be elaborated here.

[0107] Figure 6 It is a schematic structural diagram of an electronic device in the embodiments of the present disclosure. Specifically refer to the following Figure 6, which shows a schematic structural diagram suitable for implementing the electronic device 1000 in the embodiments of the present disclosure. The electronic device 1000 in the embodiments 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, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc. Figure 6 The electronic device shown is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.

[0108] As Figure 6 shown, the electronic device 1000 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 1001, which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage device 1008 into the random access memory (RAM) 1003 to implement the image processing method of the embodiments as described in the present disclosure. In the RAM 1003, various programs and information required for the operation of the electronic device 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. The input / output (I / O) interface 1005 is also connected to the bus 1004.

[0109] Generally, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touch pad, 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 wiredly to exchange information. Although Figure 6 the electronic device 1000 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. More or fewer devices may be alternatively implemented or had.

[0110] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a non-transitory computer-readable medium. The computer program includes program code for performing the method shown in the flowchart, thereby implementing the image processing method as described above. In such an embodiment, the computer program can be downloaded and installed from a network via 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 functions defined in the method of the embodiment of the present disclosure are performed.

[0111] It should be noted that the computer-readable medium described above in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection having 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 can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include an information signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated information signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit 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 can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0112] In some embodiments, the client and the server can communicate using any known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital information in any form or medium (e.g., a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any known or future-developed networks.

[0113] The above computer-readable medium can be included in the above electronic device; or it can exist separately without being assembled into the electronic device.

[0114] The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the electronic device, the electronic device is caused to:

[0115] Obtain an image to be processed;

[0116] Determine a target area in the image to be processed;

[0117] Rearrange the pixels in the target area of the image to be processed according to a preset arrangement rule to obtain a first image;

[0118] Synthesize the first image and the image to be processed to obtain a processed image.

[0119] Optionally, when the above one or more programs are executed by the electronic device, the electronic device can also perform the other steps described in the above embodiments.

[0120] Computer program code for performing the operations of the present disclosure can be written in one or more programming languages or combinations thereof. The above programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can 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 can be connected to an external computer (e.g., by using an Internet service provider to connect through the Internet).

[0121] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or by a combination of dedicated hardware and computer instructions.

[0122] The units described in the embodiments of the present disclosure can be implemented in software or in hardware. In some cases, the name of the unit does not constitute a limitation on the unit itself.

[0123] The functions described above herein can be performed, at least in part, by one or more hardware logic components. By way of example, and without limitation, the 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 a chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0124] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. 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 portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0125] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, including:

[0126] One or more processors;

[0127] A memory for storing one or more programs;

[0128] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the image processing methods provided by the present disclosure.

[0129] 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, and when the program is executed by a processor, it implements any of the image processing methods provided by the present disclosure.

[0130] The embodiments of the present disclosure further provide a computer program product, which includes a computer program or instruction, and when the computer program or instruction is executed by a processor, it implements the image processing method as described above.

[0131] It should be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0132] The above are only specific embodiments of the present disclosure, enabling those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments described herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.

Claims

1. An image processing method, characterized in that, including: 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; Combine the first image with the image to be processed to obtain a processed image.

2. The method according to claim 1, characterized in that, The determining a target area in the image to be processed includes: Determine a target area in the image to be processed based on a preset target area determination rule.

3. The method according to claim 2, characterized in that, The determining a target area in the image to be processed based on a preset target area determination rule includes: Determine a first feature parameter of the pixels in the image to be processed; Determine a target area based on the first feature parameter of the pixels and a preset threshold range.

4. The method according to claim 1, wherein Rearranging the pixels in the target area in the image to be processed according to a preset arrangement rule to obtain a first image includes: Determine a second feature parameter of the pixels in the target area; Adjust the positions of the pixels in the target area based on the second feature parameter of the pixels in the target area and the preset arrangement rule to obtain a first image.

5. The method according to claim 4, characterized in that, The adjusting the positions of the pixels in the target area based on the second feature parameter of the pixels in the target area and the preset arrangement rule to obtain a first image includes: Determine the serial numbers of the pixels in the target area in a target queue based on the second feature 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; Adjust the positions of the pixels in the target area based on the serial numbers of the pixels in the target area in the target queue to obtain a first image.

6. The method according to claim 4, wherein The second feature parameter of the pixels includes at least one of the following: The brightness, red color value, green color value, blue color value, hue, saturation, contrast of the pixels, and the average value, maximum value, and minimum value of the brightness of the unit pixel area where the pixels are located.

7. The method according to claim 1, 4 or 5, characterized in that, The preset arrangement rule includes: Arrange along the horizontal and / or vertical directions in ascending order of the second feature parameter value; or, Arrange along the horizontal and / or vertical directions in descending order of the second feature parameter value.

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 area corresponding to the image frame change frame by frame in the following manner: Increase frame by frame, decrease frame by frame, first increase and then decrease frame by frame, or first decrease and then increase frame by frame.

9. The method according to claim 1, characterized in that The combining the first image with the image to be processed to obtain a processed image includes: Replace the image in the target area in the image to be processed with the first image to obtain a processed image; or, Overlay the first image on the target area in the image to be processed to obtain a processed image.

10. An image processing apparatus, characterized in that, including: An obtaining module, configured to obtain an image to be processed; A determining module, configured to determine a target area in the image to be processed; An arranging module, configured to rearrange 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, configured to synthesize the first image and the image to be processed to obtain a processed image.

11. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device, configured to store 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-9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, the method according to any one of claims 1-9 is implemented.

Citation Information

Cited By

  • Image generation method, image processing method, apparatus, medium, and program product

    CN120783704A