Image processing method and device, equipment and storage medium
By using image processing methods in traditional artificial intelligence models and uploading image data to the cloud for large model inference processing, it solves the limitations of traditional models in different scenarios, improves detection efficiency and reduces costs, and achieves detection in most cases. Efficient detection in scenarios.
Patent Information
- Application Number
- CN202311506931.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-13
- Publication Date
- 2024-10-18
AI Technical Summary
Traditional artificial intelligence models face data limitations, algorithm limitations, and model limitations in industry applications, making it difficult to establish reliable models in different scenarios, and the accuracy of the models is affected by multiple factors, taking up a lot of time for training and optimization.
The image processing method is used to preprocess the collected image data and upload it to the cloud. The large model deployed in the cloud is used to perform inference processing on the image data to obtain the inference results, and the results are used in application scenarios through super-resolution processing to avoid differences. The limitations of using different data and algorithms to train different models in scenarios.
Through the application of large industry models, the problem of model limitations in most scenarios is solved, the prediction accuracy is improved, the data and computing costs are reduced, and the detection function is realized without occupying redundant network transmission resources, improving detection efficiency.
Smart Images

Figure CN118799587A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an image processing method, apparatus, device and storage medium. Background Art
[0002] In recent years, AI models based on deep learning have been widely used in many practical scenarios such as public security, transportation, and production. However, with the deepening of technology, traditional AI models will face the following technical limitations when applied in the industry: 1) Data limitations: Traditional models for a specific scenario require a large amount of professional data in that scenario to be trained and optimized, but some data (such as negative samples) are difficult to obtain, or the amount of data is too small to build a reliable model; 2) Algorithm limitations: Different algorithms are suitable for different scenarios, and the scenarios that an algorithm can solve are very limited; 3) Model limitations: The accuracy of the model is affected by multiple factors, such as the quantity and quality of training data, the choice of algorithm and parameter settings, and the confirmation of the above parameters often takes a lot of time. Summary of the invention
[0003] In view of this, embodiments of the present application hope to provide an image processing method, apparatus, device and storage medium.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] The present application provides an image processing method, which includes:
[0006] Preprocess the collected image data corresponding to the application scenario, and upload the preprocessed image data to the cloud;
[0007] Performing inference processing on the preprocessed image data based on a large model corresponding to the application scenario deployed in the cloud to obtain an inference result;
[0008] Super-resolution processing is performed based on the inference result, and the obtained super-resolution result is used in the application scenario.
[0009] In the embodiment of the present application, before preprocessing the collected image data corresponding to the application scenario, the method further includes:
[0010] Image data of the object to be photographed in the application scene is collected.
[0011] In the embodiment of the present application, the collecting of image data of the object to be photographed in the application scene includes:
[0012] Partitioning the object to be photographed to obtain a plurality of partitions;
[0013] For different partitions, the image to be identified of the partition is obtained based on a static stable frame method;
[0014] Determining the clarity of the image to be identified based on edge information;
[0015] The image data of the clear image to be recognized in each partition is determined as the image data of the object to be photographed.
[0016] In the embodiment of the present application, the method based on the static stable frame to obtain the image to be identified of the partition includes:
[0017] Continuously capture n frames of images;
[0018] Between adjacent frames, determine the change of pixels at corresponding positions between the i-1th frame and the i-th frame, and the change value is recorded as the difference between the i-th adjacent frames; the value of i is [1, n];
[0019] Calculating the average absolute value of each of the adjacent frame differences;
[0020] In order from low to high, the average absolute value of each adjacent frame difference is compared with the static stable frame threshold, starting from the average absolute value of the i-th adjacent frame difference. If the average absolute value of all subsequent adjacent frame differences is less than the static stable frame threshold, the i-th frame image is selected as the image to be identified.
[0021] In the embodiment of the present application, the determining the clarity of the image to be identified based on edge information includes:
[0022] For different partitions, based on the grayscale image of the image to be identified corresponding to the partition and the pixel position in the edge information of the partition, determine the average clarity of all edge positions in the partition;
[0023] If the average clarity is not less than a preset threshold, the image to be identified in the partition is determined to be clear; otherwise, the image to be identified in the partition is determined to be blurred and needs to be re-captured.
[0024] In the embodiment of the present application, the preprocessing of the collected image data corresponding to the application scenario includes:
[0025] Based on the position information of different partitions and the DPI information of the number of pixels per inch in the length of the image to be identified corresponding to the partition, the images to be identified of each partition are spliced into a whole image;
[0026] Based on the requirements of the large model deployed in the cloud for the input image size, the entire image is cropped to obtain a number of cropped small images; accordingly,
[0027] The uploading of the pre-processed image data to the cloud comprises:
[0028] The plurality of cropped small images and location information corresponding to the small images are sent to the cloud.
[0029] In the embodiment of the present application, the large model deployed on the cloud side crops the entire image according to the input image size requirement, including:
[0030] Based on the maximum number of images for a single inference supported by the large model deployed in the cloud, the size of the entire image, and the input image size supported by the large model, the entire image is cropped using a window cropping method.
[0031] In the embodiment of the present application, during the process of performing reasoning processing on the pre-processed image data, the method further includes:
[0032] For the overlapping areas between small images during the reasoning process, a voting mechanism is used to obtain the predicted classification probability of the pixel position corresponding to the overlapping area.
[0033] The present application also provides an image processing device, including:
[0034] A processing unit is used to pre-process the collected image data corresponding to the application scenario; perform inference processing on the pre-processed image data based on a large model corresponding to the application scenario deployed in the cloud to obtain an inference result; perform super-resolution processing based on the inference result, and use the obtained super-resolution result for the application scenario;
[0035] The communication unit is used to upload the pre-processed image data to the cloud.
[0036] The embodiment of the present application further provides an image processing device, comprising: a first communication interface and a first processor; wherein:
[0037] The first processor is used to pre-process the collected image data corresponding to the application scenario; perform inference processing on the pre-processed image data based on a large model corresponding to the application scenario deployed in the cloud to obtain an inference result; perform super-resolution processing based on the inference result, and use the obtained super-resolution result for the application scenario;
[0038] The first communication interface is used to upload the preprocessed image data to the cloud.
[0039] The embodiment of the present application further provides an image processing device, comprising: a first processor and a first memory for storing a computer program that can be run on the processor,
[0040] Wherein, the first processor is used to execute the steps of the above method when running the computer program.
[0041] An embodiment of the present application further provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0042] The image processing method, device, equipment and storage medium provided in the embodiments of the present application pre-process the collected image data corresponding to the application scenario, and upload the pre-processed image data to the cloud; perform inference processing on the pre-processed image data based on the large model corresponding to the application scenario deployed in the cloud to obtain an inference result; perform super-resolution processing based on the inference result, and use the obtained super-resolution result for the application scenario. The embodiments of the present application apply the industry large model to practical applications, which can avoid the various limitations caused by using different data for different scenarios and training different models based on different algorithms. Most problems can be solved by the industry large model; the pre-processing of image data and the inference processing of the pre-processed image data based on the large model can realize the industry application (detection) function without occupying excess network transmission resources, thereby improving the application (detection) efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a flow chart of the image processing method described in the embodiment of the present application;
[0044] Figure 2 This is a schematic diagram of sliding window cutting according to an embodiment of the present application;
[0045] Figure 3 This is a schematic diagram of the calculation of the overlapping area results described in the embodiment of the present application;
[0046] Figure 4 An image processing flow chart for an example application of this application;
[0047] Figure 5 This is a schematic diagram of the super-resolution of the large model inference result described in the embodiment of the present application;
[0048] Figure 6 This is a schematic diagram of the structure of the image processing device described in an embodiment of the present application;
[0049] Figure 7 This is a schematic diagram of the structure of the image processing device described in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The present application is described below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant inventions, rather than to limit the inventions. It should also be noted that, for ease of description, only the parts related to the relevant inventions are shown in the accompanying drawings. It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
[0051] In view of the problems currently faced by artificial intelligence models in industry applications, this application applies industry large models to practical application solutions (this article mainly involves image processing solutions), thereby realizing the transformation of industry AI application solutions from "handmade workshops" to "factory models" and accelerating the industrialization process of industry AI; and based on large models, the prediction accuracy can be improved, while reducing the data and computing costs of enterprises and individuals in model research and development.
[0052] The present application embodiment provides an image processing method, such as Figure 1 As shown, the method includes:
[0053] Step 101: pre-processing the collected image data corresponding to the application scenario, and uploading the pre-processed image data to the cloud;
[0054] Step 102: performing inference processing on the preprocessed image data based on a large model corresponding to the application scenario deployed in the cloud to obtain an inference result;
[0055] Step 103: Perform super-resolution processing based on the inference result, and use the obtained super-resolution result in the application scenario.
[0056] The embodiments of the present application apply the industry big model to practical applications, and can be applied to fields such as mobile phone manufacturing that require product inspection (quality inspection) through image processing, avoiding the various limitations caused by using different data in different scenarios and training different models based on different algorithms. Most problems can be solved through the industry big model; the preprocessing of image data and the inference processing of the preprocessed image data based on the big model can realize the detection function without occupying excess network transmission resources, thereby improving the detection efficiency.
[0057] In the embodiment of the present application, before preprocessing the collected image data corresponding to the application scenario, the method further includes:
[0058] Image data of the object to be photographed in the application scene is collected.
[0059] In the embodiment of the present application, the collecting of image data of the object to be photographed in the application scene includes:
[0060] Partitioning the object to be photographed to obtain a plurality of partitions;
[0061] For different partitions, the image to be identified of the partition is obtained based on a static stable frame method;
[0062] Determining the clarity of the image to be identified based on edge information;
[0063] The image data of the clear image to be recognized in each partition is determined as the image data of the object to be photographed.
[0064] In the embodiment of the present application, the method based on the static stable frame to obtain the image to be identified of the partition includes:
[0065] Continuously capture n frames of images;
[0066] Between adjacent frames, determine the change of pixels at corresponding positions between the i-1th frame and the i-th frame, and the change value is recorded as the difference between the i-th adjacent frames; the value of i is [1, n];
[0067] Calculating the average absolute value of each of the adjacent frame differences;
[0068] In order from low to high, the average absolute value of each adjacent frame difference is compared with the static stable frame threshold. Starting from the average absolute value of the i-th adjacent frame difference, if the average absolute value of all subsequent adjacent frame differences is less than the static stable frame threshold, the i-th frame image is selected as the image to be identified.
[0069] In one embodiment, the image data of the object to be photographed (the product to be tested) can be collected by a camera arranged at the application end during the actual application process. The product to be tested can be partitioned first, and then the image to be identified can be obtained by using a static stable frame method for different partitions. The specific solution of the static stable frame is as follows:
[0070] Step 1.1: The camera continuously captures n frames of images, which are distributed as I1, ..., I n ;
[0071] Step 1.2: Between adjacent frames, determine the change in pixels at corresponding positions between the previous frame and the next frame, and record it as the difference between adjacent frames: diff i =I i -I i-1 ;
[0072] Step 1.3: Calculate the difference between adjacent frames i The absolute value average is denoted as A static stable frame threshold t is set. When the average of the absolute values of the differences between adjacent frames after the average of the absolute values of the differences between the i-th adjacent frames is less than the static stable frame threshold t, it is considered that the image has been stably shot, and the last frame (i-th frame) is selected as the image to be identified; the Size is the number of pixels in the image.
[0073] In the embodiment of the present application, the determining the clarity of the image to be identified based on edge information includes:
[0074] For different partitions, based on the grayscale image of the image to be identified corresponding to the partition and the pixel position in the edge information of the partition, determine the average clarity of all edge positions in the partition;
[0075] If the average clarity is not less than a preset threshold, the image to be identified in the partition is determined to be clear; otherwise, the image to be identified in the partition is determined to be blurred and needs to be re-captured.
[0076] In one embodiment, let I be a grayscale image of an image to be identified in a certain partition, let I(x, y) be a grayscale pixel value at position (x, y), and the position set S records the edge information pixel position of the current partition. The clarity of the edge position of the image to be identified is calculated according to the following formula:
[0077]
[0078] where d x I(x,y) and d y I(x,y) is the derivative in the x,y direction, and calculates the average clarity of all edge positions in I Clarity (x, y) / |S|, set threshold t 清晰度 ,like Clarity(x,y) / |S|<t 清晰度 , then the image to be identified is judged to be blurred and needs to be re-photographed.
[0079] In the embodiment of the present application, the preprocessing of the collected image data corresponding to the application scenario includes:
[0080] Based on the position information of different partitions and the DPI information of the number of pixels per inch in the length of the image to be identified corresponding to the partition, the images to be identified of each partition are spliced into a whole image;
[0081] Based on the requirements of the large model deployed in the cloud for the input image size, the entire image is cropped to obtain a number of cropped small images; accordingly,
[0082] The uploading of the pre-processed image data to the cloud comprises:
[0083] The plurality of cropped small images and location information corresponding to the small images are sent to the cloud.
[0084] In the embodiment of the present application, the large model deployed on the cloud side crops the entire image according to the input image size requirement, including:
[0085] Based on the maximum number of images for a single inference supported by the large model deployed in the cloud, the size of the entire image, and the input image size supported by the large model, the entire image is cropped using a window cropping method.
[0086] In one embodiment, the collected images to be identified in each partition may be spliced and re-cropped, and the cropped images may be packaged and sent to the cloud.
[0087] Step 2.1 stitching the whole image: stitching the images to be identified in each partition into a whole image based on the partition position information and the DPI (pixel count per inch) information of the image to be identified corresponding to the partition;
[0088] Step 2.2 Re-cropping: Usually the size of the whole image after stitching is very large (even hundreds of millions of pixels for one image), which affects the efficiency of image transmission. To address the above problems, combined with the cloud-based large model's requirements for input image size, the whole image is re-cropped and batch-packaged and uploaded to the cloud processing module, as follows:
[0089] Let B be the maximum number of images supported by the cloud-based large model for a single inference, W and H be the sizes of the integrated images, and w and h be the input image sizes supported by the large model. Figure 2 The image is cropped in a row-by-row / column-by-column manner.
[0090] The step size of the row sliding window w =(n w ·wW) / (n w -1), where Step size of column sliding window h =(n h ·hH) / (n h -1), where After the above sliding window cropping, N small images are obtained. Each B small images and the corresponding coordinate information are packaged and sent to the cloud for large model calculation, avoiding the unnecessary time consumption caused by the cloud large model waiting for the entire image to be transmitted before reasoning.
[0091] Step 2.3 Packing and sending: After cutting, we get N = n w ·n h small pictures, and pack them into B small pictures A small packet is sent to the cloud processing module.
[0092] The image segmentation technology implemented in the embodiment of the present application based on the requirement of the large model for the input image size can effectively distinguish the edge features of key detection targets and avoid the redundant approach of "one issue at a time" in existing scenarios.
[0093] In the embodiment of the present application, during the process of performing reasoning processing on the pre-processed image data, the method further includes:
[0094] For the overlapping areas between small images during the reasoning process, a voting mechanism is used to obtain the predicted classification probability of the pixel position corresponding to the overlapping area.
[0095] In one embodiment, the large model deployed in the cloud performs model reasoning on B small images, and finally obtains n h *n w Due to the influence of image sliding window cropping, there is a problem of overlapping and occluding results. For the detection results of the overlapping area, a voting mechanism is used to obtain the predicted classification probability of the pixel position corresponding to the overlapping area. The specific implementation plan is as follows:
[0096] Step 3.1: Figure 3 , Figure 1-1 , Figure 1-2 , Figure 2-1 , Figure 2-2 They are the small image results after inference by the cloud-based large model, that is, the predicted classification probability corresponding to all pixel positions of each small image, denoted as C is the number of predicted categories, i and j are the corresponding sub-images, and x and y are the pixel position coordinates;
[0097] Step 3.2: For the overlapping area 1, the predicted probability of the corresponding pixel position is Where (x, y) and (x', y') are the pixel positions in the overlapping area 1. Figure 1-1 , Figure 1-2 The corresponding coordinates in; for the overlapping area 2, the predicted probability of the corresponding pixel position is Where (x, y) and (x', y') are the pixel positions in the overlapping area 2. Figure 2-1 , Figure 2-2 The corresponding coordinates in ;
[0098] Step 3.3: Overlap area 3 is composed of Figure 1-1 , Figure 1-2 , Figure 2-1 , Figure 2-2 The four small images overlap, and the predicted probability of the corresponding pixel position is where (x,y), (x',y'), (x",y"), and (x"',y"') are the pixel positions in the overlapping area 3. Figure 1-1 , Figure 1-2 , Figure 2-1 , Figure 2-2 The corresponding coordinates in .
[0099] The image processing method of the present application is described below in conjunction with an application example. In order to implement the method, this example proposes an image processing system, including: a local image acquisition module, a local image preprocessing module, a cloud processing module, and a local recognition module. When the application scheme is determined, the object to be inspected is first photographed and the clarity is recognized according to the application scenario through the local image acquisition module, and then the image is preprocessed by splicing, compressing and other preprocessing work in the local image preprocessing module, and the relevant data is uploaded to the cloud. The cloud processing module uses a large model to perform fine processing on the image (such as semantic segmentation, target detection, etc.), and finally transmits the processing results of the large cloud model back to the application site. The local recognition module will perform super-resolution based on the fine results of the large model processing and realize the application scenario function. Figure 4 The image processing flow chart for this application example includes:
[0100] Step 1: The local image acquisition module takes pictures and determines the clarity based on the requirements of industry application scenarios;
[0101] Specifically, Figure 4 As shown, the product to be imaged is partitioned, and the camera obtains the images to be identified in different partitions based on the static stable frame method; the clarity of the image (including out-of-focus and blur that can be discerned by the naked eye) is judged based on the edge information, as described above for details.
[0102] Step 2: The local image preprocessing module performs preprocessing operations such as splicing and compression on the collected multiple images, and uploads the data to the cloud;
[0103] See the description of Step 2.1-2.3 above for details.
[0104] Step 3: The cloud processing module calculates and processes the uploaded data and transmits the results back to the local application;
[0105] See the description of Step 3.1-3.3 above for details.
[0106] Step 4: The local recognition module performs super-resolution processing on the cloud results based on actual application needs, implements corresponding functions, and generates corresponding instructions to control the execution of the lower computer.
[0107] In one embodiment, the local recognition module can use a full convolution + dilated convolution neural network model to replace the traditional linear transformation to super-resolve the image segmentation map based on the image segmentation results sent back by the cloud, so as to improve the resolution and enhance the edge information of key targets. Since the pixel distribution of the image style result is relatively concentrated, fewer convolution calculations can be used to generate sufficient edge features, which is more suitable for lightweight deployment on the end side.
[0108] like Figure 5As shown, the super-resolution image processing effects of different scales are different. The experiment shows that the larger the super-resolution multiple, the more superpixels there are, and the better the boundary contour segmentation effect. However, too large a segmentation scale will affect the algorithm running speed. In the embodiment of the present application, the image is usually super-resolution to a dpi of about 200 to 400 to balance the calculation speed and detection accuracy. Here, the input of the super-resolution algorithm is the predicted classification probability of the corresponding pixel position of the entire image obtained above, and the corresponding input size is H×W×C. s is the super-resolution multiple, and the output size after super-resolution is s·H×s·W×C.
[0109] In order to implement the method of the embodiment of the present application, the embodiment of the present application also provides an image processing device, such as Figure 6 As shown, including:
[0110] The processing unit 601 is used to pre-process the collected image data corresponding to the application scenario; perform inference processing on the pre-processed image data based on a large model corresponding to the application scenario deployed in the cloud to obtain an inference result; perform super-resolution processing based on the inference result, and use the obtained super-resolution result for the application scenario;
[0111] The communication unit 602 is used to upload the pre-processed image data to the cloud.
[0112] In the embodiment of the present application, before the processing unit 601 pre-processes the collected image data corresponding to the application scenario, it is also used to
[0113] Image data of the object to be photographed in the application scene is collected.
[0114] In the embodiment of the present application, the processing unit 601 collects image data of the object to be photographed in the application scene, including:
[0115] Partitioning the object to be photographed to obtain a plurality of partitions;
[0116] For different partitions, the image to be identified of the partition is obtained based on a static stable frame method;
[0117] Determining the clarity of the image to be identified based on edge information;
[0118] The image data of the clear image to be recognized in each partition is determined as the image data of the object to be photographed.
[0119] In the embodiment of the present application, the processing unit 601 obtains the image to be identified of the partition based on the static stable frame method, including:
[0120] Continuously capture n frames of images;
[0121] Between adjacent frames, determine the change of pixels at corresponding positions between the i-1th frame and the i-th frame, and the change value is recorded as the difference between the i-th adjacent frames; the value of i is [1, n];
[0122] Calculating the average absolute value of each of the adjacent frame differences;
[0123] In order from low to high, the average absolute value of each adjacent frame difference is compared with the static stable frame threshold, starting from the average absolute value of the i-th adjacent frame difference. If the average absolute value of all subsequent adjacent frame differences is less than the static stable frame threshold, the i-th frame image is selected as the image to be identified.
[0124] In the embodiment of the present application, the processing unit 601 determines the clarity of the image to be identified based on the edge information, including:
[0125] For different partitions, based on the grayscale image of the image to be identified corresponding to the partition and the pixel position in the edge information of the partition, determine the average clarity of all edge positions in the partition;
[0126] If the average clarity is not less than a preset threshold, the image to be identified in the partition is determined to be clear; otherwise, the image to be identified in the partition is determined to be blurred and needs to be re-captured.
[0127] In the embodiment of the present application, the processing unit 601 pre-processes the collected image data corresponding to the application scenario, including:
[0128] Based on the position information of different partitions and the DPI information of the number of pixels per inch in the length of the image to be identified corresponding to the partition, the images to be identified of each partition are spliced into a whole image;
[0129] Based on the requirements of the large model deployed in the cloud for the input image size, the entire image is cropped to obtain a number of cropped small images; accordingly,
[0130] The uploading of the pre-processed image data to the cloud comprises:
[0131] The plurality of cropped small images and location information corresponding to the small images are sent to the cloud.
[0132] In the embodiment of the present application, the processing unit 601 crops the entire image based on the requirement of the large model deployed in the cloud for the input image size, including:
[0133] Based on the maximum number of images for a single inference supported by the large model deployed in the cloud, the size of the entire image, and the input image size supported by the large model, the entire image is cropped using a window cropping method.
[0134] In the embodiment of the present application, during the inference processing of the pre-processed image data by the processing unit 601,
[0135] For the overlapping areas between small images during the reasoning process, a voting mechanism is used to obtain the predicted classification probability of the pixel position corresponding to the overlapping area.
[0136] In actual application, the communication unit 602 may be implemented by a communication interface in an image processing device; and the processing unit 601 may be implemented by a processor in the image processing device.
[0137] It should be noted that: the image processing device provided in the above embodiment only uses the division of the above program modules as an example for explanation during communication. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the above-described processing. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0138] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiment of the present application, the embodiment of the present application also provides an image processing device, such as Figure 7 As shown, the image processing device 700 includes:
[0139] The first communication interface 701 is capable of exchanging information with other nodes on the network side (cloud);
[0140] A first processor 702 is connected to the first communication interface 701 to implement information interaction with other nodes on the network side (cloud), and is used to execute the method provided by one or more technical solutions on the image processing device side when running a computer program;
[0141] A first memory 703 , on which the computer program is stored.
[0142] Specifically, the first processor 702 is used to pre-process the collected image data corresponding to the application scenario; perform inference processing on the pre-processed image data based on a large model corresponding to the application scenario deployed in the cloud to obtain an inference result; perform super-resolution processing based on the inference result, and use the obtained super-resolution result for the application scenario;
[0143] The first communication interface 701 is used to upload the pre-processed image data to the cloud.
[0144] In the embodiment of the present application, before the first processor 702 pre-processes the collected image data corresponding to the application scenario, it is also used to
[0145] Image data of the object to be photographed in the application scene is collected.
[0146] In the embodiment of the present application, the first processor 702 collects image data of the object to be photographed in the application scene, including:
[0147] Partitioning the object to be photographed to obtain a plurality of partitions;
[0148] For different partitions, the image to be identified of the partition is obtained based on a static stable frame method;
[0149] Determining the clarity of the image to be identified based on edge information;
[0150] The image data of the clear image to be recognized in each partition is determined as the image data of the object to be photographed.
[0151] In the embodiment of the present application, the first processor 702 obtains the image to be identified of the partition based on the static stable frame method, including:
[0152] Continuously capture n frames of images;
[0153] Between adjacent frames, determine the change of pixels at corresponding positions between the i-1th frame and the i-th frame, and the change value is recorded as the difference between the i-th adjacent frames; the value of i is [1, n];
[0154] Calculating the average absolute value of each of the adjacent frame differences;
[0155] In order from low to high, the average absolute value of each adjacent frame difference is compared with the static stable frame threshold, starting from the average absolute value of the i-th adjacent frame difference. If the average absolute value of all subsequent adjacent frame differences is less than the static stable frame threshold, the i-th frame image is selected as the image to be identified.
[0156] In the embodiment of the present application, the first processor 702 determines the clarity of the image to be recognized based on the edge information, including:
[0157] For different partitions, based on the grayscale image of the image to be identified corresponding to the partition and the pixel position in the edge information of the partition, determine the average clarity of all edge positions in the partition;
[0158] If the average clarity is not less than a preset threshold, the image to be identified in the partition is determined to be clear; otherwise, the image to be identified in the partition is determined to be blurred and needs to be re-captured.
[0159] In the embodiment of the present application, the first processor 702 pre-processes the collected image data corresponding to the application scenario, including:
[0160] Based on the position information of different partitions and the DPI information of the number of pixels per inch in the length of the image to be identified corresponding to the partition, the images to be identified of each partition are spliced into a whole image;
[0161] Based on the requirements of the large model deployed in the cloud for the input image size, the entire image is cropped to obtain a number of cropped small images; accordingly,
[0162] The uploading of the pre-processed image data to the cloud comprises:
[0163] The plurality of cropped small images and location information corresponding to the small images are sent to the cloud.
[0164] In the embodiment of the present application, the first processor 702 crops the entire image based on the requirement of the large model deployed in the cloud for the input image size, including:
[0165] Based on the maximum number of images for a single inference supported by the large model deployed in the cloud, the size of the entire image, and the input image size supported by the large model, the entire image is cropped using a window cropping method.
[0166] In the embodiment of the present application, during the process of inference processing of the pre-processed image data by the first processor 702,
[0167] For the overlapping areas between small images during the reasoning process, a voting mechanism is used to obtain the predicted classification probability of the pixel position corresponding to the overlapping area.
[0168] It should be noted that the specific processing process of the first communication interface 701 and the first processor 702 can be understood by referring to the above method, which will not be repeated here.
[0169] Of course, in actual application, the various components in the image processing device 700 are coupled together through the bus system 704. It can be understood that the bus system 704 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 704 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 7 Various buses are labeled as bus system 704 .
[0170] The first memory 703 in the embodiment of the present application is used to store various types of data to support the operation of the image processing device 700. Examples of such data include: any computer program used to operate on the image processing device 700.
[0171] The method disclosed in the above embodiment of the present application can be applied to the first processor 702, or implemented by the first processor 702. The first processor 702 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the first processor 702. The above-mentioned first processor 702 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The first processor 702 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the first memory 703, and the first processor 702 reads the information in the first memory 703, and completes the steps of the above method in combination with its hardware.
[0172] In an exemplary embodiment, the image processing device 700 can be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.
[0173] In an exemplary embodiment, the present application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, including a first memory 703 storing a computer program, and the computer program can be executed by a first processor 702 of an image processing device 700 to complete the steps of the aforementioned image processing device side method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.
[0174] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0175] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0176] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. An image processing method, characterized in that: The method includes: Preprocess the collected image data corresponding to the application scenario, and upload the preprocessed image data to the cloud; Performing inference processing on the preprocessed image data based on a large model corresponding to the application scenario deployed in the cloud to obtain an inference result; Super-resolution processing is performed based on the inference result, and the obtained super-resolution result is used in the application scenario.
2. The method according to claim 1, characterized in that Before preprocessing the collected image data corresponding to the application scenario, the method further includes: Image data of the object to be photographed in the application scene is collected.
3. The method according to claim 2, characterized in that The collecting of image data of the object to be photographed in the application scene includes: Partitioning the object to be photographed to obtain a plurality of partitions; For different partitions, the image to be identified of the partition is obtained based on a static stable frame method; Determining the clarity of the image to be identified based on edge information; The image data of the clear image to be recognized in each partition is determined as the image data of the object to be photographed.
4. The method according to claim 3, characterized in that The method based on static stable frames to obtain the image to be identified in the partition includes: Continuously capture n frames of images; Between adjacent frames, determine the change of pixels at corresponding positions between the i-1th frame and the i-th frame, and the change value is recorded as the difference between the i-th adjacent frames; the value of i is [1, n]; Calculating the average absolute value of each adjacent frame difference; In order from low to high, the average absolute value of each adjacent frame difference is compared with the static stable frame threshold, starting from the average absolute value of the i-th adjacent frame difference. If the average absolute value of all subsequent adjacent frame differences is less than the static stable frame threshold, the i-th frame image is selected as the image to be identified.
5. The method according to claim 3, characterized in that: The determining the clarity of the image to be identified based on edge information includes: For different partitions, based on the grayscale image of the image to be identified corresponding to the partition and the pixel position in the edge information of the partition, determine the average clarity of all edge positions in the partition; If the average clarity is not less than a preset threshold, the image to be identified in the partition is determined to be clear; otherwise, the image to be identified in the partition is determined to be blurred and needs to be re-captured.
6. The method according to claim 3, characterized in that The preprocessing of the collected image data corresponding to the application scenario includes: Based on the position information of different partitions and the DPI information of the number of pixels per inch in the length of the image to be identified corresponding to the partition, the images to be identified of each partition are spliced into a whole image; Based on the requirements of the large model deployed in the cloud for the input image size, the entire image is cropped to obtain a number of cropped small images; accordingly, The uploading of the pre-processed image data to the cloud comprises: The plurality of cropped small images and location information corresponding to the small images are sent to the cloud.
7. The method according to claim 6, characterized in that The large model deployed on the cloud side cuts the entire image according to the input image size requirement, including: Based on the maximum number of images for a single inference supported by the large model deployed in the cloud, the size of the entire image, and the input image size supported by the large model, the entire image is cropped using a window cropping method.
8. The method according to claim 6, characterized in that In the process of performing reasoning processing on the preprocessed image data, the method further comprises: For the overlapping areas between small images during the reasoning process, a voting mechanism is used to obtain the predicted classification probability of the pixel position corresponding to the overlapping area.
9. An image processing device, characterized in that: include: A processing unit, used for preprocessing the collected image data corresponding to the application scenario; Performing inference processing on the preprocessed image data based on a large model corresponding to the application scenario deployed in the cloud to obtain an inference result; Performing super-resolution processing based on the inference result, and using the obtained super-resolution result in the application scenario; The communication unit is used to upload the pre-processed image data to the cloud.
10. An image processing device, characterized in that: include: a first communication interface and a first processor; wherein, The first processor is used to pre-process the collected image data corresponding to the application scenario; perform inference processing on the pre-processed image data based on a large model corresponding to the application scenario deployed in the cloud to obtain an inference result; perform super-resolution processing based on the inference result, and use the obtained super-resolution result for the application scenario; The first communication interface is used to upload the preprocessed image data to the cloud.
11. An image processing device, characterized in that: include: a first processor and a first memory for storing a computer program executable on the processor, Wherein, when the first processor is used to run the computer program, the steps of the method described in any one of claims 1 to 8 are executed.
12. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
