Automatic batch detection system for gem components
By combining image recognition and a three-axis moving mechanism, automatic batch detection of gemstone composition is achieved, solving the problem of low efficiency in traditional XRF instruments and enabling efficient and accurate detection without the need to fix the sample position.
Patent Information
- Application Number
- CN202511889279.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-01-16
AI Technical Summary
Traditional XRF instruments require manual adjustment of sample position in gemstone composition analysis, resulting in low efficiency and the accuracy of test results depends on the precision of sample placement, making it difficult to meet the needs of batch testing.
An image recognition module is used to automatically identify the sample position, and a three-axis moving mechanism drives the optical path module to detect samples sequentially. The distance between the optical path module and the sample is adjusted by a ranging module to achieve automatic batch detection.
It enables automated batch testing without the need for fixed sample positions, improving testing efficiency and accuracy, reducing manual labor intensity, and allowing for more flexible sample placement.
Smart Images

Figure CN121347571A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of X-ray fluorescence spectrum analysis, and particularly to a gemstone component automatic batch detection system. BACKGROUND
[0002] The core principle of XRF (X-Ray Fluorescence Spectrometry) is to use primary X-rays to excite atoms of a sample to be measured, so that the atoms emit characteristic fluorescent X-rays, and by analyzing the wavelength (qualitative) and intensity (quantitative) of the fluorescent X-rays, the element composition and content of the sample to be measured are determined, which belongs to a non-destructive element analysis technology.
[0003] As a non-destructive element analysis method, XRF technology is widely used in geological exploration, environmental monitoring, industrial quality inspection, archaeological identification and other fields due to its rapid and accurate characteristics. With the diversification of detection needs, manual testing of a single sample to be measured has been difficult to meet the actual application scenarios - for example, when hundreds of ore samples need to be quickly screened on a gemstone mining site, or when batch gemstone products need to be composition sampled on an industrial production line, the traditional "single test - manual sample change" mode exposes a significant efficiency bottleneck: the operator needs to repeatedly open and close the instrument cabin door and adjust the position of the sample to be measured, which is tedious and time-consuming. In view of the above needs, some XRF instrument manufacturers have introduced an automatic solution: some fixed positions are recorded in the XRF instrument in advance, and the sample to be measured is placed at these fixed positions. When testing, the XRF instrument moves the light pipe and detector to these fixed positions according to the pre-recorded position information for detection in turn. This method requires the sample to be measured to be placed at fixed positions, and the accuracy of placing the sample to be measured is high. If the actual placement position of the sample to be measured deviates from the position information recorded in the XRF instrument, the accuracy of the test results will be greatly reduced. SUMMARY
[0004] The gemstone component automatic batch detection system provided by the embodiments of the present application can realize batch detection of the sample to be measured, and does not require fixed placement of the sample to be measured, so that the placement of the sample to be measured is more flexible.
[0005] In order to achieve the above purpose, the present application provides a gemstone component automatic batch detection system, comprising: A light path module for emitting primary X-rays to the sample to be measured and collecting characteristic fluorescent X-rays excited by the sample to be measured; A three-axis moving mechanism connected with the light path module for moving the light path module; An image acquisition module is configured to acquire a target image of a predetermined region in which a plurality of samples to be tested are placed, wherein a plane in which the predetermined region is located is an xy-axis plane, a z-axis direction is perpendicular to the xy-axis plane, and the optical path module is arranged on one side of the predetermined region along the z-axis direction to vertically irradiate the samples to be tested; An image recognition module is in communication connection with the image acquisition module and is configured to acquire a number of samples to be tested in the predetermined region and a test point position of each sample to be tested in the predetermined region according to the target image. A motion control module is in communication connection with the three-axis moving mechanism and the image recognition module respectively, and is configured to control the three-axis moving mechanism to drive the optical path module to move to above the test point positions of the plurality of samples to be tested in sequence, so that the primary X-ray spot focus of the optical path module falls on the test point positions of the plurality of samples to be tested in sequence, thereby sequentially performing composition detection on the plurality of samples to be tested.
[0006] Further, a distance measurement module is further included, and the distance measurement module is configured to detect an actual distance between the optical path module and a surface of the sample to be tested. The motion control module is in communication connection with the distance measurement module, and is configured to acquire a moving distance of the optical path module along the z-axis direction according to the actual distance and a preset test height, and control the three-axis moving mechanism to drive the optical path module to move along the z-axis direction according to the moving distance.
[0007] Further, the optical path module is an upper-illumination type vertical optical path module, which includes a light tube and a detector, the light tube is configured to emit primary X-rays to vertically irradiate the sample to be tested, and the detector is configured to collect characteristic fluorescent X-rays excited by the sample to be tested.
[0008] Further, the predetermined region is a sample tray region, and the image recognition module is specifically configured to: convert the target image to an HSV color space, extract a sample mask according to a preset mask threshold range of the HSV space based on a color difference between the sample to be tested and a tray background; extract a contour of each sample to be tested according to the sample mask, wherein for the samples to be tested that are in contact with each other, a watershed algorithm is used to segment the contour; acquire a centroid coordinate of the contour of each sample to be tested as a test point position; store the test point position of each sample to be tested in a test point list; The motion control module is configured to acquire the test point position from the test point list to control the three-axis moving mechanism to drive the optical path module to move according to the test point position.
[0009] Further, a user interaction module is further included, and the user interaction module is configured to mark the contour and test points of each sample to be tested on the target image, and display the marked target image. The user interaction module is further configured to provide an editing interface for modifying, deleting and adding the test points. The image recognition module is further configured to update the test point list according to the operation instruction input by the user in the editing interface.
[0010] Further, the motion control module is configured to obtain a pre-stored initial motor step number, the initial motor step number being a motor step number required for the optical path module to move from an initial position to a position point corresponding to a center point of the target image in a predetermined region. The motion control module is further configured to calculate a pixel distance between the test point position of the sample to be tested in the target image and the center point of the target image, and convert the pixel distance into a target motor step number according to a preset conversion relationship, so as to move the optical path module to the test point position of the sample to be tested according to the initial motor step number and the target motor step number.
[0011] Further, a correction module is further included, and the correction module is configured to: issue a first prompt information according to a correction instruction to prompt the user to check the installation state of the image acquisition module and the ranging module; control the motion control module to drive the optical path module to move along the x-axis and the y-axis in sequence, and control the image acquisition module to acquire a correction image in the moving process, and determine whether the moving direction of the optical path module along the x-axis and the y-axis is consistent with the x-axis and y-axis direction of the correction image, and if not, issue a second prompt information; obtain a preset test height input by the user through the user interaction module; obtain the conversion relationship.
[0012] Further, an analysis module is further included, and the analysis module is connected with the optical path module, and is configured to analyze the composition of the sample to be tested according to the characteristic fluorescence X-ray.
[0013] Beneficial effects: the gem component automatic batch detection system of the present application, through the image recognition module, the number of samples to be tested in the predetermined area and the test point position of each sample to be tested are automatically obtained, and then the motion control module controls the three-axis moving mechanism to drive the optical path module to move to the above of the test point position of each sample to be tested in turn, so that the primary X-ray spot focus of the optical path module falls on the test point position of each sample to be tested in turn, thereby sequentially detecting the composition of the samples to be tested, thereby, through the above-mentioned manner, the samples to be tested can be automatically batch detected, and the fixed position information does not need to be recorded in advance, and the image recognition module can realize the automatic positioning of the samples to be tested, so that each sample to be tested does not need to be placed at a fixed position, but only needs to be placed in a predetermined area, and the position of the sample to be tested in the predetermined area is not limited, so that the position of the sample to be tested can be placed more flexibly. BRIEF DESCRIPTION OF DRAWINGS
[0014] The technical scheme of the present application and its beneficial effects will be apparent from the following detailed description of the specific embodiments of the present application, combined with the accompanying drawings.
[0015] Figure 1 is a structural schematic diagram of a gem component automatic batch detection system provided by the present application; Figure 2 is a flowchart of a gem component automatic batch detection method provided by the present application. DETAILED DESCRIPTION
[0016] Please refer to the drawings, wherein the same component symbols represent the same components, and the principles of the present application are exemplified in an appropriate operating environment. The following description is based on the exemplified specific embodiments of the present application, which should not be regarded as limiting other specific embodiments of the present application not described in detail herein.
[0017] The gem component automatic batch detection system provided by the embodiment of the present application can be integrated in an XRF instrument for detecting gem components.
[0018] Referring to Figure 1 , the embodiment of the present application provides a gem component automatic batch detection system 100, which comprises an optical path module 10, a three-axis moving mechanism 20, an image acquisition module 30, an image recognition module 40 and a motion control module 50.
[0019] The light path module 10 is used to emit primary X-rays to the to-be-tested samples and collect characteristic fluorescence X-rays excited by the to-be-tested samples. The three-axis moving mechanism 20 is fixedly connected with the light path module 10 and is used to drive the light path module 10 to move in three dimensions of x-axis, y-axis and z-axis. The image acquisition module 30 is used to acquire a target image of a predetermined region in which a plurality of to-be-tested samples are placed. The xy-axis plane is taken as the plane in which the predetermined region is located, the z-axis direction is perpendicular to the xy-axis plane, and the light path module 10 is arranged on one side of the predetermined region along the z-axis direction to vertically irradiate the to-be-tested samples. For example, when the xy-axis plane is a horizontal plane, the z-axis direction is a vertical direction, and the light path module 10 is arranged above the predetermined region along the vertical direction, so that the light path module 10 can vertically irradiate the to-be-tested samples.
[0020] The predetermined region can be a sample tray region, and the image acquisition module 30 can be a panoramic high-definition camera which is arranged above the predetermined region along the z-axis direction. The camera is fixedly installed, that is, the position of the camera does not change, and the shooting angle of the camera can be adjusted to make the predetermined region within the shooting range of the camera.
[0021] The image recognition module 40 is in communication connection with the image acquisition module 30 and is used to acquire the number of to-be-tested samples in the predetermined region and the test point position of each to-be-tested sample in the predetermined region according to the acquired target image. It can be understood that the virtual coordinates on the image have a mapping relationship with the actual physical coordinates, so that the test point position of the to-be-tested sample in the predetermined region can be determined by recognizing the test point position of the to-be-tested sample in the target image.
[0022] The motion control module 50 is in communication connection with the three-axis moving mechanism 20 and the image recognition module 40 respectively and is used to control the three-axis moving mechanism 20 to drive the light path module 10 to move to above the test point positions of the plurality of to-be-tested samples in sequence, so that the focal point of the primary X-ray spot of the light path module falls on the test point positions of the plurality of to-be-tested samples in sequence, that is, the primary X-rays are focused on the test point positions, so as to sequentially perform composition detection on the plurality of to-be-tested samples. The test point position of the to-be-tested sample refers to the coordinates of the test point on the to-be-tested sample in the xy-axis plane. Therefore, the above-mentioned method can realize automatic batch detection of the to-be-tested samples, and fixed position information does not need to be recorded in advance. The image recognition module can realize automatic positioning of the to-be-tested samples, so that the to-be-tested samples do not need to be placed in fixed positions, but only need to be placed in the predetermined region, and the positions of the to-be-tested samples in the predetermined region are not limited, so that the positions of the to-be-tested samples can be placed more flexibly.
[0023] In some embodiments, the motion control module 50 determines the test sequence according to the sample quantity, the test point position, and preset test sequence rules, which can be, for example, detecting in the order from the test point closest to the center point of the target image to the test point farthest from the center point of the target image, or detecting in the order of the test point in the positive direction of the x-axis of the center point of the target image and the test point in the negative direction of the x-axis of the center point of the target image, i.e., detecting the sample corresponding to the test point in the positive direction of the x-axis of the center point of the target image first, and then detecting the sample corresponding to the test point in the negative direction of the x-axis of the center point of the target image.
[0024] In some embodiments, the gemstone composition automatic batch detection system 100 further comprises an analysis module 60. The light path module 10 is an upper illumination type vertical light path module, and comprises a light tube and a detector. The light tube adopts a high-stability X-ray light tube, can emit primary X-rays in the negative direction of the z-axis from above the sample to be tested, and the axis of the primary X-rays coincides with the z-axis, achieving vertical illumination of the sample to be tested; the detector adopts a high-resolution fluorescence detector, is used for collecting characteristic fluorescence X-rays generated by the sample to be tested after being excited by the primary X-rays, and converts the collected fluorescence signals into electrical signals and transmits them to the analysis module 60, and the analysis module 60 analyzes according to the received electrical signals, thereby realizing detection of the composition of the sample to be tested. The analysis module 60 receives the electrical signals and performs preprocessing such as noise reduction and filtering, and then analyzes the preprocessed signals through a fluorescence analysis algorithm, determines the element composition and content of the sample to be tested in combination with a gemstone composition feature database, and finally generates a composition analysis report and transmits it to the user interaction module 80 for display.
[0025] It can be understood that the spot size and energy transfer efficiency of the primary X-rays depend on the distance between the light path module 10 and the surface of the sample to be tested. Different heights (thicknesses) of the sample to be tested will affect the focusing of the primary X-rays of the light path module 10. If the height of the light path module 10 in the z-axis direction is fixed, for a higher sample to be tested, the distance from the light path module 10 to the surface of the sample to be tested is smaller, which can cause the spot to be too small, and can easily cause the light path module 10 to collide with the sample to be tested, damaging the equipment, and for a lower sample to be tested, the distance from the light path module 10 to the surface of the sample to be tested is larger, causing the spot to spread and become larger (exceeding the test point range of the sample to be tested), the primary X-ray energy is dispersed, the fluorescence signal is weak, and the test result is inaccurate.
[0026] In some embodiments of the present application, in order to adapt to the height difference of the sample to be tested, the gemstone component automatic batch detection system 100 further comprises a distance measuring module 70 for detecting the actual distance between the optical path module 10 and the surface of the sample to be tested. The distance measuring module 70 is synchronously installed with the optical path module 10 and is installed on the three-axis moving mechanism 20 for synchronous movement. The distance measuring module 70 can be installed at the same height as the optical path module 10, for example, on one side of the optical path module 10. The distance measuring module 70 can be a laser distance measuring device for detecting the actual distance between the optical path module 10 and the surface of the sample to be tested by emitting laser.
[0027] The motion control module 50 is in communication connection with the distance measuring module 70, and is used for obtaining the movement distance of the optical path module 10 along the z-axis direction according to the actual distance and the preset test height, so as to control the three-axis moving mechanism 20 to drive the optical path module 10 to move along the z-axis direction according to the movement distance, so that the distance between the optical path module 10 and the surface of the sample to be tested is the preset test height. The preset test height is a preconfigured optimal test height, which refers to the optimal focusing distance of the optical path module 10 to the sample surface. At this distance, the primary X-ray spot is the smallest and the energy is the most concentrated, which can maximize the excitation of the sample fluorescence signal and ensure the detection accuracy.
[0028] The movement distance L of the optical path module 10 along the z-axis direction is L1-L2, wherein L1 represents the preset test height, and L2 represents the actual distance detected by the distance measuring module 70. When L is positive, it means that the optical path module 10 is too close to the sample to be tested, and the optical path module 10 is controlled to move upwards (positive direction of the z-axis). When L is negative, it means that the optical path module 10 is too far away from the sample to be tested, and the optical path module 10 is controlled to move downwards (negative direction of the z-axis).
[0029] The specific structure of the three-axis moving mechanism 20 is not limited in the embodiments of the present application, and any mechanism that can realize the independent movement function of the x-axis, y-axis and z-axis is suitable for the present application.
[0030] In some embodiments, the three-axis moving mechanism 20 drives the optical path module 10 to move through a motor. For example, the three-axis moving mechanism 20 can include an x-axis motor, a y-axis motor, a z-axis motor and corresponding linear guides, and the movement precision thereof is not less than 0.1 mm, which can meet the accurate positioning requirements of the test points of the sample to be tested. The optical path module 10 is fixed on the z-axis slider of the three-axis moving mechanism 20 through a mounting seat, the x-axis motor and the y-axis motor drive the z-axis slider and the optical path module 10 to move in the x-axis direction and the y-axis direction, so as to realize the switching of different test points of the sample to be tested; the z-axis motor drives the optical path module 10 to move along the z-axis direction, so as to realize the adjustment of the detection height. The motor driving signal of the three-axis moving mechanism 20 is provided by the motion control module 50, and the motion state can be fed back to the motion control module 50 in real time through an encoder, so as to form a closed loop control.
[0031] In some embodiments, the image recognition module 40 identifies the target image based on OpenCV image recognition technology, so as to determine the number of samples to be tested and the test point positions in the predetermined area according to the image information of the target image. Specifically, the image recognition module 40 is configured to: (1) convert the target image to HSV color space, extract the sample mask according to the preset HSV space mask threshold range based on the color difference between the sample to be tested and the tray background. Wherein, by converting the target image from RGB color space to HSV color space, the influence of light change on image recognition can be eliminated. The mask threshold range can be set according to different sample types, and the sample mask is extracted by threshold segmentation algorithm, so as to eliminate background interference.
[0032] (2) extract the contour of each sample to be tested according to the sample mask to be tested, wherein for the samples to be tested that are in contact with each other, the watershed algorithm is used to segment the contour. Wherein, the extracted sample mask to be tested is subjected to morphological opening operation and closing operation to remove image noise, and then the sample contour is extracted by edge detection algorithm; for the case where multiple samples to be tested are in contact with each other, the watershed algorithm is used to segment the adhered contour to ensure that the contour of each sample to be tested is independent.
[0033] (3) obtain the centroid coordinates of the contour of each sample to be tested as the test point position. By calculating the centroid coordinates of each independent sample contour, the position corresponding to the centroid coordinates in the predetermined area is taken as the test point position of the sample to be tested, and each test point is assigned a unique number.
[0034] (4) store the test point position of each sample to be tested in the test point list. The number, centroid coordinates and other information of all test points are stored in the test point list.
[0035] Wherein, the motion control module 50 is configured to obtain the test point position from the test point list to control the three-axis moving mechanism 20 to drive the optical path module 10 to move according to the test point position.
[0036] In some embodiments, the gemstone composition automatic batch detection system 100 can further include a user interaction module 80, which can include a touch display screen and physical operation buttons, for marking the contour of each sample to be tested and the test point position on the target image, and displaying the marked target image to facilitate the user to intuitively view the recognition result.
[0037] The user interaction module 80 provides function buttons such as "start recognition", "start test", "calibration", and provides a test point editing interface, so that the user can modify, delete and add test points in the editing interface through touch operation. When the user edits the test points in the editing interface, the user interaction module 80 transmits the operation instruction input by the user in the editing interface to the image recognition module 40, so that the image recognition module 40 updates the test point list according to the operation instruction input by the user in the editing interface.
[0038] The user interaction module 80 also provides a parameter configuration function button for inputting preset test height, mask threshold range of HSV space, lowest lowering height of optical path module, initial motor step number and other parameter information.
[0039] In some embodiments, the motion control module 50 is a microprocessor-based control system, which is the "control center" of the whole system, and its core functions include motor movement control of the three-axis moving mechanism 20, conversion of pixel distance and motor step number, etc. The motor movement control can include manual control and program automatic control modes. In manual mode, the user can control the x-axis, y-axis and z-axis motors to move individually through the user interaction module 80; in automatic mode, the motion control module 50 obtains the test point list from the image recognition module 40, reads the coordinate information of each test point in turn, controls the three-axis moving mechanism 20 to move the optical path module 10 to the corresponding position, and adjusts the z-axis height in combination with the distance data of the distance measurement module 70.
[0040] The motion control module 50 is specifically configured to obtain a pre-stored initial motor step number, which is the motor step number required for the optical path module 10 to move from an initial position to a position above a position point corresponding to a center point of a target image in a predetermined region, and the motion control module 50 is also configured to calculate a pixel distance between a test point position of the sample to be tested in the target image and the center point of the target image, and convert the pixel distance into a target motor step number according to a preset conversion relationship, so as to move the optical path module 10 to the test point position of the sample to be tested in the predetermined region according to the initial motor step number and the target motor step number.
[0041] More specifically, the installation position of the camera of the image acquisition module 30 is fixed, and the center position of the camera can be the center point position of the image acquired by the camera, which is the initial position of the optical path module 10. The initial motor steps are pre-stored in the motion control module 50, which are the motor steps required for the three-axis moving mechanism 20 to move the optical path module 10 from the initial position to above the target image center point, i.e., the motor steps required for the focal point of the light spot of the optical path module 10 to move from the initial position to the target image center point. When the image recognition module 40 determines the test point position, the motion control module 50 calculates the pixel distance between the test point position of the sample to be tested in the target image and the target image center point, calls the pre-stored conversion relationship to convert the pixel distance into target motor steps, and then obtains the final motor movement scheme according to the initial motor steps and the target motor steps, to control the three-axis moving mechanism 20 to drive the optical path module 10 to move above the test point.
[0042] The motor steps required for the optical path module 10 to move from the initial position to above the test point are the superposition of the initial motor steps and the target motor steps. During the test, there can be two ways to move the optical path module 10, the first way is to return to the initial position after testing each sample to be tested, and then move from the initial position to above the next test point, and the second way is to move from the current test point to above the next test point after testing each sample to be tested. In order to improve the detection efficiency, the second moving way can be selected, wherein the motor steps required for the optical path module 10 to move from the current test point to above the next test point are: the motor steps corresponding to the pixel distance between the next test point and the target image center point minus the motor steps corresponding to the pixel distance between the current test point and the target image center point.
[0043] In some embodiments, the gemstone composition automatic batch detection system 100 further comprises a correction module 90. The correction module 90 is in communication connection with the motion control module 50, and is used to obtain a preset test height and complete the calibration of the pixel distance and motor step conversion formula. The user interaction module 80 comprises a correction interface, and the user can perform correction operation through the correction interface. The specific correction process is as follows: According to the correction instruction, a first prompt information is sent to prompt the user to check the installation state of the image acquisition module 30 and the distance measuring module 70. The user can input the correction instruction on the user interaction module 80 to trigger the correction module 90 to execute the correction process. By adjusting the image acquisition module 30 and the distance measuring module 70, it is ensured that the shooting direction of the camera of the image acquisition module 30 and the distance measuring laser direction of the distance measuring module 70 are perpendicular to the sample tray, and the sample tray area is completely covered in the camera image range.
[0044] After the first prompt information is sent, a coordinate system alignment process is performed, and the correction module 90 controls the three-axis moving mechanism 20 to drive the optical path module 10 to move along the x-axis and the y-axis through the motion control module 50, and simultaneously controls the image acquisition module 30 to capture a correction image in the moving process, judges whether the moving direction of the optical path module 10 along the x-axis and the y-axis is consistent with the x-axis and the y-axis direction of the correction image, and if not, sends a second prompt information to prompt the user to fine-tune the rotation angle of the camera installation.
[0045] The correction module 90 is also used to obtain the lowest height of the optical path module 10 descending along the z-axis, the preset test height and the like parameters input by the user through the user interaction module 80.
[0046] The correction module 90 is also used to obtain the conversion relationship between the pixel distance and the motor step number, which can also be understood as a conversion formula. Specifically, the correction module 90 controls the image acquisition module 30 to capture a standard image of a standard sample placed in a predetermined area. The user selects a standard point on the standard image through the user interaction module 80, and the correction module 90 obtains the position of the standard point according to the user's selection, and sends a control signal to the motion control module 50 to control the three-axis moving mechanism 20 to drive the optical path module 10 to move from the initial position to above the standard point in the predetermined area and record the motor step number. Wherein, the position coordinate of the optical path module 10 in the xy-axis plane when it is in the initial position is known, for example, it can be input by the user through the user interaction module 80, or it can be obtained by the image recognition module 40 recognizing the focal point of the optical path module 10 in the standard image. The correction module 90 obtains the pixel coordinates of the standard point in the standard image and the coordinates of the focal point of the optical path module 10 in the standard image when it is in the initial position, calculates the pixel distance between the standard point and the focal point in the standard image according to the two coordinates, and calculates the conversion formula of the pixel distance and the motor step number according to the pixel distance and the recorded motor step number, and transmits it to the motion control module 50 for storage.
[0047] When the correction is completed, the user can verify the result, for example, the user can select a verification point on the standard image at will, control the motion control module 50 to drive the optical path module 10 to move through the user interaction module 80, and observe whether the optical path module 10 can accurately move to above the verification point and descend to the preset test height, wherein whether the focal point of the optical path module 10 falls on the verification point or not, and whether the height detected by the ranging module 70 is the preset test height, if so, the correction is completed.
[0048] Referring to Figure 2 The embodiment of the present application also provides a kind of gem composition automatic batch detection method, comprising the following steps: Step S11: receiving the start test instruction input by the user in the user interaction module.
[0049] Step S12: According to the start test instruction, the image acquisition module is controlled to acquire a target image of a predetermined area where a plurality of to-be-tested samples are placed. The target image can be sent to the user interaction module to display the target image for the user to confirm whether the captured target image is qualified. The user can confirm the target image to be qualified through the user interaction module to trigger the next step S13.
[0050] Step S13: The number of to-be-tested samples in the predetermined area and the test point position of each to-be-tested sample in the predetermined area are acquired according to the target image.
[0051] Step S14: The contour of each to-be-tested sample is acquired, and the contour of each to-be-tested sample and the test point position are marked on the target image. The marked target image is displayed, and the test point position of each to-be-tested sample is stored in a test point list. By displaying the contour of the to-be-tested sample and the test point position, the user can intuitively view the recognition result. The user can confirm whether the recognized test point position is accurate, and can perform editing operations such as modifying, deleting, and adding the test point.
[0052] Step S15: A confirmation instruction of the user on the marked target image is acquired, the test point position is acquired from the test point list according to the confirmation instruction, and the three-axis moving mechanism is controlled to drive the light path module to move to above the test point position of each to-be-tested sample in sequence, so that the primary X-ray spot focus of the light path module falls on the test point position of each to-be-tested sample in sequence, thereby sequentially performing composition detection on the plurality of to-be-tested samples.
[0053] When the light path module moves above the test point position of each to-be-tested sample, the actual distance between the light path module and the surface of the to-be-tested sample detected by the distance measuring module is acquired, the moving distance of the light path module along the z-axis direction is acquired according to the actual distance and the preset test height, and the three-axis moving mechanism is controlled to drive the light path module to move along the z-axis direction according to the moving distance, so that the distance between the light path module and the surface of the to-be-tested sample is the preset test height.
[0054] The gem component automatic batch detection system 100 of the embodiment of the present application, through the upper illumination type vertical light path design of the light path module 10, cooperates with the 0.1mm level precision movement of the three-axis moving mechanism 20, ensures the stability and accuracy of detection; through the HSV space threshold segmentation and watershed algorithm of the image recognition module 40, the effective identification of the overlapped samples is realized, and the identification success rate is improved; through the pixel-motor step conversion and closed loop control of the motion control module 50, the precise positioning of the test point is realized; the whole system realizes the full process automation from sample identification, positioning, testing to result analysis, greatly improves the detection efficiency of batch gem samples, reduces the manual operation strength, and does not need to record the fixed position information in advance, and the automatic positioning of the to-be-tested sample can be realized through the image recognition module, so the to-be-tested sample does not need to be placed in the fixed position, but only needs to be placed in the predetermined area, and the position of the to-be-tested sample in the predetermined area is not limited, so that the position of the to-be-tested sample can be placed more flexibly.
[0055] The principles and implementation manners of the present application are described by applying specific examples in the present text, and the above embodiment description is only for helping to understand the method of the present application and its core idea; meanwhile, for the person skilled in the art, according to the idea of the present application, the specific implementation manner and application range will have changes, and according to the above, the content of the present description should not be understood as the limitation of the present application.
Claims
1. An automatic batch gemstone composition detection system, characterized by, The application relates to a kind of X-ray fluorescence analysis system, comprising: Light path module, for emitting primary X-ray to be measured sample, and collecting the characteristic fluorescence X-ray excited by to be measured sample; Three-axis moving mechanism, connected with the light path module, for moving light path module; Image acquisition module, for obtaining target image of predetermined area where multiple to be measured samples are placed, wherein with the plane where the predetermined area is located as xy axis plane, z axis direction is perpendicular to the xy axis plane, the light path module is arranged on one side of predetermined area along z axis direction to vertically irradiate to be measured sample; Image recognition module, in communication connection with the image acquisition module, for obtaining the number of to be measured samples in predetermined area and the test point position of each to be measured sample in predetermined area according to the target image; Motion control module, in communication connection with the three-axis moving mechanism and image recognition module respectively, for controlling the three-axis moving mechanism to drive the light path module to move to the test point position of multiple to be measured samples in turn, so that the primary X-ray spot focus of light path module falls on the test point position of multiple to be measured samples in turn, thereby sequentially detecting the composition of multiple to be measured samples.
2. The automatic gemstone composition batch detection system according to claim 1, wherein, Further comprising ranging module, the ranging module is used for detecting the actual distance between light path module and the surface of to be measured sample; The motion control module is in communication connection with the ranging module, for obtaining the moving distance of the light path module along z axis direction according to the actual distance and preset test height, and controlling the three-axis moving mechanism to drive the light path module to move along z axis direction according to the moving distance.
3. The automatic gemstone composition batch detection system according to claim 1, wherein, The light path module is an upper illumination type vertical light path module, comprising light pipe and detector, the light pipe is used for emitting primary X-ray to vertically irradiate to be measured sample, and the detector is used for collecting the characteristic fluorescence X-ray excited by to be measured sample.
4. The automatic gemstone composition batch detection system according to claim 1, wherein, The predetermined area is sample tray area, and the image recognition module is specifically used for: Converting the target image to HSV color space, extracting to be measured sample mask according to preset mask threshold range of HSV space based on the color difference between to be measured sample and tray background; Extracting the contour of each to be measured sample according to the to be measured sample mask, wherein for to be measured samples in contact with each other, watershed algorithm is used to segment the contour; Obtaining the centroid coordinates of the contour of each to be measured sample as test point position; Storing the test point position of each to be measured sample in test point list; The motion control module is used for obtaining test point position from the test point list to control the three-axis moving mechanism to drive the light path module to move according to the test point position.
5. The automatic gemstone composition batch detection system according to claim 4, wherein, Further comprising user interaction module, the user interaction module is used for marking the contour of each to be measured sample and test point on the target image, and displaying the target image after marking; The user interaction module is also used for providing editing interface for modifying, deleting and adding test point; The image recognition module is also used for updating the test point list according to the operation instruction input by user in editing interface.
6. The automatic gemstone composition batch detection system according to claim 2, wherein, The motion control module is used for obtaining pre-stored initial motor step number, the initial motor step number is the motor step number required for light path module to move from initial position to the position point corresponding to the center point of target image in predetermined area. The motion control module is further configured to calculate a pixel distance between a test point position of the sample to be tested in the target image and a center point of the target image, and convert the pixel distance into a target motor step number according to a preset conversion relationship, so as to move the optical path module to the test point position of the sample to be tested according to the initial motor step number and the target motor step number.
7. The automatic gemstone composition batch detection system according to claim 6, wherein, The calibration module is further configured to: issue a first prompt information according to the calibration instruction to prompt the user to check the installation state of the image acquisition module and the ranging module; control the motion control module to drive the optical path module to move along the x-axis and the y-axis in sequence, and control the image acquisition module to acquire a calibration image in the moving process, and determine whether the moving direction of the optical path module along the x-axis and the y-axis is consistent with the x-axis and y-axis direction of the calibration image, and issue a second prompt information if not consistent; acquire a preset test height input by the user through the user interaction module; acquire the conversion relationship.
8. The automatic gemstone composition batch detection system according to claim 1, wherein, The analysis module is further configured to analyze the composition of the sample to be tested according to the characteristic fluorescent X-ray. The analysis module is further configured to analyze the composition of the sample to be tested according to the characteristic fluorescent X-ray.
Citation Information
Patent Citations
XRF (X-ray fluorescence) equipment and automatic sample positioning and multi-point testing method and device thereof
CN105158285A
Banana leaf leaf spot detection method
CN109658409A
Agaricus bisporus diameter measurement and center point positioning method
CN109741393A
Tomato identification positioning method and system
CN110599507A
Non-destructive three-dimensional fossil and cultural relic surface chemical element distribution characteristic analysis method
CN111624218A