This application claims the priority benefit of Taiwanese application no. 110123209, filed on Jun. 24, 2021. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification.
The disclosure relates to an image modification technology. In particular, the disclosure relates to an image modification method and an image modification device.
With the advancement of technology and changes in living habits of people, distance teaching, online conferences, and other life modes of achieving contact between people through remote video connection are increasingly popularized. However, during remote video, a user may dress casually at home, be naked, or fail to notice that the camera lens is turned on, resulting in an indecent image including a naked body image of the user may be directly broadcasted by the remote video, thus causing troubles in use.
The disclosure provides an image modification method and an image modification device, in which accidental broadcasting of an indecent image can be effectively reduced.
An embodiment of the disclosure provides an image modification method, which includes the following. A first image is obtained. A first image region in the first image and a second image region within the first image region are detected by at least one image detector. The second image region includes an image region presenting a target color in the first image region. The first image region is covered with a replacement image and a second image is generated based on an area ratio of the second image region to the first image region being greater than a predetermined value.
An embodiment of the disclosure also provides an image modification device, which includes a storage circuit and a processor. The storage circuit is configured to store a first image and a second image and includes at least one image detector. The processor is coupled to the storage circuit and configured to execute the at least one image detector to detect a first image region in the first image and a second image region within the first image region. The second image region includes an image region presenting a target color in the first image region. The processor is also configured to cover the first image region with a replacement image and generate the second image based on an area ratio of the second image region to the first image region being greater than a predetermined value.
Based on the foregoing, after the first image is obtained, the first image region in the first image and the second image region having the target color may be detected by the at least one image detector. Next, it may be determined whether the region having the target color in the first image is too large according to the area ratio of the second image region to the first image region. If the region is too large, the image is determined to be an indecent image, and the first image region is covered with the replacement image to generate the second image. Accordingly, accidental broadcasting of an indecent image can be effectively reduced.
To make the aforementioned more comprehensible, several embodiments accompanied with drawings are described in detail as follows.
The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification. The drawings illustrate exemplary embodiments of the disclosure and, together with the description, serve to explain the principles of the disclosure.
The image modification device 10 includes a processor 11, a storage circuit 12, and an input/output interface 13. The processor 11 is configured to be responsible for the whole or partial operation of the image modification device 10. For example, the processor 11 may include a central processing unit (CPU) or other programmable general-purpose or special-purpose microprocessors, digital signal processors (DSP), programmable controllers, application specific integrated circuits (ASIC), programmable logic devices (PLD), or other similar devices or a combination of these devices.
The storage circuit 12 is coupled to the processor 11 and configured to store data. For example, the storage circuit 12 may include a volatile storage circuit and a non-volatile storage circuit. The volatile storage circuit is configured for volatile storage of data. For example, the volatile storage circuit may include random access memory (RAM) or similar volatile storage media. The non-volatile storage circuit is configured for non-volatile storage of data. For example, the non-volatile storage circuits may include read only memory (ROM), a solid state disk (SSD), and/or a conventional hard disk drive (HDD), or similar non-volatile storage media.
The input/output interface 13 is coupled to the processor 11 and configured to perform signal input and output. For example, the input/output interface 13 may include various input/output devices, such as a network interface card, a display device, a mouse, a keyboard, a touch panel, a touch screen, a loudspeaker, a microphone, and/or a camera module. The type of the input/output device are not limited by the disclosure.
In an embodiment, the processor 11 may obtain an image (also referred to as a first image) 101 and stores the image 101 in the storage circuit 12. In an embodiment, the image 101 may be obtained from shooting an external image by a camera module (including a lens and a photosensitive element) in the input/output interface 13. Alternatively, in an embodiment, the image 101 may also be obtained by downloading from other electronic devices or servers.
In an embodiment, the processor 11 may execute an image detector 121 in the storage circuit 12 to analyze the image 101. For example, the image detector 121 may include a deep learning model and/or a neural network model. The deep learning model and/or the neural network model may be trained to improve detection efficiency (e.g., detection accuracy) for a specific object. In an embodiment, the processor 11 may detect at least one image region (also referred to as a first image region) in the image 101 and a specific image region (also referred to as a second image region) within the first image region by the image detector 121.
To be specific, the processor 11 may execute the image detector 121 to detect a specific object (i.e., the first image region and the second image region) in the image 101. The image detector 121 may feed the detection result for the specific object back to the processor 11.
In an embodiment, the processor 11 may execute a modification module 122 in the storage circuit 12 to perform image modification on the image 101. In an embodiment, the processor 11 may cover the first image region with a replacement image and generate the image 102 by the modification module 122 based on an area ratio of the second image region to the first image region detected by the image detector 121. Accordingly, in an image 102, at least part of the image in the first image region may be masked (i.e., covered) by the replacement image. The image 102 may be stored in the storage circuit 12 and be output by the input/output interface 13 (e.g., a display and/or a network interface card).
In an embodiment, the first image region includes an image region presenting a specific human body part (also referred to as a target human body part) in the image 101. In an embodiment, the target human body part may include the part generally considered to be the location of sexual organs of a human body or surroundings of the part. For example, the target human body part may include at least one of a breast, a crotch, and a hip of the human body. In other embodiments, the target human body part may also include any part of a human body that may discomfort or displease viewers when not being hidden by clothing, such as a thigh or a calf of a human body, which is not limited by the disclosure.
In an embodiment, the second image region includes at least part of an image region presenting a specific color (also referred to as a target color) in the first image region. For example, the target color may include a skin color of the human body presented in the image 101. As a race of the user, a skin condition of the user, and/or an ambient light differ, the target color may also change accordingly. In an embodiment, the processor 11 may determine the target color according to a color (i.e., the skin color) of a human face in the image 101.
After the image 101 is input to the image detector 121a, the image detector 121a may analyze the 101 image to detect the first image region in the image 101, for example, detect the image region presenting the target human body part in the image 101. In an embodiment, the image detector 121a may frame the image region presenting the target human body part in the image 101. The image region framed by the image detector 121a is namely the first image region.
In addition, after the image 101 is input to the image detector 121b, the image detector 121b may analyze the image 101 to detect the second image region within the first image region in the image 101, for example, detect the image region presenting the target color in the image 101.
It should be noted that, in another embodiment, the input of the image detector 121b may also be connected in series to the output of the image detector 121a. Accordingly, after the image detector 121a detects the first image region in the image 101, the image detector 121b may further detect the second image region in the first image region based on the first image region detected by the image detector 121a.
In an embodiment, the image detector 121a and the image detector 121b each include a deep learning model and/or a neural network model. To be specific, the image detector 121a may be trained by a great number of first sample images to enable the trained image detector 121a to detect the first image region in the image 101. Each of the first sample images includes the first image region that has been labeled as the target human body part. The image detector 121b may be trained by a great number of second sample images to enable the trained image detector 121b to detect the second image region in the image 101. Each of the second sample images includes the second image region that has been labeled as the target color.
After the first image region and the second image region are detected, the processor 11 may execute the modification module 122 of the storage circuit 12 to analyze the area ratio of the second image region to the first image region. Based on the area ratio, the processor 11 may cover the first image region with a replacement image to modify the image 101 and generate the image 102.
In an embodiment, the modification module 122 may determine whether to modify the image 101 (e.g., cover the first image region with the replacement image) according to whether the area ratio of the second image region to the first image region is greater than a predetermined value. In an embodiment, the modification module 122 may obtain the area of the first image region according to the output of the image detector 121a and obtain the area of the second image region according to the output of the image detector 121b. The modification module 122 may determine whether the proportion of the area of the second image region in the area of the first image region is greater than a predetermined value. The predetermined value may be a positive value not greater than 1, such as 20% to 100%. If the proportion of the area of the second image region in the area of the first image region is greater than the predetermined value, that is, the skin color occupies a great area in the first image region and there may be an indecent image, the modification module 122 may therefore modify the image 101 (i.e., cover the first image region with the replacement image) to replace the possibly existing indecent image. However, if the proportion of the area of the second image region in the area of the first image region is not greater than the predetermined value, the modification module 122 may not modify the image 101.
With reference back to
In an embodiment, according to the color of the human face (i.e., the skin color) in the image 101 detected by the human face detector 123, the processor 11 may select at least one image detection model (also referred to as a target model) from a plurality of candidate models for use by the image detector 121a and/or the image detector 121b. Accordingly, in response to differences in the race of the user, the skin condition of the user, and/or the ambient light, the image detector 121a and/or the image detector 121b may dynamically adopt an appropriate image detection model to improve detection efficiency for the first image region and/or the second image region.
In an embodiment, the image 102 generated by modifying the image 101 may include a local image and a remote image. The local image may be presented by the display of the input/output interface 13. The remote image may be transmitted to a remote device by using the network interface card of the input/output interface 13. In an embodiment, the processor 11 may present a warning message as the replacement image in the local image to warn or remind the user that there is an indecent image in the original image 101 and part of the image has been masked or covered. The processor 11 may present replacement clothes as the replacement image in the remote image. The image of the replacement clothes may be configured to mask part of the image in the original image 101, namely part of the image in the first image region.
In step S906, it is determined whether a proportion of the area of the second image region in the area of the first image region is greater than a predetermined value. If it is determined to be Yes, in step S907, the first image region is covered with a replacement image and a second image is generated. Accordingly, in the second image, at least part of the image in the first image region may be masked (i.e., covered) with the replacement image. In addition, if it is determined to be NO in step S906, the flow may return to step S901.
Each step in
In summary of the foregoing, according to the exemplary embodiments of the disclosure, an indecent image in a (video) image may be dynamically detected. If there is an indecent image, the indecent image may be instantly masked with a replacement image. Accordingly, accidental broadcasting of an indecent image can be effectively reduced.
It will be apparent to those skilled in the art that various modifications and variations can be made to the disclosed embodiments without departing from the scope or spirit of the disclosure. In view of the foregoing, it is intended that the disclosure covers modifications and variations provided that they fall within the scope of the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
110123209 | Jun 2021 | TW | national |