Microcosmic coding code pattern continuous acquisition method, device and equipment and storage medium
By using a code image classification model to identify and classify real-time image sequences, and by employing top-hat transformation and multilayer perceptron classifier, the problem of recognizing micro-coded codes in complex backgrounds is solved, achieving efficient and automatic micro-coded acquisition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MINDU INNOVATION LAB
- Filing Date
- 2026-01-26
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies struggle to quickly and accurately identify and filter micro-coded images in large-scale, continuous acquisition scenarios, especially in complex backgrounds where noise interference is severe, leading to low acquisition efficiency.
A code image classification model is used to identify and classify real-time image sequences. The contrast is enhanced by top-hat transformation, the proportion of high-frequency energy is calculated, and a multilayer perceptron classifier is used to achieve accurate discrimination. The micro-coded code images are then filtered and saved.
It enables automatic, real-time, and accurate identification of micro-coded images in continuous acquisition scenarios, significantly improving acquisition efficiency and automation level, and overcoming interference problems in complex backgrounds.
Smart Images

Figure CN122065864A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, device and storage medium for continuous acquisition of micro-coded image data. Background Technology
[0002] Micro-coded codes are microscopic patterns composed of irregular dots, bars, or shapes. They are increasingly used in areas such as product traceability and anti-counterfeiting, and their level of sophistication surpasses that of common QR codes. Before products bearing micro-coded codes are loaded onto trucks for sale, these codes need to be scanned to collect product information.
[0003] However, in actual data acquisition, due to the small size, irregular shape, and low contrast with the background of the encoded data, it is difficult for operators to quickly and accurately locate the encoded area from complex product packaging or label images. Furthermore, during dynamic scanning, the acquisition equipment is susceptible to noise interference from surrounding patterns, text, background textures, and motion blur caused by shaking, resulting in a large amount of non-target information in the acquired images. Therefore, existing technologies are ill-suited for large-scale, continuous data acquisition scenarios.
[0004] Therefore, in the continuous and dynamic acquisition process, how to achieve real-time, automatic, and accurate filtering of noise images and reliably retain microscopic coded images has become a key issue in improving acquisition efficiency and system practicality. Summary of the Invention
[0005] To address the aforementioned problems in the prior art, this application provides a method, apparatus, device, and storage medium for continuous acquisition of micro-coded images, which enables automatic, real-time, and accurate identification and retention of micro-coded images during continuous acquisition.
[0006] To achieve the above objectives, the technical solution adopted in this application is as follows: Firstly, this application provides a method for continuous acquisition of micro-coded code images, including: Acquire real-time image sequences; Each real-time image frame in the image sequence is input into a code image classification model for recognition and classification, and the image classification result of each real-time image frame is obtained. Filter and save real-time images whose image classification results are micro-coded code maps.
[0007] The beneficial effects of this application are as follows: by acquiring real-time image sequences, the real-time images are identified and classified by a code image classification model to filter and save micro-coded code images, thereby realizing real-time and automatic filtering of noisy images in continuous acquisition scenarios, significantly improving the efficiency and automation level of micro-coded acquisition, and realizing automatic, real-time and accurate identification and retention of micro-coded code images during continuous acquisition.
[0008] Optionally, the process by which the code-image classification model identifies and classifies each real-time image frame includes: The real-time image is subjected to a top-hat transformation to obtain the corresponding top-hat image; Calculate the proportion of high-frequency energy in the top-hat image in the frequency domain to generate a feature vector characterizing the image structure; The feature vector is input into a pre-trained multilayer perceptron classifier, which then determines whether the real-time image is a micro-coded image based on the feature vector.
[0009] As described above, the top-hat transformation effectively enhances the contrast between the tiny coded elements and the background. Then, frequency domain analysis is used to extract high-frequency features that are sensitive to texture differences. Finally, a multilayer perceptron classifier achieves accurate discrimination, enabling the code image classification model to stably identify the weak micro-coded features from complex backgrounds. At the same time, it ensures processing speed, meets real-time requirements, and overcomes the shortcomings of traditional image processing methods, such as poor generalization ability and difficulty in dealing with complex interference.
[0010] Optionally, the top-hat transformation processing of the real-time image includes: Convert the real-time image into a grayscale image; The grayscale image is binarized to obtain a binarized image; A morphological top-hat opening operation is performed on the binarized image to obtain the top-hat image.
[0011] Optionally, calculating the high-frequency energy proportion of the top-hat diagram in the frequency domain includes: Perform a Fourier transform on the top-hat diagram to obtain the corresponding spectrum diagram and calculate the total spectral energy; Based on the preset frequency domain radius, a low-frequency energy region is determined in the spectrum diagram, and the energy value within the low-frequency energy region is calculated as the low-frequency energy. The high-frequency energy is calculated based on the difference between the total spectral energy and the low-frequency energy, and the proportion of the high-frequency energy to the total spectral energy is calculated to obtain the high-frequency energy percentage.
[0012] As described above, by calculating the proportion of high-frequency energy to total energy, the structural information of the image is transformed into a normalized scalar feature. This makes the feature representation more robust, reduces interference caused by changes in absolute brightness or contrast of the image, ensures the stability and discriminative power of the feature vector, and forms the basis for the subsequent classifier to achieve high-accuracy classification. This also enhances the adaptability of the entire system under different imaging conditions.
[0013] Optionally, the formula for the morphological cap opening operation is: TopHat(I) = I - (I S); In the formula, I is the binarized image, and S is the structuring element matrix. This is the opening operator.
[0014] Optionally, the formula for calculating the frequency domain radius R is: R=W / D max ; In the formula, W is the image width of the real-time image, and D... max The feature size of the top cap image is given.
[0015] Optionally, the multilayer perceptron classifier is trained using a training dataset containing labeled micro-coded code map samples and non-micro-coded code map samples.
[0016] Secondly, this application provides a microscopic coded image continuous acquisition device, comprising: The image acquisition module is used to acquire real-time image sequences; The classification processing module is used to input each real-time image frame in the image sequence into a code image classification model for recognition and classification, and obtain the image classification result of each real-time image frame. The filtering output module is used to filter and save real-time images whose image classification results are micro-coded images.
[0017] Thirdly, this application provides a computer device, including: one or more processors, and a memory; The memory stores computer-readable instructions that, when executed by the one or more processors, perform the steps of the method as described in the first aspect.
[0018] Fourthly, this application provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the method described in the first aspect.
[0019] The technical effects of the micro-coded image continuous acquisition device provided in the second aspect, the computer device provided in the third aspect, and the storage medium provided in the fourth aspect are described in the relevant description of the micro-coded image continuous acquisition method provided in the first aspect. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the main process of the micro-encoded code image continuous acquisition method according to an embodiment of this application; Figure 2 This is a schematic diagram of image samples involved in the embodiments of this application; Figure 3 This is a schematic diagram of a micro-coded code image sample involved in an embodiment of this application; Figure 4 This is a schematic diagram of a non-microscopic coded code image sample involved in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of the micro-encoded code map continuous acquisition device according to an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a computer device according to an embodiment of this application. Detailed Implementation
[0021] To better understand the above technical solutions, exemplary embodiments of this application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application can be understood more clearly and thoroughly, and that the scope of this application can be fully conveyed to those skilled in the art.
[0022] The embodiments of this application are applied to scenarios related to the acquisition and recognition of micro-coded code images, and are particularly suitable for large-scale, continuous micro-coded code image acquisition scenarios. Existing technologies, when performing dynamic recognition through manual identification or acquisition equipment, are difficult to adapt to large-scale, continuous acquisition scenarios.
[0023] Therefore, in various embodiments of this application, a real-time image sequence is acquired; each frame of the real-time image in the image sequence is input into a code image classification model for recognition and classification to obtain the image classification result of each frame of the real-time image; the image classification result is filtered and saved as a real-time image of a micro-coded code image. This achieves real-time and automatic filtering of noise images in continuous acquisition scenarios, significantly improving the efficiency and automation level of micro-coded acquisition, and realizing automatic, real-time, and accurate identification and retention of micro-coded code images during continuous acquisition.
[0024] The present application will now be described in further detail with reference to the accompanying drawings and embodiments.
[0025] This application provides a method for continuous acquisition of micro-coded code images, such as... Figure 1 As shown, the method includes: Step S100: Obtain the real-time acquired image sequence.
[0026] In step S100, the image acquisition module can be a camera on a data acquisition device capable of operating a code image classification model, such as a mobile phone, handheld terminal, or barcode scanner. At this time, the camera continuously acquires multiple real-time images at a preset frequency, forming an image sequence.
[0027] Step S200: Input each real-time image frame in the image sequence into a code image classification model for recognition and classification, and obtain the image classification result of each real-time image frame.
[0028] The multilayer perceptron classifier is trained using a training dataset that includes labeled micro-coded code map samples and non-micro-coded code map samples.
[0029] Specifically, the training process of the code-image classification model is as follows: First, by embedding a sample collection program into the data acquisition device, data samples can be continuously collected during the device's daily operation. This means saving the images scanned during the device's operation. This process may involve collecting barcode images from labels, product elements around the labels, and motion blur caused by movement during the acquisition process, resulting in images such as... Figure 2 The image sample shown.
[0030] Then, the image samples were manually classified. The image samples contained microscopic coded images as well as some noise images that needed to be filtered out. Therefore, the collected images were divided into two categories: one category included... Figure 3 The micro-coded code diagrams shown are of one type, such as... Figure 4 The non-microscopic coding diagram is shown.
[0031] Next, the classified image samples are imported into a pre-established model architecture for training. The structural feature descriptors of the sample data are converted into training data, which includes structural feature descriptor data `trainData` and the category to which the data belongs, `trainLabel`. In this embodiment, only two categories need to be distinguished: micro-coded code images and non-micro-coded code images. Therefore, only two categories are needed for differentiation. Based on the image samples that have been manually sorted previously, classification can be performed in this step according to the order of the sample set. After all sample data has been calculated and transformed, it can be imported into the MLP (Multilayer Perceptron) neural network built into OpenCV, and a reference instance `cv::Ptr` is created.<cv::ml::ANN_MLP> MLP. At this point, it is necessary to set up the neural network structure. Since the image structural features calculated in this application are 32-bit, the input layer is 32-bit and the final output layer is 2-bit, representing the two categories of results.
[0032] The following is the relevant code for training: / / Structural feature descriptor std::vector <float>final_features; / / Training data cv::Mat trainData(1,(int)final_features.size(),CV_32F); std::memcpy(trainData.data,final_features.data(),final_features.size() sizeof(float)); / / The number of categories is 2: 0: micro-coded code map, 1: non-micro-coded code map. cv::Mat trainLabel=cv::Mat::zeros(1,2,CV_32F); if(classId==0){ trainLabel.at <float>(0,0)=1.0f; }else{ trainLabel.at <float>(0,1)=0.0f; } / / Integrate all sample training data cv::Mat trainDataAll(0,32,CV_32F); cv::Mat trainLabelAll(0,2,CV_32F); trainDataAll.push_back(trainData); trainLabelAll.push_back(trainLabel); / / Create MLP object cv::Ptr<cv::ml::ANN_MLP> mlp=cv::ml::ANN_MLP::create(); / / Set up the network structure: Input layer (32) -> Hidden layer (16) -> Output layer (2) cv::Mat layersizes=(cv::Mat_ <int>(1,3)<<32,16,2); mlp->setLayersizes(layersizes); / / Set activation function and training method mlp->setActivationFunction(cv::ml::ANN_MLP::SIGMOID_SYM); mlp->setTrainMethod(cv::ml::ANN_MLP::BACKPROP,0.001,0.1); mlp->setTermCriteria(cv::TermCriteria(cv::TermCriteria::MAX_ITER+ cv::TermCriteria::EPS,10000,0.0001)); / / Package training data and train cv::Ptr <cv::ml::traindata>tData=cv::ml::TrainData::create(trainDataAll, cv::ml::ROW_SAMPLE,trainLabelAll); mlp->train(tData); mlp->save("mlp_classifier.xml").
[0033] Finally, the trained code image classification model is deployed to the acquisition device.
[0034] Step S300: Filter and save real-time images whose image classification results are micro-coded images.
[0035] Specifically, on the acquisition device running the code image classification model, each real-time image in the image sequence acquired by the camera needs to be classified. If the classification result is 0, it means that the real-time image has a high probability of being a micro-coded image, and the image can proceed to the next acquisition step. Conversely, if the classification result is 0, it means that the real-time image does not have the characteristics of a micro-coded image and can be filtered out as a valid image, thereby improving the efficiency of micro-coded image acquisition on the production line.
[0036] The following is the relevant code for running the model: cv::Ptr<cv::ml::ANN_MLP> loaded_mlp=cv::ml::StatModel::load<cv::ml::ANN_MLP> ("mlp_classifier.xml"); / / The inputMat here also needs to be converted into a structural feature descriptor. cv::Mat inputMat; / / Execute the code image classification model to perform classification operations. cv::Mat result; loaded_mlp->predict(inputMat,result); cv::Point maxLoc; double maxval) / / minMaxLoc finds the position of the maximum value in the output Mat. cv::minMaxLoc(result,0,&maxval,0,&maxLoc); / / The column index containing the maximum value is the predicted category. int predictedClass = maxLoc.x; if(predictedClass==0){ / / Micro-coded image }else if(predictedClass!=0){ / / Non-microscopic encoded images }
[0037] In one embodiment, the process of the code-image classification model identifying and classifying each frame of real-time image includes: Step S201: Perform top-hat transformation on the real-time image to obtain the corresponding top-hat image.
[0038] The process of performing top-hat transformation on the real-time image includes: Convert a real-time image to a grayscale image.
[0039] Binarize the grayscale image to obtain a binary image.
[0040] Perform a morphological top-hat opening operation on the binarized image to obtain the top-hat image.
[0041] The formula for the morphological cap opening operation is as follows: TopHat(I) = I - (I S); In the formula, I is the binarized image, and S is the structuring element matrix. This is the opening operator.
[0042] Specifically, since the micro-coded elements in the micro-coded image are similar to the burrs and jagged edges in the binarized image, they can be regarded as a characteristic of the image. Therefore, this application uses the top-hat transform formula to first erode and then dilate to highlight the tiny coded elements in the original image, which is more conducive to extraction.
[0043] Meanwhile, the elements of the micro-coded code map are all small-volume units, so the volume of the element matrix here can be calculated by gradient equalization after contour detection. The original image is then processed using cv::morphologyEx. Figure 2 The valued image is converted into a tophat image (tophat_res), which distinguishes the raised elements from the background in the original image.
[0044] The following is the relevant code for the top-hat transformation: / / Real-time image std::vector <cv::mat>sampleImgs; for(const auto&img: sampleImgs){ / / Convert to grayscale image cv::Mat gray; cv::cvtColor(img,gray,cv::COLOR_BGR2GRAY); / / Binarization cv::Mat binary; cv::threshold(gray,binary,0,255,cv::THRESH_BINARY|cv::THRESH_OTSU); / / Structuring element size cv::Mat kernel=cv::getStructuringElement(cv::MORPH_RECT,cv::Size(5,5)); / / Top hat opening operation cv::Mat tophat_res; cv::morphologyEx(binary,tophat_res,cv::MORPH_TOPHAT,kernel); }
[0045] Step S202: Calculate the proportion of high-frequency energy in the top-hat image in the frequency domain to generate feature vectors representing the image structure.
[0046] The calculation of the high-frequency energy proportion of the top-hat diagram in the frequency domain includes: Perform a Fourier transform on the top-hat diagram to obtain the corresponding spectrum and calculate the total spectral energy.
[0047] Based on the preset frequency domain radius, the low-frequency energy region is determined in the spectrum diagram, and the energy value within the low-frequency energy region is calculated as the low-frequency energy.
[0048] The high-frequency energy is calculated based on the difference between the total spectral energy and the low-frequency energy, and the proportion of high-frequency energy to the total spectral energy is calculated to obtain the high-frequency energy percentage.
[0049] Specifically, the input layer of an MLP neural network requires one-dimensional and fixed-length feature vector data. Therefore, this application first performs a Fourier transform on the image, then extracts the Fourier transform result, calculates the amplitude spectrum of the real-time image, and then calculates the proportion of the high-frequency part of the energy at the center of the amplitude spectrum, thereby obtaining a structural feature descriptor, including: (1) Calculate the total energy of the Fourier spectrum The top-hat image is subjected to Fourier transform using cv::dft, and then cv::magnitude is used to obtain the spectrum of image structure changes. The diffusion arrangement from zero frequency to high frequency is distinguished by spectrum centering. The sum of all pixel values in the spectrum is calculated as the total energy.
[0050] (2) Calculate the energy proportion in the zero-frequency and low-frequency regions. The zero-frequency and low-frequency regions can be understood as the image background or elements that are not fine convex points. The formula for calculating the frequency domain radius R of the zero-frequency and low-frequency regions is: R=W / D max ; In the formula, W is the image width of the real-time image, and D... max The feature size of the top cap diagram.
[0051] In one example, the micro-encoding element is no less than 20 pixels, that is, the feature size of the top-hat image is 20. In this case, the image width is 512, and the spectral radius is R = 512 / 20 = 25.6 pixels.
[0052] Then, using this zero-frequency low-frequency radius, the proportion of zero-frequency low frequencies in the image is calculated using the following formula: lowFreqRadius = R / maximum radius; In the same example, lowFreqRadius = 25.6 / (512 / 2) = 0.1 = 10%, meaning that the 10% area around the center point of the spectrogram is the zero-frequency and low-frequency region. Create a circular mask region with the image center point as the center point and a radius equal to 10% of the image's side length, and calculate the sum of pixel values in the corresponding spectrogram region of the mask; this represents the low-frequency energy percentage. (3) Calculate the feature vector value. This application uses the proportion of high-frequency energy as the feature vector to characterize the image structure. That is, the more obvious the high-frequency region features in the image, the closer it is to the existence of micro-coding elements. The formula is: Eigenvalue = High-frequency energy / Total energy; High-frequency energy = Total energy - Low-frequency energy; Therefore, the top-hat feature vector of the real-time image is calculated and finally merged into one-dimensional floating-point data to provide to the multilayer perceptron classifier.
[0053] / / Scaling real-time images to the optimal Fourier transform size int m=cv::getOptimalDFTSize(tophat_res.rows); int n=cv::getOptimalDFTSize(tophat_res.cols); cv::Mat padded; cv::copyMakeBorder(tophat_res,padded,0,m-tophat_res.rows,0,n-tophat_res.cols, cv::BORDER_CONSTANT,cv::Scalar::all(0)); / / Dual-channel Fourier input, one channel for the real part and one channel for the imaginary part cv::Matplanes[]={cv::Mat_ <float>(padded),cv::Mat::zeros(padded.size(),CV_32F)}; cv::Mat complexI; cv::merge(planes,2,complexI); / / Fourier Transform cv::dft(complexI,2,complexI); / / Calculate the spectrum cv::split(complexI,planes); cv::Mat mag; cv::magnitude(planes[0],planes[1],mag); / / Spectrum Centralization int cx = mag.cols / 2; int cy = mag.rows / 2; cv::Mat q0(mag,cv::Rect(0,0,cx,cy)); cv::Mat q1(mag,cv::Rect(cx,0,cx,cy)); cv::Mat q2(mag,cv::Rect(0,cy,cx,cy)); cv::Mat q3(mag,cv::Rect(cx,cy,cx,cy)); cv::Mat tmp; q0.copyTo(tmp);q3.copyTo(q0);tmp.copyTo(q3); q1.copyTo(tmp);q2.copyTo(q1);tmp.copyTo(q2); / / Calculate total energy float totalEnergy=(float)cv::sum(mag)[0]; if(totalEnergy==0)return 0.0f; / / Construct a mask for the zero-frequency and low-frequency regions cv::Mat lowFreqMask=cv::Mat::zeros(mag.size(),CV_8U); int radius=static_cast <int>(std::min(cx,cy) lowFreqRadiusRatio); cv::circle(lowFreqMask,cv::Point(cx,cy),radius,cv::Scalar(255),-1); / / Calculate low-frequency energy cv::Scalar lowFreqEnergyScalar=cv::mean(mag,lowFreqMask)
[0054] cv::countNonZero(lowFreqMask); float lowFreqEnergy=(float)lowFreqEnergyScalar[0]; / / Calculate the proportion of high frequency float highFreqEnergy=totalEnergy-lowFreqEnergy; / / Feature vector float features=highFreqEnergy / totalEnergy; final_features.push_back(features).
[0055] Step S203: Input the feature vector into a pre-trained multilayer perceptron classifier, and the multilayer perceptron classifier determines whether the real-time image is a micro-coded image based on the feature vector.
[0056] In one embodiment, such as Figure 5 As shown, this application also provides a micro-coded image continuous acquisition device, including: Image acquisition module 501 is used to acquire real-time image sequences; The classification processing module 502 is used to input each frame of real-time image in the image sequence into a code image classification model for recognition and classification, and obtain the image classification result of each frame of real-time image. The filtering output module 503 is used to filter and save real-time images whose image classification results are micro-coded images.
[0057] In one embodiment, such as Figure 6 As shown, this application also provides a computer device 600, comprising: The communication interface 601 allows for information exchange with other devices or network nodes.
[0058] One or more processors 602 are connected to a communication interface 601 to enable information interaction with other devices or network nodes, and to execute the methods provided by one or more technical solutions in the above embodiments when running computer programs.
[0059] Memory 603 is used to store computer-readable instructions that can be executed on processor 602. When executed by one or more processors 602, the computer-readable instructions perform the steps of the software development method as described in the above embodiments.
[0060] The computer device 600 in this embodiment only shows a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. A specific computer device may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements, such as power supplies, input / output interfaces, etc. Furthermore, the computer device 600 of this embodiment can operate on an operating system stored in memory 603, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0061] In one embodiment, this application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the software development method as described in the above embodiments.
[0062] The computer-readable instructions in the aforementioned computer device 600 and storage medium may be application programs.
[0063] In addition, the specific descriptions of the technical effects and steps corresponding to the micro-coded image continuous acquisition device, the computer device 600, and the storage medium in the above embodiments are all based on the relevant descriptions of the embodiments in which the micro-coded image continuous acquisition method is located.
[0064] Since the systems / devices described in the above embodiments of this application are systems / devices used to implement the methods of the above embodiments of this application, those skilled in the art can understand the specific structure and modifications of the system / devices based on the methods described in the above embodiments of this application, and therefore will not be repeated here. All systems / devices used in the methods of the above embodiments of this application fall within the scope of protection of this application.
[0065] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0066] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions.
[0067] It should be noted that any reference numerals placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. This application can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In claims that enumerate several means, several of these means may be embodied by the same hardware. The use of the terms first, second, third, etc., is merely for convenience of expression and does not indicate any order. These terms can be understood as part of the component names.
[0068] Furthermore, it should be noted that in the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0069] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the claims should be interpreted to include the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0070] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if these modifications and variations fall within the scope of the claims of this application and their equivalents, then this application should also include these modifications and variations.< / int> < / float> < / cv::mat> < / cv::ml::traindata> < / int> < / float> < / float> < / float>
Claims
1. A method for continuous acquisition of micro-coded code images, characterized in that, include: Acquire real-time image sequences; Each real-time image frame in the image sequence is input into a code image classification model for recognition and classification, and the image classification result of each real-time image frame is obtained. Filter and save real-time images whose image classification results are micro-coded code maps.
2. The method according to claim 1, characterized in that, The code-image classification model performs the following process for recognizing and classifying each real-time image frame: The real-time image is subjected to a top-hat transformation to obtain the corresponding top-hat image; Calculate the proportion of high-frequency energy in the top-hat image in the frequency domain to generate a feature vector characterizing the image structure; The feature vector is input into a pre-trained multilayer perceptron classifier, which then determines whether the real-time image is a micro-coded image based on the feature vector.
3. The method according to claim 2, characterized in that, The top-hat transformation processing of the real-time image includes: Convert the real-time image into a grayscale image; The grayscale image is binarized to obtain a binarized image; A morphological top-hat opening operation is performed on the binarized image to obtain the top-hat image.
4. The method according to claim 2, characterized in that, The calculation of the high-frequency energy proportion of the top-hat diagram in the frequency domain includes: Perform a Fourier transform on the top-hat diagram to obtain the corresponding spectrum diagram and calculate the total spectral energy; Based on the preset frequency domain radius, a low-frequency energy region is determined in the spectrum diagram, and the energy value within the low-frequency energy region is calculated as the low-frequency energy. The high-frequency energy is calculated based on the difference between the total spectral energy and the low-frequency energy, and the proportion of the high-frequency energy to the total spectral energy is calculated to obtain the high-frequency energy percentage.
5. The method according to claim 3, characterized in that, The formula for the morphological cap opening operation is: TopHat(I)=I-(I S); In the formula, I is the binarized image, and S is the structuring element matrix. This is the opening operator.
6. The method according to claim 4, characterized in that, The formula for calculating the frequency domain radius R is: R=W / D max ; In the formula, W is the image width of the real-time image, and D... max The feature size of the top cap image is given.
7. The method according to any one of claims 1 to 6, characterized in that, The multilayer perceptron classifier is trained using a training dataset containing labeled micro-coded code image samples and non-micro-coded code image samples.
8. A micro-encoded code image continuous acquisition device, characterized in that, include: The image acquisition module is used to acquire real-time image sequences; The classification processing module is used to input each real-time image frame in the image sequence into a code image classification model for recognition and classification, and obtain the image classification result of each real-time image frame. The filtering output module is used to filter and save real-time images whose image classification results are micro-coded images.
9. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions that, when executed by the one or more processors, perform the steps of the method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the method as described in any one of claims 1 to 7.