Adaptation method, device and equipment for industrial camera template application and medium

By obtaining and adapting model combinations from the model library of industrial camera applications, and generating template applications suitable for specific scenarios, the problem that industrial camera applications in the prior art cannot effectively adapt to the combination of custom models and normal models is solved, and image processing efficiency is improved.

CN120032142AInactive Publication Date: 2025-05-23CHENGDU AJIAXI INTELLIGENT TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510497600.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-05-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing industrial camera applications cannot effectively adapt to the combination of custom models and regular models, resulting in inefficient image processing.

Method used

By obtaining a variety of model combinations from the model library of industrial camera applications, including custom models and regular models, adapting the target model combinations based on the current specific scenario, and generating template applications for industrial cameras.

Benefits of technology

Improve image processing efficiency, avoid the need to repeatedly implement business logic, and ensure that template applications are better adapted to specific scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120032142A_ABST
    Figure CN120032142A_ABST
Patent Text Reader

Abstract

The invention discloses an industrial camera template application adaptation method and device, equipment and a medium, relates to the technical field of artificial intelligence, and is used for solving the technical problem that the image processing efficiency is low due to the fact that an existing industrial camera application is not matched with a self-defined model and an adaptive model combination. The method comprises the following steps: acquiring a plurality of model combinations from a model library of an industrial camera application; wherein each model combination comprises at least one custom model and at least one conventional model; according to a current specific scene, a corresponding target model combination is obtained from the multiple model combinations in an adaptive mode; and generating the template application of the industrial camera according to the target model combination, so that compared with the existing industrial camera application, the generated template application is more adaptive to the specific scene, and when image processing is performed based on the template application, the image processing efficiency can be greatly improved by shortening the processing time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology and provides an adaptation method, device, equipment and medium for an industrial camera template application. Background Art

[0002] As we all know, industrial cameras need to run corresponding applications to complete various related processing, and the processing process involves six independent scenarios: positioning, segmentation, positive samples, target detection, optical character recognition (OCR) recognition, and classification. Obviously, the usage scenarios involved are limited. However, for some case scenarios, it is necessary to use a custom visual big model. At the same time, the visual big model will also be combined with other conventional models. For example, for a custom visual big model used to locate the defect position, it is necessary to combine the result map after the visual big model is inferred with the segmentation model to obtain the final detection result.

[0003] Therefore, existing industrial camera applications have the following problems: (1) The application can only run conventional models, but the actual application scenario requires the use of custom models; (2) Since the actual scenario requires the use of a combination of custom models and conventional models, and the custom model is different from the conventional model in that the parameters are clear, the business implementation is fixed, and the code structure is unified, it is necessary to ensure that the parameters of the business implementation entry function are unified, and the internal implementation needs to be changed according to the business scenario; (3) In the application, if there are multiple custom models combined with conventional models, the code needs to be re-implemented. In addition, each time a custom model is added, the business code in the main function needs to be modified to adapt. In addition, it needs to be rebuilt, compiled, packaged, and deployed to the industrial camera before it can be used normally. This is very time-consuming and greatly reduces the efficiency of image processing. Summary of the invention

[0004] The present application provides an adaptation method, device, equipment and medium for an industrial camera template application, which is used to solve the technical problem of low image processing efficiency caused by the incompatibility of existing industrial camera applications with a combination of custom models and adaptive models.

[0005] On the one hand, a method for adapting an industrial camera template application is provided, the method comprising: Obtain multiple model combinations from a model library of industrial camera applications; wherein each model combination includes at least one custom model and at least one conventional model; the custom model is obtained based on training for a specific scenario; the conventional model includes a positioning model, a segmentation model, a positive sample model, a target detection model, and an optical character recognition (OCR) model; According to the current specific scenario, adapt a corresponding target model combination from the multiple model combinations; A template application for the industrial camera is generated according to the target model combination.

[0006] Optionally, before acquiring multiple model combinations from a model library of industrial camera applications, the method further includes: Create a config configuration file directory, an external-aic custom model code directory, a model model file directory, and a src application main code directory in the code of the industrial camera application.

[0007] Optionally, the config configuration file directory includes an algorithm.config algorithm parameter configuration file, a camera.config camera parameter configuration file, a custom.config custom parameter configuration file, and a model.config model-related configuration file.

[0008] Optionally, the external-aic custom model code directory includes multiple custom_code.cpp custom model codes; wherein one custom_code.cpp custom model code corresponds to one custom model.

[0009] Optionally, the src application main code directory includes model_abn.cpp positive sample model loading and reasoning main code, model_cla.cpp classification model loading and reasoning main code, model_det.cpp target detection model loading and reasoning main code, model_loc.cpp positioning model loading and reasoning main code, model_seg.cpp segmentation model loading and reasoning main code, model_custom.cpp custom model loading and reasoning main code, service_abn.cpp positive sample pre- and post-processing main code, service_cla.cpp classification pre- and post-processing main code, service_det.cpp target detection pre- and post-processing main code, service_loc.cpp positioning pre- and post-processing main code, service_seg.cpp segmentation pre- and post-processing main code, service_custom.cpp custom pre- and post-processing main code, and service_ocr.cpp optical character recognition OCR pre- and post-processing main code.

[0010] Optionally, after generating the template application of the industrial camera according to the target model combination, the method further includes: Deploy the template application to the industrial camera with one click; Starting the template application deployed in the industrial camera; The target model combination in the template application is used to perform image processing to obtain a final result image; wherein the image processing includes target positioning, image segmentation, target detection, target classification and OCR.

[0011] Optionally, if the target model combination includes a custom model and a segmentation model, the step of using the target model combination in the template application to perform image processing to obtain a final result image includes: Loading a model, reading the target model combination in the template application; Sending the collected image acquired by the industrial camera into the custom model of the target model combination; The custom model is used to perform pre-processing, reasoning and post-processing on the collected image in sequence to obtain an original result image corresponding to the collected image; Sending the original result image to the segmentation model in the target model combination to perform image segmentation to obtain a segmented result image; According to the clipping coordinates obtained when the collected image is output, the segmented result image is placed back to the corresponding position in the collected image to obtain a final result image.

[0012] On the one hand, an adaptation device for industrial camera template application is provided, the device comprising: A model combination acquisition unit, used to acquire multiple model combinations from a model library of industrial camera applications; wherein each model combination includes at least one custom model and at least one conventional model; the custom model is obtained based on training for a specific scenario; the conventional model includes a positioning model, a segmentation model, a positive sample model, a target detection model, and an optical character recognition (OCR) model; A model combination matching unit, used for matching a corresponding target model combination from the plurality of model combinations according to a current specific scenario; A template application generating unit is used to generate a template application for the industrial camera according to the target model combination.

[0013] On the one hand, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein any one of the above methods is implemented when the processor executes the computer program.

[0014] In one aspect, a storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, any of the above methods is implemented.

[0015] Compared with the prior art, the beneficial effects of this application are: In the present application, when obtaining a template application for an industrial camera, first, a plurality of model combinations can be obtained from the model library of the industrial camera application; wherein each model combination includes at least one custom model and at least one regular model; the custom model is obtained based on training for a specific scenario; the regular model includes a positioning model, a segmentation model, a positive sample model, a target detection model, and an optical character recognition (OCR) model; then, the corresponding target model combination can be adapted from the plurality of model combinations according to the current specific scenario; finally, the template application for the industrial camera can be generated according to the target model combination.

[0016] It can be seen that in this application, since the corresponding target model combination can be adapted from a variety of model combinations according to the current specific scene, and the template application of the industrial camera can be generated according to the target model combination; compared with the existing industrial camera application, the template application generated by this application is more adapted to the specific scene, and then, when performing image processing based on the template application, the image processing efficiency can be greatly improved by shortening the processing time. In addition, since the template application is based on the target model combination, the template application is unique, avoiding the need to write the same business logic multiple times in different code locations, that is, the method described in this application does not need to repeatedly implement the business logic during specific implementation, thereby further improving processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0018] Figure 1 An electronic device provided in an embodiment of the present application; Figure 2 A schematic diagram of an adaptation method for an industrial camera template application provided in an embodiment of the present application; Figure 3 A schematic diagram of a target model combination provided in an embodiment of the present application; Figure 4 A schematic diagram of image processing using a template application provided in an embodiment of the present application; Figure 5 A schematic diagram of the final result diagram provided in the embodiment of the present application; Figure 6 A schematic diagram of an adaptation device for an industrial camera template application provided in an embodiment of the present application.

[0019] Markings in the figure: 10 - adaptation device for industrial camera template application, 101 - processor, 102 - memory, 103 - I / O interface, 104 - database, 60 - adaptation device for industrial camera template application, 601 - model combination acquisition unit, 602 - model combination matching unit, 603 - template application generation unit, 604 - programming unit, 605 - image processing unit. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other arbitrarily. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0021] As we all know, industrial cameras need to run corresponding applications to complete various related processing, and the processing process involves six independent scenarios: positioning, segmentation, positive samples, target detection, OCR recognition, and classification. Obviously, the usage scenarios involved are limited. However, for some case scenarios, it is necessary to use a custom visual big model. At the same time, the visual big model will also be combined with other conventional models. For example, for a custom visual big model used to locate the defect position, it is necessary to combine the result map after the visual big model is inferred with the segmentation model to obtain the final detection result.

[0022] Therefore, existing industrial camera applications have the following problems: (1) The application can only run conventional models, but the actual application scenario requires the use of custom models; (2) Since the actual scenario requires the use of a combination of custom models and conventional models, and the custom model is different from the conventional model in that the parameters are clear, the business implementation is fixed, and the code structure is unified, it is necessary to ensure that the parameters of the business implementation entry function are unified, and the internal implementation needs to be changed according to the business scenario; (3) In the application, if there are multiple custom models combined with conventional models, the code needs to be re-implemented. In addition, each time a custom model is added, the business code in the main function needs to be modified to adapt. In addition, it needs to be rebuilt, compiled, packaged, and deployed to the industrial camera before it can be used normally. This is very time-consuming and greatly reduces the efficiency of image processing.

[0023] Based on this, an embodiment of the present application provides an adaptation method for an industrial camera template application. In the method, first, a plurality of model combinations can be obtained from a model library of the industrial camera application; wherein each model combination includes at least one custom model and at least one conventional model; the custom model is obtained based on training for a specific scenario; the conventional model includes a positioning model, a segmentation model, a positive sample model, a target detection model, and an optical character recognition (OCR) model; then, the corresponding target model combination can be adapted from the plurality of model combinations according to the current specific scenario; finally, the template application for the industrial camera can be generated according to the target model combination.

[0024] It can be seen that in this application, since the corresponding target model combination can be adapted from a variety of model combinations according to the current specific scene, and the template application of the industrial camera can be generated according to the target model combination; compared with the existing industrial camera application, the template application generated by this application is more adapted to the specific scene, and then, when performing image processing based on the template application, the image processing efficiency can be greatly improved by shortening the processing time. In addition, since the template application is based on the target model combination, the template application is unique, avoiding the need to write the same business logic multiple times in different code locations, that is, the method described in this application does not need to repeatedly implement the business logic during specific implementation, thereby further improving processing efficiency.

[0025] After introducing the design ideas of the embodiments of the present application, the following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In the specific implementation process, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.

[0026] like Figure 1 As shown, an electronic device provided in an embodiment of the present application is provided, and the electronic device may specifically be an adapter device 10 for industrial camera template application.

[0027] Among them, the adaptation device 10 for the template application of the industrial camera can adapt the template application to the industrial camera, for example, it can be a personal computer (PC), a server and a laptop. The adaptation device 10 for the template application of the industrial camera may include one or more processors 101, a memory 102, an I / O interface 103 and a database 104. Specifically, the processor 101 may be a central processing unit (CPU) or a digital processing unit, etc. The memory 102 may be a volatile memory, such as a random-access memory (RAM); the memory 102 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 102 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 102 may be a combination of the above memories. The memory 102 may store some program instructions of the adaptation method of the industrial camera template application provided in the embodiment of the present application. When these program instructions are executed by the processor 101, they can be used to implement the steps of the adaptation method of the industrial camera template application provided in the embodiment of the present application to solve the technical problem of low image processing efficiency caused by the incompatibility of the existing industrial camera application with the custom model and the adaptive model combination. The database 104 can be used to store data such as the target model combination, template application, config configuration file directory, external-aic custom model code directory, model model file directory, and src application main code directory involved in the solution provided in the embodiment of the present application.

[0028] In the embodiment of the present application, the adaptation device 10 of the industrial camera template application can obtain the template application adaptation instruction through the I / O interface 103, and then the processor 101 of the adaptation device 10 of the industrial camera template application will solve the technical problem of low image processing efficiency caused by the incompatibility of the existing industrial camera application with the custom model and the adaptive model combination according to the code instructions of the adaptation method of the industrial camera template application provided in the embodiment of the present application in the memory 102. In addition, data such as the target model combination, template application, config configuration file directory, external-aic custom model code directory, model model file directory and src application main code directory can also be stored in the database 104.

[0029] Of course, the method provided in the embodiment of the present application is not limited to Figure 1 The application scenarios shown can also be used in other possible application scenarios, and the embodiments of the present application are not limited thereto. Figure 1 The functions that can be realized by each device in the application scenario shown will be described in the subsequent method embodiments, and will not be described in detail here. Below, the method of the embodiment of the present application will be introduced in conjunction with the accompanying drawings.

[0030] like Figure 2 FIG. 1 is a schematic diagram of an adaptation method for an industrial camera template application provided in an embodiment of the present application. The method can be performed by Figure 1 The method is executed by the adaptation device 10 of the industrial camera template application. Specifically, the process of the method is described as follows.

[0031] Step 201: Acquire multiple model combinations from a model library of industrial camera applications.

[0032] In an embodiment of the present application, each model combination includes at least one custom model and at least one regular model, and a model combination has a model ID; the custom model is trained based on a specific scenario; the regular model includes a positioning model, a segmentation model, a positive sample model, a target detection model and an optical character recognition (OCR) model.

[0033] In practical applications, in order to enable the generated template application to adapt to various specific scenarios, in the embodiment of the present application, before obtaining multiple model combinations from the model library of the industrial camera application, it is necessary to reprogram the application of the industrial camera. In the embodiment of the present application, the specific program structure is as follows: svapp / |—config#Configuration file directory ||—algorithm.config#Algorithm parameter configuration file ||—camera.config#Camera parameter configuration file ||—custom.config#Custom parameter configuration file, such as whether to enable logging, which can be used after modification without recompiling | | —model.config#Model related configuration files |—imgs#static image directory |—external-aic#Custom model code directory ||—custom_code0.cpp#Implementation of custom model 1 | | —custom_code1.cpp#Implementation of custom model 1 |—lib#third-party library directory |—manager.sh#Application startup script |—model#Model file directory ||—custom_V1_0 || | —custom_model_name.bin.aidem#Custom model file |—segment_V1_0 | —segment_model_name.bin.aidem#Segmentation model file |—release.txt#Application description file |—src#Application main code directory ||—cmakelists.txt#cmake compile file ||—app_main.cpp#Application main code ||—app_main.hpp#Application main code header file ||—common_utils.cpp#Application tool class ||—model_abn.cpp#Original sample model loading reasoning main code ||—model_cla.cpp#Classification model loading reasoning main code ||—model_det.cpp#Target detection model loading reasoning main code ||—model_loc.cpp#Location model loading inference main code ||—model_seg.cpp#Segmentation model loading reasoning main code ||—model_custom.cpp#Custom model loading inference main code ||—service_abn.cpp#Main code for positive sample pre- and post-processing ||—service_cla.cpp#Main code for pre- and post-segmentation processing ||—service_det.cpp#Main code for target detection pre- and post-processing ||—service_loc.cpp#Main code for pre- and post-positioning processing ||—service_seg.cpp#Main code for pre- and post-segmentation processing ||—service_custom.cpp#Main code for implementing custom model pre- and post-processing | | —service_ocr.cpp#Main code for implementing OCR pre- and post-processing | —svapp#executable program file That is, you need to create a config configuration file directory, an external-aic custom model code directory, a model model file directory, and a src application main code directory in the code of the industrial camera application.

[0034] As shown in the above program structure, the config configuration file directory includes the algorithm.config algorithm parameter configuration file, camera.config camera parameter configuration file, custom.config custom parameter configuration file (for example, whether to enable logging, which can be used after modification without compilation) and model.config model-related configuration file. Among them, the algorithm.config algorithm parameter configuration file can be automatically updated after the threshold is modified, and the model.config model-related configuration file can be automatically updated after the model is updated.

[0035] As shown in the above program structure, the external-aic custom model code directory includes multiple custom_code.cpp custom model codes, where one custom_code.cpp custom model code corresponds to one custom model. That is, if you need to customize a new custom model, you can directly add the custom_code.cpp custom model code corresponding to the custom model in the external-aic custom model code directory.

[0036] In actual applications, the naming format of the custom model code file name custom_code.cpp can be custom_code+<mode_id> +.cpp. model_id indicates the value of id in config / model.config.

[0037] In addition, the custom_code0_preProcessImage method can be used as the entry method, and then the preProcessImages in the file can be called to enter the image processing logic. The handle_image method can also be used as the main image processing function to return the result_img obtained by the inference processing to the main function.

[0038] As shown in the above program structure, the src application main code directory includes model_abn.cpp positive sample model loading and reasoning main code, model_cla.cpp classification model loading and reasoning main code, model_det.cpp target detection model loading and reasoning main code, model_loc.cpp positioning model loading and reasoning main code, model_seg.cpp segmentation model loading and reasoning main code, model_custom.cpp custom model loading and reasoning main code, service_abn.cpp positive sample pre- and post-processing main code, service_cla.cpp classification pre- and post-processing main code, service_det.cpp target detection pre- and post-processing main code, service_loc.cpp positioning pre- and post-processing main code, service_seg.cpp segmentation pre- and post-processing main code, service_custom.cpp custom pre- and post-processing main code and service_ocr.cpp optical character recognition OCR pre- and post-processing main code.

[0039] That is, for industrial camera applications, you can first implement the conventional model loading reasoning logic and pre- and post-processing implementation templates for positioning, segmentation, positive samples, target detection, classification, and OCR, so that a single application can run a single model by simply replacing the model without rewriting the application. In addition, you can use model_custom.cpp to load the inference main code of the custom model as the unified loading entry of the custom model, and use service_custom.cpp as the unified calling entry of the custom model. Based on this, you can call the corresponding custom_code.cpp custom model code by passing in the corresponding model id.

[0040] Step 202: According to the current specific scenario, a corresponding target model combination is adapted from a plurality of model combinations.

[0041] like Figure 3 As shown, it is a schematic diagram of a target model combination provided in an embodiment of the present application, wherein the target model combination includes N models, each of which is a custom model or a conventional model. For example, the current specific scene is a posture recognition scene, which needs to capture the three-dimensional posture and motion information of the human body to achieve a more natural and intuitive human-computer interaction. Therefore, the target model combination that can be adapted from a variety of model combinations can be "1 custom visual large model + 1 target detection model".

[0042] Step 203: Generate a template application for an industrial camera based on the target model combination.

[0043] In the embodiment of the present application, after a template application for an industrial camera is generated according to a target model combination, the template application can be directly used for image processing.

[0044] Specifically, Figure 4 As shown, it is a schematic diagram of using a template application for image processing provided in an embodiment of the present application. First, the template application can be deployed to the industrial camera with one click; then, the template application deployed in the industrial camera can be started; and then, the target model combination in the template application can be directly used for image processing to obtain the final result image; wherein, image processing includes target positioning, image segmentation, target detection, target classification and OCR. Specific embodiment 1: Assume that the target model combination is "custom vision large model + segmentation model", and then, the image processing process of the industrial camera is as follows: Step 1: Start the industrial camera application, which is generated by "custom vision large model + segmentation model".

[0046] Step 2: Load the model and read the target model combination in the template application.

[0047] That is, you can load the model.config model-related configuration file of the industrial camera application to read the number of models and model types (1 custom vision large model, 1 segmentation model) in the file to call the initialization init method of the corresponding model (custom vision large model + segmentation model).

[0048] Step 3: After the model is loaded, open the industrial camera.

[0049] Step 4: Send the collected images obtained by the industrial camera into the custom visual large model of the target model combination.

[0050] Step 5: Use the custom visual large model to perform pre-processing, reasoning and post-processing on the collected image in sequence to obtain the original result image corresponding to the collected image.

[0051] Among them, since the custom vision model is customized, when running the industrial camera application program, it is necessary to compile the custom inference code to generate a dynamic library, and call the dynamic library code in the main function to integrate the custom part with the main function part.

[0052] Step 6: Send the original result image to the segmentation model in the target model combination for image segmentation to obtain the segmented result image.

[0053] Step 7: According to the cropping coordinates obtained when the acquired image is output, the segmented result image is placed back to the corresponding position in the acquired image to obtain the final result image.

[0054] like Figure 5 As shown, it is a schematic diagram of the final result diagram provided by the embodiment of the present application, wherein the captured image is obtained by capturing the image of the processor chip, and then, the captured image is processed by the adaptation method based on the industrial camera template application of the present application, so that Figure 5 The final result is shown, and it marks 2 scratches and 3 stains.

[0055] In a possible implementation, when loading a dynamic library, the custom_code.cpp custom model code corresponding to each custom model will be compiled into its corresponding dynamic library only when it is used. Therefore, in the embodiment of the present application, since each custom_code.cpp custom model code corresponds to its own dynamic library, there is no problem of the same name.

[0056] In another possible implementation, in order to reduce time consumption, when the application is running, all files in the external-aic custom model code directory can be compiled into the same dynamic library to ensure that the reasoning business code of all custom models can be directly used with only one compilation. Among them, when naming the custom_code.cpp custom model code, the name of the method implementation in the file needs to be strictly agreed upon to ensure that the name is not repeated.

[0057] In summary, in the embodiments of the present application, since the corresponding target model combination can be adapted from a variety of model combinations according to the current specific scene, and the template application of the industrial camera can be generated according to the target model combination; compared with the existing industrial camera application, the template application generated by the present application is more adapted to the specific scene, and then, when performing image processing based on the template application, the image processing efficiency can be greatly improved by shortening the processing time. In addition, since the template application is based on the target model combination, the template application is unique, avoiding the need to write the same business logic multiple times in different code locations, that is, the method described in the present application does not need to repeatedly implement the business logic during specific implementation, thereby further improving the processing efficiency.

[0058] Based on the same inventive concept, the embodiment of the present application provides an adaptation device 60 for industrial camera template application, such as Figure 6 As shown, the adaptation device 60 applied to the industrial camera template includes: The model combination acquisition unit 601 is configured to acquire multiple model combinations from the model library applied by the industrial camera; wherein, each model combination includes at least one custom model and at least one conventional model; the custom model is trained based on a specific scenario; the conventional models include a positioning model, a segmentation model, a positive sample model, an object detection model, and an optical character recognition OCR model; The model combination adaptation unit 602 is configured to adapt a corresponding target model combination from multiple model combinations according to the current specific scenario; The template application generation unit 603 is configured to generate a template application for the industrial camera according to the target model combination.

[0059] Optionally, the adaptation device 60 for the industrial camera template application further includes a programming unit 604, which is configured to: Create a config configuration file directory, an external-aic custom model code directory, a model model file directory, and a src application main code directory in the code of the industrial camera application.

[0060] Optionally, the adaptation device 60 for the industrial camera template application further includes an image processing unit 605, which is configured to: Deploy the template application to the industrial camera with one key; Start the template application deployed in the industrial camera; Perform image processing using the target model combination in the template application to obtain a final result image; wherein, the image processing includes object positioning, image segmentation, object detection, object classification, and OCR.

[0061] Optionally, the image processing unit 605 is further configured to: Perform model loading and read the target model combination in the template application; Send the acquisition image obtained by the industrial camera into the custom model of the target model combination; Perform pre-processing, inference, and post-processing on the acquisition image in sequence using the custom model to obtain an original result image corresponding to the acquisition image; Send the original result image into the segmentation model in the target model combination for image segmentation to obtain a segmented result image; Place the segmented result image back to the corresponding position in the original result image according to the cropping coordinates obtained when the original result image is output to obtain the final result image.

[0062] The adaptation device 60 for the industrial camera template application can be used to execute Figure 2-Figure 5 the method executed in the embodiment shown, therefore, for the functions that can be achieved by each functional module of the adaptation device 60 for the industrial camera template application, reference can be made to Figure 2-Figure 5 the description of the embodiment shown, and details are not repeated here.

[0063] In some possible implementations, various aspects of the method provided in the present application may also be implemented in the form of a program part, which includes a program code. When the program part is run on a computer device, the program code is used to enable the computer device to execute the steps of the method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the following steps: Figure 2-Figure 5 The method performed in the illustrated embodiment.

[0064] Those skilled in the art can understand that all or part of the steps of the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above method embodiment are executed; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks or optical disks. Alternatively, if the above integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent part, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software part, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the methods described in various embodiments of the present invention. And the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0065] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0066] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. An adaptation method for industrial camera template application, characterized in that: The method comprises: Obtain multiple model combinations from a model library of industrial camera applications; wherein each model combination includes at least one custom model and at least one conventional model; the custom model is obtained based on training for a specific scenario; the conventional model includes a positioning model, a segmentation model, a positive sample model, a target detection model, and an optical character recognition (OCR) model; According to the current specific scenario, adapt a corresponding target model combination from the multiple model combinations; A template application for the industrial camera is generated according to the target model combination.

2. The method according to claim 1, characterized in that Before acquiring a plurality of model combinations from a model library of industrial camera applications, the method further includes: Create a config configuration file directory, an external-aic custom model code directory, a model model file directory, and a src application main code directory in the code of the industrial camera application.

3. The method according to claim 2, characterized in that The config configuration file directory includes the algorithm.config algorithm parameter configuration file, the camera.config camera parameter configuration file, the custom.config custom parameter configuration file and the model.config model related configuration file.

4. The method according to claim 2, characterized in that The external-aic custom model code directory includes multiple custom_code.cpp custom model codes; wherein one custom_code.cpp custom model code corresponds to one custom model.

5. The method according to claim 2, characterized in that The src application main code directory includes model_abn.cpp positive sample model loading and reasoning main code, model_cla.cpp classification model loading and reasoning main code, model_det.cpp target detection model loading and reasoning main code, model_loc.cpp positioning model loading and reasoning main code, model_seg.cpp segmentation model loading and reasoning main code, model_custom.cpp custom model loading and reasoning main code, service_abn.cpp positive sample pre- and post-processing main code, service_cla.cpp classification pre- and post-processing main code, service_det.cpp target detection pre- and post-processing main code, service_loc.cpp positioning pre- and post-processing main code, service_seg.cpp segmentation pre- and post-processing main code, service_custom.cpp custom pre- and post-processing main code and service_ocr.cpp optical character recognition OCR pre- and post-processing main code.

6. The method according to claim 1, characterized in that After generating the template application of the industrial camera according to the target model combination, the method further includes: Deploy the template application to the industrial camera with one click; Starting the template application deployed in the industrial camera; The target model combination in the template application is used to perform image processing to obtain a final result image; wherein the image processing includes target positioning, image segmentation, target detection, target classification and OCR.

7. The method according to claim 6, characterized in that If the target model combination includes a custom model and a segmentation model, the step of using the target model combination in the template application to perform image processing to obtain a final result image includes: Loading a model, reading the target model combination in the template application; Sending the collected image acquired by the industrial camera into the custom model of the target model combination; The custom model is used to perform pre-processing, reasoning and post-processing on the collected image in sequence to obtain an original result image corresponding to the collected image; Sending the original result image to the segmentation model in the target model combination to perform image segmentation to obtain a segmented result image; According to the clipping coordinates obtained when the collected image is output, the segmented result image is placed back to the corresponding position in the collected image to obtain a final result image.

8. An adaptation device for industrial camera template application, characterized in that: The device comprises: A model combination acquisition unit, used to acquire multiple model combinations from a model library of industrial camera applications; wherein each model combination includes at least one custom model and at least one conventional model; the custom model is obtained based on training for a specific scenario; the conventional model includes a positioning model, a segmentation model, a positive sample model, a target detection model, and an optical character recognition (OCR) model; A model combination matching unit, used for matching a corresponding target model combination from the plurality of model combinations according to a current specific scenario; A template application generating unit is used to generate a template application for the industrial camera according to the target model combination.

9. An electronic device, characterized in that: The device comprises: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute any method according to claims 1-7 according to the obtained program instructions.

10. A storage medium, characterized in that: The storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute any one of the methods of claims 1-7.

Citation Information

Patent Citations

  • Industrial camera photogrammetry image brightness compensation method

    CN105913401A

  • Normalization detection method for packaging character images on assembly line

    CN115511769A

  • Nut appearance defect detection method and device based on neural network

    CN118521568A

  • Multi-neural network model calling method and device, industrial camera and storage medium

    CN119025187A

  • Word segmentation method based on artificial intelligence, server and storage medium

    US20180365217A1