Industrial camera parameter selection method, device, storage medium and computer equipment
Through the automated method of updating and selecting industrial camera parameters, the problem of low image acquisition efficiency of industrial cameras in different environments is solved, and the automatic selection of parameters and efficiency improvement is achieved.
Patent Information
- Application Number
- CN202210750245.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2042-06-29
AI Technical Summary
The image acquisition effect of industrial cameras is greatly affected by the outside world in different environments, and requires manual configuration of parameters based on experience, resulting in inefficiency.
The initial parameter set is determined through an automated method, the recognition time under each set of parameters is tested, the parameter set is updated until the preset conditions are met, and the parameter with the shortest recognition time is selected as the target parameter to realize the automatic selection of industrial camera parameters.
Reduces debugging time, improves the efficiency of parameter configuration, and realizes automatic selection of industrial camera parameters without manual settings.
Smart Images

Figure CN115063380B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet of Things technology, and in particular to an industrial camera parameter selection method, device, storage medium and computer equipment. Background Art
[0002] With the rapid development of IoT technology, image acquisition and processing are increasingly used in industry. As scanning, OCR, AI and other technologies are widely used in various industries to collect image data, the demand for industrial cameras in IoT technology is also increasing.
[0003] At present, the image acquisition effect of industrial cameras is greatly affected by the external environment. Different environments require manual configuration of parameters based on experience in order to adapt. Summary of the invention
[0004] The embodiments of the present application provide an industrial camera parameter selection method, apparatus, storage medium, and computer equipment, which can automatically select industrial camera parameters and improve the efficiency of parameter configuration.
[0005] In a first aspect, the present application provides a method for selecting parameters of an industrial camera, the method comprising:
[0006] Determining a parameter set, the parameter set comprising a plurality of groups of parameters, the parameters comprising at least one type of sub-parameters;
[0007] Determine the recognition time for the industrial camera to complete the shooting and recognition of the test sample under each set of parameters;
[0008] If the recognition time corresponding to each group of parameters in the parameter set is greater than the expected time, the parameter set is updated to determine a new parameter set;
[0009] Assigning a counting identifier to the new parameter set, and determining the recognition time corresponding to each group of parameters in the new parameter set, until the currently determined new parameter set meets a preset stop condition, and determining a group of parameters in the currently determined new parameter set with the shortest recognition time as the target parameters;
[0010] The stopping condition is that the count represented by the count identifier corresponding to the currently determined new parameter set is a preset threshold, and the recognition time corresponding to each group of parameters in the currently determined new parameter set is greater than the expected time;
[0011] or
[0012] The count represented by the count identifier corresponding to the currently determined new parameter set is smaller than the preset threshold, and the currently determined new parameter set contains parameters whose corresponding identification time is not greater than the expected time.
[0013] In one of the embodiments, if the recognition time corresponding to each group of parameters in the parameter set is greater than the expected time, the parameter set is updated to determine a new parameter set, including:
[0014] Determine a first set and a second set in the parameter set; the first set includes N groups of parameters, the recognition time corresponding to any group of parameters in the first set is less than the minimum value of the recognition time corresponding to each group of parameters in the second set, and the union of the first set and the second set is equal to the parameter set;
[0015] performing mutation processing on each group of parameters in the second set;
[0016] Each group of parameters in the first set and each group of parameters in the second set that has undergone the variation process are determined as a new parameter set.
[0017] In one embodiment, the mutating each group of parameters in the second set includes:
[0018] Select any two groups of parameters from the second set, and exchange the two groups of parameters until each group of parameters in the second set has been exchanged at least once; the parameter exchange is to exchange at least one sub-parameter of the same type in the two selected groups of parameters.
[0019] In one embodiment, the performing mutation processing on each group of parameters in the second set further includes:
[0020] Randomly select M groups of parameters from the second set after parameter exchange;
[0021] Any group of parameters in the M groups of parameters is used as the parameters to be processed for mutation processing until all the groups of parameters in the M groups of parameters have completed the mutation processing; the mutation processing is to determine at least one sub-parameter from the parameters to be processed, and randomly determine an alternative parameter from the optional range corresponding to the determined sub-parameter for replacement.
[0022] In one embodiment, determining the recognition time for the industrial camera to complete the shooting and recognition of the test sample under each set of parameters includes:
[0023] Taking any set of parameters in the parameter set as working parameters of the industrial camera to shoot the test sample and obtain a shot picture;
[0024] Identifying the photographed image;
[0025] The time from when the photograph is acquired to when the recognition result is the same as the preset result is determined as the recognition time of the current set of parameters, until each set of parameters in the parameter set has a corresponding recognition time determined.
[0026] In one of the embodiments, when the stop condition is that the count represented by the count identifier corresponding to the currently determined new parameter set is a preset threshold value, and the recognition time corresponding to each group of parameters in the currently determined new parameter set is greater than the expected time, after executing the step of determining the group of parameters with the shortest recognition time corresponding to the currently determined new parameter set as the target parameters, the method further includes:
[0027] Send a prompt message; the prompt message is used to prompt the user that the recognition time corresponding to the target parameter is greater than the expected time.
[0028] In one embodiment, the method further comprises:
[0029] If there are parameters in the parameter set whose corresponding recognition time is not greater than the expected time, a group of parameters in the parameter set whose corresponding recognition time is the shortest is determined as the target parameters.
[0030] In a second aspect, the present application provides an industrial camera parameter selection device, the device being configured to perform the following steps:
[0031] Determining a parameter set, the parameter set comprising a plurality of groups of parameters, the parameters comprising at least one type of sub-parameters;
[0032] Determine the recognition time for the industrial camera to complete the shooting and recognition of the test sample under each set of parameters;
[0033] If the recognition time corresponding to each group of parameters in the parameter set is greater than the expected time, the parameter set is updated to determine a new parameter set;
[0034] Assigning a counting identifier to the new parameter set, and determining the recognition time corresponding to each group of parameters in the new parameter set, until the currently determined new parameter set meets a preset stop condition, and determining a group of parameters in the currently determined new parameter set with the shortest recognition time as the target parameters;
[0035] The stopping condition is that the count represented by the count identifier corresponding to the currently determined new parameter set is a preset threshold, and the recognition time corresponding to each group of parameters in the currently determined new parameter set is greater than the expected time;
[0036] or
[0037] The count represented by the count identifier corresponding to the currently determined new parameter set is smaller than the preset threshold, and the currently determined new parameter set contains parameters whose corresponding identification time is not greater than the expected time.
[0038] In a third aspect, the present application provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the industrial camera parameter selection method as described in any of the above embodiments.
[0039] In a fourth aspect, the present application provides a computer device, comprising: one or more processors, and a memory;
[0040] The memory stores computer-readable instructions, and when the one or more processors execute the computer-readable instructions, the steps of the industrial camera parameter selection method as described in any one of the above embodiments are performed.
[0041] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0042] The industrial camera parameter selection method, device, storage medium and computer equipment provided by the present application first determine an initial parameter set, determine the recognition time for the industrial camera to complete shooting and recognition of the test sample under each set of parameters, compare the recognition time corresponding to each set of parameters with the expected time, and if the recognition time corresponding to each set of parameters is greater than the expected time, update the parameter set, and assign a counting identifier to the new parameter set, determine the recognition time for the industrial camera to complete shooting and recognition of the test sample under each set of parameters in the new parameter set, and compare it with the expected time, until the count represented by the counting identifier corresponding to the currently determined new parameter set is a preset threshold and the recognition time corresponding to each set of parameters in the currently determined new parameter set is greater than the expected time, or, when the count represented by the counting identifier corresponding to the currently determined new parameter set is less than the preset threshold and there are parameters in the currently determined new parameter set whose corresponding recognition time is not greater than the expected time, determine a set of parameters with the shortest corresponding recognition time from the latest parameter set as the target parameters of the industrial camera, and realize automatic selection of parameters through the size relationship between the recognition time and the expected time, without manual setting, to realize automatic selection of parameters of the industrial camera, reduce debugging time, and improve the efficiency of parameter configuration. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0044] Figure 1 A schematic diagram of a process flow of a method for selecting parameters of an industrial camera in one embodiment;
[0045] Figure 2 A schematic diagram of a flow chart of the steps of updating the parameter set and determining a new parameter set in an embodiment;
[0046] Figure 3 A schematic diagram of a flow chart of determining the recognition time step for an industrial camera to complete shooting and recognition of a test sample under each set of parameters in one embodiment;
[0047] Figure 4 FIG. 1 is a diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0049] The embodiment of the present application provides an industrial camera parameter selection method, which can be applied to the automatic parameter selection of an industrial camera. The industrial camera described in the embodiment of the present application is used for data acquisition, including but not limited to image acquisition, image text information acquisition, etc. Since industrial cameras have certain requirements for the accuracy and efficiency of data acquisition, if the parameter configuration of the industrial camera cannot adapt to the current environment, it will affect the accuracy and efficiency of the acquisition, so the parameters need to be debugged.
[0050] like Figure 1 As shown, an embodiment of the present application provides an industrial camera parameter selection method, including:
[0051] Step S101: determining a parameter set, wherein the parameter set includes multiple groups of parameters, and the parameters include at least one type of sub-parameter.
[0052] Among them, sub-parameters refer to specific parameters that need to be configured for industrial cameras. The types of sub-parameters can be but are not limited to exposure value, gain value, focal length value, lighting level, fill light color, and lighting angle.
[0053] Each group of parameters in the parameter set includes the same sub-parameter type. Exemplarily, each group of parameters in the parameter set includes six types of sub-parameters: exposure value, gain value, focal length value, lighting level, fill light color, and lighting angle. Alternatively, each group of parameters in the parameter set includes five types of sub-parameters: exposure value, gain value, focal length value, lighting level, and fill light color.
[0054] Step S102, determining the recognition time for the industrial camera to complete the shooting and recognition of the test sample under each set of parameters.
[0055] The test sample is a sample used to test the shooting and recognition effect of the industrial camera. The information that needs to be collected in the test sample is known. The shooting and recognition effect of the industrial camera can be judged based on whether the industrial camera can accurately collect the information and the recognition time of accurately collecting the information.
[0056] Step S103, determining whether the parameter set meets a preset stop condition.
[0057] Among them, the stopping condition is that the count represented by the counting identifier corresponding to the currently determined new parameter set is a preset threshold, and the recognition time corresponding to each group of parameters in the currently determined new parameter set is greater than the expected time; or, the count represented by the counting identifier corresponding to the currently determined new parameter set is less than the preset threshold, and there are parameters in the currently determined new parameter set whose corresponding recognition time is not greater than the expected time.
[0058] The timing flag is used to characterize the number of updates of the parameter set. Each time it is updated, the count increases by 1. The preset threshold is the upper limit of the number of updates. When the number of updates reaches the upper limit and the parameter whose corresponding identification time is not greater than the expected time is still not found, no more updates are performed, and the parameter with the shortest corresponding identification time in the latest parameter set is directly determined as the target parameter.
[0059] The expected time is used to determine whether the recognition time for the industrial camera to recognize the information required to be collected in the test sample after completing the shooting meets the required judgment conditions. If the recognition time corresponding to the parameter is greater than the expected time, it is considered that the parameter does not meet the requirements.
[0060] Step S104: If the parameter set meets the stopping condition, a group of parameters in the parameter set corresponding to the shortest recognition time is determined as the target parameters.
[0061] Step S105, if the parameter set does not meet the stop condition, the parameter set is updated, a new parameter set is determined, a counting identifier is assigned to the new parameter set, and the process returns to step S102 to loop through steps S102 to S105 until the currently determined new parameter set meets the preset stop condition, and a set of parameters with the shortest recognition time corresponding to the currently determined new parameter set is determined as the target parameters.
[0062] Test the recognition time of the industrial camera under each set of parameters in the initial parameter set. If there are parameters in the initial parameter set whose corresponding recognition time is not greater than the expected time, and there is only one set of parameters that meet the requirements, then this set of parameters is directly determined as the target parameters of the industrial camera; if there are multiple sets of parameters that meet the requirements, then the set of parameters with the shortest corresponding recognition time in the parameter set is determined as the target parameters.
[0063] If the recognition time corresponding to each group of parameters in the initial parameter set is greater than the expected time, it is necessary to update the parameter set, determine a new parameter set, and test the recognition time corresponding to each group of parameters in the new parameter set, and compare the recognition time of each group of parameters with the expected time. If the recognition time corresponding to each group of parameters in the parameter set is greater than the expected time, update the parameter set again for testing and compare the recognition time obtained from the test with the expected time, and assign a counting identifier to the updated parameter set after each update. Repeat the above process until the parameter set meets the stopping condition, and after stopping, determine a group of parameters with the shortest corresponding recognition time from the current latest parameter set, and determine this group of parameters as the target parameters of the industrial camera.
[0064] It should be noted that when updating a parameter set, each sub-parameter has a preset optional range, and the updated sub-parameter still belongs to its corresponding optional range.
[0065] In one of the embodiments, the update parameter set may randomly select new sub-parameters from the optional ranges corresponding to each sub-parameter for replacement. In one of the embodiments, when each group of parameters includes more than two types of sub-parameters, one or more types of sub-parameters may be selected for updating each group of parameters, and not every update requires that each group of parameters be completely updated.
[0066] The industrial camera parameter selection method provided in the present application first determines an initial parameter set, determines the recognition time for the industrial camera to complete the shooting and recognition of the test sample under each set of parameters, compares the recognition time corresponding to each set of parameters with the expected time, and if the recognition time corresponding to each set of parameters is greater than the expected time, updates the parameter set, assigns a counting identifier to the new parameter set, determines the recognition time for the industrial camera to complete the shooting and recognition of the test sample under each set of parameters in the new parameter set, and compares it with the expected time, until the count represented by the counting identifier corresponding to the currently determined new parameter set is a preset threshold and the currently determined new parameter set is within the preset threshold. When the recognition time corresponding to each group of parameters is greater than the expected time, or the count represented by the count identifier corresponding to the currently determined new parameter set is less than the preset threshold and there are parameters in the currently determined new parameter set whose corresponding recognition time is not greater than the expected time, a group of parameters with the shortest corresponding recognition time is determined from the latest parameter set as the target parameters of the industrial camera, and the automatic selection of parameters is achieved through the relationship between the recognition time and the expected time. The number of updates of the parameter set and the expected time are used as the convergence conditions of the loop. No manual setting is required, so that the automatic selection of parameters of the industrial camera is achieved, the debugging time is reduced, and the efficiency of parameter configuration is improved.
[0067] In one of the embodiments, when the stop condition is that the count represented by the count identifier corresponding to the currently determined new parameter set is a preset threshold value, and the recognition time corresponding to each group of parameters in the currently determined new parameter set is greater than the expected time, after executing the step of determining the group of parameters with the shortest recognition time corresponding to the currently determined new parameter set as the target parameters, the method further includes:
[0068] Send a prompt message; the prompt message is used to prompt the user that the recognition time corresponding to the target parameter is greater than the expected time.
[0069] In this embodiment, the number of times the parameter set is updated reaches the preset threshold, so the parameter set is stopped for testing. However, at this time, the parameters whose corresponding recognition time is not greater than the expected time are still not found. Therefore, although the set of parameters with the shortest recognition time corresponding to the latest parameter set is determined as the target parameters, it may not meet the working requirements of the industrial camera. At this time, a prompt message can be sent to remind the user that the current target parameters are not the optimal solution. The user can choose whether to manually intervene to adjust the working environment of the industrial camera as needed and then re-select the parameters automatically. Among them, adjusting the working environment of the industrial camera can be, for example, adjusting the safety position, changing the ambient light, etc. In some cases, the user can also choose to use the currently determined target parameters as the working parameters of the industrial camera.
[0070] In one embodiment, if Figure 2As shown, if the recognition time corresponding to each group of parameters in the parameter set is greater than the expected time, the parameter set is updated to determine a new parameter set, including:
[0071] Step S201: determine a first set and a second set in a parameter set.
[0072] Among them, the first set includes N groups of parameters, N is a positive integer, and N is less than the number of parameter groups in the parameter set, the recognition time corresponding to any group of parameters in the first set is less than the minimum value of the recognition time corresponding to each group of parameters in the second set, and the union of the first set and the second set is equal to the parameter set.
[0073] That is, the parameters in the parameter set are sorted from small to large according to their corresponding recognition time, the first N groups of parameters starting from the parameter with the shortest corresponding recognition time are determined as the first set, and the groups of parameters in the parameter set except the first set are determined as the second set.
[0074] Step S202, performing mutation processing on each group of parameters in the second set.
[0075] Mutation processing refers to generating a set of new parameters to replace the original parameters. The new parameters can be all sub-parameters updated or only some sub-parameters updated.
[0076] Step S203: determine each group of parameters in the first set and each group of parameters in the second set that have undergone the variation process as a new parameter set.
[0077] This embodiment can avoid losing the optimal solution during the updating process by retaining the better parameters in each generation of parameter sets and adding them to the new parameter set.
[0078] In one embodiment, the mutating each group of parameters in the second set includes:
[0079] Select any two groups of parameters from the second set, and exchange the two groups of parameters until all groups of parameters in the second set have been exchanged at least once; wherein the parameter exchange is to exchange at least one sub-parameter of the same type in the two selected groups of parameters.
[0080] Take the example that each group of parameters includes Class A sub-parameters, Class B sub-parameters and Class C sub-parameters, and the parameters are exchanged to exchange two types of sub-parameters. Assume that there are 10 groups of parameters in the second set. First, randomly select two groups (A1, B1, C1) and (A2, B2, C2), and randomly select two types of sub-parameters for exchange (for example, select Class A sub-parameters and Class B sub-parameters). After the parameter exchange, the two groups of parameters are updated to (A2, B2, C1) and (A1, B1, C2). Select two groups of parameters from the remaining 8 groups of parameters for parameter exchange, and perform parameter exchange on all parameters until all 10 groups of parameters are exchanged or at least once, and the variation processing of each group of parameters in the second set is completed.
[0081] In one embodiment, the mutating each group of parameters in the second set includes:
[0082] Select any two groups of parameters from the second set, and exchange the two groups of parameters until all groups of parameters in the second set have been exchanged at least once; wherein the parameter exchange is to exchange at least one sub-parameter of the same type in the two selected groups of parameters;
[0083] Randomly select M groups of parameters from the second set after parameter exchange; where M is a positive integer, and M is less than the number of parameter groups in the second set;
[0084] Any group of parameters in the M groups of parameters is used as the parameters to be processed for mutation processing until all the groups of parameters in the M groups of parameters have completed the mutation processing; the mutation processing is to determine at least one sub-parameter from the parameters to be processed, and randomly determine an alternative parameter from the optional range corresponding to the determined sub-parameter for replacement.
[0085] In this embodiment, based on the second set after parameter exchange, M groups of parameters are randomly selected for mutation processing to improve the randomness and diversity of the parameters in the parameter set. Take each group of parameters including A-type sub-parameters, B-type sub-parameters and C-type sub-parameters, and the mutation processing is performed on only one sub-parameter as an example for explanation. For (A1, B1, C2) obtained after parameter exchange, A1=2, and the optional range of A-type sub-parameters is (1-10), a value is randomly selected from (1-10) to replace A1, for example, A1 is replaced by 3, and the group of parameters becomes (A=3, B1, C2) after mutation.
[0086] In one embodiment, if Figure 3 As shown, the determination of the recognition time for the industrial camera to complete the shooting and recognition of the test sample under each set of parameters includes:
[0087] Step S301, taking any set of parameters in the parameter set as the working parameters of the industrial camera to shoot the test sample and obtain the shot picture;
[0088] Step S302, identifying the captured image;
[0089] In step S303, the time from when the captured image is acquired to when the recognition result is the same as the preset result is determined as the recognition time of the current set of parameters; return to step S301 and re-execute steps S301 to S303 for the next set of parameters until each set of parameters in the parameter set has a corresponding recognition time determined.
[0090] In this embodiment, the recognition time test of shooting recognition when the industrial camera works under various sets of parameters can be automatically completed, thereby reducing manual intervention and improving the efficiency of industrial camera parameter selection.
[0091] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0092] The industrial camera parameter selection device provided in an embodiment of the present application is described below. The industrial camera parameter selection device described below and the industrial camera parameter selection method described above can be referenced to each other.
[0093] The embodiment of the present application also provides an industrial camera parameter selection device, the device is configured to perform the following steps:
[0094] Determining a parameter set, the parameter set comprising a plurality of groups of parameters, the parameters comprising at least one type of sub-parameters;
[0095] Determine the recognition time for the industrial camera to complete the shooting and recognition of the test sample under each set of parameters;
[0096] If the recognition time corresponding to each group of parameters in the parameter set is greater than the expected time, the parameter set is updated to determine a new parameter set;
[0097] Assigning a counting identifier to the new parameter set, and determining the recognition time corresponding to each group of parameters in the new parameter set, until the currently determined new parameter set meets a preset stop condition, and determining a group of parameters in the currently determined new parameter set with the shortest recognition time as the target parameters;
[0098] The stopping condition is that the count represented by the count identifier corresponding to the currently determined new parameter set is a preset threshold, and the recognition time corresponding to each group of parameters in the currently determined new parameter set is greater than the expected time;
[0099] or
[0100] The count represented by the count identifier corresponding to the currently determined new parameter set is smaller than the preset threshold, and the currently determined new parameter set contains parameters whose corresponding identification time is not greater than the expected time.
[0101] In one of the embodiments, the industrial camera parameter selection device is further configured to perform the following steps:
[0102] Determine a first set and a second set in the parameter set; the first set includes N groups of parameters, the recognition time corresponding to any group of parameters in the first set is less than the minimum value of the recognition time corresponding to each group of parameters in the second set, and the union of the first set and the second set is equal to the parameter set;
[0103] performing mutation processing on each group of parameters in the second set;
[0104] Each group of parameters in the first set and each group of parameters in the second set that has undergone the variation process are determined as a new parameter set.
[0105] In one of the embodiments, the industrial camera parameter selection device is further configured to perform the following steps:
[0106] Select any two groups of parameters from the second set, and exchange the two groups of parameters until each group of parameters in the second set has been exchanged at least once; the parameter exchange is to exchange at least one sub-parameter of the same type in the two selected groups of parameters.
[0107] In one of the embodiments, the industrial camera parameter selection device is further configured to perform the following steps:
[0108] Randomly select M groups of parameters from the second set after parameter exchange;
[0109] Any group of parameters in the M groups of parameters is used as the parameters to be processed for mutation processing until all the groups of parameters in the M groups of parameters have completed the mutation processing; the mutation processing is to determine at least one sub-parameter from the parameters to be processed, and randomly determine an alternative parameter from the optional range corresponding to the determined sub-parameter for replacement.
[0110] In one of the embodiments, the industrial camera parameter selection device is further configured to perform the following steps:
[0111] Taking any set of parameters in the parameter set as working parameters of the industrial camera to shoot the test sample and obtain a shot picture;
[0112] Identifying the photographed image;
[0113] The time from when the photograph is acquired to when the recognition result is the same as the preset result is determined as the recognition time of the current set of parameters, until each set of parameters in the parameter set has a corresponding recognition time determined.
[0114] In one of the embodiments, the industrial camera parameter selection device is further configured to perform the following steps when the stop condition is that the count represented by the count identifier corresponding to the currently determined new parameter set is a preset threshold value, and the recognition time corresponding to each group of parameters in the currently determined new parameter set is greater than the expected time:
[0115] Send a prompt message; the prompt message is used to prompt the user that the recognition time corresponding to the target parameter is greater than the expected time.
[0116] In one of the embodiments, the industrial camera parameter selection device is further configured to perform the following steps:
[0117] If there are parameters in the parameter set whose corresponding recognition time is not greater than the expected time, a group of parameters in the parameter set whose corresponding recognition time is the shortest is determined as the target parameters.
[0118] The above industrial camera parameter selection device can be divided into different modules as needed to complete all or part of the functions of the above industrial camera parameter selection device. Each module in the above industrial camera parameter selection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the above operations.
[0119] In one embodiment, the present application further provides a storage medium, wherein the storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors perform the following steps:
[0120] Determining a parameter set, the parameter set comprising a plurality of groups of parameters, the parameters comprising at least one type of sub-parameters;
[0121] Determine the recognition time for the industrial camera to complete the shooting and recognition of the test sample under each set of parameters;
[0122] If the recognition time corresponding to each group of parameters in the parameter set is greater than the expected time, the parameter set is updated to determine a new parameter set;
[0123] Assigning a counting identifier to the new parameter set, and determining the recognition time corresponding to each group of parameters in the new parameter set, until the currently determined new parameter set meets a preset stop condition, and determining a group of parameters in the currently determined new parameter set with the shortest recognition time as the target parameters;
[0124] The stopping condition is that the count represented by the count identifier corresponding to the currently determined new parameter set is a preset threshold, and the recognition time corresponding to each group of parameters in the currently determined new parameter set is greater than the expected time;
[0125] or
[0126] The count represented by the count identifier corresponding to the currently determined new parameter set is smaller than the preset threshold, and the currently determined new parameter set contains parameters whose corresponding identification time is not greater than the expected time.
[0127] In one embodiment, the computer readable instructions, when executed by a processor, further implement the following steps:
[0128] Determine a first set and a second set in the parameter set; the first set includes N groups of parameters, the recognition time corresponding to any group of parameters in the first set is less than the minimum value of the recognition time corresponding to each group of parameters in the second set, and the union of the first set and the second set is equal to the parameter set;
[0129] performing mutation processing on each group of parameters in the second set;
[0130] Each group of parameters in the first set and each group of parameters in the second set that has undergone the variation process are determined as a new parameter set.
[0131] In one embodiment, the computer readable instructions, when executed by a processor, further implement the following steps:
[0132] Select any two groups of parameters from the second set, and exchange the two groups of parameters until each group of parameters in the second set has been exchanged at least once; the parameter exchange is to exchange at least one sub-parameter of the same type in the two selected groups of parameters.
[0133] In one embodiment, the computer readable instructions, when executed by a processor, further implement the following steps:
[0134] Randomly select M groups of parameters from the second set after parameter exchange;
[0135] Any group of parameters in the M groups of parameters is used as the parameters to be processed for mutation processing until all the groups of parameters in the M groups of parameters have completed the mutation processing; the mutation processing is to determine at least one sub-parameter from the parameters to be processed, and randomly determine an alternative parameter from the optional range corresponding to the determined sub-parameter for replacement.
[0136] In one embodiment, the computer readable instructions, when executed by a processor, further implement the following steps:
[0137] Taking any set of parameters in the parameter set as working parameters of the industrial camera to shoot the test sample and obtain a shot picture;
[0138] Identifying the photographed image;
[0139] The time from when the photograph is acquired to when the recognition result is the same as the preset result is determined as the recognition time of the current set of parameters, until each set of parameters in the parameter set has a corresponding recognition time determined.
[0140] In one embodiment, the computer readable instructions, when executed by a processor, further implement the following steps:
[0141] Send a prompt message; the prompt message is used to prompt the user that the recognition time corresponding to the target parameter is greater than the expected time.
[0142] In one embodiment, the computer readable instructions, when executed by a processor, further implement the following steps:
[0143] If there are parameters in the parameter set whose corresponding recognition time is not greater than the expected time, a group of parameters in the parameter set whose corresponding recognition time is the shortest is determined as the target parameters.
[0144] In one embodiment, the present application further provides a computer device, wherein computer-readable instructions are stored in the computer device, and when the one or more processors execute the computer-readable instructions, the following steps are performed:
[0145] Determining a parameter set, the parameter set comprising a plurality of groups of parameters, the parameters comprising at least one type of sub-parameters;
[0146] Determine the recognition time for the industrial camera to complete the shooting and recognition of the test sample under each set of parameters;
[0147] If the recognition time corresponding to each group of parameters in the parameter set is greater than the expected time, the parameter set is updated to determine a new parameter set;
[0148] Assigning a counting identifier to the new parameter set, and determining the recognition time corresponding to each group of parameters in the new parameter set, until the currently determined new parameter set meets a preset stop condition, and determining a group of parameters in the currently determined new parameter set with the shortest recognition time as the target parameters;
[0149] The stopping condition is that the count represented by the count identifier corresponding to the currently determined new parameter set is a preset threshold, and the recognition time corresponding to each group of parameters in the currently determined new parameter set is greater than the expected time;
[0150] or
[0151] The count represented by the count identifier corresponding to the currently determined new parameter set is smaller than the preset threshold, and the currently determined new parameter set contains parameters whose corresponding identification time is not greater than the expected time.
[0152] In one embodiment, when the processor executes the computer readable instructions, the processor further performs the following steps:
[0153] Determine a first set and a second set in the parameter set; the first set includes N groups of parameters, the recognition time corresponding to any group of parameters in the first set is less than the minimum value of the recognition time corresponding to each group of parameters in the second set, and the union of the first set and the second set is equal to the parameter set;
[0154] performing mutation processing on each group of parameters in the second set;
[0155] Each group of parameters in the first set and each group of parameters in the second set that has undergone the variation process are determined as a new parameter set.
[0156] In one embodiment, when the processor executes the computer readable instructions, the processor further performs the following steps:
[0157] Select any two groups of parameters from the second set, and exchange the two groups of parameters until each group of parameters in the second set has been exchanged at least once; the parameter exchange is to exchange at least one sub-parameter of the same type in the two selected groups of parameters.
[0158] In one embodiment, when the processor executes the computer readable instructions, the processor further performs the following steps:
[0159] Randomly select M groups of parameters from the second set after parameter exchange;
[0160] Any group of parameters in the M groups of parameters is used as the parameters to be processed for mutation processing until all the groups of parameters in the M groups of parameters have completed the mutation processing; the mutation processing is to determine at least one sub-parameter from the parameters to be processed, and randomly determine an alternative parameter from the optional range corresponding to the determined sub-parameter for replacement.
[0161] In one embodiment, when the processor executes the computer readable instructions, the processor further performs the following steps:
[0162] Taking any set of parameters in the parameter set as working parameters of the industrial camera to shoot the test sample and obtain a shot picture;
[0163] Identifying the photographed image;
[0164] The time from when the photograph is acquired to when the recognition result is the same as the preset result is determined as the recognition time of the current set of parameters, until each set of parameters in the parameter set has a corresponding recognition time determined.
[0165] In one embodiment, when the processor executes the computer readable instructions, the processor further performs the following steps:
[0166] Send a prompt message; the prompt message is used to prompt the user that the recognition time corresponding to the target parameter is greater than the expected time.
[0167] In one embodiment, when the processor executes the computer readable instructions, the processor further performs the following steps:
[0168] If there are parameters in the parameter set whose corresponding recognition time is not greater than the expected time, a group of parameters in the parameter set whose corresponding recognition time is the shortest is determined as the target parameters.
[0169] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 4As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for selecting parameters of an industrial camera is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0170] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0171] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0172] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0173] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0174] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.
[0175] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for selecting parameters of an industrial camera, characterized in that: The method comprises: Determining a parameter set, the parameter set comprising a plurality of groups of parameters, the parameters comprising at least one type of sub-parameters; Determine the recognition time for the industrial camera to complete the shooting and recognition of the test sample under each set of parameters; If the recognition time corresponding to each group of parameters in the parameter set is greater than the expected time, the parameter set is updated to determine a new parameter set; Assigning a counting identifier to the new parameter set, and determining the recognition time corresponding to each group of parameters in the new parameter set, until the currently determined new parameter set meets a preset stop condition, and determining a group of parameters in the currently determined new parameter set with the shortest recognition time as the target parameters; The stopping condition is that the count represented by the count identifier corresponding to the currently determined new parameter set is a preset threshold, and the recognition time corresponding to each group of parameters in the currently determined new parameter set is greater than the expected time; or The count represented by the count identifier corresponding to the currently determined new parameter set is smaller than the preset threshold, and the currently determined new parameter set contains parameters whose corresponding identification time is not greater than the expected time.
2. The industrial camera parameter selection method according to claim 1, characterized in that: If the recognition time corresponding to each group of parameters in the parameter set is greater than the expected time, the parameter set is updated to determine a new parameter set, including: Determine a first set and a second set in the parameter set; the first set includes N groups of parameters, N is a positive integer, and N is less than the number of parameter groups in the parameter set, the recognition time corresponding to any group of parameters in the first set is less than the minimum value of the recognition time corresponding to each group of parameters in the second set, and the union of the first set and the second set is equal to the parameter set; performing mutation processing on each group of parameters in the second set; Each group of parameters in the first set and each group of parameters in the second set that has undergone the variation process are determined as a new parameter set.
3. The industrial camera parameter selection method according to claim 2, characterized in that: The performing mutation processing on each group of parameters in the second set includes: Select any two groups of parameters from the second set, and exchange the two groups of parameters until each group of parameters in the second set has been exchanged at least once; the parameter exchange is to exchange at least one sub-parameter of the same type in the two selected groups of parameters.
4. The industrial camera parameter selection method according to claim 3, characterized in that: The performing mutation processing on each group of parameters in the second set further includes: Randomly select M groups of parameters from the second set after parameter exchange; where M is a positive integer, and M is less than the number of parameter groups in the second set; Any group of parameters in the M groups of parameters is used as the parameters to be processed for mutation processing until all the groups of parameters in the M groups of parameters have completed the mutation processing; the mutation processing is to determine at least one sub-parameter from the parameters to be processed, and randomly determine an alternative parameter from the optional range corresponding to the determined sub-parameter for replacement.
5. The industrial camera parameter selection method according to claim 1, characterized in that: Determining the recognition time for the industrial camera to complete the shooting and recognition of the test sample under each set of parameters includes: Taking any set of parameters in the parameter set as working parameters of the industrial camera to shoot the test sample and obtain a shot picture; Identifying the photographed image; The time from when the photograph is acquired to when the recognition result is the same as the preset result is determined as the recognition time of the current set of parameters, until each set of parameters in the parameter set has a corresponding recognition time determined.
6. The industrial camera parameter selection method according to any one of claims 1 to 5, characterized in that: When the stop condition is that the count represented by the count identifier corresponding to the currently determined new parameter set is a preset threshold value, and the recognition time corresponding to each group of parameters in the currently determined new parameter set is greater than the expected time, after executing the step of determining a group of parameters with the shortest recognition time corresponding to the currently determined new parameter set as the target parameters, the method further includes: Send a prompt message, wherein the prompt message is used to prompt the user that the recognition time corresponding to the target parameter is greater than the expected time.
7. The industrial camera parameter selection method according to claim 1, characterized in that: The method further comprises: If there are parameters in the parameter set whose corresponding recognition time is not greater than the expected time, a group of parameters in the parameter set whose corresponding recognition time is the shortest is determined as the target parameters.
8. An industrial camera parameter selection device, characterized in that: The apparatus comprises a processor configured to perform the following steps: Determining a parameter set, the parameter set comprising a plurality of groups of parameters, the parameters comprising at least one type of sub-parameters; Determine the recognition time for the industrial camera to complete the shooting and recognition of the test sample under each set of parameters; If the recognition time corresponding to each group of parameters in the parameter set is greater than the expected time, the parameter set is updated to determine a new parameter set; Assigning a counting identifier to the new parameter set, and determining the recognition time corresponding to each group of parameters in the new parameter set, until the currently determined new parameter set meets a preset stop condition, and determining a group of parameters in the currently determined new parameter set with the shortest recognition time as the target parameters; The stopping condition is that the count represented by the count identifier corresponding to the currently determined new parameter set is a preset threshold, and the recognition time corresponding to each group of parameters in the currently determined new parameter set is greater than the expected time; or The count represented by the count identifier corresponding to the currently determined new parameter set is smaller than the preset threshold, and the currently determined new parameter set contains parameters whose corresponding identification time is not greater than the expected time.
9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the industrial camera parameter selection method according to any one of claims 1 to 7.
10. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the one or more processors execute the computer-readable instructions, the steps of the industrial camera parameter selection method according to any one of claims 1 to 7 are performed.
Citation Information
Patent Citations
Camera lens distortion parameter estimation device and method
CN111429533A
An artificial intelligence-based jelly effect prevention method and system in an aerial photography scene
CN112926530A
Image processing method and device, electronic device and computer-readable storage medium
US20190130538A1
Method for operating a camera in dependency on a current state of an environmental region of the camera, camera, and motor vehicle
WO2018130596A1
