Image detection method and device
By caching and storing images and scene perception information in electronic devices, it solves the problem of difficulty in reproducing abnormal images captured by electronic devices, achieving accurate positioning and optimizing the efficiency of photography software.
Patent Information
- Application Number
- CN202311826441.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-12-28
AI Technical Summary
Electronic equipment may experience abnormalities when capturing images, but due to the loss and difficulty of reproducing cached data, the cause of the abnormalities is difficult to locate.
By caching the images collected by the camera, the metadata information of the images, and the scene perception information, and storing them locally when an error occurs in the image processing process, the scene can be reproduced to locate anomalies.
It effectively locates and solves the causes of image anomalies, improves processing efficiency, and supports users to upload data through the server for big data analysis to optimize the camera software.
Smart Images

Figure CN117474926B
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to an image detection method and device. Background Art
[0002] With the development of electronic devices, some electronic devices include cameras, and electronic devices can support functions such as taking pictures. When obtaining a photographed image, current electronic devices will perform some algorithm processing, such as loading some effect parameters.
[0003] However, in some electronic devices, images captured may be abnormal, but the causes of these abnormalities cannot be determined. Summary of the invention
[0004] The embodiments of the present application provide an image detection method and device for providing information for locating abnormal problems in images.
[0005] In the first aspect, an embodiment of the present application proposes an image detection method. The method includes: in response to a photo operation, caching first information, the first information including an image captured by a camera, metadata information of the image, and scene perception information when the image was taken; wherein the image and metadata information are used to simulate the original image when the image was taken, and the scene perception information is used to simulate the environment when the image was taken; when an error occurs in the process of processing the image, the first information is stored locally in the first electronic device. In this way, the scene reproduction of the above-mentioned photo operation of the first electronic device can be achieved based on the first information stored locally in the first electronic device, and the abnormality in the photo operation can be located in the scene reproduction.
[0006] In a possible implementation, the scene perception information includes one or more of the following: decision information for deciding the algorithm mode used for taking pictures, information collected by sensors for anti-shake processing, information collected by sensors for brightness perception, information collected by sensors for temperature perception, or information collected by sensors for distance perception. It can be understood that this information is information that may affect the image quality in the shooting scene, and saving this information is conducive to restoring the scene of abnormal images.
[0007] In one possible implementation, the first information includes decision information for deciding the algorithm mode used for taking pictures. It is understandable that these decision information may affect the image quality information, and saving this information is conducive to restoring the scene of abnormal images. In one possible implementation, the process of processing images includes one or more of the following: decompression process, noise reduction process, clarity enhancement process, highlight suppression process, face area processing process, blur process, de-mosaic process, bad pixel removal process, white balance processing process, automatic exposure AC control process, automatic focus AF control process, sharpening process, color correction process, color enhancement process or image compression process. It is understandable that these processing processes are processes that are prone to errors in image processing. Therefore, detecting whether the images output by these processes are abnormal is conducive to accurately obtaining the cause of the image abnormality in the subsequent process.
[0008] In a possible implementation, before the first information is stored locally in the first electronic device, the method further includes: after the first process is executed, performing an abnormality detection on the processed image obtained after the first process is executed; wherein, if an abnormality is detected in the processed image, it indicates that the first process is wrong, and the first process is any process in the process of processing the image. This is conducive to the subsequent determination of the cause of the image abnormality.
[0009] In a possible implementation, the first process includes one or more of the following: a noise reduction process, a definition enhancement algorithm process, a highlight suppression process, or a face area processing process. It is understandable that these processing processes are processes with a high frequency of errors in practice, and setting an image quality assessment IQA module for these processing processes can more accurately determine abnormal images through a small amount of detection.
[0010] In a possible implementation, a dump switch is provided in the first electronic device, and when the dump switch is in an on state, the first electronic device allows the data in the cache to be stored locally in the first electronic device, and when the dump switch is in an off state, the first electronic device does not allow the data in the cache to be stored locally in the first electronic device; storing the first information locally in the first electronic device includes: storing the first information locally in the first electronic device when the dump switch is in an on state. In this way, the user can control the dump switch, and when the dump switch is in an on state, the data in the cache of the first electronic device is stored locally, and correspondingly, when the dump switch is in an off state, the data in the cache of the first electronic device may not be stored locally, so that user needs can be adapted and user privacy can be better protected.
[0011] In one possible implementation, after the first information is stored locally on the first electronic device, it also includes: obtaining a photographed image; upon receiving an operation for uploading the photographed image to the server, uploading both the first information and the photographed image to the server. In this way, the device used for scene reproduction can download the first information and photographed image of the first electronic device through the server. When the user of the first electronic device wants to solve the problem of abnormal image, the user can use the first electronic device to operate online without establishing a communication connection between the first electronic device and the scene reproduction device. Furthermore, the server can also collect abnormal images and related information of multiple users to perform big data analysis, which is conducive to the optimization of the camera software.
[0012] In one possible implementation, after the first information is stored locally in the first electronic device, the method further includes: using the first information to simulate a photographing process to obtain processing results of each photographing process; wherein, in the simulated photographing process, the photographing strategy is determined based on the scene perception information in the first information, and the image captured by the camera is replaced with the original image obtained based on the image, scene perception information and metadata information in the first information. It is understandable that the second electronic device can use the first information to determine the photographing strategy required to reproduce the abnormal image, and restore the scene information when the abnormal image was taken. In this way, the cause of the image abnormality can be determined more accurately.
[0013] In a possible implementation, the first electronic device or the second electronic device performs the simulation of the photographing process using the first information. It is understandable that the first electronic device may be an electronic device that takes an abnormal image, and the photographing process may be simulated using the first electronic device. In the case where the first electronic device cannot simulate the photographing process, the second electronic device may also be used to simulate the photographing process. In this way, the first electronic device or the second electronic device may be flexibly used to simulate the photographing process according to the actual availability of the first electronic device or the second electronic device.
[0014] In one possible implementation, the process of simulating the photographing process using the first information is performed by the second electronic device. Before simulating the photographing process using the first information, it includes: converting the first information into a form that can be matched by the version of the second electronic device; importing the converted first information into the second electronic device. It can be understood that the first information is obtained by the first electronic device, and the process of simulating the photographing process using the first information is performed by the second electronic device. The first electronic device and the second electronic device may be electronic devices of different models, so it is necessary to convert the first information into a form that can be matched by the version of the second electronic device. In this way, the second electronic device can use the converted first information to simulate the photographing process and reproduce the image abnormality.
[0015] In a possible implementation, after simulating the photographing process using the first information and obtaining the processing results of each photographing process, the method further includes: modifying the process of simulating the photographing process using the first information; re-simulating the photographing using the first information and the modified simulated photographing process until the result of the simulated photographing is not abnormal. It is understandable that the second electronic device can simulate the photographing process using the first information to locate the cause of the abnormality of the image, and on this basis, the second electronic device can modify the abnormal image to obtain a normal image. In this way, the efficiency of processing image abnormalities is improved.
[0016] In a second aspect, an embodiment of the present application provides an image detection device, which may be an electronic device, or a chip or chip system in an electronic device. The image detection device may include a display unit and a processing unit. When the image detection device is an electronic device, the display unit may be a display screen. The display unit is used to perform the display step so that the electronic device implements an image detection method described in the first aspect or any possible implementation of the first aspect. When the image detection device is an electronic device, the processing unit may be a processor. The image detection device may also include a storage unit, which may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit so that the electronic device implements an image detection method described in the first aspect or any possible implementation of the first aspect. When the image detection device is a chip or chip system in an electronic device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit so that the electronic device implements an image detection method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit within the chip (eg, a register, a cache, etc.), or a storage unit within the electronic device that is located outside the chip (eg, a read-only memory, a random access memory, etc.).
[0017] Exemplarily, a processing unit is used to cache first information in response to a photo-taking operation, where the first information includes an image captured by a camera, metadata information of the image, and scene perception information when the image is taken; wherein the image and metadata information are used to simulate the original image when the image is taken, and the scene perception information is used to simulate the environment when the image is taken; when an error occurs in the process of processing the image, the first information is stored locally on the first electronic device.
[0018] In one possible implementation, the scene perception information includes one or more of the following: decision information for deciding the algorithm mode to use for taking pictures, information collected by sensors for anti-shake processing, information collected by sensors for brightness perception, information collected by sensors for temperature perception, or information collected by sensors for distance perception.
[0019] In a possible implementation, the first information includes decision information for deciding an algorithm mode to use for taking photos.
[0020] In one possible implementation, the image processing process includes one or more of the following: a decompression process, a noise reduction process, a clarity enhancement process, a highlight suppression process, a face area processing process, a blurring process, a de-mosaicing process, a bad pixel removal processing process, a white balance processing process, an automatic exposure AC control process, an automatic focus AF control process, a sharpening processing process, a color correction process, a color enhancement process or an image compression process.
[0021] In a possible implementation, before the first information is stored locally in the first electronic device, it also includes: a processing unit, which is used to perform anomaly detection on a processed image obtained after executing the first process after executing the first process; wherein, when an abnormality is detected in the processed image, it indicates that an error occurs in the first process, and the first process is any process in the process of processing the image.
[0022] In a possible implementation, the first process includes one or more of the following: a noise reduction process, a clarity enhancement algorithm process, a highlight suppression process, or a face area processing process.
[0023] In a possible implementation, a dump switch is provided in the first electronic device. When the dump switch is in an on state, the first electronic device allows data in a cache to be stored locally on the first electronic device. When the dump switch is in an off state, the first electronic device does not allow data in the cache to be stored locally on the first electronic device. Storing the first information locally on the first electronic device includes: a processing unit, which, when the dump switch is in an on state, is used to store the first information locally on the first electronic device.
[0024] In a possible implementation, after the first information is stored locally on the first electronic device, it further includes: a processing unit, configured to obtain a photographed image; and configured to upload both the first information and the photographed image to the server upon receiving an operation for uploading the photographed image to the server.
[0025] In one possible implementation, after the first information is stored locally on the first electronic device, the method also includes: a processing unit, used to use the first information to simulate a photo-taking process to obtain processing results of each photo-taking process; wherein, in the simulated photo-taking process, the photo-taking strategy is determined based on the scene perception information in the first information, and the image captured by the camera is replaced with an original image obtained based on the image in the first information, the scene perception information and the metadata information.
[0026] In a possible implementation, the process of simulating a photographing process using the first information is executed by the first electronic device or the second electronic device.
[0027] In one possible implementation, the process of simulating the photographing process using the first information is executed by the second electronic device. Before the process of simulating the photographing process using the first information, it includes: a processing unit, which is used to convert the first information into a form that can be matched by the version of the second electronic device; and is used to import the converted first information into the second electronic device.
[0028] In one possible implementation, after the photo-taking process is simulated using the first information and the processing results of each photo-taking process are obtained, the method also includes: a processing unit, used to modify the process of simulating the photo-taking process using the first information; and used to use the first information and the modified simulated photo-taking process to re-simulate the photo-taking until the result of the simulated photo-taking is not abnormal.
[0029] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, the memory being used to store code instructions, and the processor being used to run the code instructions to execute the method described in the first aspect or any possible implementation of the first aspect.
[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instructions are stored. When the computer program or instructions are run on a computer, the computer executes the method described in the first aspect or any possible implementation of the first aspect.
[0031] In a fifth aspect, an embodiment of the present application provides a computer program product including a computer program. When the computer program runs on a computer, the computer executes the method described in the first aspect or any possible implementation manner of the first aspect.
[0032] In a sixth aspect, the present application provides a chip or a chip system, the chip or chip system comprising at least one processor and a communication interface, the communication interface and the at least one processor are interconnected by a line, and the at least one processor is used to run a computer program or instruction to execute the method described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip can be an input / output interface, a pin or a circuit, etc.
[0033] In a possible implementation, the chip or chip system described above in the present application further includes at least one memory, in which instructions are stored. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (such as a read-only memory, a random access memory, etc.).
[0034] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0036] Figure 2 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0037] Figure 3 A schematic flow chart of an image capture data storage process provided in an embodiment of the present application;
[0038] Figure 4 A schematic flow chart of an abnormal image reproduction process provided in an embodiment of the present application;
[0039] Figure 5 A schematic flow chart of an image detection method provided in an embodiment of the present application;
[0040] Figure 6 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0042] 1. RAW images
[0043] It can be understood as the unprocessed image captured by the camera device, and the RAW image can also be understood as the original image.
[0044] 2. YUV image
[0045] It can be understood as an image processed by a color encoding method, where Y represents luminance, that is, the grayscale value, U represents chrominance, which is used to describe the image color, and V represents chroma, which is used to describe the image saturation.
[0046] 3. Image signal processor (ISP)
[0047] ISP can be used to process images, where image processing may include image rasterization, black level compensation, lens correction, bad pixel correction, color difference, noise removal, automatic white balance, color correction, color control conversion, downsampling processing, image format conversion, etc. In some implementations, ISP processing of images may also be referred to as ISP image processing. For example, ISP image processing may convert a RAW image into a YUV image.
[0048] 4. Host computer
[0049] The host computer refers to a computer or single-chip microcomputer that directly sends operation instructions and provides a user operation interactive interface to display feedback data to the user, such as a computer, mobile phone or tablet.
[0050] Exemplarily, in the embodiments of the present application, the host computer can be used to replace or convert control electronic devices, etc.
[0051] 5. Other terms
[0052] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0053] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0054] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, and c can be single or multiple.
[0055] 6. Electronic equipment
[0056] The electronic device of the embodiment of the present application may include a handheld device, a vehicle-mounted device, etc. with an image detection function. For example, some electronic devices are: mobile phones, tablet computers, PDAs, laptop computers, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, terminal devices in 5G networks or future evolved public land mobile communication networks (PLANs), and wireless terminals in smart cities. The embodiments of the present application do not limit this.
[0057] As an example but not limitation, in the embodiments of the present application, the electronic device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-sized, and fully or partially independent of smartphones, such as smart watches or smart glasses, as well as devices that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets and smart jewelry for vital sign monitoring.
[0058] In addition, in the embodiments of the present application, the electronic device may also be a terminal device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network that interconnects people and machines and things.
[0059] The electronic device in the embodiments of the present application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.
[0060] In an embodiment of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0061] With the development of electronic devices, some electronic devices include cameras, and electronic devices can support functions such as taking pictures. When obtaining a photographed image, current electronic devices will perform some algorithm processing, such as loading some effect parameters.
[0062] However, some electronic devices may have image anomalies in their captured images, and such anomalies are reproducible with a low probability and are difficult to reproduce after changes in time and space, and may be extremely time-consuming. For example, a user took a picture of the sunset while riding on a high-speed train, but the image of the sunset was abnormal. When the user reported the image anomaly to the after-sales service of the electronic device, the after-sales service may not be able to reproduce the scene of taking the sunset, nor locate why the image of the sunset was abnormal, because time and space have changed.
[0063] This is because when an electronic device captures an image, it caches the original image captured by the camera, but the cached data of the electronic device may be lost. For example, the old cached data will be replaced by the new cached data; or the cache is released after the application exits, and the data in the cache is destroyed. Therefore, when the user reports an image abnormality to the after-sales service, the after-sales service may not be able to obtain the original image and other data captured by the camera, which may result in the image abnormality being unable to be reproduced.
[0064] In view of this, an embodiment of the present application provides an image detection method. After the electronic device starts taking pictures, the image captured by the camera, the metadata information of the image, and the scene perception information when the image is taken can be cached, and the image output through the image processing process can be detected. When it is detected that the image output through the image processing process is abnormal, the electronic device can store the image captured by the camera, the metadata information of the image, and the scene perception information when the image is taken locally in the electronic device. In this way, the subsequent electronic device can realize the scene reproduction of the above-mentioned photo operation of the electronic device based on the data stored locally in the electronic device, and the abnormality in the photo operation can be located in the scene reproduction.
[0065] In order to better understand the embodiments of the present application, the structure of the electronic device according to the embodiments of the present application is introduced below.
[0066] For example, Figure 1 A schematic structural diagram of an electronic device is shown.
[0067] The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0068] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented by hardware, software, or a combination of software and hardware.
[0069] In the embodiment of the present application, the electronic device can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.
[0070] The electronic device can sense the shooting environment through the temperature sensor 180J, the ambient light sensor 180L, the gyroscope sensor 180B, the acceleration sensor 180E and the distance sensor 180F.
[0071] Exemplarily, the first electronic device can perform anti-shake perception when the camera 193 shoots an image based on the gyroscope sensor 180B and the acceleration sensor 180E, can perform temperature perception when the camera 193 shoots an image based on the temperature sensor 180J, can perform ambient light perception when the camera 193 shoots an image based on the ambient light sensor 180L, and can perform distance perception when the camera 193 shoots an image based on the distance sensor 180F. The above scene perception information, metadata information, and images captured by the camera can be stored locally in the internal memory 121, so as to reproduce the scene when the image was shot later.
[0072] Figure 2 It is a software structure block diagram of the electronic device of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, the hardware abstraction layer (hardware adaptation layer, HAL), and the kernel layer.
[0073] The application layer can also be called the application layer, which can include a series of application packages. Figure 2 As shown, the application layer may include applications such as video, conference, camera, etc. Applications may include system applications and third-party applications.
[0074] The application framework layer can also be called the Framework layer. The Framework layer can provide application programming interface (API) and programming framework for the application layer applications. The Framework layer can include some predefined functions.
[0075] like Figure 2 As shown, the Framework layer may include a window manager, a resource manager, a notification manager, a content provider, a view system, and the like.
[0076] Android runtime includes core libraries and virtual machines. Android runtime is responsible for the control and management of the Android system.
[0077] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0078] The application layer and the framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and the framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0079] The system library can also be called the Native layer, which can include multiple functional modules, such as the media library, function library, and graphics processing library.
[0080] The HAL layer is an abstract structure between the kernel layer and the Android runtime. The HAL layer can be a package of the hardware driver, providing a unified interface for the call of the upper layer application. In the embodiment of the present application, the HAL layer may include an image front-end processing module TFE, an image processing engine module, a perception engine module, a decision engine module, and an image quality assessment (IQA) module.
[0081] The image front-end processing (thin front end, TFE) module, which can also be called the thin front end, can be used to receive the RAW image output by the image sensor. The TFE module can also perform processing such as downsampling and / or cropping on the RAW image, and output the RAW image to the image processing engine module.
[0082] The image processing engine module may include: an offline processing engine (OPE) module and an image processing engine (IPE) module. Among them, the IPE module is an online image processing engine. It is understandable that some electronic devices use OPE modules, and other electronic devices use IPE modules. The specific electronic device uses OPE modules or IPE modules, which is not limited in the embodiments of the present application.
[0083] The OPE module or IPE module can perform ISP image processing on the RAW image and output a YUV image. The image processing may include lens correction, noise removal, color correction and other effect processing.
[0084] The perception engine module is used to perceive scene perception information, etc.; the decision engine module is used to decide which camera to use for taking pictures, etc.; the IQA module is used to detect whether the image output through the image processing process has any abnormalities, etc.
[0085] The kernel layer is the layer between hardware and software. The kernel layer may include display driver, camera driver, audio driver, battery driver, sensor driver, etc.
[0086] In an embodiment of the present application, the electronic device can process an image at the HAL layer. For example, the electronic device can perceive the environmental information around the electronic device through the perception engine module; the decision engine module can decide which camera to use to take a picture; the RAW image can be processed by the ISP image processing in the IPE module, such as decompression, noise reduction, clarity enhancement or highlight suppression, and output YUV image; the image output through the image processing process in the IPE module can be detected in the IQA module, such as noise reduction, clarity enhancement or highlight suppression.
[0087] It should be noted that the embodiments of the present application are only illustrated using the Android system as an example. In other operating systems (such as Windows system, IOS system, etc.), as long as the functions implemented by each functional module are similar to those in the embodiments of the present application, the solutions of the present application can also be implemented.
[0088] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments.
[0089] The image detection method of the embodiment of the present application may include two stages: the first stage is the image capture data storage process; the second stage is the image abnormality reproduction process.
[0090] In the embodiment of the present application, three electronic devices may be included: a first electronic device, a second electronic device and a host computer. The first electronic device is used to implement the image shooting data storage process of the first stage; the second electronic device and the host computer are used to implement the image abnormality reproduction process of the second stage, the host computer is used to trigger the second electronic device to take pictures, and the second electronic device is used to reproduce the image abnormality.
[0091] Exemplarily, the image detection method of the embodiment of the present application is introduced by taking the example that the first electronic device, the second electronic device and the host computer are all mobile phones.
[0092] The following introduces the image capture data storage process of the first stage through a possible implementation process.
[0093] For example, Figure 3 The flowchart of the image capture data storage process of the embodiment of the present application is shown. The corresponding process of the first electronic device performing image capture data storage may specifically include the following steps:
[0094] S301, photo taking starts.
[0095] S302, scene perception.
[0096] In the embodiment of the present application, after the first electronic device starts taking photos, the camera of the first electronic device may start to collect images, and the perception engine module may perceive scene perception information in the scene in which the image is located. For example, the scene perception information may include perception of decision information for the algorithm mode used to decide the photo taking, perception of information collected by the sensor for anti-shake processing, perception of information collected by the sensor for brightness perception, or perception of information collected by the sensor for temperature perception, etc.
[0097] S303, deciding on collection strategy and processing strategy.
[0098] In an embodiment of the present application, the decision collection strategy of the first electronic device can be used to decide which camera of the first electronic device to use to capture an image based on the above-mentioned scene perception information.
[0099] Exemplarily, the camera of the first electronic device may include a main camera, a telephoto camera, or a wide-angle camera, and each camera has a different focal length. For example, the focal length of the main camera may be 23 mm, the focal length of the telephoto camera may be 12 mm, and the focal length of the wide-angle camera may be 69 mm.
[0100] In an embodiment of the present application, the processing strategy of the first electronic device can be used to decide which algorithm to use to process the image captured by the camera based on the above-mentioned scene perception information.
[0101] For example, if the perception engine of the first electronic device senses that the ambient light of the surrounding environment of the image captured by the camera is dark, a night scene algorithm can be used to process the image captured by the camera.
[0102] S304, the camera collects images.
[0103] Exemplarily, the first electronic device may decide to use a main camera to capture images based on the scene perception information, and the images captured by the main camera may be 5 RAW images.
[0104] S305: Cache the first information.
[0105] In an embodiment of the present application, the first information may include an image captured by a camera, metadata information of the image, decision information, and scene perception information when the image is captured. Among them, the metadata information of the image is information that determines the image quality, and may include exposure values and gain values, etc. The decision information is used by the first electronic device to decide the algorithm mode used for taking pictures. For example, the decision information may include information for deciding high dynamic range (HDR) mode, portrait mode, large aperture mode, or wide-angle mode, etc.
[0106] After the camera of the first electronic device captures an image, the first electronic device can cache the image captured by the camera, the metadata information of the image, and the scene perception information when the image was taken, so that the second electronic device can subsequently reproduce the image anomaly based on the cached data, thereby locating the image anomaly.
[0107] In other embodiments, the first electronic device may also write the image captured by the camera, metadata information of the image, and scene perception information when the image is taken into the photographed image in a highly compressed manner.
[0108] In the embodiment of the present application, S306 to S308 may be executed cyclically subsequently to detect whether multiple processes are abnormal one by one.
[0109] S306, process N processing.
[0110] In an embodiment of the present application, the first electronic device can process the image captured by the camera, and the process of processing the image can include multiple processes. For example, the process of processing the image can include: a decompression process, a noise reduction process, a clarity enhancement process, a highlight suppression process, a face area processing process, a blur process, a de-mosaic process, a bad pixel removal process, a white balance process, an automatic exposure (AC) control process, an auto focus (AF) control process, a sharpening process, a color correction process, a color enhancement process, or an image compression process.
[0111] Process N can be any one of the above-mentioned multiple processes. For example, process N can be a clarity enhancement process, and the first electronic device can perform clarity enhancement processing on the RAW image and output a YUV image; or, process N can be a face area processing process, and the first electronic device can perform face area processing on the RAW image and output a YUV image.
[0112] Optionally, process N can be that the first electronic device can set an IQA module for processes that have high functionality and are prone to abnormalities, such as noise reduction processes, clarity enhancement processes, highlight suppression processes, and face area processing processes; and do not set an IQA module for processes that have low functionality and are not prone to abnormalities, such as decompression processes.
[0113] S307, image quality assessment IQA module.
[0114] In the embodiment of the present application, the IQA module of the first electronic device is used to detect whether an image output through the image processing process is abnormal, etc.
[0115] In a possible implementation, the IQA module may detect whether the image processed by process N is abnormal based on an image detection algorithm.
[0116] Exemplarily, the IQA module of the first electronic device can detect image anomalies through at least one algorithm processing method. For example, histogram detection algorithm: the histogram detection algorithm can determine whether the image is abnormal by detecting whether the image brightness and color distribution are uniform; blur detection algorithm: for an image, the blur detection algorithm can determine whether the image is abnormal by factors such as image clarity, edge sharpness, and richness of details; structural similarity index (SSIM) algorithm: can be used to measure the similarity between two images. The asynchronous detection module can cache thumbnails, compare the image taken by the camera with the thumbnail, and determine whether the image is abnormal based on the size of the difference.
[0117] For example, the first electronic device can detect the image processed by the process in S306 through the histogram detection algorithm of the IQA module. For example, it can detect whether the brightness and color distribution of the YUV image output by the clarity improvement process in S306 are uniform, so as to determine whether the clarity improvement process is abnormal. For example, if the brightness and color distribution of the YUV image are uniform, it means that the clarity improvement process is not abnormal. If the brightness and color distribution of the YUV image are uneven, it means that the clarity improvement process is abnormal. The first electronic device can also detect the image processed by the process in S306 through the blur detection algorithm of the IQA module. For example, it can detect the clarity, edge sharpness and detail richness of the YUV image output by the face area processing process in S306, so as to determine whether the face area processing process is abnormal. For example, if the clarity, edge sharpness and detail richness of the YUV image are poor, it means that the face area processing process is abnormal. If the clarity, edge sharpness and detail richness of the YUV image are good, it means that the face area processing process is not abnormal.
[0118] Of course, the IQA module can also detect abnormal scenes including but not limited to flower images, black images, color cast, excessive noise, consistency, algorithm single frame, etc., which will not be elaborated here.
[0119] In another possible manner, the IQA module of the first electronic device may also subscribe to abnormal data reported by process N. If abnormal data reported by any process is obtained, the IQA module will also identify the image output by the process as an abnormal image.
[0120] It is understandable that when the IQA module of the first electronic device detects the image output through the image processing process, it may not close other processes being performed by the first electronic device, but open another thread to detect the process of the image collected by the camera. This may not affect the processing of other processes of the electronic device.
[0121] S308, whether the test result is abnormal.
[0122] In a possible manner, if any one or more of the above is abnormal, S309 is executed to store the first information of the first electronic device locally on the first electronic device.
[0123] S309, determining that the dump switch is turned on.
[0124] In the embodiment of the present application, the dump switch of the first electronic device is used to store the first information of the first electronic device locally on the first electronic device.
[0125] Exemplarily, the dump switch may include two states: on and off. When the dump switch is on, the first electronic device allows the first information to be stored locally on the first electronic device, and when the dump switch is off, the first electronic device does not allow the first information to be stored locally on the first electronic device.
[0126] The dump switch of the first electronic device is in the turned-on state by default before the photo-taking starts, or the user can turn on the dump switch in the setting application of the first electronic device before the photo-taking starts according to needs.
[0127] S310, first information is stored locally.
[0128] In the embodiment of the present application, when the IQA module detects that an image output through the image processing process is abnormal, the first electronic device may store the first information locally on the first electronic device.
[0129] S311, photo taking is completed.
[0130] S312, user-initiated demand.
[0131] S313, uploading the photographed image and the first information to the server.
[0132] In the embodiment of the present application, when the image output by the IQA module of the first electronic device after the image processing process is abnormal, the first electronic device can store the first information locally in the first electronic device and then end the photo taking.
[0133] In this case, whether the first electronic device can upload the first information and the photographed image to the server may be determined by the user's active demand. For example, the user's active demand may include the following two possible situations.
[0134] In one possible case, the first electronic device may prompt the user whether to upload the image of the abnormality detected by the first electronic device to the server. If the user confirms to upload, the first electronic device may upload the first information and the photographed image to the server.
[0135] In another possible case, the first electronic device can provide an Android application package (APK) or connection for uploading abnormal images, and the user can select an image 1 and upload it to the server through the APK or connection. This can be considered as an active user demand, and the first electronic device can upload the image 1 captured by the camera, the metadata information of the image 1, the scene perception information when the image 1 is taken, and the image 1 to the server.
[0136] S314, the first information automatically ages.
[0137] In the embodiment of the present application, after S301 to S313 are completed, the first electronic device may automatically age the cached first information. For example, when the cache is full, the earliest stored data in the cache may be automatically cleared.
[0138] The image capture data storage process in the image detection method of the embodiment of the present application can cache the image captured by the camera, the metadata information of the image, and the scene perception information when the image is captured after the first electronic device starts taking pictures, and can detect the image output through the image processing process. When it is detected that the image output through the image processing process is abnormal, the image captured by the camera, the metadata information of the image, and the scene perception information when the image is captured are stored locally in the first electronic device. After the photo is taken, the first information and the photographed image can also be uploaded to the server according to user needs. In this way, when the user subsequently reports the need to locate the image abnormality, the second electronic device used to locate the image abnormality can obtain data such as the scene perception information when the image is abnormal, and use the data to reproduce the image abnormality.
[0139] The following introduces the image anomaly reproduction process of the second stage through a possible implementation process.
[0140] For example, Figure 4 The flowchart of the abnormal image reproduction process of the embodiment of the present application is shown. The corresponding second electronic device and the host computer perform abnormal image reproduction process, which may specifically include the following steps:
[0141] S401, abnormality recurrence begins.
[0142] S402: Upload the first information to the second electronic device.
[0143] S403, the second electronic device is connected to the host computer.
[0144] S404, the host computer detects the mobile phone version and performs data conversion.
[0145] S405: The converted data is imported into the second electronic device.
[0146] In an embodiment of the present application, after the abnormality reproduction begins, the first information can be transmitted to the second electronic device through the first electronic device. The second electronic device is connected to the host computer. The second electronic device can transmit the first information to the host computer. The host computer can convert the first information into a form that can match the version of the second electronic device by detecting the version information of the second electronic device, and import the converted first information into the second electronic device.
[0147] It should be understood that the first electronic device and the second electronic device may be electronic devices of the same model or electronic devices of different models, and this embodiment of the present application does not limit this.
[0148] S406: The host computer triggers the second electronic device to take a photo.
[0149] Exemplarily, the host computer may send an instruction to the second electronic device to trigger a photo button. It should be noted that the triggering of photo taking in S406 is not triggering a real photo taking, but can be understood as triggering a process of simulating the first electronic device taking an abnormal image using the first information, so as to obtain the abnormal image later.
[0150] S407, simulating scene perception and determining a photo-taking strategy.
[0151] In the embodiment of the present application, simulating scene perception and determining the photographing strategy can be understood as determining the photographing strategy based on the scene perception information in the first information, rather than using the perception information in the current scene of the second electronic device to determine the photographing strategy. In this way, the scene when the first electronic device captures an abnormal image can be reproduced.
[0152] It should be understood that the second electronic device has no requirements for the scene of abnormal image reproduction, and the second electronic device can restore the scene in the first information of the first electronic device across time and space limitations.
[0153] S408, replacing the image, scene perception information, and metadata information collected by the camera.
[0154] It is understandable that after receiving the instruction to trigger the photo-taking, the second electronic device will start the camera to collect images, but in the embodiment of the present application, the real image collected by the camera is not processed, but the image collected by the camera is replaced with the original image in the first information, and the metadata information of the image is replaced with the metadata information in the first information. In this way, the specific image when the first electronic device takes the abnormal image can be reproduced.
[0155] In the embodiment of the present application, S409 to S412 may be executed in a loop subsequently to achieve the reproduction of multiple process processing situations.
[0156] S409, process N processing.
[0157] In the embodiment of the present application, process N can refer to Figure 3 The description of process N in will not be repeated here.
[0158] S410, whether the exception recurs.
[0159] For example, if an anomaly is detected in any process during the simulation, it can be considered that the anomaly is reproduced, so that the process can be optimized based on the reproduced anomaly to resolve the anomaly.
[0160] S411, process modification.
[0161] In the embodiment of the present application, if the abnormal image problem is reproduced, the second electronic device can modify the process in the simulated photo-taking process.
[0162] The above modification refers to modifying the image processing algorithm in the image processing flow, such as a mean filter noise elimination algorithm, a Laplace operator algorithm, an image enhancement algorithm, a face recognition algorithm, a target tracking algorithm or a background blur algorithm.
[0163] Exemplarily, the target tracking algorithm is 4-channel fusion, but the ghost images of the images under the 4-channel fusion are too different. Therefore, the second electronic device can modify the algorithm to change the 4-channel into a single channel, so that the image abnormality is modified.
[0164] S412: Whether the exception is handled.
[0165] In the embodiment of the present application, after modifying the abnormal process in S411 to obtain a modified process, the second electronic device can perform S405 to S410. If the abnormality does not recur, it means that the abnormality has been modified. If the abnormality recurs, it means that the abnormality has not been modified, and the process modification continues.
[0166] S413, abnormality analysis ends.
[0167] It should be noted that the image detection method of the embodiment of the present application can be implemented in the HAL layer, and can also be implemented in other software architecture layers of the electronic device, and the embodiment of the present application is not limited thereto.
[0168] It should be understood that in some embodiments, the first electronic device and the host computer can also reproduce the image abnormality according to the first information; or, the second electronic device can reproduce the image abnormality according to the first information; or, the first electronic device can reproduce the image abnormality according to the first information. The specific implementation process is similar to the above and will not be repeated here.
[0169] In the image abnormality recurrence process in the image detection method of the embodiment of the present application, the second electronic device can determine the photographing strategy according to the scene perception information in the first information, and can replace the image captured by the camera with the original image obtained based on the image, scene perception information and metadata information in the first information, simulate the photographing process of the first electronic device, perform process N processing of the original image, and determine the abnormality in the process of processing the original image; the second electronic device can also modify the abnormal process to obtain a normal image. In this way, the labor cost is saved to a large extent, and the efficiency of locating image abnormalities and processing image abnormalities is improved.
[0170] Optionally, the image detection method of the embodiment of the present application can be applicable to photo taking in multiple scenes, which may include the following scenes: multi-camera photo taking, zoom photo taking, portrait mode photo taking, large aperture photo taking, professional mode photo taking, recording photo taking or front-facing photo taking, etc., which is not limited to the embodiment of the present application.
[0171] The following specific embodiments are used to describe the method of the present application in detail. The following embodiments may be combined with each other or implemented independently, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0172] Figure 5 The image detection method of an embodiment of the present application is shown. The method can be applied to a first electronic device, and the method includes:
[0173] S501, a first electronic device caches first information in response to a photo-taking operation, where the first information includes an image captured by a camera, metadata information of the image, and scene perception information when the image is taken; wherein the image and metadata information are used to simulate the original image when the image is taken, and the scene perception information is used to simulate the environment when the image is taken.
[0174] In the embodiment of the present application, before the first electronic device caches the first information, the first electronic device can perceive the scene perception information of the scene in which the image captured by the camera is located based on the perception engine module, and according to the scene perception information, it can determine which camera the first electronic device uses to capture the image, and which image processing algorithm to use to process the image captured by the camera. The camera of the first electronic device can be understood as the above Figure 3 The camera of the first electronic device in step S303 corresponding to the above is not described in detail. The image processing algorithm can be understood as the above Figure 3 The example of the image processing algorithm in the corresponding step S303 is not repeated here.
[0175] S502: When an error occurs in the process of processing the image, the first information is stored locally in the first electronic device.
[0176] In a possible implementation, the first electronic device can capture images based on a determined camera, and cache the images captured by the camera, the metadata information of the images, and the scene perception information when the images were taken. The first electronic device can detect the process of processing the images captured by the camera through the IQA module. When an abnormality is detected in the process of processing the captured images, if the dump switch of the first electronic device is in the on state, the first electronic device can store the images captured by the camera, the metadata information of the images, and the scene perception information when the images were taken locally in the first electronic device. The process of processing the images captured by the camera can be understood as the above Figure 3 The corresponding process N in step S306 is not repeated here. The IQA module can be understood as the above Figure 3 The IQA module in the corresponding step S307 is not described again.
[0177] The image detection method of the embodiment of the present application can cache the image captured by the camera, the metadata information of the image, and the scene perception information when the image is taken after the first electronic device starts taking pictures, and can detect the image output through the image processing process through the IQA module. When it is detected that the image output through the image processing process is abnormal, the image captured by the camera, the metadata information of the image, and the scene perception information when the image is taken are stored locally in the first electronic device. In this way, the second electronic device can subsequently reproduce the scene of the above-mentioned photo operation of the first electronic device based on the local storage data of the first electronic device, and the abnormality in the photo operation can be located in the scene reproduction.
[0178] In some embodiments, the first electronic device can also compress the metadata information of the image and the scene perception information when the image is taken into the photographed image, and upload the photographed image to the server according to the user's needs. In this way, if the user subsequently reports to after-sales service that the photographed image is abnormal, the after-sales staff can easily obtain the metadata information of the image and the scene perception information when the image is taken, so as to reproduce the abnormality of the image.
[0179] Optional, in Figure 5 Based on the corresponding embodiments, the scene perception information includes one or more of the following: decision information for deciding the algorithm mode used for taking pictures, information collected by sensors for anti-shake processing, information collected by sensors for brightness perception, information collected by sensors for temperature perception, or information collected by sensors for distance perception.
[0180] In the embodiment of the present application, the first electronic device can perceive the scene perception information around the image captured by the camera through the perception engine module. The perception engine module can be understood as the above Figure 3The perception engine module in the corresponding step S302 is not described in detail. It can be understood that saving the scene perception information is conducive to the subsequent restoration of the abnormal image scene.
[0181] Optional, in Figure 5 On the basis of the corresponding embodiment, the first information includes decision information for deciding the algorithm mode used for taking pictures. It can be understood that saving the decision information is conducive to the subsequent restoration of abnormal image scenes.
[0182] Optional, in Figure 5 On the basis of the corresponding embodiments, the image processing process includes one or more of the following: decompression process, noise reduction process, clarity enhancement process, highlight suppression process, face area processing process, blur process, de-mosaic process, bad pixel removal process, white balance process, AC control process, AF control process, sharpening process, color correction process, color enhancement process or image compression process. It is understandable that the specific implementation of these image processing processes and the judgment method of whether each process is abnormal can be any achievable judgment method, and the embodiments of the present application are not specifically limited.
[0183] Exemplarily, the algorithms used in the image processing process may include: decompression algorithm, mean filter noise elimination algorithm, Laplace operator algorithm, image enhancement algorithm, face recognition algorithm, background blur algorithm, de-mosaic algorithm, bad pixel removal algorithm, white balance processing algorithm, AC control algorithm, AF control algorithm, sharpening processing algorithm, color correction algorithm, color enhancement algorithm or Jpeg image compression algorithm.
[0184] It is understandable that the process of the first electronic device processing the image captured by the camera is based on the above algorithms, and errors may occur during the operation of these algorithms. Therefore, the above image processing process is also a process that is prone to errors in image processing. Detecting whether the images output by these processes are abnormal is conducive to accurately obtaining the cause of the image abnormality.
[0185] Optional, in Figure 5 On the basis of the corresponding embodiment, before the first information is stored locally in the first electronic device, it also includes: after executing the first process, performing anomaly detection on the processed image obtained after executing the first process; wherein, when an abnormality is detected in the processed image, it indicates that the first process is wrong, and the first process is any process in the process of processing the image.
[0186] In the embodiment of the present application, the first electronic device may be provided with an IQA module in the processing process to perform abnormality detection on the processed image obtained after executing the image processing process. The IQA module performs abnormality detection on the processed image obtained after executing the image processing process, which can be understood as the above Figure 3 The example of the IQA module in step S307 corresponding to the above is not repeated here. This is helpful for determining the cause of the image abnormality later.
[0187] Optional, in Figure 5 On the basis of the corresponding embodiment, the first process includes one or more of the following: a noise reduction process, a clarity enhancement algorithm process, a highlight suppression process or a face area processing process.
[0188] In the embodiment of the present application, the above-mentioned process of processing graphics includes the above-mentioned first process, and the first process can be understood as a process that is prone to abnormalities.
[0189] Exemplarily, the first electronic device may set an IQA module for image processing processes that are highly functional and prone to abnormalities, such as noise reduction processes, clarity enhancement processes, highlight suppression processes, and face area processing processes. It can be understood that these processing processes are processes with a higher error frequency in practice, and setting an IQA module for these processes can more accurately identify abnormal images through a small amount of testing.
[0190] Exemplarily, the IQA module is not provided for image processing processes that have little functionality and are not likely to occur, such as a decompression process, so as to reduce the operating load of the first electronic device.
[0191] Optional, in Figure 5 On the basis of the corresponding embodiment, a dump switch is provided in the first electronic device. When the dump switch is in an on state, the first electronic device allows the data in the cache to be stored locally in the first electronic device. When the dump switch is in an off state, the first electronic device does not allow the data in the cache to be stored locally in the first electronic device. Storing the first information locally in the first electronic device includes: storing the first information locally in the first electronic device when the dump switch is in an on state.
[0192] In the embodiment of the present application, the dump switch can be understood as the above Figure 3 The dump switch in the corresponding step S309 is not described in detail. In this way, the user can control the dump switch. When the dump switch is in the on state, the data in the cache of the first electronic device is stored locally. Correspondingly, when the dump switch is in the off state, the data in the cache of the first electronic device may not be stored locally. In this way, it can meet the needs of users and better protect user privacy.
[0193] Optional, in Figure 5On the basis of the corresponding embodiment, after the first information is stored locally on the first electronic device, it also includes: obtaining a photographed image; and uploading both the first information and the photographed image to the server when an operation for uploading the photographed image to the server is received.
[0194] In the embodiment of the present application, when an abnormality occurs in the process of processing the camera image acquisition, the first electronic device can determine whether to upload the first information and the photographed image to the server according to the user's active demand after storing the first information locally through the dump switch. The user's active demand can be understood as the above Figure 3 The user's active demand in the corresponding step S312 will not be repeated here.
[0195] In this way, the electronic device used for scene reproduction can download the first information and photographed images of the first electronic device through the server. When the user of the first electronic device wants to solve the image abnormality problem, the user can use the first electronic device to operate online without establishing a communication connection between the first electronic device and the scene reproduction device. Furthermore, the server can also collect abnormal images and related information of multiple users to perform big data analysis, which is conducive to the optimization of the camera software.
[0196] In some embodiments, after the first electronic device uploads the cached data to the server, the cached data will automatically age. Automatic aging can be understood as the above Figure 3 The first information in the corresponding step S314 is automatically aged and will not be repeated here.
[0197] Optional, in Figure 5 On the basis of the corresponding embodiment, after the first information is stored locally in the first electronic device, the method also includes: using the first information to simulate the photo-taking process to obtain the processing results of each photo-taking process; wherein, in the simulated photo-taking process, the photo-taking strategy is determined based on the scene perception information in the first information, and the image captured by the camera is replaced with the original image obtained based on the image in the first information, the scene perception information and the metadata information.
[0198] In the embodiment of the present application, the second electronic device can use the first information to determine the photographing strategy required to reproduce the abnormal image. The photographing strategy can be understood as the above Figure 4 The corresponding photographing strategy in step S407 will not be described in detail.
[0199] In a possible implementation, after receiving the instruction to trigger the photo-taking, the second electronic device will start the camera to capture the image. The second electronic device may not process the real image captured by the camera, but replace the image captured by the camera with the original image in the first information, and replace the metadata of the image with the metadata in the first information. In this way, the specific image when the first electronic device captures the abnormal image can be reproduced.
[0200] Optional, in Figure 5 On the basis of the corresponding embodiment, the process of simulating the photographing by using the first information is executed by the first electronic device or the second electronic device.
[0201] In the embodiment of the present application, the first electronic device and the second electronic device may be electronic devices of different models. The first electronic device may be an electronic device that takes an abnormal image, and the first electronic device may be used to simulate the photographing process. In the case where the first electronic device cannot simulate the photographing process, the second electronic device may be used to simulate the photographing process. In this way, the first electronic device or the second electronic device can be flexibly used to simulate the photographing process according to the actual availability of the first electronic device or the second electronic device.
[0202] Optional, in Figure 5 On the basis of the corresponding embodiment, the process of simulating the photo-taking using the first information is executed by the second electronic device. Before simulating the photo-taking using the first information, it includes: converting the first information into a form that can be matched by the version of the second electronic device; and importing the converted first information into the second electronic device.
[0203] In the embodiment of the present application, the first information may be obtained by the first electronic device, and the second electronic device may perform the simulation of the photographing process using the first information. The first electronic device and the second electronic device may be electronic devices of different models, so the first information needs to be converted into a form that can be matched by the version of the second electronic device. In this way, the second electronic device can use the converted first information to simulate the photographing process and reproduce the image abnormality.
[0204] In a possible implementation, the image abnormality reproduction process is performed by the host computer controlling the second electronic device. The host computer can perform data conversion on the first information and import the converted data into the second electronic device. The data interaction process between the host computer and the second electronic device can be understood as the above Figure 4 The data interaction between the host computer and the second electronic device in the corresponding steps S402 to S405 will not be repeated here.
[0205] In some embodiments, the process of reproducing the image abnormality that occurs in the first electronic device may be completed by the first electronic device; or, the process of reproducing the image abnormality that occurs in the first electronic device may also be completed by the host computer controlling the first electronic device. This embodiment of the application is not limited to this.
[0206] Optional, in Figure 5On the basis of the corresponding embodiment, after using the first information to simulate the photographing process and obtaining the processing results of each photographing process, the method also includes: modifying the process of using the first information to simulate the photographing process; using the first information and the modified simulated photographing process to re-simulate the photographing until the result of the simulated photographing is not abnormal.
[0207] In the embodiment of the present application, the second electronic device completes the reproduction of the image taken by the first electronic device, and can also modify the abnormal process until the result of the simulated photo shooting is no longer abnormal. The process modification can be understood as the above Figure 4 The process modification in the corresponding step S411 is omitted. In this way, the labor cost is saved to a great extent, and the efficiency of locating image anomalies and processing image anomalies is improved.
[0208] In some embodiments, if the second electronic device fails to reproduce the image captured by the first electronic device, the second electronic device will no longer reproduce the image abnormality and will not modify the abnormal process.
[0209] It should be noted that the module names involved in the embodiments of the present application can be defined as other names as long as the functions of each module can be achieved, and there is no specific restriction on the names of the modules.
[0210] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0211] The image detection method of the embodiment of the present application has been described above, and the device for executing the above method provided by the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the relevant device provided by the embodiment of the present application can execute the steps in the above list sorting method.
[0212] like Figure 6 A schematic diagram of the structure of a chip provided in an embodiment of the present application: The chip 610 includes one or more (including two) processors 601 , a communication line 602 , a communication interface 603 and a memory 604 .
[0213] In some implementations, the memory 604 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
[0214] The method described in the above embodiment of the present application can be applied to the processor 601, or implemented by the processor 601. The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 601 or an instruction in the form of software. The above processor 601 can be a general-purpose processor (for example, a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components. The processor 601 can implement or execute the methods, steps and logic block diagrams related to each processing disclosed in the embodiment of the present application.
[0215] The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. Among them, the software module can be located in a mature storage medium in the field such as a random access memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable read only memory (EEPROM). The storage medium is located in the memory 604, and the processor 601 reads the information in the memory 604 and completes the steps of the above method in combination with its hardware.
[0216] The processor 601 , the memory 604 , and the communication interface 603 may communicate with each other via the communication line 602 .
[0217] The image detection method provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic devices include terminal devices, and the specific device form of the terminal devices can refer to the above related descriptions, which will not be repeated here.
[0218] The image detection method provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic devices include terminal devices, and the specific device form of the terminal devices can refer to the above related descriptions, which will not be repeated here.
[0219] An embodiment of the present application provides an electronic device, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the electronic device executes the above method.
[0220] The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.
[0221] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The above method is implemented when the computer program is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.
[0222] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.
[0223] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.
[0224] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0225] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.
Claims
1. An image detection method, characterized in that: include: In response to a photographing operation, first information is cached, the first information including an image captured by a camera, metadata information of the image, and scene perception information when the image is photographed; wherein the image and the metadata information are used to simulate an original image when the image is photographed, the scene perception information is used to simulate an environment when the image is photographed, and the metadata information of the image is information that determines image quality; When an error occurs in the process of processing the image, the first information is stored locally in the first electronic device, and the first information is used to reproduce the image abnormality; After storing the first information locally in the first electronic device, the method further includes: Using the first information to simulate a photographing process, and obtaining processing results of each photographing process; Wherein, in the simulated photographing process, the photographing strategy is determined based on the scene perception information in the first information, and the image captured by the camera is replaced with an original image obtained based on the image in the first information, the scene perception information and the metadata information; After simulating the photographing process by using the first information and obtaining the processing results of each photographing process, the method further includes: Modifying the process of simulating a photographing process using the first information; The first information and the modified simulated photographing process are used to re-perform simulated photographing until the result of the simulated photographing is normal.
2. The method according to claim 1, characterized in that: The scene perception information includes one or more of the following: decision information for deciding the algorithm mode used for taking pictures, information collected by sensors for anti-shake processing, information collected by sensors for brightness perception, information collected by sensors for temperature perception, or information collected by sensors for distance perception.
3. The method according to claim 1, characterized in that The first information includes decision information for deciding an algorithm mode to be used for taking pictures.
4. The method according to any one of claims 1 to 3, characterized in that: The process of processing the image includes one or more of the following: a decompression process, a noise reduction process, a clarity enhancement process, a highlight suppression process, a face area processing process, a blurring process, a de-mosaicing process, a bad pixel removal processing process, a white balance processing process, an automatic exposure AC control process, an automatic focus AF control process, a sharpening processing process, a color correction process, a color enhancement process or an image compression process.
5. The method according to any one of claims 1 to 3, characterized in that Before storing the first information locally in the first electronic device, the method further includes: After executing the first process, performing abnormality detection on the processed image obtained after executing the first process; Wherein, when an abnormality is detected in the processed image, it indicates that an error occurs in the first process, where the first process is any process in the process of processing the image.
6. The method according to claim 5, characterized in that The first process includes one or more of the following: a noise reduction process, a clarity enhancement algorithm process, a highlight suppression process, or a face area processing process.
7. The method according to any one of claims 1 to 3, characterized in that The first electronic device is provided with a dump switch, and when the dump switch is in an on state, the first electronic device allows the data in the cache to be stored locally in the first electronic device, and when the dump switch is in an off state, the first electronic device does not allow the data in the cache to be stored locally in the first electronic device; The storing the first information locally in the first electronic device includes: When the dump switch is in an on state, the first information is stored locally in the first electronic device.
8. The method according to any one of claims 1 to 3, characterized in that After storing the first information locally in the first electronic device, the method further includes: Get the photographed image; When an operation for uploading the photographed image to a server is received, both the first information and the photographed image are uploaded to the server.
9. The method according to any one of claims 1 to 3, characterized in that: The process of simulating photographing by using the first information is performed by the first electronic device or the second electronic device.
10. The method according to claim 9, characterized in that The process of simulating photographing by using the first information is performed by the second electronic device, and before the process of simulating photographing by using the first information, the process includes: Converting the first information into a format that can be matched by a version of the second electronic device; The first information in a converted format is imported into the second electronic device.
11. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the method according to any one of claims 1 to 10.
12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
13. A chip system, characterized in that: The method comprises at least one processor and a communication interface, wherein the communication interface and the at least one processor are interconnected via a line, and the at least one processor is used to run a computer program or instruction to execute the method according to any one of claims 1 to 10.
