Visual system mounting method and visual system mounting device
By using the position and imaging parameter adjustment of the image sensor during the installation process of the vision system, the problems of high subjectivity, time-consuming and cost in the prior art installation results are solved, and a more efficient and objective installation process is achieved.
Patent Information
- Application Number
- CN202510209094.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-06-27
AI Technical Summary
In the prior art, the installation process of the vision system is dependent on experienced engineers for adjustment, resulting in subjective, time-consuming and costly results.
By acquiring the image of the target object collected by the image sensor, adjusting the position and imaging parameters of the image sensor until the production requirements are met, and the installation process of the vision system is standardized.
It improves the objectivity of the installation results, reduces labor costs, improves installation efficiency, and enables the installation of other vision systems to be based on target pose and imaging parameters.
Smart Images

Figure CN120224003A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of vision systems, and particularly relates to an installation method and an installation device for a vision system. Background Art
[0002] Before installing a vision system on a production line, it is necessary to simulate the vision system used in the production process, sample the standard vision system, and obtain the installation conditions of the standard vision system that meet the production requirements; thus, based on the installation conditions of the standard vision system, the vision system on the production line is set. In the related art, mainly through experienced engineers, observing the imaging clarity in the vision software and continuously adjusting the settings of the standard vision system to make the standard vision system meet the production requirements. However, the judgment results of the above method are subjective, time-consuming, and have a high labor cost. Summary of the Invention
[0003] This application aims to solve at least one of the technical problems existing in the related art. For this purpose, this application proposes an installation method and an installation device for a vision system, standardizes the process of adjusting the vision system to meet the production requirements, improves the objectivity of the installation results, reduces the labor cost, and improves the installation efficiency.
[0004] In a first aspect, this application provides an installation method for a vision system, where the vision system includes an image sensor; the method includes:
[0005] Obtaining a first image corresponding to a target object collected by the image sensor;
[0006] Adjusting the pose of the image sensor according to the pixel position of the target object in the first image to obtain a new first image until the pixel position of the target object in the new first image is at the target pixel position of the new first image, and determining the current pose of the image sensor as the target pose corresponding to the image sensor;
[0007] When the image sensor is in the target pose, adjusting the imaging parameters of the image sensor based on a second image corresponding to the target object collected by the image sensor to obtain target imaging parameters; the target pose and the target imaging parameters are used to indicate the installation of at least one vision system of the same type as the vision system.
[0008] According to the installation method of the vision system of the present application, by acquiring a first image of a target object collected by an image sensor, based on the first image, adjusting the pose of the image sensor until the pixel position of the target object can be at the target pixel position, the target pose is obtained; when the image sensor is in the target pose, continue to acquire a second image, based on the second image, adjust the imaging parameters of the image sensor, obtain the target imaging parameters, standardize the process of adjusting the vision system to meet the production requirements, improve the objectivity of the installation result, reduce the labor cost. In addition, other vision systems can also be installed based on the target pose and the target imaging parameters, improving the installation efficiency.
[0009] According to the installation method of the vision system of the present application, adjusting the pose of the image sensor according to the pixel position of the target object in the first image to obtain a new first image until the pixel position of the target object in the new first image is at the target pixel position of the new first image, and determining the current pose of the image sensor as the target pose corresponding to the image sensor includes:
[0010] Based on the edge of the target object in the first image, obtain the pixel position of the target object;
[0011] Calculate the offset value between the pixel position and the target pixel position in the first image;
[0012] When the offset value is not greater than the first offset threshold, determine that the pixel position of the target object is at the target pixel position of the first image, and determine the current pose of the image sensor as the target pose corresponding to the image sensor;
[0013] When the offset value is greater than the first offset threshold, adjust the pose of the image sensor to obtain a new first image corresponding to the target object collected by the adjusted image sensor.
[0014] According to the installation method of the vision system of the present application, the target pose includes an inclination angle, and the target object is a target profiling block; determining the current pose of the image sensor as the target pose corresponding to the image sensor includes:
[0015] Based on the actual side length of the target profiling block, the pixel length of the target profiling block in the first image, and the thickness of the target profiling block, calculate the inclination angle corresponding to the current pose of the image sensor;
[0016] Determine the inclination angle as the target pose corresponding to the image sensor.
[0017] According to the installation method of the vision system of the present application, the target imaging parameters include the target distance parameter between the image sensor and the target object; when the image sensor is in the target pose, based on the second image corresponding to the target object collected by the image sensor, adjusting the imaging parameters of the image sensor to obtain the target imaging parameters includes:
[0018] When the image sensor is in the target pose, obtaining the second image corresponding to the target object collected by the image sensor;
[0019] Based on the display clarity corresponding to the target object in the second image, adjusting the distance between the image sensor and the target object until the display clarity is not less than the clarity threshold, and determining the current distance between the image sensor and the target object as the target distance parameter.
[0020] According to the installation method of the vision system of the present application, the vision system further includes: a light source system; the target imaging parameters further include at least one of the light source brightness parameter corresponding to the light source system, the exposure parameter corresponding to the image sensor, and the white balance ratio corresponding to the image sensor; based on the second image corresponding to the target object collected by the image sensor, adjusting the imaging parameters of the image sensor to obtain the target imaging parameters includes:
[0021] Based on the value range corresponding to the exposure parameter, the value range corresponding to the light source brightness parameter, and the value range corresponding to the white balance ratio, respectively traversing at least one of the exposure parameter, the light source brightness parameter, and the white balance ratio to obtain multiple sets of imaging parameters;
[0022] Obtaining the second image corresponding to the target object collected by the image sensor under each set of the imaging parameters;
[0023] Based on the difference degree between the background pixel region in each of the second images and the foreground pixel region corresponding to the target object in the second image, determining the target imaging parameters from the multiple sets of imaging parameters.
[0024] According to the installation method of the vision system of the present application, the determining the target imaging parameters from the multiple sets of imaging parameters based on the difference degree between the background pixel region in each of the second images and the foreground pixel region corresponding to the target object in the second image includes:
[0025] Respectively selecting a plurality of background sub-regions and a plurality of foreground sub-regions from the background pixel region of the target image and the foreground pixel region corresponding to the target object of the target image in each of the second images;
[0026] Group the multiple background sub-regions and the multiple foreground sub-regions to obtain multiple groups of regions of interest;
[0027] Calculate the difference degrees between the background sub-regions and the foreground sub-regions in each group of the regions of interest respectively to obtain multiple sub-difference degrees;
[0028] Sum up the multiple sub-difference degrees to obtain the difference degree between the background pixel region in the target image and the foreground pixel region corresponding to the target object in the target image;
[0029] When the difference degree is greater than the difference degree threshold, determine the imaging parameters used for acquiring the target image from the multiple groups of imaging parameters;
[0030] Determine the imaging parameters used for acquiring the target image as the target imaging parameters.
[0031] In a second aspect, the present application provides an installation device for a vision system, where the vision system includes an image sensor; the device includes:
[0032] A first processing module, configured to obtain a first image corresponding to a target object collected by the image sensor;
[0033] A second processing module, configured to adjust the pose of the image sensor according to the pixel position of the target object in the first image to obtain a new first image until the pixel position of the target object in the new first image is at a target pixel position of the new first image, and determine the current pose of the image sensor as the target pose corresponding to the image sensor;
[0034] A third processing module, configured to, when the image sensor is in the target pose, adjust the imaging parameters of the image sensor based on a second image corresponding to the target object collected by the image sensor to obtain target imaging parameters; the target pose and the target imaging parameters are used to indicate the installation of at least one vision system of the same type as the vision system.
[0035] According to the installation device for a vision system of the present application, by obtaining a first image of a target object collected by an image sensor, adjusting the pose of the image sensor based on the first image until the pixel position of the target object can be at the target pixel position to obtain the target pose; when the image sensor is in the target pose, continue to obtain a second image, adjust the imaging parameters of the image sensor based on the second image to obtain the target imaging parameters, standardize the process of adjusting the vision system to meet the production requirements, improve the objectivity of the installation result, reduce the labor cost, and in addition, other vision systems can also be installed based on the target pose and the target imaging parameters to improve the installation efficiency.
[0036] In a third aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the installation method of the vision system described in the first aspect above is implemented.
[0037] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the installation method of the vision system described in the first aspect above is implemented.
[0038] In a fifth aspect, the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, the installation method of the vision system described in the first aspect above is implemented.
[0039] One or more of the above technical solutions in the embodiments of the present application have at least one of the following technical effects:
[0040] By acquiring a first image of a target object collected by an image sensor, based on the first image, adjusting the pose of the image sensor until the pixel position of the target object can be at a target pixel position to obtain a target pose; in the case where the image sensor is at the target pose, continuing to acquire a second image, based on the second image, adjusting the imaging parameters of the image sensor to obtain target imaging parameters, standardizing the process of adjusting the vision system to meet production requirements, improving the objectivity of the installation result, reducing labor costs. In addition, other vision systems can also be installed based on the target pose and target imaging parameters, improving the installation efficiency.
[0041] Further, by replacing the target object with a target profiling block, based on the actual side length of the target profiling block, the pixel length of the target profiling block in the first image, and the thickness of the target profiling block, accurately calculating the tilt angle of the current pose of the image sensor, and determining the calculated tilt angle as the target pose, improving the accuracy of the determined target pose.
[0042] Furthermore, by acquiring a second image corresponding to the target object, based on the magnitude relationship between the display clarity corresponding to the target object in the second image and a clarity threshold, determining whether the current distance between the image sensor and the target object is suitable for image acquisition. In the case where the display clarity is not less than the clarity threshold, determining the current distance between the image sensor and the target object as the target distance parameter, using the display clarity as a decision parameter to determine the target distance parameter, the determination method is simple and convenient, easy to operate, and scientific.
[0043] Furthermore, by traversing one or more of the exposure parameters, light source brightness parameters, and white balance ratios, multiple sets of imaging parameters are obtained, and second images collected by the image sensor under each set of imaging parameters are acquired. The influence of each set of imaging parameters on the collected images is visualized, so as to select optimal target imaging parameters from the multiple sets of imaging parameters based on the difference degree between the background pixel region and the foreground pixel region in each second image, thereby improving the usability and reliability of imaging parameter selection.
[0044] Additional aspects and advantages of the present application will be given in part in the following description, become apparent in part from the following description, or be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The above and / or additional aspects and advantages of the present application will become apparent and be readily understood from the description of the embodiments in conjunction with the following drawings, where:
[0046] Figure 1 is one of the flow schematic diagrams of the installation method of the vision system provided by the embodiment of the present application;
[0047] Figure 2 is one of the principle schematic diagrams of the installation method of the vision system provided by the embodiment of the present application;
[0048] Figure 3 is the second of the flow schematic diagrams of the installation method of the vision system provided by the embodiment of the present application;
[0049] Figure 4 is the second of the principle schematic diagrams of the installation method of the vision system provided by the embodiment of the present application;
[0050] Figure 5 is the third of the principle schematic diagrams of the installation method of the vision system provided by the embodiment of the present application;
[0051] Figure 6 is the fourth of the principle schematic diagrams of the installation method of the vision system provided by the embodiment of the present application;
[0052] Figure 7 is the structural schematic diagram of the installation device of the vision system provided by the embodiment of the present application;
[0053] Figure 8 is the structural schematic diagram of the electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0054] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0055] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of the same category, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means that the associated objects before and after are in an "or" relationship.
[0056] Next, in conjunction with the accompanying drawings, the installation method of the vision system, the installation device of the vision system, the electronic device, and the readable storage medium provided by the embodiments of the present application will be described in detail through specific embodiments and their application scenarios.
[0057] Among them, the installation method of the vision system can be applied to a terminal, and specifically can be executed by hardware or software in the terminal.
[0058] The terminal includes, but is not limited to, portable communication devices such as mobile phones or tablets. It should also be understood that in some embodiments, the terminal may not be a portable communication device, but a desktop computer.
[0059] In the following various embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse, and a joystick.
[0060] The installation method of the vision system provided by the embodiments of the present application. The execution subject of the installation method of the vision system can be an electronic device or a functional module or functional entity in the electronic device that can implement the installation method of the vision system. The electronic devices mentioned in the embodiments of the present application include, but are not limited to, mobile phones, tablets, computers, cameras, and wearable devices, etc. Hereinafter, the installation method of the vision system provided by the embodiments of the present application will be described by taking the electronic device as the execution subject.
[0061] As Figure 1 shown, the installation method of the vision system includes: step 110, step 120, and step 130.
[0062] The vision system includes an image sensor.
[0063] Step 110: Obtain a first image corresponding to a target object collected by an image sensor;
[0064] In this step, the target object is the object to be photographed whose image needs to be obtained during the installation of the vision system.
[0065] The target object can be a product on a production line in an industrial scenario and an object for determining the image quality collected by the image sensor.
[0066] During the installation of the vision system, different target objects can be selected based on the actual situation.
[0067] The first image is an image including the complete target object collected by the image sensor.
[0068] As Figure 2 shown, the image sensor can be fixed on the bracket of the vision system.
[0069] During the actual execution process, after fixing the image sensor on the bracket of the vision system and placing the target object at the relevant position on the production line, the image sensor starts to photograph the target object to obtain the first image.
[0070] It should be noted that the position of the image sensor on the bracket can generally enable the image sensor to photograph the location where the target object is located.
[0071] During the actual execution process, the first image can be displayed in real time on the software interface.
[0072] In some embodiments, obtaining the first image corresponding to the target object collected by the image sensor may further include:
[0073] Obtain an initial image corresponding to the target object collected by the image sensor;
[0074] When the pixel integrity corresponding to the target object in the initial image is not less than the integrity threshold, determine the initial image as the first image;
[0075] When the pixel integrity corresponding to the target object in the initial image is less than the integrity threshold, adjust at least one of the position of the image sensor and the initial parameters of the image sensor to obtain a new initial image until the pixel integrity corresponding to the target object in the new initial image is not less than the integrity threshold, and determine the new initial image as the first image.
[0076] In this embodiment, the initial image is an image directly collected based on the initial position of the image sensor on the bracket of the vision system.
[0077] The pixel integrity is the integrity of the target object in the initial image.
[0078] The pixel integrity can be obtained by performing feature extraction on the initial image.
[0079] The integrity threshold is a preset value for determining whether the target object in the initial image is complete.
[0080] The specific value of the integrity threshold can be determined based on user-defined or actual situations, and this application does not make any limitations.
[0081] The initial parameters are the relevant parameters that affect the field of view of the image sensor.
[0082] The initial parameters can include: aperture, magnification, focal length, etc.
[0083] The new initial image is the image captured by the image sensor after adjusting one or more of the position of the image sensor and the imaging parameters of the image sensor.
[0084] In the actual execution process, when the pixel integrity corresponding to the target object in the initial image is not less than the integrity threshold, it is approximately considered that the image sensor can completely capture the target object. At this time, the initial image can be determined as the first image.
[0085] As Figure 3 shown, when the pixel integrity of the target object in the initial image is less than the integrity threshold, it is approximately considered that the image sensor cannot completely capture the target object. At this time, based on parameters such as the position of the target object, the initial distance between the target object and the image sensor, the aperture and magnification of the image sensor, the field of view of the image sensor can be adjusted so that the complete target object is included in the field of view of the image sensor to preliminarily determine the imaging field of view of the image sensor.
[0086] For example, by adjusting the direction of the image sensor lens or the initial distance between the image sensor and the target object, the complete target object can be included in the field of view of the image sensor.
[0087] Another example is to adjust the magnification of the image sensor, reduce or increase the magnification of the image sensor for the target object, so that the complete target object is included in the field of view of the image sensor.
[0088] In the actual execution process, after adjusting the image sensor, if the pixel integrity corresponding to the target object in the new initial image captured by the image sensor is not less than the integrity threshold, the new initial image can be determined as the first image.
[0089] According to the installation method of the vision system provided by the embodiments of the present application, by comparing the size relationship between the pixel integrity corresponding to the target object in the initial image and the integrity threshold, it is effectively determined whether the target object in the initial image is complete. When the pixel integrity corresponding to the target object is not less than the integrity threshold, the initial image is determined as the first image, improving the image quality and usability of the obtained first image.
[0090] Step 120: According to the pixel position of the target object in the first image, adjust the pose of the image sensor to obtain a new first image until the pixel position of the target object in the new first image is at the target pixel position of the new first image, and determine the current pose of the image sensor as the target pose corresponding to the image sensor.
[0091] In this step, the pixel position is the pixel coordinates of the target object in the first image.
[0092] The pose of the image sensor is the position where the image sensor is installed and the attitude of the image sensor, etc.
[0093] The target pixel position is a pre-specified position area to improve the display effect of the target object in the first image.
[0094] The target pixel position can be the central pixel position of the first image or the pixel positions around the pixel position of the first image.
[0095] The specific position of the target pixel position can be determined based on user definition or based on the actual situation, and the present application does not make a limitation.
[0096] The target pose is the pose that the image sensor needs to be set to meet the image acquisition requirements.
[0097] In the actual execution process, the pixel position where the target object is located in the first image can be recognized through an image recognition algorithm, or the pixel position of the target object can be determined by receiving the input of the user.
[0098] For example, a free curve is set on the software interface, and the user (i.e., the installation engineer) can frame the product or product features to determine the pixel position of the target object based on the position of the user's frame line.
[0099] In the actual execution process, after determining the pixel position of the target object and the target pixel position of the first image, the position relationship between the pixel position of the target object and the target pixel position of the first image can be compared. When the pixel position of the target object is at the target pixel position of the first image, the current pose of the image sensor can be determined as the target pose corresponding to the image sensor.
[0100] The pixel position of the target object being at the target pixel position of the first image includes, but is not limited to: the pixel position of the target object and the target pixel position being exactly coincident, the overlap rate between the pixel position of the target object and the target pixel position being greater than the overlap threshold, and the distance between the pixel position of the target object and the target pixel position being not greater than the distance threshold.
[0101] The overlap rate is the ratio of the area of the overlapping part between the pixel position of the target object and the target pixel position to the total area of the pixel position of the target object and the target pixel position.
[0102] The overlap threshold is a preset value for determining whether the pixel position of the target object and the target pixel position of the first image match.
[0103] The overlap threshold can be user-defined or determined based on the actual situation, and this application does not make any limitations.
[0104] The distance threshold is a preset value for determining the proximity of the pixel position of the target object and the target pixel position of the first image.
[0105] The distance threshold can be user-defined or determined based on the actual situation, and this application does not make any limitations.
[0106] In the actual execution process, the pixel area of the pixel position of the target object and the pixel area of the target pixel position can be calculated respectively, so as to obtain the overlap rate based on the calculated pixel areas, and compare the overlap rate with the overlap threshold to determine whether the pixel position of the target object is at the target pixel position of the first image.
[0107] When the pixel position of the target object is at the target pixel position of the first image, the current pose of the image sensor is determined as the target pose corresponding to the image sensor.
[0108] When the pixel position of the target object is not at the target pixel position of the first image, the pose of the image sensor is adjusted to obtain a new first image, and it is continuously determined whether the pixel position of the target object in the new first image is at the target pixel position until the pixel position of the target object in the new first image is at the target pixel position of the new first image, and the current pose of the image sensor is determined as the target pose corresponding to the image sensor.
[0109] Step 130: When the image sensor is in the target pose, based on the second image corresponding to the target object collected by the image sensor, adjust the imaging parameters of the image sensor to obtain the target imaging parameters; the target pose and the target imaging parameters are used to indicate at least one vision system of the same type as the installed vision system.
[0110] In this embodiment, the second image is an image of the target object collected by the image sensor based on the determined field of view of the target pose.
[0111] The imaging parameters of the image sensor are parameters that affect the image quality collected by the image sensor.
[0112] The imaging parameters of the image sensor include but are not limited to: exposure, aperture, shutter speed, ISO sensitivity, focal length, and white balance.
[0113] The target imaging parameters are the parameters that the image sensor needs to set to meet the image acquisition requirements.
[0114] During the actual execution process, after obtaining the second image collected by the image sensor, the imaging parameters of the image sensor can be adjusted based on the image quality of the second image.
[0115] For example, when the clarity of the second image does not meet the clarity requirements, continuously adjust the imaging parameters such as the shutter speed and focusing accuracy of the image sensor to make the clarity of the image sensor meet the clarity requirements.
[0116] For another example, when the image quality of the second image is poor, the ISO sensitivity of the image sensor can be continuously adjusted to reduce the noise in the second image.
[0117] During the actual execution process, after obtaining the second image, the imaging parameters of the image sensor can be continuously adjusted to make the second image collected by the image sensor meet the shooting requirements, and the target imaging parameters corresponding to the image sensor can be obtained under the condition of meeting the shooting requirements.
[0118] In an actual application scenario, before installing the vision system on the production line, through the processes of step 110, step 120, and step 130, the vision system used in the production process can be simulated, and the standard vision system can be prototyped to obtain the installation situation of the standard vision system that meets the production requirements, that is, the target pose and target imaging parameters are obtained, and the obtained target pose and target imaging parameters are used to instruct the installation process of the vision system of the same type as the standard vision system or on the same production line as the standard vision system.
[0119] The inventor found during the research and development process that in the related art, mainly through experienced engineers, observing the imaging clarity in the vision software, continuously adjusting the settings of the standard vision system to make the standard vision system meet the production requirements. However, the above method has subjective judgment results, consumes time, and has high labor costs.
[0120] In this application, by obtaining the first image of the target object collected by the image sensor, it is determined whether taking a picture in the current pose of the image sensor meets the display position requirement of the pixel position of the target object in the first image. When the display position requirement is not met, the pose of the image sensor is adjusted so that in the new first image collected by the image sensor in the new pose, the pixel position of the target object can be at the target pixel position, and the target pose is obtained. After determining the target pose of the image sensor, further based on the target pose, a second image is obtained, and based on the second image, the imaging parameters of the image sensor are adjusted to obtain the target imaging parameters. Thus, based on the target pose and the target imaging parameters, other vision systems are installed, standardizing the debugging process of the vision system, making the installation result of the vision system more objective, without the need for users to master too much prior knowledge, reducing labor costs, and improving installation efficiency.
[0121] According to the installation method of the vision system provided by the embodiments of this application, by obtaining the first image of the target object collected by the image sensor, based on the first image, the pose of the image sensor is adjusted until the pixel position of the target object can be at the target pixel position, and the target pose is obtained. When the image sensor is in the target pose, continue to obtain the second image, and based on the second image, adjust the imaging parameters of the image sensor to obtain the target imaging parameters, standardizing the process of adjusting the vision system to meet the production requirements, improving the objectivity of the installation result, reducing labor costs. In addition, other vision systems can also be installed based on the target pose and the target imaging parameters, improving the installation efficiency.
[0122] Continue to refer to Figure 3 , in some embodiments, step 120 may further include:
[0123] Based on the edge of the target object in the first image, obtain the pixel position of the target object;
[0124] Calculate the offset value between the pixel position and the target pixel position in the first image;
[0125] When the offset value is not greater than the first offset threshold, it is determined that the pixel position of the target object is at the target pixel position in the first image, and the current pose of the image sensor is determined as the target pose corresponding to the image sensor;
[0126] When the offset value is greater than the first offset threshold, adjust the pose of the image sensor to obtain a new first image corresponding to the target object collected by the adjusted image sensor.
[0127] In this embodiment, the offset value is a numerical value representing the offset situation between the pixel position of the target object and the target pixel position in the first image.
[0128] The offset value may include: offset distance, offset direction, etc.
[0129] For example, the pixel position of the target object is offset by 1 cm in the due north direction relative to the target pixel position.
[0130] The offset value can be the offset value between the center points of the pixel position and the target pixel position, or the offset value between the point closer to the target pixel position in the pixel position and the center point of the target pixel position.
[0131] Of course, in the actual execution process, the offset value can also be calculated by any other achievable method, and the present application does not make any limitations.
[0132] The first offset threshold is a preset value for judging the offset magnitude between the pixel position of the target object and the target pixel position.
[0133] The specific value of the first offset threshold can be based on user definition or determined based on the actual situation, and the present application does not make any limitations.
[0134] In the actual execution process, the edge of the target object can be obtained by feature extraction of the first image or by user selection, so as to obtain the pixel position of the target object based on the edge, and then calculate the offset value between the pixel position and the target pixel position.
[0135] The pixel position of the target object and the center of the target pixel position can be displayed in real time on the software interface, and a connection line between the two midpoint lines can be established to prompt the user of the offset value.
[0136] When the offset value is not greater than the first offset threshold, it can be determined that the pixel position of the target object is at the target pixel position of the first image, and the current pose of the image sensor is determined as the target pose corresponding to the image sensor.
[0137] When the offset value is greater than the first offset threshold, it can be determined that the pixel position of the target object is not at the target pixel position of the first image. The pose of the image sensor can be further adjusted to obtain a new first image corresponding to the target object collected by the adjusted image sensor. The offset value between the pixel position of the target object and the target pixel position in the new first image is further compared, and the adjustment operation is continuously repeated until the offset value between the pixel position of the target object and the target pixel position in the new first image is not greater than the first offset threshold, and the current pose of the image sensor is determined as the target pose corresponding to the image sensor.
[0138] According to the installation method of the vision system provided by the embodiments of the present application, the pixel position of the target object in the first image is obtained through the edge of the target object, the offset value between the pixel position and the target pixel position is calculated, and the magnitude relationship between the offset value and the first offset threshold is compared, so as to effectively determine whether the pixel position is at the target pixel position of the first image, and quantify the judgment method of whether the current pose meets the usage requirements, thereby improving the accuracy and usability of the determined pose of the image sensor.
[0139] Continuing to refer to Figure 3 , in some embodiments, the target pose includes an inclination angle, and the target object is a target profiling block; determining the current pose of the image sensor as the target pose corresponding to the image sensor may further include:
[0140] Calculating the inclination angle corresponding to the current pose of the image sensor based on the actual side length of the target profiling block, the pixel length of the target profiling block in the first image, and the thickness of the target profiling block;
[0141] Determining the inclination angle as the target pose corresponding to the image sensor.
[0142] In this embodiment, the inclination angle is the inclination angle of the image sensor relative to the vertical plane perpendicular to the horizontal plane.
[0143] The inclination angle may include: forward inclination angle, backward inclination angle, right inclination angle, left inclination angle, etc.
[0144] The inclination angle can indicate the current state of the image sensor.
[0145] The target profiling block is a special object with a certain thickness.
[0146] The target profiling block may include a plurality of hollowed-out and regularly shaped regions.
[0147] Such as Figure 3 shown, the target profiling block may include a plurality of rectangular hollowed-out regions and a plurality of circular hollowed-out regions.
[0148] The thickness of the target profiling block may be 3 mm, the side length of the rectangular hollowed-out region in the target profiling block is 5 mm, and the region from the rectangular hollowed-out region to the center of the nearby circular hollowed-out region may be 10.5 mm.
[0149] The specific setting of the target profiling block may be based on user definition or determined according to the actual situation, which is not limited in this application.
[0150] The target profiling block may be placed at a relevant position on the production line, and the distance between the placement position of the target profiling block and the image sensor may be the same as the distance between the product on the production line and the image sensor.
[0151] For example, the distance between the placement position of the target profiling block and the image sensor can be 110 mm.
[0152] As Figure 5 shown, the image sensor is tilted to the right, and there is the following functional relationship between the angle A, the actual side length of the target profiling block, the pixel length of the target profiling block in the first image, and the thickness of the target profiling block:
[0153]
[0154] where A is the first tilt angle; W is the actual side length of the target profiling block; W L is the pixel length of the target profiling block; H is the thickness of the target profiling block.
[0155] The actual side length of the target profiling block is the actual side length of the rectangular hollowed-out area.
[0156] The pixel length of the target profiling block is the pixel length of the photographed rectangular hollowed-out area.
[0157] Continuing to refer to Figure 4 , in the case where the image sensor has an inclination angle, there will be a shadow in the hollowed-out area in the first image, and the pixel length of the target profiling block is the pixel length of the white area in the hollowed-out area except for the shadow part.
[0158] W L is the pixel length of the white area in the hollowed-out area except for the left shadow part.
[0159] In the actual execution process, the first tilt angle can be calculated based on the following formula:
[0160]
[0161] where A is the first tilt angle; W is the actual side length of the target profiling block; W L is the pixel length of the target profiling block; H is the thickness of the target profiling block.
[0162] Similarly, there is the following functional relationship between the angle B, the actual side length of the target profiling block, the pixel length of the target profiling block in the first image, and the thickness of the target profiling block:
[0163]
[0164] where B is the second tilt angle; W is the actual side length of the target profiling block; W R is the pixel length of the target profiling block; H is the thickness of the target profiling block.
[0165] In the actual execution process, the second tilt angle can be calculated based on the following formula:
[0166]
[0167] Wherein, B is the second inclination angle; W is the actual side length of the target profiling block; W R is the pixel length of the target profiling block; H is the thickness of the target profiling block.
[0168] W R is the pixel length of the white area in the hollowed-out area except for the right-side shadow part.
[0169] During the actual execution process, the inclination angles of the image sensor in each direction can be calculated respectively, and the calculated inclination angles are determined as the target poses corresponding to the image sensor.
[0170] The inclination angle of the image sensor can be displayed in real time within the software interface.
[0171] According to the installation method of the vision system provided by the embodiments of the present application, by replacing the target object with the target profiling block, based on the actual side length of the target profiling block, the pixel length of the target profiling block in the first image, and the thickness of the target profiling block, the inclination angle of the current pose of the image sensor is accurately calculated, so as to determine the calculated inclination angle as the target pose, improving the accuracy of the determined target pose.
[0172] Continue to refer to Figure 3 , in some embodiments, the target imaging parameter includes the target distance parameter between the image sensor and the target object, and step 130 may further include:
[0173] When the image sensor is in the target pose, obtain a second image of the target object collected by the image sensor;
[0174] Based on the display clarity corresponding to the target object in the second image, adjust the distance between the image sensor and the target object until the display clarity is not less than the clarity threshold, and determine the current distance between the image sensor and the target object as the target distance parameter.
[0175] In this embodiment, the target object may be a product on the production line or a specially made target.
[0176] The specially made target may have characteristics that are easy to detect and locate, such as, an obvious geometric shape.
[0177] The geometric shape may include: checkerboard, concentric circles, crosshairs, etc.
[0178] The specially made target may be as Figure 6 shown.
[0179] The display clarity is the clarity of the target object in the second image.
[0180] It should be noted that when the target object is a special target, the overexposure problem caused by photographing the product can be alleviated, that is, when the target object is a target with characteristics, the display clarity is more standardized.
[0181] In the actual execution process, the display clarity of the target object in the second image can be calculated by extracting the features of the second image and using the weighted average method or other statistical methods.
[0182] Of course, in the actual execution process, the display clarity of the target object in the second image can also be calculated by any other feasible method.
[0183] The clarity threshold is a preset value for judging whether the display clarity of the target object in the second image meets the production requirements.
[0184] The specific value of the clarity threshold can be user-defined or determined based on the actual situation, and this application does not make any limitations.
[0185] The target distance parameter is the distance between the image sensor and the target object when the image clarity collected by the image sensor meets the production requirements.
[0186] In the actual execution process, the second image of the products related to the production line or the second image of the special target photographed by the image sensor can be obtained, and the correlation between the display clarity of the target object in the second image and the clarity threshold can be compared.
[0187] When the display clarity of the target object is not less than the clarity threshold, the current distance between the image sensor and the target object is determined as the target distance parameter.
[0188] When the display clarity of the target object is less than the clarity threshold, within the adjustable distance range of the image sensor, the distance between the image sensor and the target object is adjusted. Based on the new distance, a new second image is collected, and the size relationship between the display clarity of the target object in the new second image and the clarity threshold is compared until the display clarity of the target object is not less than the clarity threshold, and the current distance between the image sensor and the target object is determined as the target distance parameter.
[0189] In the actual execution process, the display clarity of the target object can be displayed on the software interface in real time. By adjusting the distance between the image sensor and the target object until the display clarity is not less than the clarity threshold, after determining that the display clarity is not less than the clarity threshold, the user can click the "Finish button" to prompt the user that the current distance between the image sensor and the target or the product is a more suitable distance.
[0190] According to the installation method of the vision system provided by the embodiments of the present application, by obtaining a second image corresponding to a target object, based on the magnitude relationship between the display clarity corresponding to the target object in the second image and a clarity threshold, it is determined whether the current distance between the image sensor and the target object is suitable for image acquisition. When the display clarity is not less than the clarity threshold, the current distance between the image sensor and the target object is determined as the target distance parameter, and the display clarity is used as the decision parameter to determine the target distance parameter. The judgment method is simple, convenient, easy to operate, and scientific.
[0191] Continuing to refer to Figure 3 , in some embodiments, the vision system further includes: a light source system; the target imaging parameters further include at least one of a light source brightness parameter corresponding to the light source system, an exposure parameter corresponding to the image sensor, and a white balance ratio corresponding to the image sensor; based on the second image corresponding to the target object collected by the image sensor, adjusting the imaging parameters of the image sensor to obtain the target imaging parameters may further include:
[0192] Based on the value range corresponding to the exposure parameter, the value range corresponding to the light source brightness parameter, and the value range corresponding to the white balance ratio, respectively traverse at least one of the exposure parameter, the light source brightness parameter, and the white balance ratio to obtain multiple sets of imaging parameters;
[0193] Obtain the second image corresponding to the target object collected by the image sensor under each set of imaging parameters;
[0194] Based on the difference degree between the background pixel region in each second image and the foreground pixel region corresponding to the target object in the second image, determine the target imaging parameters from multiple sets of imaging parameters.
[0195] In this embodiment, the light source system is a system that provides illumination for the target object.
[0196] The light source system can be arranged below or on the side of the image sensor.
[0197] The specific installation position of the light source system can be determined based on user-defined or actual situations, and the present application does not make any limitations.
[0198] The light source brightness parameter is a parameter that characterizes the intensity of the light emitted by the light source system.
[0199] The exposure parameter is a setting for controlling the amount of light received by the photosensitive element of the image sensor.
[0200] The exposure parameter affects the brightness and contrast of the image collected by the image sensor.
[0201] The white balance ratio is a parameter for adjusting color balance.
[0202] The multiple sets of imaging parameters are combinations of different parameter values obtained by traversing the exposure parameters, light source brightness parameters, and white balance ratios.
[0203] When the image sensor is in black and white mode, that is, the image collected by the image sensor is a black and white image, the exposure parameters and light source brightness parameters can be traversed separately.
[0204] When the image sensor is in color mode, that is, the image collected by the image sensor is a color image, the exposure parameters, light source brightness parameters, and white balance ratios can be traversed separately.
[0205] The background pixel region is the other region in the second image except the target object.
[0206] The foreground pixel region is the region where the target object is located in the second image.
[0207] The degree of difference is the degree of difference between the background pixel region and the foreground pixel region.
[0208] Taking the case where the image sensor is in black and white mode as an example, all values within the value ranges of the exposure parameters and light source brightness can be traversed to obtain multiple sets of imaging parameters. Under each set of imaging parameters, the second image is collected separately.
[0209] For example, during the traversal process, first set the exposure parameter to any value within the value range, then traverse the light source brightness parameter, and then change the exposure parameter to a value different from the previous traversal, and continue to traverse the light source brightness parameter until all values within the value range corresponding to the exposure parameter have been used, obtaining multiple sets of imaging parameters.
[0210] Another example is that during the traversal process, based on the user's prior knowledge or the default value of the image sensor, the exposure parameter can be set to a fixed value, the light source brightness parameter is traversed to obtain at least part of the imaging parameters. After the traversal of the light source brightness parameter is completed, based on the user's prior knowledge or the default value of the light source system, the light source brightness parameter of the light source system is set to a fixed value, and the exposure parameter is traversed to obtain multiple sets of imaging parameters.
[0211] Similarly, when the image sensor is in color mode, during the traversal process, the exposure parameter and the white balance ratio can be first set to any value within the value range, then the light source brightness parameter is traversed, and then the exposure parameter and the white balance ratio are changed to values different from the previous traversal, and continue to traverse the light source brightness parameter until all settings within the value range corresponding to the exposure parameter and the value range corresponding to the white balance ratio have been used, obtaining multiple sets of imaging parameters.
[0212] It is also possible to set the exposure parameter and the white balance ratio to fixed values based on the user's prior knowledge or the default values of the image sensor, traverse the light source brightness parameter to obtain at least part of the imaging parameters. After the traversal of the light source brightness parameter is completed, based on the user's prior knowledge, the default values of the light source system, and the default values of the image sensor, set the light source brightness parameter of the light source system to a fixed value and the white balance ratio of the image sensor to a fixed value, traverse the exposure parameter to obtain at least part of the imaging parameters. After the traversal of the exposure parameter is completed, based on the user's prior knowledge, the default values of the light source system, and the default values of the image sensor, set the light source brightness parameter of the light source system to a fixed value and the exposure parameter of the image sensor to a fixed value, traverse the white balance ratio to obtain multiple sets of imaging parameters.
[0213] It should be noted that it is also possible to traverse the exposure parameter based on the adjustment requirements of the imaging parameters.
[0214] Based on the adjustment requirements of the imaging parameters, traverse the light source brightness parameter.
[0215] Based on the adjustment requirements of the imaging parameters, traverse the white balance ratio.
[0216] In the case where multiple parameters need to be traversed, the traversal order of each parameter can be determined based on the actual situation, and this application does not make any limitations.
[0217] During the process of traversing the imaging parameters, the image sensor can collect the second image of the target object in real time.
[0218] After obtaining multiple second images, the difference degree between the background pixel region and the foreground pixel region in each second image can be calculated respectively. For example, based on the pixel values corresponding to each pixel point in the background pixel region and the pixel values corresponding to each pixel point in the foreground pixel region, perform a difference operation to obtain the difference degree, and based on the difference degrees of each second image, determine the target imaging parameters from multiple sets of imaging parameters.
[0219] According to the installation method of the vision system provided by the embodiments of the present application, by traversing one or more of the exposure parameter, the light source brightness parameter, and the white balance ratio, multiple sets of imaging parameters are obtained, and the second images collected by the image sensor under each set of imaging parameters are acquired, visualizing the influence of each imaging parameter on the collected image. Thus, based on the difference degree between the background pixel region and the foreground pixel region in each second image, the better target imaging parameters are selected from multiple sets of imaging parameters, improving the usability and reliability of the selection of imaging parameters.
[0220] In some embodiments, determining the target imaging parameters from multiple sets of imaging parameters based on the difference degree between the background pixel region in each second image and the foreground pixel region corresponding to the target object in the second image may further include:
[0221] Select a plurality of background sub-regions and a plurality of foreground sub-regions from the background pixel region of the target image and the foreground pixel region corresponding to the target object of the target image in each of the second images, respectively;
[0222] Group the plurality of background sub-regions and the plurality of foreground sub-regions to obtain multiple groups of regions of interest;
[0223] Calculate the difference degrees between the background sub-regions and the foreground sub-regions in each group of regions of interest respectively to obtain a plurality of sub-difference degrees;
[0224] Sum up the plurality of sub-difference degrees to obtain the difference degree between the background pixel region in the target image and the foreground pixel region corresponding to the target object in the target image;
[0225] When the difference degree is greater than the difference degree threshold, determine the imaging parameters used for acquiring the target image from the multiple groups of imaging parameters;
[0226] Determine the imaging parameters used for acquiring the target image as the target imaging parameters.
[0227] In this embodiment, the target image is any one of the multiple second images.
[0228] The background sub-region is a partial region in the background pixel region.
[0229] It should be noted that the area of the background sub-region is smaller than the area of the background pixel region.
[0230] Taking the number of the multiple background sub-regions as 9 as an example, the multiple background sub-regions can be respectively named as: ROI_Background_1, ROI_Background_2... and ROI_Background_9.
[0231] The foreground sub-region is a partial region in the foreground pixel region.
[0232] It should be noted that the area of the foreground sub-region is smaller than the area of the foreground pixel region.
[0233] Taking the number of the multiple foreground sub-regions as 9 as an example, the multiple foreground sub-regions can be respectively named as: ROI_Product_1, ROI_Product_2... and ROI_Product_9.
[0234] It should be noted that the number of the background sub-regions is the same as the number of the foreground sub-regions.
[0235] The specific number of the multiple background sub-regions and the multiple foreground sub-regions can be determined based on user-defined or based on the actual situation. For example, the number of both the multiple background sub-regions and the multiple foreground sub-regions is 5 or 10; this application does not make a limitation.
[0236] The multiple regions of interest are obtained by corresponding multiple background sub-regions and multiple foreground sub-regions one by one.
[0237] In some embodiments, grouping can be performed based on the distances between the respective background sub-regions and the respective foreground sub-regions to obtain multiple groups of regions of interest.
[0238] In other embodiments, random grouping can also be performed to obtain multiple groups of regions of interest.
[0239] Of course, in the actual execution process, other arbitrary achievable methods can also be used, such as grouping the multiple background sub-regions and the multiple foreground sub-regions based on the names of the respective background sub-regions and foreground sub-regions to obtain multiple groups of regions of interest, which is not limited in this application.
[0240] The difference degree threshold is a preset value for judging the size of the difference between the background pixel region and the foreground pixel region in the target image.
[0241] The specific value of the difference degree threshold can be user-defined or determined based on the actual situation, which is not limited in this application.
[0242] For example, the difference degree threshold can be the maximum value among the calculated multiple difference degrees, or the average value of the first target number of larger difference degrees calculated, etc.
[0243] In the actual execution process, the difference degree between the background sub-region and the foreground sub-region in each group of regions of interest can be calculated based on the following formula to obtain the sub-difference degree:
[0244] Sub-difference degree = |ROI_Product_1 - ROI_Background_1|.
[0245] Based on the following formula, calculate the difference degree between the background pixel region in the target image and the foreground pixel region corresponding to the target object in the target image:
[0246] Difference degree = |ROI_Product_1 - ROI_Background_1| + … + |ROI_Product_9 - ROI_Background_9|.
[0247] When the difference degree between the background pixel region and the foreground pixel region in the target image is greater than the difference degree threshold, it indicates that the imaging parameters used to collect the target image can meet the shooting requirements in the production process. At this time, the imaging parameters used to collect the target image can be determined from multiple sets of imaging parameters, and the imaging parameters used to collect the target image are determined as the target imaging parameters.
[0248] During the actual execution process, multiple groups of imaging parameters and multiple second images can be numbered respectively, and the second images collected under each group of imaging parameters are made to correspond one by one, so as to quickly determine the imaging parameters used for collecting the target image.
[0249] According to the installation method of the vision system provided by the embodiments of the present application, by respectively selecting multiple background sub-regions and multiple foreground sub-regions from the background pixel region and the foreground pixel region in the target image, and grouping the multiple background sub-regions and the multiple foreground sub-regions to obtain multiple regions of interest, calculating the sub-difference degrees of each region of interest respectively, and based on the multiple sub-difference degrees, determining the difference degree between the background pixel region and the foreground pixel region in the target image, the accuracy of the calculated difference degree is improved, and the imaging parameters used for the target image are used as the preferred values of the target imaging parameters, so as to improve the usability of the determined target imaging parameters.
[0250] Continue to refer to Figure 3 , in some embodiments, after step 130, the method may further include:
[0251] Generating an installation report based on the target pose, the target imaging parameters, and the second image;
[0252] Outputting the installation report.
[0253] In this embodiment, the installation report is an instruction report for instructing the installation of one or more vision systems of the same type as the vision system.
[0254] The installation report may include: the target pose, the target imaging parameters, and the contrast results of the brightness and color difference between the target object and the background in the second image, as well as the clarity, etc.
[0255] Among them, the target pose includes the tilt angle of the image sensor.
[0256] The target imaging parameters may include: the target distance parameter between the image sensor and the target object, the exposure parameter, the light source brightness parameter, and the white balance ratio, etc.
[0257] During the actual execution process, the second image can be processed by image analysis software or image analysis tools to obtain the contrast results of the brightness and color difference between the target object and the background in the second image, as well as the clarity, etc.
[0258] In addition, the pixel equivalent can be calculated based on the second image, and the pixel equivalent is output during the installation exposure for the user to understand the installation effect.
[0259] The installation report can be displayed on the software interface for the user to view.
[0260] According to the installation method of the vision system provided by the embodiments of the present application, an installation report is generated through the target pose, the target imaging parameters, and the second image, enabling the user to understand how to install other vision systems and the installation effect of the vision system, providing detailed and comprehensive information for the user to install the vision system, and improving the user experience.
[0261] For the installation method of the vision system provided by the embodiments of the present application, the execution subject may be an installation device of the vision system. In the embodiments of the present application, taking the installation device of the vision system executing the installation method of the vision system as an example, the installation device of the vision system provided by the embodiments of the present application is described.
[0262] The embodiments of the present application also provide an installation device of a vision system.
[0263] As Figure 7 shown, the installation device of the vision system includes: a first processing module 710, a second processing module 720, and a third processing module 730.
[0264] The first processing module 710 is configured to obtain a first image corresponding to a target object collected by an image sensor;
[0265] The second processing module 720 is configured to adjust the pose of the image sensor according to the pixel position of the target object in the first image to obtain a new first image until the pixel position of the target object in the new first image is at the target pixel position of the new first image, and determine the current pose of the image sensor as the target pose corresponding to the image sensor;
[0266] The third processing module 730 is configured to, when the image sensor is in the target pose, adjust the imaging parameters of the image sensor based on the second image corresponding to the target object collected by the image sensor to obtain target imaging parameters; the target pose and the target imaging parameters are used to indicate the installation of at least one vision system of the same type as the vision system.
[0267] According to the installation device of the vision system provided by the embodiments of the present application, by obtaining the first image of the target object collected by the image sensor, adjusting the pose of the image sensor based on the first image until the pixel position of the target object can be at the target pixel position to obtain the target pose; when the image sensor is in the target pose, continue to obtain the second image, adjust the imaging parameters of the image sensor based on the second image to obtain the target imaging parameters, standardize the process of adjusting the vision system to meet the production requirements, improve the objectivity of the installation result, reduce the labor cost, and in addition, other vision systems can also be installed based on the target pose and the target imaging parameters, improving the installation efficiency.
[0268] In some embodiments, the second processing module 720 may further be configured to:
[0269] Obtain the pixel positions of the target object based on the edges of the target object in the first image;
[0270] Calculate the offset value between the pixel positions and the target pixel positions in the first image;
[0271] When the offset value is not greater than the first offset threshold, determine that the pixel positions of the target object are at the target pixel positions in the first image, and determine the current pose of the image sensor as the target pose corresponding to the image sensor;
[0272] When the offset value is greater than the first offset threshold, adjust the pose of the image sensor, and obtain a new first image corresponding to the target object collected by the adjusted image sensor.
[0273] In some embodiments, the target pose includes an inclination angle, and the target object is a target profiling block; the second processing module 720 may also be used for:
[0274] Based on the actual side length of the target profiling block, the pixel length of the target profiling block in the first image, and the thickness of the target profiling block, calculate the inclination angle corresponding to the current pose of the image sensor;
[0275] Determine the inclination angle as the target pose corresponding to the image sensor.
[0276] In some embodiments, the target imaging parameters include the target distance parameter between the image sensor and the target object; the third processing module 730 may also be used for:
[0277] When the image sensor is in the target pose, obtain a second image corresponding to the target object collected by the image sensor;
[0278] Based on the display clarity corresponding to the target object in the second image, adjust the distance between the image sensor and the target object until the display clarity is not less than the clarity threshold, and determine the current distance between the image sensor and the target object as the target distance parameter.
[0279] In some embodiments, the vision system further includes: a light source system; the target imaging parameters further include: at least one of the light source brightness parameter corresponding to the light source system, the exposure parameter corresponding to the image sensor, and the white balance ratio corresponding to the image sensor; the third processing module 730 may also be used for:
[0280] Based on the value ranges corresponding to the exposure parameter, the light source brightness parameter, and the white balance ratio, respectively traverse at least one of the exposure parameter, the light source brightness parameter, and the white balance ratio to obtain multiple sets of imaging parameters;
[0281] Obtain the second images corresponding to the target object collected by the image sensor under each set of imaging parameters;
[0282] Determine target imaging parameters from multiple sets of imaging parameters based on the difference degree between the background pixel region in each second image and the foreground pixel region corresponding to the target object in the second image.
[0283] In some embodiments, the third processing module 730 may also be used for:
[0284] Select multiple background sub-regions and multiple foreground sub-regions respectively from the background pixel region of the target image in each second image and the foreground pixel region corresponding to the target object of the target image;
[0285] Group the multiple background sub-regions and multiple foreground sub-regions to obtain multiple groups of regions of interest;
[0286] Calculate the difference degree between the background sub-region and the foreground sub-region in each group of regions of interest respectively to obtain multiple sub-difference degrees;
[0287] Sum up the multiple sub-difference degrees to obtain the difference degree between the background pixel region in the target image and the foreground pixel region corresponding to the target object in the target image;
[0288] In the case where the difference degree is greater than the difference degree threshold, determine the imaging parameters used for acquiring the target image from multiple sets of imaging parameters;
[0289] Determine the imaging parameters used for acquiring the target image as the target imaging parameters.
[0290] The installation device of the vision system in the embodiments of the present application may be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal or other devices other than a terminal. Exemplarily, the electronic device may be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc., and may also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc. The embodiments of the present application do not make specific limitations.
[0291] The installation device of the vision system in the embodiments of the present application can be a device with an operating system. The operating system can be the Android operating system, the IOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
[0292] The installation device of the vision system provided by the embodiments of the present application can implement Figures 1 to 6 each process implemented by the method embodiments. To avoid repetition, details are not described here again.
[0293] In some embodiments, as Figure 8 shown, the embodiments of the present application further provide an electronic device 800, including a processor 801, a memory 802, and a computer program stored on the memory 802 and executable on the processor 801. When the program is executed by the processor 801, it implements each process of the above-mentioned method embodiment of the vision system installation, and can achieve the same technical effect. To avoid repetition, details are not described here again.
[0294] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0295] The embodiments of the present application further provide a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements each process of the above-mentioned method embodiment of the vision system installation, and can achieve the same technical effect. To avoid repetition, details are not described here again.
[0296] Wherein, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.
[0297] The embodiments of the present application further provide a computer program product, including a computer program, which implements the above-mentioned vision system installation method when executed by a processor.
[0298] Wherein, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.
[0299] The embodiments of the present application further provide a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement each process of the above-mentioned method embodiment of the vision system installation, and can achieve the same technical effect. To avoid repetition, details are not described here again.
[0300] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-a-chip, etc.
[0301] It should be noted that in this document, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device including a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including a..." does not exclude the presence of additional identical elements in the process, method, article, or device including such element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.
[0302] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the related technology, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present application.
[0303] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.
[0304] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "schematic embodiments", "examples", "specific examples", or "some examples", etc., mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0305] Although the embodiments of the present application have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present application, and the scope of the present application is defined by the claims and their equivalents.
Claims
1. A method for installing a visual system, characterized in that: The visual system includes an image sensor; the method includes: Acquire a first image corresponding to the target object captured by the image sensor; According to the pixel position of the target object in the first image, adjusting the posture of the image sensor to acquire a new first image until the pixel position of the target object in the new first image is at the target pixel position of the new first image, and determining the current posture of the image sensor as the target posture corresponding to the image sensor; When the image sensor is in the target posture, the imaging parameters of the image sensor are adjusted based on a second image corresponding to the target object captured by the image sensor to obtain target imaging parameters; the target posture and the target imaging parameters are used to indicate the installation of at least one visual system of the same type as the visual system.
2. The method for installing a visual system according to claim 1, characterized in that: The step of adjusting the posture of the image sensor according to the pixel position of the target object in the first image to acquire a new first image until the pixel position of the target object in the new first image is at a target pixel position of the new first image, and determining the current posture of the image sensor as the target posture corresponding to the image sensor, comprises: Based on the edge of the target object in the first image, acquiring the pixel position of the target object; Calculating an offset value between the pixel position and a target pixel position in the first image; When the offset value is not greater than a first offset threshold, determining that the pixel position of the target object is at the target pixel position of the first image, and determining the current posture of the image sensor as the target posture corresponding to the image sensor; When the offset value is greater than a first offset threshold, the posture of the image sensor is adjusted to obtain a new first image corresponding to the target object captured by the adjusted image sensor.
3. The method for installing a visual system according to claim 1, characterized in that: The target posture includes a tilt angle, and the target object is a target profiling block; and determining the current posture of the image sensor as the target posture corresponding to the image sensor includes: Calculating a tilt angle corresponding to a current posture of the image sensor based on an actual side length of the target profiling block, a pixel length of the target profiling block in the first image, and a thickness of the target profiling block; The tilt angle is determined as a target posture corresponding to the image sensor.
4. The method for installing a visual system according to any one of claims 1 to 3, characterized in that: The target imaging parameter includes a target distance parameter between the image sensor and the target object; when the image sensor is in the target posture, adjusting the imaging parameter of the image sensor based on the second image corresponding to the target object acquired by the image sensor to obtain the target imaging parameter includes: When the image sensor is in the target posture, acquiring a second image corresponding to the target object captured by the image sensor; Based on the display clarity corresponding to the target object in the second image, the distance between the image sensor and the target object is adjusted until the display clarity is not less than a clarity threshold, and the current distance between the image sensor and the target object is determined as the target distance parameter.
5. The method for installing a visual system according to any one of claims 1 to 3, characterized in that: The visual system further includes: a light source system; the target imaging parameters further include: at least one of a light source brightness parameter corresponding to the light source system, an exposure parameter corresponding to the image sensor, and a white balance ratio corresponding to the image sensor; the imaging parameters of the image sensor are adjusted based on the second image corresponding to the target object acquired by the image sensor to obtain the target imaging parameters, including: Based on the value range corresponding to the exposure parameter, the value range corresponding to the light source brightness parameter, and the value range corresponding to the white balance ratio, traverse at least one of the exposure parameter, the light source brightness parameter, and the white balance ratio to obtain multiple sets of imaging parameters; Acquire a second image corresponding to the target object captured by the image sensor under each set of imaging parameters; The target imaging parameter is determined from the multiple sets of imaging parameters based on the difference between the background pixel area in each of the second images and the foreground pixel area corresponding to the target object in the second image.
6. The method for installing a visual system according to claim 5, characterized in that: The determining the target imaging parameter from the plurality of sets of imaging parameters based on the difference between the background pixel area in each of the second images and the foreground pixel area corresponding to the target object in the second image comprises: Selecting a plurality of background sub-regions and a plurality of foreground sub-regions from the background pixel region of the target image and the foreground pixel region corresponding to the target object of the target image in each of the second images respectively; Grouping the multiple background sub-regions and the multiple foreground sub-regions to obtain multiple groups of regions of interest; respectively calculating the difference between the background sub-region and the foreground sub-region in each group of the regions of interest to obtain a plurality of sub-differences; Adding the multiple sub-differences to obtain a difference between a background pixel region in the target image and a foreground pixel region corresponding to the target object in the target image; In a case where the difference is greater than a difference threshold, determining an imaging parameter used to acquire the target image from the multiple sets of imaging parameters; The imaging parameters used to acquire the target image are determined as the target imaging parameters.
7. A visual system installation device, characterized in that: The visual system includes an image sensor; the device includes: A first processing module, used to obtain a first image corresponding to the target object acquired by the image sensor; a second processing module, configured to adjust the posture of the image sensor according to the pixel position of the target object in the first image to acquire a new first image, until the pixel position of the target object in the new first image is at a target pixel position of the new first image, and determine the current posture of the image sensor as the target posture corresponding to the image sensor; The third processing module is used to adjust the imaging parameters of the image sensor based on the second image corresponding to the target object captured by the image sensor to obtain target imaging parameters when the image sensor is in the target posture; the target posture and the target imaging parameters are used to indicate the installation of at least one visual system of the same type as the visual system.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for installing the visual system according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for installing a visual system as described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for installing a visual system as described in any one of claims 1 to 6 is implemented.