CN120346994A - Optical compensation method and system for color sorter - Google Patents
Optical compensation method and system for color sorterInfo
- Publication number
- CN120346994A CN120346994A CN202510635164.XA CN202510635164A CN120346994A CN 120346994 A CN120346994 A CN 120346994A CN 202510635164 A CN202510635164 A CN 202510635164A CN 120346994 A CN120346994 A CN 120346994A
- Authority
- CN
- China
- Prior art keywords
- image
- illumination intensity
- value
- optical compensation
- spectrum
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B07—SEPARATING SOLIDS FROM SOLIDS; SORTING
- B07C—POSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
- B07C5/00—Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
- B07C5/34—Sorting according to other particular properties
- B07C5/342—Sorting according to other particular properties according to optical properties, e.g. colour
Landscapes
- Image Processing (AREA)
Abstract
The invention relates to the technical field of color selectors, in particular to an optical compensation method and an optical compensation system of a color selector, wherein the method comprises the steps of detecting actual illumination intensity by a sensor and calculating a proportion value of the actual illumination intensity to preset standard illumination intensity; the method comprises the steps of determining that a proportion value is lower than a set proportion threshold value, dividing a spectrum image into a plurality of image blocks, respectively carrying out optical compensation on the plurality of image blocks according to the proportion value to obtain a dynamic threshold value of each image block, wherein the dynamic threshold value is used for generating a binary mask of the spectrum image, and the spectrum image is collected by a color selector under the actual illumination intensity. The optical compensation method provided by the invention can obtain the spectrum image with stable quality under the condition of unstable light source, and finally improves the screening precision and stability of the color selector.
Description
Technical Field
The invention belongs to the technical field of color selectors, and particularly relates to an optical compensation method and system of a color selector.
Background
The optical detection system of the color selector is a core module for realizing material color identification. The multi-spectrum light source of the core component adopts an LED combination (such as visible light and infrared light) to cover a 400-1000nm broadband, so that the color characteristics of the material surface can be obtained through the visible light, and the infrared light can be utilized to penetrate the surface layer to detect internal flaws (such as cereal mildew).
In actual production, the stability of the light source directly determines the detection precision, namely when the illumination fluctuates due to factors such as unreasonable control parameters, dust pollution, equipment aging and the like, the color information of the spectrum image is offset, so that the subsequent recognition algorithm misjudges, and finally the screening accuracy is influenced.
Disclosure of Invention
The invention provides an optical compensation method and system for a color sorter to solve the technical problems.
In a first aspect, the present invention provides a method for optical compensation of a color sorter, comprising:
Detecting the actual illumination intensity by using a sensor, and calculating a ratio value of the actual illumination intensity to the preset standard illumination intensity;
Confirming that the proportion value is lower than a set proportion threshold value, and dividing the spectrum image into a plurality of image blocks;
Respectively carrying out optical compensation on a plurality of image blocks according to the proportion value to obtain a dynamic threshold value of each image block, wherein the dynamic threshold value is used for generating a binary mask of a spectrum image;
The spectrum image is collected by the color selector under the actual illumination intensity.
In an alternative embodiment, the method further comprises:
deploying a sensor according to the position of a spectrum acquisition camera in the color selector;
And acquiring a sensor ID and a spectrum acquisition camera ID, and establishing a mapping relation between the sensor ID and the spectrum acquisition camera ID.
In an alternative embodiment, the method further comprises:
the actual illumination intensity is confirmed to exceed the standard illumination intensity, and then the light source power of the optical system is called;
If the light source power does not exceed the standard power, generating prompt information of abnormality of the light source;
And if the light source power exceeds the standard power, modulating the light source power into the standard power.
In an alternative embodiment, if the ratio value is determined to be lower than the set ratio threshold, dividing the spectral image into a plurality of image blocks includes:
Determining a target spectrum acquisition device ID according to the sensor ID of the sensor and the corresponding relation;
Inquiring a target spectrum image according to the target spectrum acquisition device ID, wherein the target spectrum acquisition device ID is the ID of a source acquisition device of the target spectrum image;
And acquiring pixels and texture features of a target spectrum image, and dividing the target spectrum image into a plurality of image blocks according to the pixels and the texture features.
In an alternative embodiment, acquiring pixels and texture features of a target spectral image, dividing the target spectral image into a plurality of image blocks according to the pixels and the texture features, includes:
Setting the size of a basic image block according to the pixels of the target spectrum image and the corresponding relation between the preset pixels and the size of the basic image block;
Calculating a gradient amplitude matrix of the target spectrum image:
wherein, the Is a gradient in the x-direction,Is a y-direction gradient;
Dividing grids for the target spectrum image according to the size of the basic image block, and counting the variance of gradients in each grid ;
Adjusting the size of the basic image block according to the texture complexity to obtain the size of the image block:
Wherein, the As a function of the base image block size,To adjust parameters;
Setting the overlapping rate of the image blocks;
According to the image block size And the overlapping rate is used for dividing the spectrum image into image blocks with corresponding sizes.
In an optional embodiment, the optical compensation is performed on the image blocks according to the ratio value to obtain a dynamic threshold value of each image block, which includes:
defining the image size as MXN, the block size as MXn, the total block number as ;
The coordinate range of the (i, j) th block is:,;
an average is calculated for all pixels within each block:
wherein c is the spectral channel of the light, Is a pixel value;
calculating the deviation degree of the pixel value and the mean value:
The single channel threshold is:
wherein, the The adjustment factor at block (i, j) for channel c;
the calculation method of the adjustment coefficient comprises the following steps:
wherein, the As the reference coefficient of the reference value,As the sensitivity coefficient of the light intensity,For the standard light intensity of the light,Is the actual illumination intensity;
Fusing a plurality of single-channel thresholds to obtain a dynamic threshold:
。
in an alternative embodiment, the method further comprises:
For each pixel (x, y), finding the image block (i, j) to which it belongs, generating a binary mask of the image block using the corresponding threshold value:
wherein, I (x, y) is a pixel value, and T (I, j) is a dynamic threshold value of an image block to which the pixel belongs;
taking a weighted sum of a plurality of corresponding image block thresholds for pixels in the overlapping area;
And traversing all image blocks of the spectrum image to obtain a binary mask of the spectrum image.
In a second aspect, the present invention provides an optical compensation system for a color sorter, comprising:
The detection module is used for detecting the actual illumination intensity by using the sensor and calculating the ratio value of the actual illumination intensity to the preset standard illumination intensity;
the segmentation module is used for confirming that the proportion value is lower than a set proportion threshold value, and dividing the spectrum image into a plurality of image blocks;
The compensation module is used for respectively carrying out optical compensation on the image blocks according to the proportion value to obtain a dynamic threshold value of each image block, wherein the dynamic threshold value is used for generating a binary mask of the spectrum image;
The spectrum image is collected by the color selector under the actual illumination intensity.
In a third aspect, there is provided an apparatus comprising:
a memory for storing an optical compensation program of the color selector;
A processor for implementing the steps of the optical compensation method of the color selector as provided in the first aspect when executing the optical compensation program of the color selector.
In a fourth aspect, there is provided a computer readable storage medium having stored thereon an optical compensation program for a color selector, which when executed by a processor performs the steps of the optical compensation method for a color selector as provided in the first aspect.
The optical compensation method and the system for the color selector have the beneficial effects that the sensor is deployed on the color selector to acquire the actual illumination intensity, the actual illumination intensity is compared with the standard illumination intensity, whether the current illumination intensity needs to be compensated or whether the control parameters of the light source need to be adjusted is determined, and if the current illumination intensity needs to be compensated, the adaptive compensation is performed by adopting a block type strategy, so that the spectrum image quality is improved. The optical compensation method provided by the invention can obtain the spectrum image with stable quality under the condition of unstable light source, and finally improves the screening precision and stability of the color selector.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic flow chart of a method of one embodiment of the invention.
FIG. 2 is a schematic block diagram of a system of one embodiment of the present invention.
Fig. 3 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solution of the present invention better understood by those skilled in the art, the technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
The optical compensation method of the color selector provided by the embodiment of the invention is executed by computer equipment, and correspondingly, the optical compensation system of the color selector runs in the computer equipment.
FIG. 1 is a schematic flow chart of a method of one embodiment of the invention. The execution body of fig. 1 may be an optical compensation system of a color sorter. The order of the steps in the flow chart may be changed and some may be omitted according to different needs.
As shown in fig. 1, the method includes:
S1, detecting actual illumination intensity by using a sensor, and calculating a ratio value of the actual illumination intensity to preset standard illumination intensity;
S2, confirming that the proportion value is lower than a set proportion threshold value, and dividing the spectrum image into a plurality of image blocks;
S3, respectively carrying out optical compensation on a plurality of image blocks according to the proportion value to obtain a dynamic threshold value of each image block, wherein the dynamic threshold value is used for generating a binary mask of a spectrum image;
The spectrum image is collected by the color selector under the actual illumination intensity.
In one embodiment of the invention, based on step S1, a possible embodiment thereof will be given below as a non-limiting illustration.
Firstly, a sensor is deployed according to the position of a spectrum acquisition camera in a color selector, a sensor ID and a spectrum acquisition camera ID are acquired, and a mapping relation between the sensor ID and the spectrum acquisition camera ID is established. Specific:
establishing a coordinate system by taking a camera optical center as an origin (x 0,y0,z0), and following the sensor deployment coordinates: Each camera is configured with 3 groups of light intensity sensors (front/middle/rear) to form a triangulation network, eliminating single point errors.
The sensor ID adopts 16-bit unique code (the first 8-bit equipment type and the last 8-bit serial number) and is stored in the sensor EEPROM.
Camera ID is composed of device serial number (12 bits) +channel number (2 bits), such as SN20250326001_03 represents 3 rd channel camera of 1 st device manufactured by 2025, 3 rd month 26.
Mu s-level synchronization of the sensor t sync and the camera t camera is realized by adopting IEEE 1588 Precision Time Protocol (PTP) sync= tcamera+ △toffset
Wherein Δt offset is calibrated by two-way communication.
Establishing a dynamic mapping relation between a camera and a sensor:
(1) Spatial positioning and direction matching
Camera view analysis, which is to determine the direction of the optical axis (e.g., horizontally right, 45 degrees inclined) and the angle of view (e.g., 120 °) of each spectral camera, and to determine the three-dimensional spatial range that it can "see".
Sensor screening, namely, finding out all sensors located within the field of view of the camera (for example, if a certain field of view of the camera covers the right area of the device, the light intensity sensor deployed on the right side is screened).
(2) Distance weighting and prioritization
Distance impact assessment, namely calculating the linear distance between each candidate sensor and the corresponding camera, wherein the closer the distance is, the more accurate the sensor monitors the illumination of the camera (for example, the weight of the sensor in 1 meter is 0.8,2 meters and the weight of the sensor out of 0.8,2 meters is 0.2).
The master-slave relationship is established by selecting the sensor with the highest weight as the master sensor (more than 60% of the weight is contributed) and the rest as the standby sensor for each camera.
(3) Dynamic calibration and real-time update
The environment compensation mechanism is to adjust the sensor weight according to real-time data periodically (such as every 1000 frames of images are processed), for example, if the deviation between the monitored light intensity of a certain sensor and the actual acquisition value of the camera is increased, the weight is reduced.
And (3) fault redundancy switching, namely when the main sensor fails, automatically switching to a standby sensor with a next highest weight, so as to ensure continuous and stable operation of the system.
Therefore, the distance weighted dynamic mapping construction mode is adopted, so that the data reliability is improved, and the system stability is ensured through a redundancy switching mechanism.
After receiving the actual illumination intensity detected by the main sensor, calculating the actual illumination intensityAnd standard illumination intensityRatio of (2). If the ratio value is lower than the set ratio threshold value, optical compensation is judged to be needed.
In addition, if the actual illumination intensity exceeds the standard illumination intensity, the light source power of the optical system is called, if the light source power does not exceed the standard power, prompt information of light source abnormality is generated, and if the light source power exceeds the standard power, the light source power is modulated to the standard power.
In one embodiment of the present invention, based on step S2, a possible embodiment thereof will be given below as a non-limiting illustration.
The base image block size is set, for example, to 32×32, according to the pixel of the target spectral image and the correspondence between the preset pixel and the base image block size.
Calculating a gradient amplitude matrix of the target spectrum image:
wherein, the Is a gradient in the x-direction,Is a y-direction gradient;
Dividing grids for the target spectrum image according to the size of the basic image block, and counting the variance of gradients in each grid ;
Adjusting the size of the basic image block according to the texture complexity to obtain the size of the image block:
Wherein, the As a function of the base image block size,To adjust parameters;
And setting the overlapping rate of the image blocks, setting 10-20% overlapping between the blocks, and taking weighted average of the threshold values of overlapping areas to avoid jumping of the segmentation boundary.
According to the image block sizeAnd the overlapping rate is used for dividing the spectrum image into image blocks with corresponding sizes.
By dynamically adjusting the size and the overlapping rate of the image blocks, the technology realizes the self-adaptive segmentation of texture complexity perception, and remarkably improves the robustness and the efficiency of the color selector in complex material detection.
In one embodiment of the present invention, based on step S3, a possible embodiment thereof will be given below as a non-limiting illustration.
Defining the image size as MXN, the block size as MXn, the total block number as;
The coordinate range of the (i, j) th block is:,;
an average is calculated for all pixels within each block:
wherein c is the spectral channel of the light, Is a pixel value;
calculating the deviation degree of the pixel value and the mean value:
The single channel threshold is:
wherein, the The adjustment factor at block (i, j) for channel c;
the calculation method of the adjustment coefficient comprises the following steps:
wherein, the As the reference coefficient of the reference value,As the sensitivity coefficient of the light intensity,For the standard light intensity of the light,Is the actual illumination intensity;
Fusing a plurality of single-channel thresholds to obtain a dynamic threshold:
。
For each pixel (x, y), finding the image block (i, j) to which it belongs, generating a binary mask of the image block using the corresponding threshold value:
wherein, I (x, y) is a pixel value, and T (I, j) is a dynamic threshold value of an image block to which the pixel belongs;
For pixels of the overlapping region, taking a weighted sum of a plurality of corresponding image block thresholds:
For pixel (x, y) of the overlap region, it belongs to multiple image blocks at the same time. Assuming that the pixel (x, y) belongs to m image blocks, the corresponding thresholds are respectively ,,...,The weights are w 1,w2,…,wm respectively.
The weight calculation may be based on the distance of the pixel to the center of the respective image block. Setting the pixel (x, y) to the center of the image (i k,jk)The distance of (2) is:
Then the weight is 。
Calculating a dynamic threshold of the overlapping region pixels:
。
The value of the pixel in the binary mask is also determined from the magnitude relationship of I (x, y) to T w.
Traversing all image blocks of the spectrum image to obtain a binary mask of the spectrum image:
and sequentially processing pixels in each image block according to the coordinate sequence of the image blocks, wherein the pixels comprise non-overlapping areas and overlapping areas.
A binary mask matrix M of the same size as the spectral image is finally obtained, where M (x, y) represents the value (0 or 1) of the pixel (x, y) in the binary mask.
Binary Mask (Binary Mask) is a key tool in image processing and computer vision, whose core function is to explicitly separate the target region from the background by binarizing the pixel matrix of 0 and 1. The following are examples of specific uses and applications in color selectors:
1. core functionality of binary masks
Target segmentation:
And separating the target (such as material particles and flaw points) in the image from the background to generate a binary image only comprising the outline of the target.
Example, in a color selector, a binary mask may accurately circumscribe unacceptable heterochromatic particles.
Feature extraction:
geometric features (area, perimeter, centroid) or color features (RGB mean, HSV distribution) of the target are calculated based on the mask.
By way of example, the size of the target particles is counted by masking, and a determination is made as to whether the size criteria are met.
Decision control:
The direct drive hardware performs a sorting action (e.g., triggers a valve culling target).
Example a color selector controls the high pressure air flow according to the mask position to blow marked particles off the production line.
2. Typical application scenario in color selector
Foreign matter removal, namely identifying and marking materials with abnormal colors and shapes (such as plastic sheets and metal impurities).
The method comprises the steps of generating a binary mask through dynamic threshold segmentation, calculating the mask area, and triggering elimination if the area exceeds a threshold value.
Quality classification, namely classifying materials (such as coffee beans and nuts) according to the color shade or the defect degree.
The method comprises the steps of extracting a target area from a mask, analyzing RGB values of pixels in the mask, and judging which level the RGB values belong to.
And detecting the damage, namely detecting the defects of cracks, pits and the like on the surface of the material.
The process includes masking to extract edge contour, calculating contour integrity index (roundness and aspect ratio), and identifying breakage.
3. Technical scheme extension
Mask post-processing:
morphological operations-noise cancellation using expansion/corrosion, closing small voids.
And (3) communicating domain analysis, namely marking an independent target, and avoiding misjudgment caused by adhesion of a plurality of particles.
Multimodal fusion:
and a mask is generated by combining RGB and infrared images, so that the segmentation accuracy (such as transparent material detection) under a complex scene is improved.
Real-time guarantee:
A lightweight algorithm (such as OpenCV thresholding) or hardware acceleration (GPU/dedicated chip) is employed to ensure tens of thousands of frames per second are processed.
The optical compensation method of the color selector remarkably improves the sorting precision and the system robustness in complex industrial scenes through innovative technologies such as dynamic threshold adjustment, intelligent blocking strategy, multispectral fusion and the like. The following is a specific beneficial effect analysis:
1. Illumination fluctuation self-adaptive compensation and detection stability improvement
And a dynamic threshold mechanism, namely triggering threshold adjustment through a proportional value (actual illumination/standard illumination), and still maintaining detection precision under + -30% illumination fluctuation.
And (3) the power of the light source is controlled in a closed loop manner, namely, when the illumination is abnormal, the power of the light source is automatically adjusted to a rated value (such as from 120% to 100%), and the service life of the LED caused by power overload is prevented from being shortened.
2. Texture aware chunking, balancing detail and efficiency
The gradient variance drives the block size to be reduced from 32×32 to 16×16 in a high texture area (such as grain deep groove), improves the edge detection precision, and is expanded to 64×64 in a low texture area (such as quartz sand), thereby reducing the calculation amount by 50%.
The weighted average of the overlapped blocks is 15 percent of the weighted average (the weight is inversely proportional to the distance), so that the mean square error of the dividing boundary is reduced, and the ladder-shaped artifact of the traditional block is avoided.
3. Multispectral fusion enhanced discriminant capability
And (3) channel independent compensation and fusion, namely respectively calculating thresholds for RGB, infrared and other channels, and generating a final threshold value through weighted summation. The internal discrimination capability of the target object is improved.
4. Dynamic mapping and redundancy design to ensure system reliability
The spatial perception mapping algorithm ensures that the sensor is exactly matched with the camera through view angle constraints (such as 120 deg.) and distance weighting (the weight is inversely proportional to the square of the distance). And 4 cameras are deployed on a certain production line, so that the error association rate is reduced after dynamic mapping, and invalid compensation instructions are reduced.
And (3) fault redundancy switching, namely when the main sensor fails, the system is switched to the standby sensor, so that the production line is prevented from being stopped.
5. Real-time and energy efficiency optimization
Block size and hardware adaptation-block size is coupled with GPU thread block size (32 x32 adapted CUDA warp), parallel processing efficiency is improved by 40%. At 1080p resolution, single frame processing time is shortened from 8ms to 5ms, supporting 120fps real-time sorting.
In this embodiment, the optical compensation system of the color selector may be divided into a plurality of functional modules according to the functions performed by the optical compensation system, as shown in fig. 2. The module referred to in the present invention refers to a series of computer program segments capable of being executed by at least one processor and of performing a fixed function, stored in a memory. In the present embodiment, the functions of the respective modules will be described in detail in the following embodiments.
The detection module is used for detecting the actual illumination intensity by using the sensor and calculating the ratio value of the actual illumination intensity to the preset standard illumination intensity;
the segmentation module is used for confirming that the proportion value is lower than a set proportion threshold value, and dividing the spectrum image into a plurality of image blocks;
The compensation module is used for respectively carrying out optical compensation on the image blocks according to the proportion value to obtain a dynamic threshold value of each image block, wherein the dynamic threshold value is used for generating a binary mask of the spectrum image;
The spectrum image is collected by the color selector under the actual illumination intensity.
Fig. 3 illustrates an optical compensation method of a color sorter according to an embodiment of the present application may be applied to a device. It will be appreciated by those skilled in the art that the structure of the apparatus according to the embodiments of the present application is not limited to the apparatus, and the apparatus may include more or less components than those illustrated, or may be combined with some components, or may be arranged with different components. In embodiments of the present application, devices include, but are not limited to, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The apparatus may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the embodiments of the application described and/or claimed herein.
The device 300 may include, among other things, a processor 310, a memory 320, and a communication unit 330. The components may communicate via one or more buses, and it will be appreciated by those skilled in the art that the configuration of the server as shown in the drawings is not limiting of the invention, as it may be a bus-like structure, a star-like structure, or include more or fewer components than shown, or may be a combination of certain components or a different arrangement of components.
The memory 320 may be used to store instructions for execution by the processor 310, and the memory 320 may be implemented by any type or combination of volatile or nonvolatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. The execution of the instructions in memory 320, when executed by processor 310, enables apparatus 300 to perform some or all of the steps in the method embodiments described below.
Processor 310 is a control center of the storage device, connects various portions of the overall electronic device using various interfaces and lines, and performs various functions of the electronic device and/or processes data by running or executing software programs and/or modules stored in memory 320, and invoking data stored in the memory. The processor may be comprised of an integrated circuit (INTEGRATED CIRCUIT, simply referred to as an IC), for example, a single packaged IC, or may be comprised of multiple packaged ICs connected to one another for the same function or for different functions. For example, the processor 310 may include only a central processing unit (Central Processing Unit, CPU for short). In the embodiment of the invention, the CPU can be a single operation core or can comprise multiple operation cores.
And a communication unit 330 for establishing a communication channel so that the storage device can communicate with other devices. Receiving user data sent by other devices or sending user data to other devices.
The present invention also provides a computer storage medium in which a program may be stored, which program may include some or all of the steps in the embodiments provided by the present invention when executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory RAM), or the like.
It will be apparent to those skilled in the art that the techniques of embodiments of the present invention may be implemented in software plus a necessary general purpose hardware platform. Based on such understanding, the technical solution in the embodiments of the present invention may be embodied essentially or what contributes to the prior art in the form of a software product stored in a storage medium such as a U-disc, a mobile hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk or an optical disk, etc. various media that can store program codes, including several instructions to cause a computer device (which may be a personal computer, a server, or a second device, a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present invention.
The same or similar parts between the various embodiments in this specification are referred to each other. In particular, for the apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, as far as reference is made to the description in the method embodiments.
In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods may be implemented in other ways. For example, the system embodiments described above are merely illustrative, e.g., the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple modules or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with respect to each other may be through some interface, indirect coupling or communication connection of systems or modules, electrical, mechanical, or other form.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
Although the present invention has been described in detail by way of preferred embodiments with reference to the accompanying drawings, the present invention is not limited thereto. Various equivalent modifications and substitutions may be made in the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and it is intended that all such modifications and substitutions be within the scope of the present invention/be within the scope of the present invention as defined by the appended claims.
Claims (10)
1. A method of optically compensating a color sorter, comprising:
Detecting the actual illumination intensity by using a sensor, and calculating a ratio value of the actual illumination intensity to the preset standard illumination intensity;
Confirming that the proportion value is lower than a set proportion threshold value, and dividing the spectrum image into a plurality of image blocks;
Respectively carrying out optical compensation on a plurality of image blocks according to the proportion value to obtain a dynamic threshold value of each image block, wherein the dynamic threshold value is used for generating a binary mask of a spectrum image;
The spectrum image is collected by the color selector under the actual illumination intensity.
2. The method according to claim 1, wherein the method further comprises:
deploying a sensor according to the position of a spectrum acquisition camera in the color selector;
And acquiring a sensor ID and a spectrum acquisition camera ID, and establishing a mapping relation between the sensor ID and the spectrum acquisition camera ID.
3. The method according to claim 1, wherein the method further comprises:
The actual illumination intensity is confirmed to exceed the standard illumination intensity, and the light source power [2] [3] of the optical system of [1] is called;
If the power of the light source does not exceed the set standard power, generating prompt information of abnormality of the light source;
And if the light source power exceeds the standard power, modulating the light source power into the standard power.
4. The method of claim 2, wherein determining that the scale value is below a set scale threshold value, dividing the spectral image into a plurality of image blocks comprises:
Determining a target spectrum acquisition device ID according to the sensor ID of the sensor and the corresponding relation;
Inquiring a target spectrum image according to the target spectrum acquisition device ID, wherein the target spectrum acquisition device ID is the ID of a source acquisition device of the target spectrum image;
And acquiring pixels and texture features of a target spectrum image, and dividing the target spectrum image into a plurality of image blocks according to the pixels and the texture features.
5. The method of claim 4, wherein acquiring pixels and texture features of a target spectral image, dividing the target spectral image into a plurality of image blocks based on the pixels and the texture features, comprises:
Setting the size of a basic image block according to the pixels of the target spectrum image and the corresponding relation between the preset pixels and the size of the basic image block;
Calculating a gradient amplitude matrix of the target spectrum image:
wherein, the Is a gradient in the x-direction,Is a y-direction gradient;
Dividing grids for the target spectrum image according to the size of the basic image block, and counting the variance of gradients in each grid ;
Adjusting the size of the basic image block according to the texture complexity to obtain the size of the image block:
Wherein, the As a function of the base image block size,To adjust parameters;
Setting the overlapping rate of the image blocks;
According to the image block size And the overlapping rate is used for dividing the spectrum image into image blocks with corresponding sizes.
6. The method of claim 1, wherein optically compensating the plurality of image blocks according to the scale value, respectively, results in a dynamic threshold for each image block, comprising:
defining the image size as MXN, the block size as MXn, the total block number as ;
The coordinate range of the (i, j) th block is:,;
an average is calculated for all pixels within each block:
wherein c is the spectral channel of the light, Is a pixel value;
calculating the deviation degree of the pixel value and the mean value:
The single channel threshold is:
wherein, the The adjustment factor at block (i, j) for channel c;
the calculation method of the adjustment coefficient comprises the following steps:
wherein, the As the reference coefficient of the reference value,As the sensitivity coefficient of the light intensity,For the standard light intensity of the light,Is the actual illumination intensity;
Fusing a plurality of single-channel thresholds to obtain a dynamic threshold:
。
7. the method according to claim 1, wherein the method further comprises:
For each pixel (x, y), finding the image block (i, j) to which it belongs, generating a binary mask of the image block using the corresponding threshold value:
wherein, I (x, y) is a pixel value, and T (I, j) is a dynamic threshold value of an image block to which the pixel belongs;
taking a weighted sum of a plurality of corresponding image block thresholds for pixels in the overlapping area;
And traversing all image blocks of the spectrum image to obtain a binary mask of the spectrum image.
8. An optical compensation system for a color sorter, comprising:
The detection module is used for detecting the actual illumination intensity by using the sensor and calculating the ratio value of the actual illumination intensity to the preset standard illumination intensity;
the segmentation module is used for confirming that the proportion value is lower than a set proportion threshold value, and dividing the spectrum image into a plurality of image blocks;
The compensation module is used for respectively carrying out optical compensation on the image blocks according to the proportion value to obtain a dynamic threshold value of each image block, wherein the dynamic threshold value is used for generating a binary mask of the spectrum image;
The spectrum image is collected by the color selector under the actual illumination intensity.
9. An apparatus, comprising:
a memory for storing an optical compensation program of the color selector;
A processor for implementing the steps of the optical compensation method of a color selector according to any one of claims 1-7 when executing the optical compensation program of the color selector.
10. A computer readable storage medium storing a computer program, characterized in that the readable storage medium stores thereon an optical compensation program of a color selector, which when executed by a processor, implements the steps of the optical compensation method of a color selector according to any one of claims 1-7.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510635164.XA CN120346994B (en) | 2025-05-16 | 2025-05-16 | Optical compensation method and system for color sorter |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510635164.XA CN120346994B (en) | 2025-05-16 | 2025-05-16 | Optical compensation method and system for color sorter |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN120346994A true CN120346994A (en) | 2025-07-22 |
| CN120346994B CN120346994B (en) | 2025-10-28 |
Family
ID=96411046
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202510635164.XA Active CN120346994B (en) | 2025-05-16 | 2025-05-16 | Optical compensation method and system for color sorter |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN120346994B (en) |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20110074803A1 (en) * | 2009-09-29 | 2011-03-31 | Louis Joseph Kerofsky | Methods and Systems for Ambient-Illumination-Selective Display Backlight Modification and Image Enhancement |
| CN107408983A (en) * | 2015-03-04 | 2017-11-28 | 日本电气株式会社 | Optical signal monitor, optical wavelength multiplexing transmitter and method of monitoring optical signals |
| CN114495082A (en) * | 2022-01-13 | 2022-05-13 | 南昌大学 | LabVIEW-based low-illumination compensation new energy license plate recognition system |
| CN118366189A (en) * | 2024-05-13 | 2024-07-19 | 武汉天马微电子有限公司上海分公司 | Optical compensation method, device, equipment, storage medium and program product |
| CN118968117A (en) * | 2024-07-10 | 2024-11-15 | 山东省农业科学院 | Screening and grading system and method for fresh cut peony flowers based on image recognition |
| CN119887816A (en) * | 2025-03-26 | 2025-04-25 | 成都大学 | Image data processing method, system, computer equipment and storage medium |
-
2025
- 2025-05-16 CN CN202510635164.XA patent/CN120346994B/en active Active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20110074803A1 (en) * | 2009-09-29 | 2011-03-31 | Louis Joseph Kerofsky | Methods and Systems for Ambient-Illumination-Selective Display Backlight Modification and Image Enhancement |
| CN107408983A (en) * | 2015-03-04 | 2017-11-28 | 日本电气株式会社 | Optical signal monitor, optical wavelength multiplexing transmitter and method of monitoring optical signals |
| CN114495082A (en) * | 2022-01-13 | 2022-05-13 | 南昌大学 | LabVIEW-based low-illumination compensation new energy license plate recognition system |
| CN118366189A (en) * | 2024-05-13 | 2024-07-19 | 武汉天马微电子有限公司上海分公司 | Optical compensation method, device, equipment, storage medium and program product |
| CN118968117A (en) * | 2024-07-10 | 2024-11-15 | 山东省农业科学院 | Screening and grading system and method for fresh cut peony flowers based on image recognition |
| CN119887816A (en) * | 2025-03-26 | 2025-04-25 | 成都大学 | Image data processing method, system, computer equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN120346994B (en) | 2025-10-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109829914B (en) | Method and device for detecting product defects | |
| CN108596166B (en) | Container number identification method based on convolutional neural network classification | |
| CN106127779B (en) | The defect inspection method and system of view-based access control model identification | |
| CN114937055A (en) | Image self-adaptive segmentation method and system based on artificial intelligence | |
| CN116503388B (en) | Defect detection method, device and storage medium | |
| CN118823481A (en) | A bridge detection image recognition method and system based on artificial intelligence | |
| EP4226225B1 (en) | A line clearance system | |
| CN116228780B (en) | Silicon wafer defect detection method and system based on computer vision | |
| KR20050013570A (en) | Method for pattern inspection | |
| CN115018785B (en) | A method for detecting the tension of lifting wire rope based on visual vibration frequency recognition | |
| CN113324864A (en) | Pantograph carbon slide plate abrasion detection method based on deep learning target detection | |
| CN116228741A (en) | PCBA (printed circuit board assembly) component defect detection method and device | |
| CN112184723A (en) | Image processing method and device, electronic device and storage medium | |
| KR102498322B1 (en) | Apparatus and Method for Classifying States of Semiconductor Device based on Deep Learning | |
| CN115311286A (en) | Dyeing defect identification method for dyed textiles | |
| CN120746958A (en) | Metal structural part surface damage identification method based on machine vision | |
| CN115841450A (en) | Surface defect detection method, device, terminal and computer readable storage medium | |
| CN119131006A (en) | A ceramic defect intelligent detection method, system, device and storage medium based on deep learning | |
| CN117274258B (en) | Method, system, equipment and storage medium for detecting defects of main board image | |
| CN116908185B (en) | Method, device, electronic device and storage medium for detecting appearance defects of articles | |
| CN120346994B (en) | Optical compensation method and system for color sorter | |
| CN110031474B (en) | Foreign matter detection method and foreign matter detection device | |
| CN119943699A (en) | A photovoltaic panel detection method and system based on machine vision | |
| CN117690846B (en) | Visual detection method, device and equipment for solar silicon wafer and storage medium | |
| CN118096678A (en) | Wafer detection method, device, computer equipment and readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |