Focusing method and device of industrial camera, industrial control equipment and storage medium

Through industrial control equipment, industrial cameras are controlled to perform multiple rounds of movement and image acquisition in harsh environments, and gradually adjust the height and brightness, solving the problem of lack of autofocus in the existing technology, and achieving a fast and accurate autofocus effect.

CN119676556AActive Publication Date: 2025-03-21BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202311228165.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-21
Publication Date
2025-03-21
Estimated Expiration
2043-09-21

AI Technical Summary

Technical Problem

The lack of automatic focus function in harsh environments in existing industrial cameras, resulting in long-term and low accuracy in manual adjustment.

Method used

The industrial camera is controlled to move multiple rounds in the vertical direction through industrial control equipment, and image acquisition is performed during each round of movement, the image with the highest definition is determined, and the height of the industrial camera and the brightness of the fill light source are gradually adjusted until the set threshold is reached.

Benefits of technology

It realizes fast automatic focus of industrial cameras, improves image quality and production efficiency, and reduces the time and error of manual adjustment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676556A_ABST
    Figure CN119676556A_ABST
Patent Text Reader

Abstract

The invention relates to a focusing method and device of an industrial camera, industrial control equipment and a storage medium. The industrial control equipment can control the industrial camera to move for multiple rounds in the direction perpendicular to the product to be machined according to the multiple sorted set distances, and a first image with the highest definition is determined from the images collected for multiple rounds. Then, the industrial camera is adjusted to the height where the industrial camera is located when the first image is collected, multiple rounds of brightness adjustment are conducted on the light supplementing light source according to the multiple sorted set brightness, and a second image with the highest definition is determined from the images collected in the multiple rounds. And finally, adjusting the brightness of the light supplementing light source to the brightness when the second image is acquired, further controlling the industrial camera to move for multiple rounds, and the like until the change value of the height of the industrial camera and the change value of the brightness of the light supplementing light source are both smaller than a set threshold value, thereby completing automatic focusing of the industrial camera. According to the invention, automatic focusing of the industrial camera can be rapidly completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a focusing method and device for an industrial camera, industrial control equipment, and a storage medium. Background Art

[0002] Industrial cameras are a key component in machine vision systems that can convert optical signals into orderly electrical signals. With the development of industrial automation, they are widely used in industrial inspection, which can be applied to recognition, surface quality, image processing, image acquisition and other fields.

[0003] Since industrial cameras are used in harsh environments (e.g., machine vibration, electromagnetic interference, etc.), they do not have an autofocus function. Usually, the distance between the industrial camera and the product, as well as the brightness of the light source, is manually adjusted to improve the image quality of the images captured by the industrial camera. However, manual adjustment is time-consuming and has low accuracy. Summary of the invention

[0004] The present disclosure provides a focusing method and device for an industrial camera to solve the deficiencies in the related art.

[0005] According to a first aspect of an embodiment of the present disclosure, a focusing method for an industrial camera is provided, the method comprising:

[0006] Based on the initial height of the industrial camera, the initial brightness of the fill light source corresponding to the industrial camera is calculated, and according to the sorted multiple set distances, the industrial camera is controlled to perform multiple rounds of movement in a direction perpendicular to the product to be processed, and in each round of movement, while the fill light source is performing fill light on the industrial camera based on the initial brightness, a round of image acquisition is performed on the product to be processed, and a first image with the highest definition is determined from the images acquired in multiple rounds;

[0007] The industrial camera is adjusted to the height at which the first image is acquired, and multiple rounds of brightness adjustment are performed on the fill light source according to the sorted multiple set brightnesses, and in each round of adjustment, the industrial camera is controlled to acquire one round of images of the product to be processed when the industrial camera is at the height at which the first image is acquired, and a second image with the highest definition is determined from the multiple rounds of acquired images;

[0008] The brightness of the fill-in light source is adjusted to the brightness when the second image is collected, and the industrial camera is controlled to perform multiple rounds of movement in a direction perpendicular to the product to be processed according to the sorted multiple set distances. In each round of movement, while the fill-in light source fills the industrial camera based on the brightness when the second image is collected, a round of image collection is performed on the product to be processed, and a third image with the highest clarity is determined from the images collected in multiple rounds, and so on, until the change value of the height of the industrial camera and the change value of the brightness of the fill-in light source are both less than the set threshold value, so as to complete the autofocus of the industrial camera.

[0009] The technical solution provided by the embodiments of the present disclosure may at least include the following beneficial effects:

[0010] According to the embodiments of the present disclosure, the industrial control device can control the industrial camera to move in multiple rounds in a direction perpendicular to the product to be processed according to the sorted multiple set distances, perform multiple rounds of image acquisition on the product to be processed, and determine the first image with the highest clarity from the multiple rounds of acquired images. Then, adjust the industrial camera to the height at which the first image is acquired, and perform multiple rounds of brightness adjustment on the fill light source according to the sorted multiple set brightness, perform multiple rounds of image acquisition on the product to be processed, and determine the second image with the highest clarity from the multiple rounds of acquired images. Finally, adjust the brightness of the fill light source to the brightness when the second image is acquired, and control the industrial camera to move in multiple rounds in a direction perpendicular to the product to be processed according to the sorted multiple set distances, perform multiple rounds of image acquisition on the product to be processed, and so on, until the change value of the height of the industrial camera and the change value of the brightness of the fill light source are both less than the set threshold value, so as to complete the automatic focus of the industrial camera. Thus, the automatic focus of the industrial camera is quickly completed. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0012] Figure 1 It is a schematic flow chart of a focusing method of an industrial camera according to an embodiment of the present disclosure.

[0013] Figure 2 is based on Figure 1 A schematic flow chart of another focusing method for an industrial camera is shown based on the illustrated embodiment.

[0014] Figure 3is based on Figure 1 A schematic flow chart of another focusing method for an industrial camera is shown based on the illustrated embodiment.

[0015] Figure 4 It is a schematic diagram of a focusing process of a focusing method for an industrial camera according to an embodiment of the present disclosure.

[0016] Figure 5 is based on Figure 1 A schematic flow chart of another focusing method for an industrial camera is shown based on the illustrated embodiment.

[0017] Figure 6 is based on Figure 1 A schematic flow chart of another focusing method for an industrial camera is shown based on the illustrated embodiment.

[0018] Figure 7 The present invention is a schematic block diagram of a focusing device for an industrial camera according to an embodiment of the present invention.

[0019] Figure 8 is based on Figure 7 A schematic block diagram of another focusing device for an industrial camera based on the illustrated embodiment is shown.

[0020] Fig. 9 is based on Figure 7 A schematic block diagram of another focusing device for an industrial camera based on the illustrated embodiment is shown.

[0021] Fig.10 is based on Figure 7 A schematic block diagram of another focusing device for an industrial camera based on the illustrated embodiment is shown.

[0022] Fig.11 is based on Figure 7 A schematic block diagram of another focusing device for an industrial camera based on the illustrated embodiment is shown.

[0023] Fig.12 The invention is a schematic block diagram of a focusing device for an industrial camera according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.

[0025] Since industrial cameras are used in harsh environments (e.g., machine vibration, electromagnetic interference, etc.), they do not have an autofocus function. Usually, the distance between the industrial camera and the product, as well as the brightness of the light source, is manually adjusted to improve the image quality of the images captured by the industrial camera. However, manual adjustment is time-consuming and has low accuracy.

[0026] The following describes the focusing method of an industrial camera provided by the present disclosure through specific embodiments and in combination with specific application scenarios.

[0027] In an embodiment of the present disclosure, the focusing system of an industrial camera includes: an industrial control device, an industrial camera, and a fill light source. The industrial control device may refer to an industrial control computer (IPC), which is a computer device specifically used in the field of industrial control. It has high reliability, stability, and anti-interference ability, and is suitable for various industrial automation applications. The industrial control device can control the industrial camera to move in a direction perpendicular to the product to be processed, and adjust the focal length of the industrial camera. Among them, the focusing system of the industrial camera also includes: a control device. The control device has three axes, namely, the X-axis, the Y-axis, and the Z-axis. The industrial camera can be installed on the Z-axis of the control device, and the industrial control device can control the industrial camera to move through the control device. The industrial control device can adjust the brightness of the fill light source to fill light for the industrial camera through the fill light source. The industrial camera collects images of the product to be processed and sends the collected images to the industrial control device. The industrial control device can calculate the clarity of multiple images collected by the industrial camera, and control and adjust the industrial camera and the fill light source based on the image with the highest clarity. Furthermore, the focusing system of the industrial camera includes: processing equipment, and the industrial control equipment can process the products to be processed through the processing equipment. The products to be processed may specifically include but are not limited to mobile phones, tablet computers, wearable devices, Internet of Things devices, etc. The processing equipment may specifically include but is not limited to non-contact piezoelectric jet dispensing valves, etc.

[0028] It should be noted that the fill light source can be located on the industrial camera or around the product to be processed, and the fill light source can illuminate the processing equipment at a suitable angle. The present disclosure does not limit the location of the fill light source and the irradiation angle of the fill light source to the processing equipment.

[0029] See also Figure 1 , Figure 1 FIG. 1 is a schematic flow chart of a focusing method for an industrial camera according to an embodiment of the present disclosure. Figure 1 As shown, the focusing method of the industrial camera may include the following steps:

[0030] In step 102, the initial brightness of the fill light source corresponding to the industrial camera is calculated based on the initial height of the industrial camera, and the industrial camera is controlled to perform multiple rounds of movement in a direction perpendicular to the product to be processed according to the sorted multiple set distances. In each round of movement, while the fill light source is filling the industrial camera based on the initial brightness, a round of image acquisition is performed on the product to be processed, and a first image with the highest clarity is determined from the images acquired in multiple rounds.

[0031] The Z axis of the control device is perpendicular to the product to be processed. The industrial control device can control the industrial camera to move perpendicular to the product to be processed by controlling the Z axis of the device. Specifically, the industrial control device can set the position, rotation angle, movement speed, movement distance and other control parameters of the three axes (X axis, Y axis, Z axis) of the control device to control the movement of the industrial camera.

[0032] Furthermore, the industrial control device can initialize the control device, the industrial camera, and the fill light source before focusing the industrial camera.

[0033] In actual applications, if the brightness of the fill light source is high, the image collected may be overexposed after the industrial control equipment controls the industrial camera to move multiple rounds in a direction perpendicular to the product to be processed for the first time. If the brightness of the fill light source is low, the image collected may be underexposed after the industrial control equipment controls the industrial camera to move multiple rounds in a direction perpendicular to the product to be processed for the first time. As a result, the image with the highest definition determined does not conform to the actual situation.

[0034] In one possible implementation, the industrial control equipment can calculate the initial brightness of the fill light source corresponding to the industrial camera based on the initial height of the industrial camera, and control the industrial camera to perform multiple rounds of movement in a direction perpendicular to the product to be processed according to the sorted multiple set distances. In each round of movement, while the fill light source is filling the industrial camera based on the initial brightness, a round of image acquisition is performed on the product to be processed, and the first image with the highest clarity is determined from the images acquired in multiple rounds.

[0035] Optionally, in step 102, the industrial control device may calculate the ratio of the current height of the industrial camera to the highest height of the industrial camera, and further calculate the brightness of the fill light source based on the ratio. The specific formula is as follows:

[0036]

[0037] In the formula, E i It is used to indicate the brightness of the fill light source when the height of the industrial camera is i, Z iIndicates that the current height of the industrial camera is i, Z indicates the highest height of the industrial camera, K indicates the preset coefficient, and b indicates the preset constant. The preset coefficient and the preset constant can be determined by the technicians according to business requirements and debugging experience. For example, the preset coefficient can be 250, and the preset constant can be 5.

[0038] From the above embodiments, it can be known that the industrial control equipment can calculate the brightness of the fill light source corresponding to the industrial camera based on the height of the industrial camera, and adjust the brightness of the fill light source as the industrial camera moves in a direction perpendicular to the product to be processed, so that the brightness difference in the image collected by the industrial camera is small. Thus, the image with the highest clarity that meets the actual situation is determined.

[0039] In step 104, the industrial camera is adjusted to the height at which the first image was acquired, and multiple rounds of brightness adjustment are performed on the fill light source according to the sorted multiple set brightnesses. During each round of adjustment, the industrial camera is controlled to acquire a round of images of the product to be processed while the industrial camera is at the height at which the first image was acquired, and a second image with the highest clarity is determined from the images acquired in multiple rounds.

[0040] In practical applications, the initial brightness of the fill light source corresponding to the industrial camera is calculated based on the initial height of the industrial camera, and the industrial camera is filled with light to avoid overexposure or underexposure of the captured image. However, the brightness required to capture the highest definition image may not be the initial brightness of the fill light source corresponding to the industrial camera, and the brightness of the fill light source needs to be further adjusted.

[0041] In one possible implementation, the industrial camera is adjusted to the height at which it was when the first image was captured, and multiple rounds of brightness adjustment are performed on the fill light source according to the sorted multiple set brightnesses. During each round of adjustment, when the industrial camera is at the height at which the first image was captured, the industrial camera is controlled to perform a round of image capture on the product to be processed, and a second image with the highest clarity is determined from the images captured in multiple rounds.

[0042] It can be seen from the above embodiments that the industrial control device can adjust the brightness of the fill light source based on the height at which the industrial camera captures the first image, and determine the brightness of the fill light source that can capture a clearer image.

[0043] In step 106, the brightness of the fill-in light source is adjusted to the brightness when the second image is collected, and the industrial camera is controlled to perform multiple rounds of movement in a direction perpendicular to the product to be processed according to the sorted multiple set distances. In each round of movement, a round of image collection is performed on the product to be processed while the fill-in light source is filling the industrial camera with light based on the brightness when the second image is collected, and a third image with the highest clarity is determined from the images collected in multiple rounds, and so on, until the change value of the height of the industrial camera and the change value of the brightness of the fill-in light source are both less than the set threshold value, so as to complete the autofocus of the industrial camera.

[0044] In actual applications, after the industrial control equipment adjusts the brightness of the fill light source, the height of the industrial camera required for the image with the highest definition will change. When the industrial camera is filled with light based on the brightness of the fill light source, the height of the industrial camera required to capture the image with the highest definition may not be the current height of the industrial camera, and the height of the industrial camera needs to be further adjusted. Furthermore, after the industrial control equipment adjusts the height of the industrial camera, the brightness required for the image with the highest definition may still change. When the industrial camera is at the height where the image with the highest definition is captured, the brightness required to capture the image with the highest definition may still not be the brightness of the current fill light source, and the brightness of the fill light source needs to be further adjusted.

[0045] In one possible implementation, the brightness of the fill light source is adjusted to the brightness when the second image is captured, and the industrial camera is controlled to perform multiple rounds of movement in a direction perpendicular to the product to be processed according to the sorted multiple set distances. In each round of movement, while the fill light source is filling the industrial camera with light based on the brightness when the second image is captured, a round of image capture is performed on the product to be processed, and a third image with the highest clarity is determined from the images captured in multiple rounds, and so on, until the change in the height of the industrial camera and the change in the brightness of the fill light source are both less than the set threshold value, so as to complete the autofocus for the industrial camera.

[0046] It can be seen from the above embodiments that the industrial control equipment can adjust the height of the industrial camera based on the brightness of the fill light source when capturing the second image, determine the height of the industrial camera that can capture a clearer image, and continuously adjust the height of the industrial camera and the brightness of the fill light source based on the image with the highest definition to complete automatic focusing for the industrial camera.

[0047] For example, the initial brightness of the fill light source corresponding to the industrial camera is calculated based on the initial height of the industrial camera, and the industrial camera is controlled to perform multiple rounds of movement in a direction perpendicular to the product to be processed according to the sorted multiple set distances. In each round of movement, while the fill light source is filling the industrial camera based on the initial brightness, a round of image acquisition is performed on the product to be processed, and the first image with the highest clarity is determined from the images acquired in multiple rounds.

[0048] Secondly, the industrial camera is adjusted to the height at which it was when the first image was captured, and multiple rounds of brightness adjustment are performed on the fill light source according to the sorted multiple set brightnesses. During each round of adjustment, when the industrial camera is at the height at which the first image was captured, the industrial camera is controlled to perform a round of image capture on the product to be processed, and a second image with the highest clarity is determined from the images captured in multiple rounds.

[0049] Then, the brightness of the fill light source is adjusted to the brightness when the second image is collected, and the industrial camera is controlled to perform multiple rounds of movement in a direction perpendicular to the product to be processed according to the sorted multiple set distances. In each round of movement, while the fill light source is filling the industrial camera with light based on the brightness when the second image is collected, a round of image collection is performed on the product to be processed, and a third image with the highest clarity is determined from the images collected in multiple rounds, and so on, until the change value of the height of the industrial camera and the change value of the brightness of the fill light source are both less than the set threshold value, so as to complete the autofocus for the industrial camera.

[0050] See also Figure 2 , Figure 2 is based on Figure 1 A schematic flow chart of another focusing method for an industrial camera is shown based on the embodiment shown. Figure 2 As shown, it may include:

[0051] In step 202, a plurality of set distances are sorted in descending order.

[0052] In a possible implementation, multiple set distances are sorted in descending order.

[0053] For example, the set distances are 0.4 mm, 0.1 mm, and 0.001 mm, and the multiple set distances are sorted in descending order, and the sorted set distances are 0.4 mm, 0.1 mm, and 0.001 mm.

[0054] In step 204, the industrial camera is controlled to perform a first round of movement in a direction perpendicular to the product to be processed according to a first distance value among the sorted multiple set distances, and during the first round of movement, a round of image acquisition is performed on the product to be processed while the fill light source is filling light for the industrial camera based on the initial brightness, and the image with the highest definition is determined from the images collected in the first round, and a range of a preset size with the height at which the industrial camera collects the image with the highest definition as the center point is used as the height range for the next round of movement of the industrial camera, and the industrial camera is controlled to move in a direction perpendicular to the product to be processed within the height range according to a second distance value among the sorted multiple set distances, and so on, until the first image with the highest definition is determined from the images collected in the last round.

[0055] The number of set distances and the distance value may be determined by a technician according to business requirements. The range of preset sizes may also be determined by a technician according to business requirements.

[0056] It should be noted that the industrial control device can control the industrial camera to collect a set number of images within a range of a preset size with the height at which the industrial camera collects the highest definition image as the center point.

[0057] In a possible implementation, the industrial camera is controlled to perform a first round of movement in a direction perpendicular to the product to be processed according to a first distance value among the sorted multiple set distances, and during the first round of movement, a round of image acquisition is performed on the product to be processed while the fill light source is filling light for the industrial camera based on the initial brightness, and the image with the highest clarity is determined from the images acquired in the first round, and a range of a preset size with the height at which the industrial camera acquires the image with the highest clarity as the center point is used as the height range for the next round of movement of the industrial camera, and the industrial camera is controlled to move within the height range in a direction perpendicular to the product to be processed according to a second distance value among the sorted multiple set distances, and so on, until the first image with the highest clarity is determined from the images acquired in the last round.

[0058] For example, if the set distances are 0.4mm, 0.1mm, and 0.001mm, the multiple set distances are sorted in descending order, and the sorted set distances are determined to be 0.4mm, 0.1mm, and 0.001mm. The first distance value is determined to be 0.4mm, the second distance value is 0.1mm, and the third distance value is 0.001mm.

[0059] According to the first distance value of 0.4mm, the industrial camera is controlled to perform a first round of movement in a direction perpendicular to the product to be processed, and during the first round of movement, while the fill light source is filling the industrial camera based on the initial brightness, an image of the product to be processed is collected every 0.4mm, and the image with the highest clarity is determined from the images collected in the first round, and a range of a preset size with the height at which the image with the highest clarity collected by the industrial camera is located as the center point is used as the height range for the second round of movement of the industrial camera.

[0060] According to the second distance value of 0.1mm, the industrial camera is controlled to perform a second round of movement in a direction perpendicular to the product to be processed within the height range moved by the second round of the industrial camera, and during the second round of movement, while the fill light source is filling the industrial camera based on the initial brightness, an image of the product to be processed is collected every 0.1mm, and the image with the highest clarity is determined from the images collected in the second round, and a range of a preset size with the height at which the image with the highest clarity collected by the industrial camera is located as the center point is used as the height range for the third round of movement of the industrial camera.

[0061] According to the third distance value of 0.001mm, the industrial camera is controlled to move the third round in a direction perpendicular to the product to be processed and within the height range of the third round of the industrial camera. During the movement of the third round, while the fill light source is filling the industrial camera based on the initial brightness, an image of the product to be processed is collected every 0.001mm, and the image with the highest clarity is determined from the images collected in the third round as the first image with the highest clarity determined from the images collected in multiple rounds.

[0062] It can be seen from the above embodiments that the industrial control device can determine the height at which the industrial camera is located when the image with the highest definition is collected, while the industrial camera is being supplemented with light based on the brightness of the same supplementary light source. In addition, the number of collected images is reduced, the waste of computing resources is reduced, and computing efficiency is improved.

[0063] See also Figure 3 , Figure 3 is based on Figure 1 A schematic flow chart of another focusing method for an industrial camera is shown based on the embodiment shown. Figure 3 As shown, it may include:

[0064] In step 302, a plurality of set brightnesses are sorted in order from large to small.

[0065] In a possible implementation, multiple set brightnesses are sorted in descending order.

[0066] For example, the brightness is set to 10 levels (Level), 5 levels, and 1 level, and a plurality of set brightnesses are sorted in order from large to small, and the sorted set brightnesses are 10 levels, 5 levels, and 1 level.

[0067] In step 304, a first round of brightness adjustment is performed on the fill light source according to the first brightness among the multiple set brightnesses after sorting, and during the first round of adjustment, the industrial camera is controlled to perform a round of image acquisition on the product to be processed when the industrial camera is located at the height at which the first image was acquired, and the image with the highest clarity is determined from the images acquired in the first round, and a range of a preset size with the brightness of the fill light source when acquiring the image with the highest clarity as the center point is used as the brightness range of the fill light source to be adjusted in the next round, and a second round of brightness adjustment is performed on the fill light source within the brightness range according to the second brightness among the multiple set brightnesses after sorting, and so on, until the second image with the highest clarity is determined from the images acquired in the last round.

[0068] The number and brightness of the set brightness can be determined by the technician according to business requirements. The range of the preset size can also be determined by the technician according to business requirements.

[0069] It should be noted that the industrial control device can control the industrial camera to capture a set number of images within a preset range with the brightness of the fill light source when capturing the highest definition image as the center point.

[0070] In one possible implementation, a first round of brightness adjustment is performed on the fill light source according to a first brightness among the sorted multiple set brightnesses, and during the first round of adjustment, when the industrial camera is at the height at which it was when the first image was captured, the industrial camera is controlled to capture a round of images of the product to be processed, and the image with the highest clarity is determined from the images captured in the first round, and a range of a preset size with the brightness of the fill light source when the image with the highest clarity is captured as the center point is used as the brightness range for adjusting the fill light source in the next round, and a second round of brightness adjustment is performed on the fill light source within the brightness range according to a second brightness among the sorted multiple set brightnesses, and so on, until a second image with the highest clarity is determined from the images captured in the last round.

[0071] For example, if the set brightness is 10, 5, and 1, the multiple set brightnesses are sorted in descending order, and the sorted set brightnesses are 10, 5, and 1. And it is determined that the first brightness is 10, the second brightness is 5, and the third brightness is 1.

[0072] According to the first brightness of 10 levels, the first round of brightness adjustment is performed on the fill light source, and during the first round of adjustment, when the industrial camera is located at the height when the first image is captured, an image of the product to be processed is captured every 10 levels of brightness, and the image with the highest clarity is determined from the images captured in the first round, and a range of a preset size with the brightness of the fill light source when the image with the highest clarity is captured as the center point is used as the brightness range of the fill light source for the second round of adjustment.

[0073] According to the second brightness being level 5, a second round of brightness adjustment is performed for the fill light source within the brightness range adjusted by the second round of fill light source, and during the second round of adjustment, when the industrial camera is located at the height at which it was when the first image was captured, an image of the product to be processed is captured at every 5 levels of brightness, and the image with the highest clarity is determined from the images captured in the second round, and a range of a preset size with the brightness of the fill light source when the image with the highest clarity is captured as the center point is used as the brightness range adjusted by the second round of fill light source.

[0074] According to the third brightness being level 1, a third round of brightness adjustment is performed for the fill light source within the brightness range adjusted by the third round of fill light source, and during the third round of adjustment, when the industrial camera is at the height at which the first image was captured, an image of the product to be processed is captured at every brightness level 1, and the image with the highest clarity is determined from the images captured in the third round as the second image with the highest clarity determined from the images captured in multiple rounds.

[0075] From the above embodiments, it can be seen that the industrial control equipment can determine the brightness of the fill light source when the image with the highest definition is collected at the same height of the industrial camera. In addition, the number of collected images is reduced, the waste of computing resources is reduced, and the computing efficiency is improved.

[0076] See also Figure 4 , Figure 4 It is a schematic diagram of a focusing process of a focusing method for an industrial camera according to an embodiment of the present disclosure.

[0077] like Figure 4 As shown, the industrial control device can initialize the control device, the camera, and the fill light source, and calculate the initial brightness of the fill light source corresponding to the industrial camera based on the initial height of the industrial camera.

[0078] Secondly, sort the multiple set distances in order from large to small, and control the industrial camera to perform a first round of movement in a direction perpendicular to the product to be processed according to the first distance value among the sorted multiple set distances, and during the first round of movement, while the fill light source is filling the industrial camera with light based on the initial brightness, perform a round of image acquisition on the product to be processed, and determine the image with the highest clarity from the images acquired in the first round, and use a range of a preset size with the height at which the image with the highest clarity acquired by the industrial camera is located as the center point as the height range for the next round of movement of the industrial camera, and control the industrial camera to move within the height range in a direction perpendicular to the product to be processed according to the second distance value among the sorted multiple set distances, and so on, until the first image with the highest clarity is determined from the images acquired in the last round.

[0079] Then, the industrial camera is adjusted to the height at which the first image was acquired, and multiple set brightnesses are sorted in descending order. According to the first brightness among the sorted multiple set brightnesses, a first round of brightness adjustment is performed for the fill light source. During the first round of adjustment, when the industrial camera is at the height at which the first image was acquired, the industrial camera is controlled to acquire a round of images of the product to be processed, and the image with the highest clarity is determined from the images acquired in the first round. A range of a preset size with the brightness of the fill light source when the image with the highest clarity is taken as the center point is used as the brightness range for adjusting the fill light source in the next round. According to the second brightness among the sorted multiple set brightnesses, a second round of brightness adjustment is performed for the fill light source within the brightness range, and so on, until the second image with the highest clarity is determined from the images acquired in the last round.

[0080] Finally, the brightness of the fill light source is adjusted to the brightness when the second image is captured, and the industrial camera is controlled to perform a first round of movement in a direction perpendicular to the product to be processed according to the sorted multiple set distances. During the first round of movement, while the fill light source is filling the industrial camera with light based on the brightness when the second image is captured, a round of image capture is performed on the product to be processed, and the image with the highest clarity is determined from the images captured in the first round. A range of a preset size with the height at which the image with the highest clarity captured by the industrial camera is located as the center point is used as the height range for the next round of movement of the industrial camera. According to the second distance value among the sorted multiple set distances, the industrial camera is controlled to move within the height range in the direction perpendicular to the product to be processed, and so on, until the third image with the highest clarity is determined from the images captured in the last round.

[0081] The process continues in this way until the change in the height of the industrial camera and the change in the brightness of the fill light source are both less than the set threshold, thereby completing the automatic focus for the industrial camera.

[0082] Optionally, in step 102, the industrial control device may calculate the difference in grayscale values ​​between pixel points in a pair of pixel points separated by a set unit distance and contained in the acquired image.

[0083] Then, the industrial control device can add the square values ​​of the calculated differences to obtain the clarity of the collected image. The specific formula is as follows:

[0084]

[0085] In the formula, f(I) is used to represent the clarity of the I-th captured image, (i, j) represents the pixel coordinates of the pixel, i represents the horizontal coordinate of the pixel in the captured image, j represents the vertical coordinate of the pixel in the captured image, I(i, j) represents the grayscale value of the pixel at the pixel coordinate (i, j) in the captured image, and (i+2, j) and I(i, j) form a pixel pair.

[0086] It can be seen from the above embodiment that the larger the value of f(I), the higher the clarity of the image. The smaller the value of f(I), the lower the clarity of the image. Among them, the algorithm for calculating the clarity of the image by the industrial control equipment can be a gradient filter method.

[0087] See also Figure 5 , Figure 5 is based on Figure 1 A schematic flow chart of another focusing method for an industrial camera is shown based on the embodiment shown. Figure 5 As shown, it may include:

[0088] In step 502, when the change value of the height at which the industrial camera is located and the change value of the brightness of the fill light source are both less than a set threshold, the round of image acquisition for the product to be processed is determined.

[0089] The threshold value may be determined by technical personnel according to business requirements.

[0090] In a possible implementation, when the change in the height of the industrial camera and the change in the brightness of the fill light source are both less than a set threshold, a round of image acquisition for the product to be processed is determined.

[0091] In step 504, the target image with the highest definition is determined from the images collected in this round, the height of the industrial camera and the brightness of the fill light source when collecting the target image are determined as focus parameters, and the focus parameters are output.

[0092] In a possible implementation, the target image with the highest definition is determined from the images collected in this round, the height of the industrial camera and the brightness of the fill light source when collecting the target image are determined as focus parameters, and the focus parameters are output.

[0093] It can be seen from the above embodiments that the industrial control equipment can adjust the height of the industrial camera and the brightness of the fill light source according to the focus parameters during the subsequent processing of the product to be processed, thereby avoiding repeated focusing of the industrial camera under the same environment, saving computing resources, and improving production efficiency.

[0094] See also Figure 6 , Figure 6 is based on Figure 1 A schematic flow chart of another focusing method for an industrial camera is shown based on the embodiment shown. Figure 6 As shown, it may include:

[0095] In step 602, the world coordinates of each component in the product to be processed are determined according to the height of the industrial camera, the internal parameter compensation coefficient of the industrial camera, and the external parameter compensation coefficient.

[0096] In a possible implementation, the world coordinates of each component in the product to be processed are determined according to the height of the industrial camera, the intrinsic compensation coefficient of the industrial camera, and the extrinsic compensation coefficient.

[0097] Among them, the internal parameter compensation coefficients include: focal length, image principal point coordinates, and distortion parameters. They are used to convert coordinate points from the camera coordinate system to the pixel coordinate system. The external parameter compensation coefficients include: rotation angles around three axes (X axis, Y axis, and Z axis), and translation amounts in the directions of three axes (X axis, Y axis, and Z axis), which are used to convert coordinate points from the world coordinate system to the camera coordinate system.

[0098] In step 604, the determined world coordinates of each component in the product to be processed are provided to a processing device so that the product to be processed is processed by the processing device.

[0099] In a possible implementation, the determined world coordinates of each component in the product to be processed are provided to a processing device so that the product to be processed is processed by the processing device. For example, a non-contact electrospray dispensing valve is installed on the Z axis of the control device to fill the holes in the product to be processed. Of course, the present disclosure can also process other products to be processed using methods corresponding to other products to be processed.

[0100] Corresponding to the aforementioned embodiment of the focusing method for an industrial camera, the present disclosure also provides an embodiment of a focusing device for an industrial camera.

[0101] See also Figure 7 , Figure 7 The present invention is a schematic block diagram of a focusing device for an industrial camera according to an embodiment of the present invention.

[0102] like Figure 7 As shown, the device may include:

[0103] The control module 702 is used to calculate the initial brightness of the fill light source corresponding to the industrial camera based on the initial height of the industrial camera, and control the industrial camera to perform multiple rounds of movement in a direction perpendicular to the product to be processed according to the sorted multiple set distances, and in each round of movement, the fill light source performs fill light on the industrial camera based on the initial brightness, performs a round of image acquisition on the product to be processed, and determines a first image with the highest definition from the images acquired in multiple rounds;

[0104] An adjustment module 704 is used to adjust the industrial camera to the height at which the first image is acquired, perform multiple rounds of brightness adjustment for the fill light source according to the sorted multiple set brightnesses, and in each round of adjustment, control the industrial camera to acquire a round of images of the product to be processed when the industrial camera is at the height at which the first image is acquired, and determine a second image with the highest definition from the multiple rounds of acquired images;

[0105] The focusing module 706 is used to adjust the brightness of the fill-in light source to the brightness when the second image is collected, and control the industrial camera to perform multiple rounds of movement in a direction perpendicular to the product to be processed according to the sorted multiple set distances, and in each round of movement, a round of image collection is performed on the product to be processed while the fill-in light source fills the industrial camera based on the brightness when the second image is collected, and a third image with the highest clarity is determined from the images collected in multiple rounds, and so on, until the change value of the height of the industrial camera and the change value of the brightness of the fill-in light source are both less than the set threshold value, so as to complete the automatic focusing of the industrial camera.

[0106] See also Figure 8 , Figure 8 is based on Figure 7 A schematic block diagram of another focusing device for an industrial camera based on the embodiment shown. Figure 8 As shown, the control module 702 may include:

[0107] A first sorting module 802, used to sort the multiple set distances in descending order;

[0108] The control submodule 804 is used to control the industrial camera to perform a first round of movement in a direction perpendicular to the product to be processed according to a first distance value among the multiple set distances after sorting, and during the first round of movement, a round of image acquisition is performed on the product to be processed while the fill light source is filling light for the industrial camera based on the initial brightness, and the image with the highest clarity is determined from the images collected in the first round, and a range of a preset size with the height at which the industrial camera collects the image with the highest clarity as the center point is used as the height range for the next round of movement of the industrial camera, and the industrial camera is controlled to move in a direction perpendicular to the product to be processed within the height range according to a second distance value among the multiple set distances after sorting, and so on, until the first image with the highest clarity is determined from the images collected in the last round.

[0109] See also Fig. 9 , Fig. 9 is based on Figure 7 A schematic block diagram of another focusing device for an industrial camera based on the embodiment shown. Fig. 9 As shown, the adjustment module 704 may include:

[0110] A second sorting module 902 is used to sort the multiple set brightnesses in descending order;

[0111] The adjustment submodule 904 performs a first round of brightness adjustment for the fill light source according to the first brightness among the multiple set brightnesses after sorting, and during the first round of adjustment, the industrial camera is controlled to perform a round of image acquisition for the product to be processed when the industrial camera is located at the height at which the first image was acquired, and determines the image with the highest clarity from the images acquired in the first round, and uses a range of a preset size with the brightness of the fill light source when acquiring the image with the highest clarity as the center point as the brightness range for adjusting the fill light source in the next round, and performs a second round of brightness adjustment for the fill light source within the brightness range according to the second brightness among the multiple set brightnesses after sorting, and so on, until the second image with the highest clarity is determined from the images acquired in the last round.

[0112] See also Fig.10 , Fig.10 is based on Figure 7 A schematic block diagram of another focusing device for an industrial camera based on the embodiment shown. Fig.10 As shown, the device may also include:

[0113] A first determination module 1002 is used to determine a round of image acquisition for the product to be processed when the change value of the height at which the industrial camera is located and the change value of the brightness of the fill light source are both less than a set threshold;

[0114] The output module 1004 is used to determine the target image with the highest definition from the images collected in this round, determine the height of the industrial camera and the brightness of the fill light source when collecting the target image as focus parameters, and output the focus parameters.

[0115] See also Fig.11 , Fig.11 is based on Figure 7 A schematic block diagram of another focusing device for an industrial camera based on the embodiment shown. Fig.11 As shown, the device may also include:

[0116] A second determination module 1102 is used to determine the world coordinates of each component in the product to be processed according to the height of the industrial camera, the internal parameter compensation coefficient of the industrial camera, and the external parameter compensation coefficient;

[0117] The processing module 1104 is used to provide the determined world coordinates of each component in the product to be processed to a processing device, so that the product to be processed can be processed by the processing device.

[0118] Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the relevant method, and will not be elaborated here.

[0119] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art can understand and implement it without paying creative labor.

[0120] Accordingly, the present disclosure also provides a focusing system for an industrial camera, comprising:

[0121] Industrial cameras are used to capture images of products to be processed and send the captured images to industrial control equipment;

[0122] Fill light source, used to fill light for industrial cameras;

[0123] The industrial control equipment is connected to the industrial camera and the fill light source respectively, and is used to execute the focusing method of the industrial camera, control and adjust the industrial camera and the fill light source to complete the automatic focusing of the industrial camera.

[0124] Accordingly, the present disclosure also provides an industrial control device, including:

[0125] processor;

[0126] a memory for storing processor-executable instructions;

[0127] Wherein, the processor is used to implement the focusing method of the above-mentioned industrial camera.

[0128] Correspondingly, the present disclosure also provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the focusing method of the industrial camera described above is implemented.

[0129] like Fig.12 As shown, Fig.12 1 is a schematic block diagram of a focusing device 1200 for an industrial camera according to an embodiment of the present disclosure. For example, the device 1200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0130] Reference Fig.12 , the device 1200 may include one or more of the following components: a processing component 1202 , a memory 1204 , a power component 1206 , a multimedia component 1208 , an audio component 1210 , an input / output (I / O) interface 1212 , a sensor component 1214 , and a communication component 1216 .

[0131] The processing component 1202 generally controls the overall operation of the device 1200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1202 may include one or more processors 1220 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 1202 may include one or more modules to facilitate the interaction between the processing component 1202 and other components. For example, the processing component 1202 may include a multimedia module to facilitate the interaction between the multimedia component 1208 and the processing component 1202.

[0132] The memory 1204 is configured to store various types of data to support the operation of the device 1200. Examples of such data include instructions for any application or method operating on the device 1200, contact data, phone book data, messages, pictures, videos, etc. The memory 1204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0133] The power supply component 1206 provides power to the various components of the device 1200. The power supply component 1206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 1200.

[0134] The multimedia component 1208 includes a screen that provides an output interface between the device 1200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1208 includes a front camera and / or a rear camera. When the device 1200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0135] The audio component 1210 is configured to output and / or input audio signals. For example, the audio component 1210 includes a microphone (MIC), and when the device 1200 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1204 or sent via the communication component 1216. In some embodiments, the audio component 1210 also includes a speaker for outputting audio signals.

[0136] I / O interface 1212 provides an interface between processing component 1202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0137] The sensor assembly 1214 includes one or more sensors for providing various aspects of the status assessment of the device 1200. For example, the sensor assembly 1214 can detect the open / closed state of the device 1200, the relative positioning of components, such as the display and keypad of the device 1200, the sensor assembly 1214 can also detect the position change of the device 1200 or a component of the device 1200, the presence or absence of user contact with the device 1200, the orientation or acceleration / deceleration of the device 1200, and the temperature change of the device 1200. The sensor assembly 1214 can include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1214 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1214 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0138] The communication component 1216 is configured to facilitate wired or wireless communication between the device 1200 and other devices. The device 1200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR, or a combination thereof. In an exemplary embodiment, the communication component 1216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0139] In an exemplary embodiment, the device 1200 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the methods described in any of the above embodiments.

[0140] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1204 including instructions, and the instructions can be executed by the processor 1220 of the device 1200 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0141] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0142] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

[0143] 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. The terms "include", "comprises" 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 statement "comprises a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0144] The method and device provided in the embodiments of the present disclosure are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method of the present disclosure and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present disclosure, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present disclosure.

Claims

1. A focusing method for an industrial camera, characterized in that: The method comprises: Based on the initial height of the industrial camera, the initial brightness of the fill light source corresponding to the industrial camera is calculated, and according to the sorted multiple set distances, the industrial camera is controlled to perform multiple rounds of movement in a direction perpendicular to the product to be processed, and in each round of movement, while the fill light source is performing fill light on the industrial camera based on the initial brightness, a round of image acquisition is performed on the product to be processed, and a first image with the highest definition is determined from the images acquired in multiple rounds; The industrial camera is adjusted to the height at which the first image is acquired, and multiple rounds of brightness adjustment are performed on the fill light source according to the sorted multiple set brightnesses, and in each round of adjustment, the industrial camera is controlled to acquire one round of images of the product to be processed when the industrial camera is at the height at which the first image is acquired, and a second image with the highest definition is determined from the multiple rounds of acquired images; The brightness of the fill-in light source is adjusted to the brightness when the second image is collected, and the industrial camera is controlled to perform multiple rounds of movement in a direction perpendicular to the product to be processed according to the sorted multiple set distances. In each round of movement, while the fill-in light source fills the industrial camera based on the brightness when the second image is collected, a round of image collection is performed on the product to be processed, and a third image with the highest clarity is determined from the images collected in multiple rounds, and so on, until the change value of the height of the industrial camera and the change value of the brightness of the fill-in light source are both less than the set threshold value, so as to complete the autofocus of the industrial camera.

2. The method according to claim 1, characterized in that According to the sorted multiple set distances, the industrial camera is controlled to perform multiple rounds of movement in a direction perpendicular to the product to be processed, and in each round of movement, a round of image acquisition is performed on the product to be processed while the fill light source is performing fill light on the industrial camera based on the initial brightness, and a first image with the highest definition is determined from the images acquired in multiple rounds, including: Sort multiple set distances in descending order; According to the first distance value among the sorted multiple set distances, the industrial camera is controlled to perform a first round of movement in a direction perpendicular to the product to be processed, and during the first round of movement, while the fill light source is filling light for the industrial camera based on the initial brightness, a round of image acquisition is performed on the product to be processed, and the image with the highest clarity is determined from the images acquired in the first round, and a range of a preset size with the height at which the industrial camera acquires the image with the highest clarity as the center point is used as the height range for the next round of movement of the industrial camera, and according to the second distance value among the sorted multiple set distances, the industrial camera is controlled to move in the direction perpendicular to the product to be processed within the height range, and so on, until the first image with the highest clarity is determined from the images acquired in the last round.

3. The method according to claim 1, characterized in that According to the sorted multiple set brightnesses, multiple rounds of brightness adjustment are performed for the fill light source, and in each round of adjustment, when the industrial camera is at the height at which the first image is collected, the industrial camera is controlled to collect one round of images of the product to be processed, and a second image with the highest definition is determined from the multiple rounds of collected images, including: Sort multiple set brightness levels in descending order; According to the first brightness among the multiple set brightnesses after sorting, a first round of brightness adjustment is performed for the fill light source, and during the first round of adjustment, when the industrial camera is located at the height at which the first image was captured, the industrial camera is controlled to perform a round of image capture for the product to be processed, and the image with the highest clarity is determined from the images captured in the first round, and a range of a preset size with the brightness of the fill light source when the image with the highest clarity is captured as the center point is used as the brightness range for adjusting the fill light source in the next round, and according to the second brightness among the multiple set brightnesses after sorting, a second round of brightness adjustment is performed for the fill light source within the brightness range, and so on, until the second image with the highest clarity is determined from the images captured in the last round.

4. The method according to claim 1, characterized in that: Calculate the clarity of the acquired image, including: Calculating the difference in grayscale values ​​between pixel points in a pair of pixel points separated by a set unit distance in the acquired image; The square values ​​of the calculated differences are added to obtain the clarity of the captured image.

5. The method according to claim 4, characterized in that Calculating the clarity of the acquired image, including: The clarity is calculated based on the following formula: In the formula, f(I) is used to represent the clarity of the I-th captured image, (i, j) represents the pixel coordinates of the pixel, i represents the horizontal coordinate of the pixel in the captured image, j represents the vertical coordinate of the pixel in the captured image, I(i, j) represents the grayscale value of the pixel at the pixel coordinate (i, j) in the captured image, and (i+2, j) and I(i, j) form a pixel pair.

6. The method according to claim 1, characterized in that Calculating the initial brightness of a fill light source corresponding to the industrial camera based on the initial height of the industrial camera includes: The ratio of the current height of the industrial camera to the highest height of the industrial camera is calculated, and the brightness of the fill light source is further calculated based on the ratio.

7. The method according to claim 6, characterized in that The brightness of the fill light source is calculated based on the following formula: In the formula, E i It is used to indicate the brightness of the fill light source when the height of the industrial camera is i, Z i Indicates that the current height of the industrial camera is i, Z indicates the maximum height of the industrial camera, K indicates the preset coefficient, and b indicates the preset constant.

8. The method according to claim 1, characterized in that The method further comprises: When the change value of the height at which the industrial camera is located and the change value of the brightness of the fill light source are both less than a set threshold, determining a round of image acquisition for the product to be processed; A target image with the highest definition is determined from the images collected in this round, the height of the industrial camera and the brightness of the fill light source when collecting the target image are determined as focus parameters, and the focus parameters are output.

9. The method according to claim 1, characterized in that: The method further comprises: Determining the world coordinates of each device in the product to be processed according to the height of the industrial camera, the internal parameter compensation coefficient of the industrial camera, and the external parameter compensation coefficient; The determined world coordinates of each component in the product to be processed are provided to a processing device so that the product to be processed can be processed by the processing device.

10. A focusing device for an industrial camera, characterized in that: The device comprises: A control module, for calculating the initial brightness of the fill light source corresponding to the industrial camera based on the initial height of the industrial camera, controlling the industrial camera to perform multiple rounds of movement in a direction perpendicular to the product to be processed according to the sorted multiple set distances, and in each round of movement, performing a round of image acquisition of the product to be processed while the fill light source is performing fill light on the industrial camera based on the initial brightness, and determining a first image with the highest definition from the images acquired in multiple rounds; an adjustment module, configured to adjust the industrial camera to the height at which the first image is acquired, perform multiple rounds of brightness adjustment for the fill light source according to the sorted multiple set brightnesses, and in each round of adjustment, control the industrial camera to acquire a round of images of the product to be processed when the industrial camera is at the height at which the first image is acquired, and determine a second image with the highest definition from the multiple rounds of acquired images; A focusing module is used to adjust the brightness of the fill light source to the brightness when the second image is collected, and control the industrial camera to perform multiple rounds of movement in a direction perpendicular to the product to be processed according to the sorted multiple set distances, and in each round of movement, a round of image collection is performed on the product to be processed while the fill light source fills the industrial camera based on the brightness when the second image is collected, and a third image with the highest clarity is determined from the images collected in multiple rounds, and so on, until the change value of the height of the industrial camera and the change value of the brightness of the fill light source are both less than the set threshold value, so as to complete the automatic focusing of the industrial camera.

11. A focusing system for an industrial camera, characterized in that: include: Industrial cameras are used to capture images of products to be processed and send the captured images to industrial control equipment; Fill light source, used to fill light for industrial cameras; The industrial control equipment is connected to the industrial camera and the fill light source respectively, and is used to execute the method described in any one of claims 1 to 9 to control and adjust the industrial camera and the fill light source to complete the automatic focusing of the industrial camera.

12. An industrial control device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is used to implement the method according to any one of claims 1 to 9.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Automatic focusing method and device

    CN106231201A

  • Video monitoring focusing method and device

    CN108521544A

  • Automatic focusing method for image analyzer

    CN111698420A

  • Automatic focusing method and system based on 2.5 D and computer terminal applying automatic focusing method and system

    CN115334229A

  • Focusing definition detection method and device, storage medium and electronic equipment

    CN115460348A