Light source switching method, apparatus, device, and computer-readable storage medium
Patent Information
- Application Number
- CN202310964778.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-01
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2043-08-01
AI Technical Summary
[0004]本申请的主要目的在于提供一种光源切换方法、装置、设备及存储介质,旨在解决现有材料加工中单色光源兼容性的技术问题
[0036] Compared to existing technologies that only use monochromatic light sources, the light source switching method of this application uses light sources with multiple colors. First, the target material type corresponding to the material is obtained. Then, the target light source color to be used for the material to be processed is determined according to the target material type. Then, the target channel in each light source channel is opened according to the target light source color, and other channels except the target channel are closed, so that the color of the light output by the light source is switched to the target light source color.
Smart Images

Figure CN116963359B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of materials processing technology, and in particular to a light source switching method, apparatus, device, and computer-readable storage medium. Background Technology
[0002] Currently, the commonly used light source colors for vision are W (white), B (blue), and R (red). The choice of visual light source color often affects the imaging effect.
[0003] In the material processing process, the selection of light source is mainly based on factors such as the color, shape, and working distance of the material provided by the customer. In existing material processing systems, only a single-color light source can often be provided. However, the types of materials that a single-color light source can be compatible with are limited, which restricts the selection of materials and reduces the efficiency of material processing. Summary of the Invention
[0004] The main objective of this application is to provide a light source switching method, apparatus, device, and storage medium, which aims to solve the technical problem of monochromatic light source compatibility in existing material processing.
[0005] To achieve the above objectives, this application provides a light source switching method, which is applied to a light source switching system. The light source switching system includes: a light source, the light source including multiple light source channels corresponding to various colors; the light source switching method includes:
[0006] Obtain the target material type of the material to be processed;
[0007] Determine the target light source color corresponding to the material to be processed based on the target material type;
[0008] Based on the target light source color, one or more target channels in each of the light source channels are activated, and other channels in each of the light source channels except for the target channel are closed, so that the light source switches the color of the output light to the target light source color.
[0009] Optionally, in some feasible embodiments, the material number of the material to be processed is obtained;
[0010] The target material type corresponding to the material number is determined according to a preset mapping relationship, wherein the mapping relationship is: one material type corresponds to one or more material numbers;
[0011] Optionally, in some feasible embodiments, the light source switching system further includes: a rangefinder; after the step of switching the color of the output light from the light source to the color of the target light source, the method further includes:
[0012] The working distance between the material to be processed and the distance measuring instrument is obtained based on the distance measuring instrument;
[0013] The working brightness of each of the light source channels is controlled based on a preset correspondence and the working distance, wherein the working distance is positively correlated with the working brightness.
[0014] Optionally, in some feasible embodiments, the light source switching system further includes: a processing table located directly below the rangefinder; after the step of controlling the working brightness of each light source channel based on a preset correspondence and the working distance, the method further includes:
[0015] The distance parameter between the measuring point of the measuring instrument and the measuring instrument is obtained in real time based on the measuring instrument, wherein the measuring point is on the surface of the processing table or on the surface of the material to be processed on the processing table;
[0016] If the distance parameter is greater than the preset distance threshold, it is determined that the measuring point is on the surface of the processing table, that is, there is no material to be processed in the light source switching system, and the light source is turned off;
[0017] If the distance parameter is not greater than the preset distance threshold, then the distance measuring point is determined to be on the surface of the material to be processed.
[0018] Optionally, in some feasible embodiments, the light source switching system further includes: a camera; the light source switching system stores multiple material types, each of the material types including multiple color features; the method further includes:
[0019] Control the camera to acquire a target image of the material to be processed;
[0020] Identify the colors of each material in the target image of the material to be processed;
[0021] Calculate the area ratio of each of the material colors in the material to be processed, and use each area ratio as the target color parameter of the material to be processed;
[0022] Determine whether any of the stored color features contains a target color feature that corresponds to the target color parameter;
[0023] If the target color feature exists, the target material type corresponding to the material to be processed is determined based on the target color feature.
[0024] Optionally, in some feasible embodiments, after the step of determining whether a target color feature corresponding to the target color parameter exists among the stored color features, the method further includes:
[0025] If the target color feature does not exist, the target color parameter is stored as the color feature of the target material type.
[0026] Optionally, in some feasible embodiments, the method further includes:
[0027] Determine whether the material to be processed exists in the image acquired in real time by the camera;
[0028] If the material to be processed is not present, the light source is turned off.
[0029] Furthermore, to achieve the above objectives, this application also provides a light source switching device, which is a virtual device applied to a light source switching system. The light source switching system includes: a light source, the light source including multiple light source channels corresponding to various colors; the light source switching device includes:
[0030] The type determination module obtains the target material type of the material to be processed;
[0031] A light source determination module is used to determine the target light source color corresponding to the material to be processed based on the target material type.
[0032] The light source control module is used to activate one or more target channels in each of the light source channels based on the target light source color, and to close other channels in each of the light source channels except for the target channel, so that the light source switches the color of the output light to the target light source color.
[0033] In addition, to achieve the above objectives, this application also provides a light source switching device, which includes: a memory, a processor, and a light source switching program stored in the memory and executable on the processor. When the light source switching program is executed by the processor, it implements the steps of the light source switching method as described above.
[0034] This application also provides a computer-readable storage medium storing a light source switching program, which, when executed by a processor, implements the steps of the light source switching method described above.
[0035] This application provides a light source switching method, apparatus, device, and computer-readable storage medium. The light source switching method is applied to a light source switching system, which includes a light source and multiple light source channels corresponding to different colors. The light source switching method includes: acquiring a target material type of a material to be processed; determining a target light source color corresponding to the material to be processed based on the target material type; activating one or more target channels in each of the light source channels based on the target light source color, and deactivating other channels in each of the light source channels except for the target channel, so that the light source switches the color of its output light to the target light source color.
[0036] Compared to existing technologies that only use monochromatic light sources, the light source switching method of this application uses light sources with multiple colors. First, the target material type corresponding to the material is obtained. Then, the target light source color to be used for the material to be processed is determined according to the target material type. Then, the target channel in each light source channel is opened according to the target light source color, and other channels except the target channel are closed, so that the color of the light output by the light source is switched to the target light source color.
[0037] Thus, based on the above-mentioned method of controlling the activation of multiple colors of light sources according to the material number, compared with the traditional method of using only a single monochromatic light source, the light source switching method of this application allows each light source channel of the light source to be activated simultaneously. That is to say, the light source can output multiple colors of light to adapt to different material types. Furthermore, the type of color of the light output by the light source can be controlled according to the type of material, and the switching of the light source can be automated. Therefore, the technical solution adopted in this application can improve the compatibility of the light source and improve the work efficiency of material processing. Attached Figure Description
[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0040] Figure 1 This is a schematic diagram of the light source switching device structure in the hardware operating environment of the device involved in the embodiments of this application;
[0041] Figure 2 This is a schematic diagram illustrating the implementation process of an embodiment of the light source switching method of this application;
[0042] Figure 3 This is a schematic diagram of the functional modules of the light source switching device involved in the embodiments of this application.
[0043] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0044] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0045] It should be noted that the commonly used light source colors for vision are W (white), B (blue), and R (red), and the choice of visual light source color often affects the imaging effect.
[0046] In the material processing process, the selection of light source is mainly based on factors such as the color, shape, and working distance of the material provided by the customer. In existing material processing systems, only a single-color light source can often be provided. However, the types of materials that a single-color light source can be compatible with are limited, which restricts the selection of materials and reduces the efficiency of material processing.
[0047] To address the aforementioned problems, this application provides a light source switching method, apparatus, device, and storage medium. The light source switching method is applied to a light source switching system, which includes a light source comprising multiple light source channels corresponding to various colors. The light source switching method includes: acquiring a target material type of a material to be processed; determining a target light source color corresponding to the material to be processed based on the target material type; activating one or more target channels in each of the light source channels based on the target light source color, and deactivating other channels in each of the light source channels except for the target channel, thereby switching the color of the output light from the light source to the target light source color.
[0048] Compared to existing technologies that use only a single-color light source, the light source switching method of this application uses a light source with at least three colors. First, the target material type corresponding to the material is obtained. Then, the target light source color to be used for the material to be processed is determined according to the target material type. Then, the target channel in each light source channel is controlled to open according to the target light source color, and other channels except the target channel are closed, so that the final output color of the light source is switched to the target light source color.
[0049] Thus, based on the above-mentioned method of controlling the activation of light sources of at least three colors according to the material number, compared with the traditional method of using only a single monochromatic light source, the light source switching method of this application allows each light source channel of the light source to be activated simultaneously. That is to say, the light source can output multiple colors of light, adapting to different material types. Furthermore, the type of light source can be controlled according to the material type, and the switching of light sources can be automated. Therefore, the technical solution adopted in this application can improve the compatibility of light sources and improve the efficiency of material processing.
[0050] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0051] Please refer to Figure 1 , Figure 1 This is a schematic diagram of the light source switching device structure of the hardware operating environment of the device involved in the embodiments of this application.
[0052] The terminal device in this application embodiment can be a light source switching system.
[0053] like Figure 1 As shown, the light source switching device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to establish communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM or a stable, non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0054] Optionally, the light source switching device may also include a user interface 1003, a network interface 1004, a camera, RF (Radio Frequency) circuitry, sensors, audio circuitry, a WiFi module, etc. The user interface may include a display screen and an input submodule such as a keyboard. Optionally, the user interface may also include a standard wired interface or a wireless interface. The network interface may optionally include a standard wired interface or a wireless interface (such as a WiFi interface).
[0055] Those skilled in the art will understand that Figure 1The light source switching device structure shown does not constitute a limitation on the light source switching device. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0056] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, and a light source switching program. The operating system is a program that manages and controls the hardware and software resources of the light source switching device, supporting the operation of the light source switching program and other software and / or programs. The network communication module is used to enable communication between the various components within the memory 1005, as well as communication with other hardware and software in the light source switching device.
[0057] exist Figure 1 In the light source switching device shown, the processor 1001 is used to execute the light source switching program stored in the memory 1005 and perform the following operations:
[0058] Obtain the target material type of the material to be processed;
[0059] Determine the target light source color corresponding to the material to be processed based on the target material type;
[0060] Based on the target light source color, one or more target channels in each of the light source channels are activated, and other channels in each of the light source channels except for the target channel are closed, so that the light source switches the color of the output light to the target light source color.
[0061] Furthermore, the processor 1001 can call the light source switching program stored in the memory 1005 and also perform the following operations:
[0062] Obtain the material number of the material to be processed;
[0063] The target material type corresponding to the material number is determined according to a preset mapping relationship, wherein the mapping relationship is: one material type corresponds to one or more material numbers.
[0064] Furthermore, the processor 1001 can call the light source switching program stored in the memory 1005 and also perform the following operations:
[0065] The working distance between the material to be processed and the distance measuring instrument is obtained based on the distance measuring instrument;
[0066] The working brightness of each of the light source channels is controlled based on a preset correspondence and the working distance, wherein the working distance is positively correlated with the working brightness.
[0067] Furthermore, the processor 1001 can call the light source switching program stored in the memory 1005 and also perform the following operations:
[0068] The distance parameter between the measuring point of the measuring instrument and the measuring instrument is obtained in real time based on the measuring instrument, wherein the measuring point is on the surface of the processing table or on the surface of the material to be processed on the processing table;
[0069] If the distance parameter is greater than the preset distance threshold, it is determined that the measuring point is on the surface of the processing table, that is, there is no material to be processed in the light source switching system, and the light source is turned off;
[0070] If the distance parameter is not greater than the preset distance threshold, then the distance measuring point is determined to be on the surface of the material to be processed.
[0071] Furthermore, the processor 1001 can call the light source switching program stored in the memory 1005 and also perform the following operations:
[0072] Control the camera to acquire a target image of the material to be processed;
[0073] Identify the colors of each material in the target image of the material to be processed;
[0074] Calculate the area ratio of each of the material colors in the material to be processed, and use each area ratio as the target color parameter of the material to be processed;
[0075] Determine whether any of the stored color features contains a target color feature that corresponds to the target color parameter;
[0076] If the target color feature exists, the target material type corresponding to the material to be processed is determined based on the target color feature.
[0077] Furthermore, the processor 1001 can call the light source switching program stored in the memory 1005 and also perform the following operations:
[0078] If the target color feature does not exist, the target color parameter is stored as the color feature of the target material type.
[0079] Furthermore, the processor 1001 can call the light source switching program stored in the memory 1005 and also perform the following operations:
[0080] Determine whether the material to be processed exists in the image acquired in real time by the camera;
[0081] If the material to be processed is not present, the light source is turned off.
[0082] The specific implementation of the light source switching device in this application is basically the same as the embodiments of the light source switching method described below.
[0083] This application provides a light source switching method. In the first embodiment of the light source switching method of this application, please refer to... Figure 2 The light source switching system includes: a light source, the light source including multiple light source channels corresponding to various colors; the light source switching method includes:
[0084] Step S10: Obtain the target material type of the material to be processed;
[0085] Step S20: Determine the target light source color corresponding to the material to be processed based on the target material type;
[0086] In this embodiment, different material types require different colored light sources for imaging. Therefore, the system also presets the correspondence between material types and light source colors. First, the target material type of the material to be processed is obtained according to the parameters output by the technician. After determining the target material type of the material to be processed, the target light source color corresponding to the target material type is obtained from the system according to the target material type.
[0087] Step S30: Based on the target light source color, activate one or more target channels in each of the light source channels, and close other channels in each of the light source channels except for the target channel, so that the light source switches the color of the output light to the target light source color.
[0088] In this embodiment, each color in the multi-color light source corresponds to a light source channel. After obtaining the target light source color corresponding to the material to be processed, one or more target channels in each light source channel are turned on based on the target light source color, while other channels are turned off, so that the color presented by the light source corresponds to the target light source color.
[0089] For example, in one embodiment, a light source containing white, red, and blue light source channels is used to process materials with a silver base color. In this case, the light source channel corresponding to blue is turned on, and the light source channels corresponding to white and red are turned off, so that the color of the light output by the light source is switched to blue.
[0090] Furthermore, in a feasible embodiment, step S10 above, the step of obtaining the target material type of the material to be processed, includes:
[0091] Step S101: Obtain the material number of the material to be processed;
[0092] Step S102: Determine the target material type corresponding to the material number according to the preset mapping relationship, wherein the mapping relationship is: one material type corresponds to one or more material numbers.
[0093] In this embodiment, when a batch of materials needs to be processed, since vision cannot automatically identify the type of materials, technicians need to number the materials and input the numbers into the light source switching system. The system stores the mapping relationship between material numbers and material types. One material type can correspond to multiple material numbers. After the system obtains the material number, it parses the material number to obtain the target material type of the material to be processed.
[0094] Specifically, staff first name the different materials at the customer's site sequentially and use the shape int as the internal drawing number of the system software. Then, when processing the materials, the corresponding number of the material is input into the software. After the system obtains the material number, it parses the number to obtain the target material type of the material. Then, based on the target material type of the material, it determines the corresponding target color type. The system vision is connected to the light source channels corresponding to each color via serial communication. After obtaining the target color type, the system controls the channel that needs to be lit to be turned on based on serial communication, and other channels are set to zero and turned off. For example, when processing materials with a green background and white markers, the red channel can be lit. Or, when processing materials with a silver background, the blue channel can be lit.
[0095] Although the commonly used light source colors are white, red, and blue, a light source can include more than three light source channels, and these channels can be combined and lit to produce a variety of different colors of light to suit various types of materials.
[0096] Compared to existing technologies that use only a single-color light source, the light source switching method of this application uses a light source with at least three colors. First, the target material type corresponding to the material is obtained. Then, the target light source color to be used for the material to be processed is determined according to the target material type. Then, the target channel in each light source channel is controlled to open according to the target light source color, and other channels except the target channel are closed, so that the final output color of the light source is switched to the target light source color.
[0097] Thus, based on the above-mentioned method of controlling the activation of light sources of at least three colors according to the material number, compared with the traditional method of using only a single monochromatic light source, the light source switching method of this application allows each light source channel of the light source to be activated simultaneously. That is to say, the light source can output multiple colors of light, adapting to different material types. Furthermore, the type of light source can be controlled according to the material type, and the switching of light sources can be automated. Therefore, the technical solution adopted in this application can improve the compatibility of light sources and improve the efficiency of material processing.
[0098] Furthermore, based on the first embodiment of the light source switching method of this application described above, a second embodiment of the light source switching method of this application is proposed.
[0099] In a second embodiment of the light source switching method of this application, the light source switching system further includes: a rangefinder; after step S30 above, where the light source switches the color of its output light to the color of the target light source, the light source switching method of this application further includes:
[0100] Step A10: Obtain the working distance between the material to be processed and the rangefinder based on the rangefinder;
[0101] In this embodiment, the light source switching system also includes a rangefinder, which can be positioned directly above the processing table supporting the material to avoid affecting the accuracy of the rangefinder due to the material's placement. During material processing, the rangefinder measures the working distance between the material and the rangefinder.
[0102] Step A20: Control the working brightness of each of the light source channels based on a preset correspondence and the working distance, wherein the correspondence is that the working distance and the working brightness are positively correlated.
[0103] In this embodiment, the distance between the light source and the material to be processed also affects the parameters of the light source. Therefore, the working brightness of each light source channel in the light source is adjusted based on the working distance measured by the rangefinder. The farther the working distance, the brighter the working brightness of the target channel in the working state in each channel, so as to ensure the stability of imaging.
[0104] Furthermore, in a feasible embodiment, the light source switching system further includes: a processing table, the processing table being located directly below the rangefinder; after step A20 above, the step of controlling the working brightness of each of the light source channels based on a preset correspondence and the working distance, the light source switching method of this application further includes:
[0105] Step B10: Based on the distance measuring instrument, the distance parameter between the measuring point of the distance measuring instrument and the distance measuring instrument is obtained in real time, wherein the measuring point is on the surface of the processing table or on the surface of the material to be processed on the processing table.
[0106] Step B20: If the distance parameter is greater than the preset distance threshold, it is determined that the measuring point is on the surface of the processing table, that is, there is no material to be processed in the light source switching system, and the light source is turned off.
[0107] Step B30: If the distance parameter is not greater than a preset distance threshold, then it is determined that the measuring point is on the surface of the material to be processed.
[0108] In this embodiment, during the processing, the rangefinder acquires the distance parameters between the rangefinder and the measuring point in real time. The rangefinder can be an infrared rangefinder, emitting infrared light downwards from directly above the processing table. Those skilled in the art will understand that when there is no material on the processing table, the infrared light from the rangefinder illuminates the table surface, meaning the measuring point is the table surface. When there is material on the processing table, the material blocks the table, and the infrared light from the rangefinder illuminates the surface of the material on the table surface, meaning the measuring point is the surface of the material. When it is detected that there is material to be processed on the processing table, the light source switching system operates normally because... The positions of the workbench and the distance measuring instrument are fixed, so the distance measured between them is also fixed, although there may be slight fluctuations within a small range. However, the material has a certain thickness, meaning that when the material is placed on the workbench, the distance from the material surface to the distance measuring instrument is always smaller than the distance from the workbench surface to the distance measuring instrument. Therefore, a distance threshold can be set based on the distance between the workbench and the distance measuring instrument. Then, the relationship between the real-time measured distance parameter and the distance threshold can be used to determine whether there is material on the workbench. If the distance parameter is greater than the distance threshold, it means that there is no material on the workbench, and the light source can be turned off to save power.
[0109] Specifically, when processing materials, the system determines which channels of the light source are turned on based on the material's number. Then, it controls the brightness of each channel of the light source based on the working distance of the material to be processed measured by the rangefinder. The system also acquires the distance parameters measured by the rangefinder in real time. If the distance parameters are found to be greater than the distance threshold, it means that the processing work is over and the material is no longer on the processing table. At this time, the light source is turned off to save power.
[0110] Thus, based on the above-mentioned method of controlling the brightness of at least three colors of light source according to the working distance measured by the rangefinder, compared with the traditional method of using only a single monochromatic light source, the light source switching method of this application can adaptively adjust the brightness of the light source according to the working distance, improve the imaging effect, and can turn off the light source in time after the material is removed from the processing table to save energy. Therefore, the technical solution adopted in this application can improve the compatibility of the light source and improve the working efficiency of material processing.
[0111] Furthermore, based on the first and second embodiments of the light source switching method of this application described above, a third embodiment of the light source switching method of this application is proposed.
[0112] In a third embodiment of the light source switching method of this application, the light source switching system further includes: a camera; the light source switching system stores multiple material types, each of which includes multiple color features; the light source switching method of this application further includes:
[0113] Step C10: Control the camera to acquire a target image of the material to be processed;
[0114] Step C20: Identify the colors of the materials to be processed in the target image;
[0115] In this embodiment, a camera is assumed above the processing table. The camera is used to acquire the target image of the material to be processed on the processing table in real time. When the presence of the material to be processed on the processing table is detected, the target image of the material to be processed is acquired. The material in the target image can be distinguished from the background by existing image recognition technology, and then the various colors of the material in the target image and the outlines corresponding to each color are identified.
[0116] Step C30: Calculate the area ratio of each material color in the material to be processed, and use each area ratio as the target color parameter of the material to be processed;
[0117] In this embodiment, the area occupied by each color can be calculated based on the outline corresponding to each color, and then the area ratio of each color in the color of the material can be calculated based on the area occupied by each color, and the calculated ratio is used as the color parameter of the material to be processed.
[0118] Step C40: Determine whether any of the stored color features contains a target color feature corresponding to the target color parameter;
[0119] Step C50: If the target color feature exists, determine the target material type corresponding to the material to be processed based on the target color feature.
[0120] In this embodiment, the system stores multiple material types, each of which includes multiple color features. After obtaining the target color parameter of the material to be processed, the system searches for the existence of the target color parameter in the color features of each material type stored in the system. If the target color parameter exists, the target material type of the material to be processed can be determined to be the material type corresponding to the target color parameter. The color of the light source can then be determined and the light source controlled based on the material type.
[0121] Furthermore, in a feasible embodiment, after step C40 above, which determines whether any of the stored color features contains a target color feature corresponding to the target color parameter, the method further includes:
[0122] Step C60: If the target color feature does not exist, then the target color parameter is stored as the color feature of the target material type.
[0123] In this embodiment, the system searches for the existence of the target color parameter in the color features of each material type stored in the system. If the target color parameter does not exist, the target material type of the material to be processed is determined according to the number of the material to be processed, based on the method in Embodiment 1 above. Then, the target color parameter is stored as the color feature of the target material type. If there are materials with the same features in subsequent processing, the type of material can be directly determined.
[0124] Furthermore, in one feasible embodiment, the light source switching method of this application further includes:
[0125] Step D10: Determine whether the material to be processed exists in the image acquired in real time by the camera;
[0126] Step D20: If the material to be processed does not exist, then turn off the light source.
[0127] In this embodiment, during the processing, the presence of materials on the processing table can be determined in real time by the images captured by the camera. If there are no materials on the processing table, the light source is turned off to save energy.
[0128] Specifically, the system is equipped with a camera that captures images of the processing table in real time. When material is detected on the processing table, the system acquires a target image of the material to be processed, identifies the color of the material in the image, calculates the area and proportion of each color, and uses the proportion as the target color parameter of the material to be processed. For example, if the material is blue, it is recorded as B100%. If the material has a green background with white dots, and the calculated proportion of green area is 80%, then the color parameter of the material is G80%_W20%. The system searches for the existence of the target color parameter in the color features. If it exists, the light source can be controlled directly according to the material type corresponding to the color feature. If it does not exist, the material type is determined according to the material number, and the target color parameter is added to the color feature of that material type. After the camera detects that there is no material in the image, it turns off the light source to save power.
[0129] Thus, based on the above-mentioned method of controlling the activation of light sources of at least three colors according to the material number, compared with the traditional method of using only a single monochromatic light source, the light source switching method of this application identifies the color parameters of the material by a camera, then compares them with the stored color features to determine the type of material, and controls the light source based on the type of material, thereby realizing the automation of light source switching. Therefore, the technical solution adopted in this application can improve the compatibility of the light source and improve the work efficiency of material processing.
[0130] In addition, please refer to Figure 3 , Figure 3This is a functional block diagram of the light source switching device of this application. This application also provides a light source switching device applied to a light source switching system. The light source switching system includes: a light source, the light source including multiple light source channels corresponding to various colors; the light source switching device includes:
[0131] Type determination module 10 obtains the target material type of the material to be processed;
[0132] The light source determination module 20 is used to determine the target light source color corresponding to the material to be processed based on the target material type.
[0133] The light source control module 30 is used to activate one or more target channels in each of the light source channels based on the target light source color, and to close other channels in each of the light source channels except for the target channel, so that the light source switches the color of the output light to the target light source color.
[0134] Optionally, the type determination module includes:
[0135] The number acquisition unit is used to acquire the material number of the material to be processed;
[0136] The type acquisition unit is used to determine the target material type corresponding to the material number according to a preset mapping relationship, wherein the mapping relationship is: one material type corresponds to one or more material numbers.
[0137] Optionally, the light source switching device further includes:
[0138] The ranging module is used to obtain the working distance between the material to be processed and the ranging instrument based on the ranging instrument;
[0139] A brightness control module is used to control the working brightness of each of the light source channels based on a preset correspondence and the working distance, wherein the correspondence is that the working distance is positively correlated with the working brightness.
[0140] Optionally, the light source switching device further includes:
[0141] A distance measuring module is implemented to acquire, in real time, the distance parameters between the measuring point of the measuring instrument and the measuring instrument, wherein the measuring point is on the surface of the processing table or on the surface of the material to be processed on the processing table.
[0142] The distance determination module is used to determine that if the distance parameter is greater than a preset distance threshold, the measuring point is on the surface of the processing table, that is, the material to be processed does not exist in the light source switching system, and the light source is turned off; if the distance parameter is not greater than the preset distance threshold, the measuring point is determined to be on the surface of the material to be processed.
[0143] Optionally, the light source switching device further includes:
[0144] The image acquisition module is used to control the camera to acquire a target image of the material to be processed;
[0145] The color recognition module is used to identify the colors of each material in the target image of the material to be processed.
[0146] The calculation module is used to calculate the area ratio of each of the material colors in the material to be processed, and to use each area ratio as the target color parameter of the material to be processed;
[0147] The feature retrieval module is used to determine whether there is a target color feature among the stored color features that corresponds to the target color parameter;
[0148] The type determination module is used to determine the target material type corresponding to the material to be processed based on the target color feature if the target color feature exists.
[0149] Optionally, the light source switching device further includes:
[0150] The feature update module is used to store the target color parameter as the color feature of the target material type if the target color feature does not exist.
[0151] Optionally, the light source switching device further includes:
[0152] The image judgment module is used to determine whether the material to be processed exists in the image acquired in real time by the camera;
[0153] The power-saving module is used to turn off the light source if the material to be processed is not present.
[0154] The specific implementation of the light source switching device in this application is basically the same as the embodiments of the light source switching method described above, and will not be repeated here.
[0155] In addition, this application also proposes a computer-readable storage medium storing a program for switching light sources, which, when executed by a processor, implements the steps of the light source switching method of this application as described above.
[0156] The specific embodiments of the computer storage medium in this application are basically the same as the embodiments of the light source switching method described above, and will not be repeated here.
[0157] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0158] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0159] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0160] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for switching light sources, characterized in that, The light source switching method is applied to a light source switching system, which includes a light source and a camera, wherein the light source includes multiple light source channels corresponding to various colors; the light source switching method includes: Control the camera to acquire a target image of the material to be processed; Identify the colors of each material in the target image of the material to be processed, calculate the area ratio of each material color in the material to be processed, and use each area ratio as the target color parameter of the material to be processed; Determine whether there is a target color feature among the pre-stored color features of multiple material types that matches the target color parameter; If the target color feature exists, the target material type corresponding to the material to be processed is determined based on the target color feature; If the target color feature does not exist, the material number of the material to be processed is obtained, the target material type corresponding to the material number is determined according to the preset mapping relationship, and the target color parameter is stored as the color feature corresponding to the determined target material type, wherein the mapping relationship is that one material type corresponds to one or more material numbers; Determine the target light source color corresponding to the material to be processed based on the target material type; Based on the target light source color, one or more target channels in each of the light source channels are activated, and other channels in each of the light source channels except for the target channel are closed, so that the light source switches the color of the output light to the target light source color.
2. The light source switching method according to claim 1, characterized in that, The light source switching system further includes: a rangefinder; after the step of switching the color of the output light from the light source to the color of the target light source, the method further includes: The working distance between the material to be processed and the distance measuring instrument is obtained based on the distance measuring instrument; The working brightness of each of the light source channels is controlled based on a preset correspondence and the working distance, wherein the working distance is positively correlated with the working brightness.
3. The light source switching method according to claim 2, characterized in that, The light source switching system further includes a processing table, which is located directly below the rangefinder. After the step of controlling the working brightness of each of the light source channels based on the preset correspondence and the working distance, the method further includes: The distance parameter between the measuring point of the measuring instrument and the measuring instrument is obtained in real time based on the measuring instrument, wherein the measuring point is on the surface of the processing table or on the surface of the material to be processed on the processing table; If the distance parameter is greater than the preset distance threshold, it is determined that the measuring point is on the surface of the processing table, that is, there is no material to be processed in the light source switching system, and the light source is turned off; If the distance parameter is not greater than the preset distance threshold, then the distance measuring point is determined to be on the surface of the material to be processed.
4. The light source switching method according to any one of claims 1, characterized in that, The method further includes: Determine whether the material to be processed exists in the image acquired in real time by the camera; If the material to be processed is not present, the light source is turned off.
5. A light source switching device, characterized in that, The light source switching device is applied to a light source switching system, the light source switching system comprising: a light source, the light source including multiple light source channels corresponding to various colors; the light source switching device comprising: The type determination module is used to control the camera to acquire target images of the materials to be processed; Identify the colors of each material in the target image of the material to be processed, calculate the area ratio of each material color in the material to be processed, and use each area ratio as the target color parameter of the material to be processed; Determine whether there is a target color feature among the pre-stored color features of multiple material types that matches the target color parameter; If the target color feature exists, the target material type corresponding to the material to be processed is determined based on the target color feature; If the target color feature does not exist, the material number of the material to be processed is obtained, the target material type corresponding to the material number is determined according to the preset mapping relationship, and the target color parameter is stored as the color feature corresponding to the determined target material type, wherein the mapping relationship is that one material type corresponds to one or more material numbers; A light source determination module is used to determine the target light source color corresponding to the material to be processed based on the target material type. The light source control module is used to activate one or more target channels in each of the light source channels based on the target light source color, and to close other channels in each of the light source channels except for the target channel, so that the light source switches the color of the output light to the target light source color.
6. A light source switching device, characterized in that, The light source switching device includes a memory and a processor, wherein the memory stores a light source switching program, and when the light source switching program is executed by the processor, it implements the steps of the light source switching method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a light source switching program, which, when executed by a processor, implements the steps of the light source switching method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Light source color self-adaptive adjusting method and device, circuit board processing equipment and medium
CN116091794A