A wood rod pen barrel production detection method, device and medium

By using multi-sensor synchronous data acquisition and a multi-modal fusion data model, combined with a neural network model, the problems of missed inspections and inconsistent judgments in the production of wooden pen barrels have been solved, realizing automated and accurate quality inspection and ensuring product consistency and user experience.

CN122222997APending Publication Date: 2026-06-16JINING QISHENG CULTURAL & EDUCATIONAL PRODUCTS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610523139.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-20
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

In the industrial production of wooden pen barrels, existing technologies rely on manual visual inspection, resulting in a high rate of missed inspections, inconsistent judgment standards, and the inability to inspect the internal quality of the pen refill online, which fails to guarantee product consistency and user experience.

Method used

The system uses multiple sensors to simultaneously acquire panoramic surface data, axial contour sequence data, and internal transmission image data of the wooden pen barrel. By aligning spatial coordinates, a multimodal fusion data model is generated. Combined with a neural network model, flaws and defects are automatically identified, a three-dimensional solid model is reconstructed, and geometric dimensions and pen refill posture are calculated. The integrated analysis generates a quality report.

Benefits of technology

It achieves the same-source acquisition and pixel-level spatial registration of surface optical information, external geometric information and internal structural information of wooden pen barrels, automatically identifies surface defects and printing defects, quantifies geometric tolerance parameters, realizes online full inspection of the internal state of the pen refill, and avoids systematic deviations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122222997A_ABST
    Figure CN122222997A_ABST
Patent Text Reader

Abstract

The application discloses a wood rod pen barrel production detection method, equipment and medium, the method comprises the following steps: triggering the sensor to collect the wood rod pen barrel data and obtaining a multi-dimensional image; the surface panoramic image data, the axial contour sequence image data and the internal transmission image data are calculated by spatial coordinate alignment to map to a unified three-dimensional coordinate system to generate a multi-modal fusion data model; the surface defect data and the printing defect data are identified from the aligned surface panoramic image data, the external three-dimensional entity model of the wood rod pen barrel is reconstructed from the aligned axial contour sequence image data, the geometric size data is calculated, the pencil core area is segmented from the aligned internal transmission image data, and the spatial attitude data of the pencil core is calculated; the surface defect data, the printing defect data, the geometric size data and the spatial attitude data of the pencil core are input into a preset configurable quality rule knowledge base and a comprehensive evaluation model to generate a comprehensive quality report, and a final quality grade judgment instruction is output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a production inspection method, equipment and medium for wooden pen barrels. Background Technology

[0002] In the large-scale industrial production of wooden pen barrels, quality inspection is a crucial process for ensuring product consistency and user experience. Early inspection relied entirely on manual visual sorting. Workers visually inspected the pen barrel surface for scratches, stains, blurred printing, and other visible defects, using simple tools like calipers to check dimensional tolerances. However, human eye fatigue led to a sharp increase in the rate of missed inspections as work continued. Different quality inspectors had subjective differences in their criteria for judging the same defect, and it was impossible to perform any form of online inspection of the core quality indicators of the pen refill inside the barrel. Destructive cutting and sampling were the only option, resulting in a large number of defective products flowing into the subsequent packaging stage. Summary of the Invention

[0003] This application provides a production testing method, equipment, and medium for wooden pen barrels to solve the above-mentioned technical problems.

[0004] On one hand, embodiments of this application provide a production inspection method for wooden pen barrels, including: When the wooden pen barrel to be inspected is conveyed to the preset inspection station, multiple sensors are simultaneously triggered to collect data on the wooden pen barrel in order to obtain multi-dimensional image data; the multi-dimensional image data includes surface panoramic image data, axial contour sequence image data and internal transmission image data. Based on the fixed spatial position relationship of the wooden pen at the preset detection station and the known physical size benchmark, the spatial coordinate alignment calculation is performed on the surface panoramic image data, axial contour sequence image data and internal transmission image data, and the three types of image data are mapped to a unified three-dimensional coordinate system to generate a multimodal fusion data model of the wooden pen. Based on the multimodal fusion data model, surface defect data and printing defect data are identified from the aligned surface panoramic image data. The external three-dimensional solid model of the wooden pen barrel is reconstructed from the aligned axial contour sequence image data and the corresponding geometric dimension data is calculated. The pen core area is segmented from the aligned internal transmission image data and the spatial posture data of the pen core is calculated. The surface defects and printing defects data, the geometric dimensions data, and the spatial orientation data of the pen refill are input into a preset configurable quality rule knowledge base and a comprehensive evaluation model for integrated analysis, generating a comprehensive quality report and outputting the final quality level judgment instruction; the comprehensive quality report includes specific defect details and quantitative indicators.

[0005] In one implementation of this application, identifying surface defect data and printing defect data from aligned surface panoramic image data based on the multimodal fusion data model specifically includes: The aligned surface panoramic image data is input into a pre-trained first neural network model to extract multi-layered texture and color feature maps from the surface panoramic image data; Based on the multi-layered texture and color feature map, candidate region boxes are generated based on the first neural network model, and the features within the candidate region boxes are classified and bounding box regression is calculated. The specific category label, confidence score, and boundary coordinates in the unified three-dimensional coordinate system of the defect region are output. The preset printing template image is matched with the corresponding area in the surface panoramic image data for feature matching and difference pixel calculation. The integrity percentage of the printed pattern area and the color offset vector relative to the template are output as the alignment deviation value of the surface panoramic image data.

[0006] In one implementation of this application, the external three-dimensional solid model of the wooden pen barrel is reconstructed from the aligned axial contour sequence image data, and the corresponding geometric dimension data is calculated. Specifically, this includes: The aligned axial contour sequence image data is filtered and denoised, and the processed axial contour sequence image data is then subjected to three-dimensional reconstruction to generate a continuous external three-dimensional solid model of the wooden pen barrel. Based on the external three-dimensional solid model, multiple cross-sections are cut along the axial direction at preset fixed intervals. The minimum circumscribed circle diameter of each cross-section is calculated, and the standard deviation and range of all cross-section diameters are statistically analyzed as diameter uniformity values. Fit the central axis of the external three-dimensional solid model, and calculate the standard deviation of the distance from each point on the model surface to the central axis as the straightness deviation value; Extract the point cloud sets of the two end faces of the external three-dimensional solid model, fit the plane equation of the end face respectively, and calculate the angle with the ideal vertical plane as the flatness parameter; In the end edge region of the external three-dimensional solid model, chamfer feature segments are identified through cross-sectional profile analysis, and the length and angle of the chamfer feature segments are calculated as chamfer dimension values.

[0007] In one implementation of this application, segmenting the pen tip region from aligned internal transmission image data and calculating the spatial pose data of the pen tip specifically includes: The internal transmission image data is input into a pre-trained second neural network model to extract deep features of the internal transmission image data through an encoder, and the deep features are upsampled and classified at the pixel level through a decoder to output a probability map of each pixel belonging to the pen tip or the background. The probability map is thresholded to generate a binarized pen refill pixel region mask, and the largest connected region in the pen refill pixel region mask is extracted as the target pen refill region. Calculate the central moment of the target pen tip region, fit the spatial equation of the central axis of the pen tip pixel region, and extract the theoretical central axis spatial equation from the external three-dimensional solid model. Under the unified three-dimensional coordinate system, the minimum spatial distance between the central axis of the pen core pixel region and the theoretical central axis of the external three-dimensional solid model is calculated as the radial eccentricity distance value, and the angle between the two axis direction vectors is calculated as the axial parallelism angle value. The system analyzes whether the pixel area mask of the pen refill is continuous. If the pixel area mask of the pen refill is discontinuous beyond a preset area threshold, an integrity status indicator indicating that the pen refill is broken or hollow is output. The discontinuity includes breakage or voids.

[0008] In one implementation of this application, the surface defects and printing defects data, the geometric dimensions data, and the spatial orientation data of the pen refill are input into a preset configurable quality rule knowledge base and a comprehensive evaluation model for integrated analysis, generating a comprehensive quality report, and outputting a final quality level determination instruction, specifically including: A configurable quality rule knowledge base is constructed; the configurable quality rule knowledge base stores the threshold conditions and logical judgment relationships of various quality defects in the form of a rule list, and the threshold conditions are set for the surface defects and printing defects data, the geometric dimension data, and the spatial posture data of the pen refill respectively; Based on the surface defects and printing defects data, the geometric dimensions data, and the spatial orientation data of the pen refill, each rule in the configurable quality rule knowledge base is traversed, and the current feature value is matched with the triggering conditions in the rule; If all triggering conditions of a rule are met, the corresponding output action is executed, and the output action is added as a defect record to the comprehensive quality report. The defect record includes the triggered rule ID, defect feature name, quantified value, and position information in the unified three-dimensional coordinate system. Based on the severity level of all triggered rules, and following a preset priority logic, a final quality level determination instruction is generated.

[0009] In one implementation of this application, based on the fixed spatial position relationship of the wooden pen at the preset detection station and the known physical dimension benchmark, spatial coordinate alignment calculations are performed on the surface panoramic image data, axial contour sequence image data, and internal transmission image data. The three types of image data are mapped to a unified three-dimensional coordinate system to generate a multimodal fusion data model of the wooden pen, specifically including: The reference axis and key end face features of the wooden pen barrel are extracted from the axial contour sequence image data to establish a unified three-dimensional coordinate system; Based on the calibration transformation matrix between the first imaging sensing module and the second imaging sensing module, each pixel in the surface panoramic image data is mapped to a three-dimensional spatial point in the unified three-dimensional coordinate system, thereby completing the bonding of the surface texture and the three-dimensional model. Based on the projection geometry between the imaging plane of the third imaging sensing module and the unified three-dimensional coordinate system, and the known diameter of the wooden pen barrel, the internal transmission image data is normalized in scale and corrected in spatial position so that the projection position of the pen core in the internal transmission image data is consistent with the actual spatial position in the unified three-dimensional coordinate system. By minimizing the positional error between the feature edges in the surface panoramic image data and the corresponding contour edges in the axial contour sequence image data, as well as the error between the pen tip projection in the internal transmission image data and the theoretical position in the unified three-dimensional coordinate system, the multimodal fusion data model is constructed.

[0010] In one implementation of this application, when the wooden pen shaft to be inspected is conveyed to a preset inspection station, multiple sensors are simultaneously triggered to collect data from the wooden pen shaft to obtain multi-dimensional image data, specifically including: Based on the trigger signal that the wooden pen barrel to be detected reaches the preset detection station, an image acquisition command is generated and the image acquisition command is synchronously sent to the preset first imaging sensor module, second imaging sensor module and third imaging sensor module. The circumferential image acquisition unit in the first imaging sensing module is controlled to drive the camera unit surrounding the wooden pen holder to continuously acquire multiple frames of images covering the entire outer surface of the wooden pen holder at a preset fixed frame rate, and then stitch them together to synthesize panoramic image data of the surface. The contour scanning unit in the second imaging sensing module is controlled to perform line-by-line scanning along the axial direction of the wooden pen barrel to obtain continuous axial contour sequence image data of the pen barrel shape. The penetrating imaging unit in the third imaging sensing module is controlled to emit penetrating radiation of a specific wavelength and receive the intensity distribution signal after penetration when the wooden pen is stationary or in uniform motion, thereby generating a two-dimensional projection image that distinguishes the wooden part of the pen and the internal pen core material, which serves as internal transmission image data.

[0011] In one implementation of this application, it further includes: Establish a structured historical inspection database to store the feature index of the multimodal fusion data model of each wooden pen barrel, the full content of the comprehensive quality report, and the corresponding production batch code and key process parameter values; Disputed sample data where manual re-inspection results differ from automatic judgment results are collected at preset time intervals, and incremental training datasets are constructed using the disputed sample data to incrementally train the first neural network model and the second neural network model; the disputed sample data includes sample image data, manually annotated correct defect information, and final quality level. During incremental training, the model weight parameters are updated based on new training data to complete the optimization and iteration of model parameters, thereby achieving continuous self-optimization of the detection model.

[0012] On the other hand, this application also provides a production and testing device for wooden pen barrels, the device comprising: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, which enables the at least one processor to perform a production inspection method for wooden pen barrels as described above.

[0013] On the other hand, this application embodiment also provides a non-volatile computer storage medium storing computer-executable instructions, which, when executed, implement the production inspection method for wooden pen barrels as described above.

[0014] This application provides a production testing method, equipment, and medium for wooden pen barrels, which has at least the following beneficial effects: By simultaneously triggering multiple sensors at a preset inspection station to acquire three types of multi-dimensional image data—surface panorama, axial contour sequence, and internal transmission—and aligning and mapping these heterogeneous image data to a unified coordinate system based on fixed spatial relationships and known physical dimensions, homogeneous acquisition and pixel-level spatial registration of the surface optical information, external 3D geometric information, and internal transmission structure information of the wooden pen barrel were achieved within a single inspection station. A multimodal fusion data model was constructed to achieve semantic alignment of inspection data from different physical dimensions and imaging mechanisms within the same 3D digital twin framework. Based on the generated multimodal fusion data model, the aligned surface panorama image data was extracted from... The system dynamically identifies surface defects and printing defects, reconstructs the external three-dimensional solid model from aligned axial contour sequence image data and quantifies geometric tolerance parameters, accurately segments the pen refill area from aligned internal transmission image data and calculates the radial eccentricity, axial parallelism deviation and integrity status of the pen refill, and incorporates the internal spatial posture of the pen refill into the online full inspection scope. Since the extraction of the three types of features is performed based on aligned image data under the same fusion data model framework, the edge position of surface defects, the geometric center of the external contour and the axis equation of the internal pen refill are all compared and calculated in the same coordinate system, avoiding systematic deviations introduced by factors such as sensor installation errors, transmission mechanism vibration and pen barrel posture fluctuations. Attached Figure Description

[0015] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A schematic flowchart illustrating a production and testing method for wooden pen barrels provided in this application embodiment; Figure 2 This is a schematic diagram of the internal structure of a production and testing equipment for wooden pen barrels, provided as an embodiment of this application. Detailed Implementation

[0016] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0017] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0018] Figure 1This is a flowchart illustrating a production and testing method for wooden pen barrels, provided as an embodiment of this application.

[0019] The analysis method involved in the embodiments of this application can be implemented by a terminal device or a server, and this application does not impose any special limitations on it. For ease of understanding and description, the following embodiments are all described in detail using a server as an example.

[0020] It should be noted that the server can be a single device or a system composed of multiple devices, i.e., a distributed server. This application does not make any specific limitations on this.

[0021] like Figure 1 As shown in the embodiment of this application, a production inspection method for wooden pen barrels is provided, including: Step 101: When the wooden pen to be inspected is conveyed to the preset inspection station, multiple sensors are simultaneously triggered to collect data from the wooden pen to obtain multi-dimensional image data.

[0022] It should be noted that the multidimensional image data in the embodiments of this application includes surface panoramic image data, axial contour sequence image data, and internal transmission image data.

[0023] In this embodiment, the preset detection station refers to a fixed location area set along the production line conveyor path, specifically for performing multi-source data acquisition. This station is equipped with a mechanical positioning mechanism, such as a pneumatic gripper, rotating roller, or limit stop, which ensures that each wooden pen barrel conveyed here has a definite and repeatable spatial posture at the moment of data acquisition. The wooden pen barrel to be tested is conveyed to this station by an upstream conveyor belt or turntable feeding mechanism at a fixed interval. When a photoelectric sensor or proximity switch detects that the pen barrel has reached the designated position, a trigger signal is generated.

[0024] Synchronously triggering multiple sensors is a prerequisite for achieving spatiotemporal alignment of multi-source data. In traditional solutions, different detection devices are arranged sequentially along the production line, and the pen barrel images are generated at different workstations. Due to vibrations, speed changes, or pen barrel rolling, the posture changes, making it difficult for the images acquired by each sensor to correspond precisely in space. In this embodiment, all imaging sensor modules are activated simultaneously by the same trigger signal, ensuring that the surface, contour, and internal image data reflect the physical properties of the same pen barrel at the same moment and under the same force. Specifically, the synchronous trigger command is issued by an industrial control computer or programmable logic controller and simultaneously sent to the first, second, and third imaging sensor modules via hardwiring or real-time industrial Ethernet. After receiving the command, each module immediately starts data acquisition based on the first sampling cycle of its internal clock. The signal propagation delay and sampling clock deviation are controlled at the microsecond level, which is much smaller than the static dwell time of the pen barrel at the workstation, and can be considered as ideal synchronization in engineering.

[0025] Regarding the acquisition of panoramic surface image data, this application employs a circumferential vision acquisition strategy. The wooden penholder is a slender, rotating body; a single planar photograph can only cover a portion of its outer surface, necessitating the acquisition of a full-circumference image through relative motion. Specifically, the wooden penholder remains stationary while multiple cameras are positioned around it, or a single camera is used to revolve around the penholder to capture images, thus synthesizing a panoramic surface image. This panoramic image covers the entire outer surface area of ​​the penholder from one end face to the other, including two-dimensional optical representations of wood grain, printed patterns, coating colors, and various surface imperfections such as cracks, scars, holes, and stains.

[0026] Regarding the acquisition of axial contour sequence image data, this application employs active optical contour scanning technology. A line laser contour sensor is a typical implementation method. Its working principle involves projecting a linear laser beam onto the surface of the pen barrel, obtaining the two-dimensional coordinates of each point on the cross-section using triangulation, and continuously acquiring a series of cross-sectional contour lines as the pen barrel moves at a constant speed along the axial direction or as the sensor scans along the axial direction, thus accumulating to form a three-dimensional point cloud covering the entire shape of the pen barrel.

[0027] Regarding the acquisition of internal transmission image data, this application employs imaging bands with material penetration capabilities to reveal the internal pen refill structure encased in a wooden pen barrel. The pen refill is typically composed of composite materials such as graphite, clay, or pigments and waxes. Its density, atomic number, or absorption coefficient for specific wavelengths differs significantly from that of the wood in the pen barrel, providing a physical basis for transmission imaging. In specific near-infrared bands, wood exhibits a degree of translucency, while the pen refill material has strong absorption, allowing for the acquisition of two-dimensional projection images of the pen refill, clearly outlining its contours, orientation, and internal continuity. This internal transmission image data is obtained without causing any damage to the pen barrel, making it possible to perform online full inspection of each pen, whereas previously only possible through random sampling during dissection.

[0028] Step 102: Based on the fixed spatial position relationship of the wooden pen barrel at the preset detection station and the known physical size benchmark, perform spatial coordinate alignment calculation on the surface panoramic image data, axial contour sequence image data and internal transmission image data, map the three types of image data to a unified three-dimensional coordinate system, and generate a multimodal fusion data model of the wooden pen barrel.

[0029] In this embodiment, the fixed spatial positional relationship refers to the installation position and attitude parameters of each imaging sensing module relative to the mechanical reference of the detection station. For example, the camera optical center coordinates of the first imaging module, the laser emission surface equation of the second imaging module, and the X-ray source focal point coordinates and detector plane equation of the third imaging module are all pre-measured through factory calibration or on-site manual-eye calibration and stored in the system configuration file. The known physical dimension reference refers to the standard geometric features of the pen itself, such as the design values ​​of the total length, nominal diameter, and end face shape of the pen, as well as possible positioning features, such as printing start marks and end chamfer start points. These physical references act as natural spatial anchors during the data fusion process to correct residual errors introduced by long-term sensor drift, temperature deformation, or small pose fluctuations of the pen.

[0030] Spatial coordinate alignment calculation unifies three types of heterogeneous, heterogeneous, and heterogeneous image data under the same digital reference frame. Axial contour sequence image data is itself a three-dimensional point cloud format, naturally containing spatial coordinate information. This application embodiment first establishes an initial three-dimensional coordinate system based on this point cloud data. Specifically, with the pen shaft axis as the Z-axis, the center of one end face as the origin, and the direction pointing to the other end as the positive Z-direction, the X-axis and Y-axis lie in the end face plane, forming a right-handed coordinate system. Based on this, the surface panoramic image data is mapped to this coordinate system. The surface panoramic image is two-dimensional planar data, and its pixel coordinates have a one-to-one correspondence with the three-dimensional spatial points on the pen shaft surface. That is, given the pen shaft rotation angle and axial position, the cylindrical coordinates corresponding to any pixel can be calculated, and then converted into three-dimensional rectangular coordinates. This application embodiment utilizes the calibration transformation matrix between the first imaging module and the second imaging module, namely the rotation matrix and translation vector, to accurately project the pixels of each frame of the surface image onto the corresponding surface area of ​​the three-dimensional point cloud model, achieving texture mapping.

[0031] For internal transmission image data, the imaging process involves compressing a three-dimensional object into a two-dimensional projection. This requires inferring the actual spatial position of the pen refill from the pen barrel's external dimensions. This application's embodiment uses the imaging geometry model of the third imaging module, either a pinhole imaging model or a cone-beam projection model, combined with the pen barrel's known pose and diameter at the workstation, to perform scale normalization and position correction on the transmission image. Specifically, the pen barrel's outer shell appears as a strip-shaped region of a certain width in the projection image. By extracting the boundary of this strip-shaped region using an edge detection algorithm, the projection width of the pen barrel on the projection plane can be determined. The ratio of this width to the actual diameter of the pen barrel determines the scaling factor of the projection image. Simultaneously, the projection position of the pen barrel's axis in the projection image can be determined by end-face features or a center of rotational symmetry. This allows the pen refill pixel coordinates in the image coordinate system to be back-projected onto a ray in space. The chord intercepted by this ray and the pen barrel's three-dimensional model shell represents the theoretical position range of the pen refill on that cross-section. Through the above calculations, the internal transmission image data is embedded in a unified three-dimensional coordinate system, and each segment of the pen refill's projection is assigned actual spatial depth information.

[0032] Edge features in the surface panoramic image data, such as the boundaries of printed patterns, end face contours, and chamfer start lines, may not completely coincide with the corresponding three-dimensional contour edges in the axial contour sequence image data due to sensor noise, calibration residual errors, and other reasons. This application uses the sum of squared distances between the projected positions of surface features and the three-dimensional contour positions as the objective function to fine-tune the relative pose parameters between each sensor until the error converges to a preset threshold. Simultaneously, the projected edge of the pen tip in the internal transmission image data should also be consistent with the theoretical contour generated by the forward projection of the pen tip's spatial pose equation; this consistency constraint is also incorporated into the optimization process. The multimodal fusion data model generated after this joint optimization has its surface texture, external geometry, and internal structure strictly aligned in space. By selecting any point in the model, information such as its surface color, local curvature, and whether a pen tip exists underneath can be queried simultaneously, providing high-quality input data for subsequent collaborative feature extraction.

[0033] Step 103: Based on the multimodal fusion data model, identify surface defect data and printing defect data from the aligned surface panoramic image data, reconstruct the external three-dimensional solid model of the wooden pen barrel from the aligned axial contour sequence image data and calculate the corresponding geometric dimension data, segment the pen core area from the aligned internal transmission image data and calculate the spatial posture data of the pen core.

[0034] In this embodiment, based on a multimodal fusion data model, the system executes three independent feature extraction and analysis processes in parallel. These three processes process aligned image data in three dimensions—surface, axis, and interior—independently and synchronously, and the output results have spatial consistency in a unified three-dimensional coordinate system, providing complete feature input for subsequent integrated analysis.

[0035] Specifically, the aligned panoramic image data of the surface is input into a pre-trained first neural network model. This first neural network model is a deep convolutional neural network used for industrial defect detection, and its network architecture typically employs a composite structure combining a feature pyramid network and a region proposal network. During the training phase, the model uses labeled images of wooden pen barrel surfaces as training samples, covering various defect categories such as cracks, scars, holes, stains, printing misalignments, printing gaps, and color misregistration. The network weight parameters are iteratively optimized using a stochastic gradient descent algorithm until the model's classification accuracy and localization precision on the validation set reach preset targets. After the pre-training process, the first neural network model is able to extract defect features from complex backgrounds.

[0036] When the aligned panoramic surface image data is input into the first neural network model, the model first abstracts the image step by step through multiple layers of convolution and pooling operations. Shallow convolutional layers primarily respond to low-level visual features such as edges, corners, and color patches in the image; mid-level convolutional layers combine these low-level features into mid-level semantic features such as texture primitives and local patterns; deep convolutional layers further abstract high-level semantic features directly related to defect categories. Through this hierarchical feature extraction mechanism, the model automatically generates multi-level texture and color feature maps of the panoramic surface image data. This feature map preserves the spatial resolution information of the original image while mapping the original pixel space to a high-dimensional feature space, making different defect categories that are difficult to separate linearly in pixel space significantly distinguishable in the high-dimensional feature space.

[0037] Based on multi-level texture and color feature maps, the region proposal network in the first neural network model scans the feature map using a sliding window approach. For each sliding window position, the region proposal network simultaneously outputs two sets of predictions: a confidence score indicating whether a defective target exists within the window, and the offset of the window relative to the true defect boundary. By densely sampling the entire feature map, the region proposal network generates several candidate region boxes. These candidate region boxes cover all possible locations in the image that may contain defects, but the vast majority of them are negative sample regions that do not contain defects. Subsequently, based on the confidence scores and spatial overlap of the candidate region boxes, redundant and low-confidence boxes are eliminated, retaining the set of candidate region boxes with the highest confidence and no significant overlap.

[0038] For each retained candidate region bounding box, a region-of-interest (ROI) pooling operation is used to uniformly scale feature map sub-blocks of different sizes within the candidate region bounding box to a fixed size, and then feeds them into parallel classification and regression branches. The classification branch uses a fully connected layer and a softmax activation function to output the probability distribution of the candidate region bounding box belonging to each preset defect category and background category. The category corresponding to the highest probability is taken as the defect category label for the candidate region, and this probability value is the confidence score. The regression branch uses a fully connected layer and a linear activation function to output the positional offset of the candidate region bounding box relative to the real defect boundary, including the center point coordinate offset, width offset, and height offset. Applying the positional offset to the original coordinates of the candidate region bounding box yields the precise bounding box coordinates that closely match the real defect boundary. Finally, these bounding box coordinates are transformed from the image pixel coordinate system to a unified three-dimensional coordinate system through a coordinate mapping relationship, outputting the latitude and longitude position of the defect area on the pen holder surface.

[0039] For example, in the detection of printing defects, this embodiment also integrates an independent template comparison branch as a supplement to the first neural network model. This branch does not rely on a large number of training samples, but is based on the direct comparison between a standard template and the image to be tested. The preset printing template image is collected by the production line during the changeover and debugging phase. The first sample, which has been manually confirmed to be free of any printing defects, is selected and acquired using the same optical system as the first imaging sensing module under the same workstation and lighting conditions to ensure that the template image and the image to be tested are consistent in imaging geometry and color response. The template image is stored in the system memory, and a template library is established for different product models.

[0040] During inspection, the system automatically retrieves the corresponding printing template image based on the current production batch code. Using the established coordinate mapping, the printed pattern area in the template image is spatially registered with the corresponding area in the surface panoramic image data, compensating for pose differences caused by pen rotation or axial movement. After registration, the grayscale difference between the test image and the template image is calculated pixel-by-pixel. The differing pixels undergo thresholding and morphological closing operations to form several connected components. Each connected component represents a candidate region for printing defects. For each connected component, its geometric features such as area, aspect ratio, principal axis direction, and centroid coordinates are calculated, and noise interference is filtered out based on preset area thresholds and shape constraints. For connected components determined to be genuine printing defects, their offset relative to the corresponding position on the template is further calculated. This offset is expressed as a vector, containing lateral and longitudinal offset components, in millimeters or pixels, and output as a color offset vector. Simultaneously, the proportion of pixels within the printed pattern area whose difference from the template pixels does not exceed a threshold is calculated as the integrity percentage of the printed pattern area. This integrity percentage reflects whether there are defects such as missing lines, broken lines, or blurring in the printed content.

[0041] In this embodiment, the aligned axial contour sequence image data is filtered and denoised. The axial contour sequence image data is essentially a series of cross-sectional contour point clouds acquired by a line laser contour sensor or a line scan camera, with each cross-section containing hundreds of ordered two-dimensional coordinate points. Due to factors such as specular reflection areas on the pen holder surface, absorption and attenuation of laser light by dark wood, and interference from stray light from the environment, outlier noise points inevitably appear in the original contour data. This embodiment uses a Gaussian filtering algorithm to smooth each frame of the contour point cloud. For each point on the contour line, the weighted average of the coordinates of several neighboring points is taken as the new coordinates of that point. The weights are determined by a Gaussian function, with points closer to the center having higher weights. This filtering operation effectively suppresses random measurement noise while preserving the main geometric features of the contour, preventing excessive edge blunting. For individual strong outliers whose amplitudes significantly deviate from the neighborhood mean, median filtering is used for removal.

[0042] The processed axial contour sequence image data is subjected to 3D reconstruction. Each frame in the axial contour sequence image data corresponds to the cross-sectional contour of the pen barrel at a certain axial position. The spacing between frames is determined by the movement speed of the conveying mechanism and the sampling frequency of the sensor, and is usually set to sub-millimeter level. To generate a continuous and closed external 3D solid model, the gaps between adjacent contour lines need to be interpolated and filled. In this embodiment, the coordinates of all contour point clouds are used as constraints to construct implicit surface equations. The surface expression is obtained by solving a system of linear equations, and then triangular meshes are extracted at arbitrary resolution. This allows for the natural handling of possible local concave and convex features on the pen barrel surface, resulting in a smooth reconstruction without step effects. For a pen barrel with a regular cylindrical shape, corresponding points of adjacent contour lines are connected by straight line segments to form a quadrilateral mesh. The reconstructed 3D solid model is stored in memory in a standard 3D model format, containing complete information such as vertex coordinates, normal vectors, and triangular facet indices.

[0043] Based on an external 3D solid model, for diameter uniformity measurement, cross-sections perpendicular to the pen shaft axis are cut at preset fixed intervals along the axis. The cutting interval needs to balance measurement resolution and computational efficiency, typically one cross-section per millimeter. For each cross-section, the point cloud is the intersection of the 3D model and the cross-section, representing a closed polygon that approximates a circle. Since the pen shaft cross-section is not a perfect circle, this embodiment uses the minimum circumcircle algorithm to characterize the diameter of the cross-section. Specifically, using the vertices of the polygon as constraints, the algorithm finds the circle with the smallest radius that can contain all vertices, and the diameter of this circle is used as the diameter value of the current cross-section. All cross-sections are traversed to obtain the diameter distribution sequence along the axial direction. The standard deviation and range of this sequence are calculated. The standard deviation reflects the dispersion of diameter fluctuations, and the range reflects the maximum amplitude of diameter fluctuations; together, they constitute the diameter uniformity value. The smaller this value, the better the consistency of pen shaft thickness, reflecting higher process stability in the upstream extrusion or rolling process.

[0044] Regarding the measurement of straightness deviation, straightness is a core indicator characterizing whether the pen barrel is bent. First, the central axis of the external 3D solid model is fitted. For an ideal solid of revolution, the central axis is the line connecting the centers of all cross-sections. In this embodiment, the coordinates of all vertices of the 3D solid model are used to construct a dataset, and its covariance matrix is ​​calculated. The direction of the eigenvector corresponding to the largest eigenvalue is the axis direction. Then, the mean projection of all vertices in this direction is calculated to determine the spatial position of the axis. Subsequently, the Euclidean distance from each vertex on the model surface to this axis is calculated. Since the pen barrel surface is not perfectly smooth, there are slight fluctuations in the distance from each point to the axis. In this embodiment, the standard deviation of all distance values ​​is taken as the straightness deviation value. The larger the standard deviation, the greater the radial fluctuation of the pen barrel surface relative to the ideal axis, and the more severe the bending.

[0045] Regarding end-face flatness measurement, the two end faces of the pen barrel are the reference surfaces that directly contact subsequent cutting and assembly processes, and their flatness directly affects machining accuracy. A subset of point clouds corresponding to the end faces is extracted from the external 3D solid model. End-face region identification can be achieved through axial coordinate thresholding, i.e., taking all vertices whose axial coordinates are less than or greater than a certain threshold. For each end-face point cloud set, the least squares method is used to fit the plane equation, aiming to minimize the sum of squared distances from all points to the fitted plane. After fitting, the distance from all points in the point cloud to the fitted plane is calculated, and the average value is used as the end-face flatness parameter. Furthermore, the angle between the normal vector of the fitted plane and the normal vector of the ideal vertical plane is calculated; this angle reflects whether the end face is perpendicular to the pen barrel axis. If the angle exceeds the allowable range, it may lead to uneven stress on the pen barrel during packaging or use.

[0046] Regarding chamfer measurement, the ends of the pen barrel are usually chamfered to facilitate assembly or improve tactile feel. Measuring the chamfer dimensions is crucial for ensuring fitting accuracy. Multiple cross-sectional profiles are sampled at equal intervals along the circumferential direction on the end edge region of the external 3D solid model. For each cross-sectional profile, moving from the outermost edge point of the end face towards the inside of the pen barrel, the profile line initially appears as a sloping line segment at a certain angle to the axis, then turns into a straight line segment parallel to the axis; this turning point is the chamfer starting point. The chamfer starting point can be located by detecting the abrupt change in slope between adjacent line segments on the profile line. The axial distance from the starting point to the end face is measured; this distance is the chamfer length. The angle between the sloping line segment and the axis is measured; this angle is the chamfer angle. The average of the measurement results for all sampled cross-sections is taken as the final chamfer dimension value.

[0047] In this embodiment, the internal transmission image data is input into a pre-trained second neural network model. This second neural network model employs an encoder-decoder architecture, specifically designed for region-of-interest (ROI) segmentation tasks in medical images or industrial non-destructive testing images. The encoder consists of multiple stacked convolutional and downsampling layers. With each downsampling, the feature map size is halved while the number of channels multiplies. Through this progressive abstraction, the encoder gradually expands the receptive field, extracting deep semantic features from the internal transmission image data, enabling the model to distinguish subtle grayscale and texture differences between the pen refill and the pen barrel wood in the transmission image. The decoder consists of multiple upsampling and convolutional layers, progressively restoring the original resolution of the feature map through transposed convolution or bilinear interpolation. Each layer in the decoder fuses features with the corresponding feature map in the encoder via skip connections, combining deep semantic information with shallow spatial details, thus maintaining both accuracy in category discrimination and precision in boundary localization during pixel-level classification. The final layer of the decoder uses convolution and a softmax activation function to output the probability value of each pixel belonging to the pen refill or the background, forming a probability map of the same size as the input image.

[0048] Thresholding is performed on the probability map. Each pixel in the probability map has a value between 0 and 1; the closer to 1, the higher the confidence that the pixel belongs to the pen refill. This embodiment sets a threshold, typically 0.5, setting pixels with probability values ​​greater than or equal to the threshold to 1 and the remaining pixels to 0, generating a binary mask of the pen refill pixel region. This mask is a single-channel binary image; white areas represent the pen refill region determined by the model, and black areas represent the background. Due to potential interference from ray scattering, detector noise, or metal attachments at the pen tip in the internal transmission image, the binary mask often contains several scattered small, isolated white areas. These areas are not real pen refills but artifacts. This embodiment traverses all white pixels in the binary mask, merging adjacent white pixels into the same connected component and assigning a unique identifier to each connected component. The pixel area of ​​each connected component is calculated, and only the connected component with the largest area is retained as the target pen refill region; the remaining connected components are considered artifacts and filtered out.

[0049] The central moments of the target pen refill region are calculated. The central moments are a mathematical description of the geometric features of an image region, reflecting its shape, orientation, and distribution. For a connected region in a binary image, the zeroth moment represents the area of ​​the region, the first moment represents the centroid coordinates, and the second central moments constitute the covariance matrix, whose eigenvectors point towards the principal axis of the region. This embodiment calculates the second central moments of the target pen refill region, constructs the covariance matrix, and solves for its eigenvalues ​​and eigenvectors. The direction of the eigenvector corresponding to the largest eigenvalue is the principal axis direction of the pen refill region, which is consistent with the pen refill's orientation on the projection plane. Based on the established imaging geometry, the pen refill's central axis on the projection plane is back-projected into three-dimensional space. Specifically, multiple cross-sections are sampled at equal intervals along the axial direction on the pen refill region mask. The intersection of each cross-section with the pen refill's centerline is the center point of the pen refill at that axial position. The two-dimensional image coordinates of this center point are converted into a ray in three-dimensional space using a projection geometry model. The intersection of this ray with the pen barrel shell model is the three-dimensional spatial coordinate of the pen refill at that axial position. By performing linear fitting on the three-dimensional spatial coordinate points of all sampled sections, the spatial equation of the central axis of the pen tip pixel region is obtained.

[0050] Extract the spatial equation of the theoretical central axis from the reconstructed external 3D solid model. For an ideal solid of revolution, the theoretical central axis of the pen barrel is the line connecting the centers of all cross-sections. The theoretical central axis has already been fitted and calculated, and can be directly used.

[0051] Under a unified three-dimensional coordinate system, the refill alignment is quantitatively calculated. Radial eccentricity is defined as the minimum spatial distance between the refill's central axis and the theoretical central axis of the pen barrel. For two straight lines, the vector formed by any two points on the two lines, and the direction vectors of the two lines, are calculated. The shortest distance is equal to the projected length of this vector in the direction perpendicular to the two lines. This radial eccentricity value directly reflects the degree to which the refill deviates from the center within the pen barrel's cross-section and is one of the core indicators for evaluating the pen barrel's quality grade. Axial parallelism deviation is defined as the absolute value of the angle between the direction vectors of the two axes. This angle reflects whether the refill is parallel to the pen barrel. If the angle is too large, the refill may be exposed at one end of the pen barrel while deeply embedded at the other, severely affecting the writing experience or subsequent machining.

[0052] The continuity of the pixel region mask for the pen refill is analyzed. The pen refill should appear as a continuous, axially extending strip in the transmission image. If there are voids or breaks inside the pen refill, the region will show an interruption or a large-area depression at the corresponding position. In this embodiment, the binary mask is scanned along the pen shaft axis, and the number of pixels belonging to the pen refill region in each row is counted, forming a width curve distributed along the axis. If, within a certain axial interval, the width value is consistently below a preset threshold or suddenly drops to zero, a discontinuity is determined at that position. This discontinuity specifically includes two forms: breaks and voids. A break is characterized by a complete interruption of the pen refill region, with no connected pixels on either side; a void is characterized by a hole surrounded by background pixels inside the pen refill region, but the region as a whole remains connected. For the detected discontinuous positions, information such as their axial coordinates, defect type, and defect length is recorded as an integrity status indicator.

[0053] Step 104: Input the surface defects and printing defects data, geometric dimension data, and the spatial posture data of the pen refill into the preset configurable quality rule knowledge base and comprehensive evaluation model for integrated analysis, generate a comprehensive quality report, and output the final quality level judgment instruction; the comprehensive quality report includes specific defect details and quantitative indicators.

[0054] In this embodiment, firstly, a configurable quality rule knowledge base is constructed. This knowledge base stores threshold conditions and logical judgment relationships for various quality defects in the form of a rule list. The goal is to transform the experience and knowledge of quality inspection experts into judgment logic that can be automatically executed by a computer, while maintaining high flexibility and maintainability. Threshold conditions are set separately for surface defects and printing defects, geometric dimension data, and the spatial posture data of pen refills. Each rule consists of three elements: trigger condition, output action, and severity level. The trigger condition is a Boolean expression, and its operands are various quantitative characteristic values, such as radial eccentricity greater than 0.15 mm, straightness deviation greater than 0.10 mm, crack area greater than 2.0 square millimeters, etc. Multiple conditions can be combined using AND and OR logic. The output action is defined as a structured record added to the comprehensive quality report when the rule is triggered. This record at least includes fields such as defect name, measured value, judgment basis, and three-dimensional position coordinates. The severity level is used to distinguish between minor defects and fatal defects, and is usually divided into levels such as prompt, warning, and non-conformance.

[0055] Based on surface defect and printing defect data, geometric dimension data, and the spatial orientation data of the pen refill, the system iterates through each rule in the configurable quality rule knowledge base from top to bottom, matching the current feature value with the triggering conditions in the rule. This matching process is purely numerically driven and fully automated, eliminating the subjectivity and fatigue fluctuations of manual judgment. If all triggering conditions of a rule are met, the corresponding output action is executed, and the output action is added as a defect record to the comprehensive quality report. This defect record includes the triggered rule ID, defect feature name, quantified value, and position information in a unified three-dimensional coordinate system.

[0056] Based on the defect severity levels indicated by all triggered rules, a final quality grade determination instruction is generated according to a preset priority logic. The determination logic can be implemented using various methods such as weighted voting, priority adjudication, or decision trees. For example, if any rule with a severity level of "unqualified" is triggered, the product is directly determined to be scrap; if there are no severe defects but multiple minor flaws, it is determined to be acceptable; if no rules are triggered, it is determined to be superior. This quality grade determination instruction is sent to the downstream sorting execution unit in the form of digital I / O signals or industrial bus protocols, driving pneumatic levers, flaps, or robots to guide the penholders into the corresponding collection bins.

[0057] It's important to note that the comprehensive quality report is not a binary signal of pass or fail, but rather a digital quality archive. This report details every defect present in the pen barrel, its precise location, its quantifiable severity, and the quality standards violated. This structured data can be directly correlated with the process parameters of upstream processes such as barrel manufacturing, printing, and assembly, providing quantifiable decision-making support for defect tracing, process window optimization, and predictive maintenance.

[0058] In this embodiment, a structured historical inspection database is established, which stores the feature index of the multimodal fusion data model for each wooden pen barrel, the full content of the comprehensive quality report, and the corresponding production batch code and key process parameter values. Disputed sample data where manual re-inspection results differ from automatic judgment results are collected at preset time intervals. This disputed sample data includes sample image data, manually annotated correct defect information, and the final quality level. An incremental training dataset is constructed using the disputed sample data to incrementally train the first and second neural network models. During incremental training, the model weight parameters are updated based on the new training data, completing the iterative optimization of the model parameters and achieving continuous self-optimization of the detection model. Simultaneously, frequently occurring defect patterns exceeding the boundaries of the original rules in the disputed sample data are analyzed. Based on this, new judgment rules are added to the configurable quality rule knowledge base, or the threshold parameters of existing rules are adjusted, achieving automatic evolution and optimization of the quality judgment logic.

[0059] The above are embodiments of the method proposed in this application. Based on the same inventive concept, embodiments of this application also provide a production and testing device for wooden pen barrels, the structure of which is as follows: Figure 2 As shown.

[0060] Figure 2 This is a schematic diagram of the internal structure of a production and testing device for wooden pen barrels, provided as an embodiment of this application. Figure 2 As shown, the device includes: At least one processor; And, a memory that is communicatively connected to at least one processor; The memory stores instructions that can be executed by at least one processor, and the instructions, when executed by at least one processor, enable at least one processor to: When the wooden pen shaft to be inspected is conveyed to the preset inspection station, multiple sensors are simultaneously triggered to collect data on the wooden pen shaft to obtain multi-dimensional image data; the multi-dimensional image data includes surface panoramic image data, axial contour sequence image data and internal transmission image data. Based on the fixed spatial position relationship of the wooden pen in the preset detection station and the known physical size benchmark, spatial coordinate alignment calculation is performed on the surface panoramic image data, axial contour sequence image data and internal transmission image data. The three types of image data are mapped to a unified three-dimensional coordinate system to generate a multimodal fusion data model of the wooden pen. Based on the multimodal fusion data model, surface defect data and printing defect data are identified from aligned surface panoramic image data. The external three-dimensional solid model of the wooden pen barrel is reconstructed from aligned axial contour sequence image data and the corresponding geometric dimension data is calculated. The pen core area is segmented from aligned internal transmission image data and the spatial posture data of the pen core is calculated. Data on surface defects and printing defects, geometric dimensions, and the spatial orientation of the pen refill are input into a pre-configured quality rule knowledge base and a comprehensive evaluation model for integrated analysis. This generates a comprehensive quality report and outputs the final quality level determination instruction. The comprehensive quality report includes details of specific defects and quantitative indicators.

[0061] This application also provides a non-volatile computer storage medium storing computer-executable instructions, which, when executed, can: When the wooden pen shaft to be inspected is conveyed to the preset inspection station, multiple sensors are simultaneously triggered to collect data on the wooden pen shaft to obtain multi-dimensional image data; the multi-dimensional image data includes surface panoramic image data, axial contour sequence image data and internal transmission image data. Based on the fixed spatial position relationship of the wooden pen in the preset detection station and the known physical size benchmark, spatial coordinate alignment calculation is performed on the surface panoramic image data, axial contour sequence image data and internal transmission image data. The three types of image data are mapped to a unified three-dimensional coordinate system to generate a multimodal fusion data model of the wooden pen. Based on the multimodal fusion data model, surface defect data and printing defect data are identified from aligned surface panoramic image data. The external three-dimensional solid model of the wooden pen barrel is reconstructed from aligned axial contour sequence image data and the corresponding geometric dimension data is calculated. The pen core area is segmented from aligned internal transmission image data and the spatial posture data of the pen core is calculated. Data on surface defects and printing defects, geometric dimensions, and the spatial orientation of the pen refill are input into a pre-configured quality rule knowledge base and a comprehensive evaluation model for integrated analysis. This generates a comprehensive quality report and outputs the final quality level determination instruction. The comprehensive quality report includes details of specific defects and quantitative indicators.

[0062] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for IoT devices and media are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0063] The systems, media, and methods provided in this application are one-to-one correspondences. Therefore, the systems and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the systems and media will not be repeated here.

[0064] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0065] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0066] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0067] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0068] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0069] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0070] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0071] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0072] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A production inspection method for wooden pen barrels, characterized in that, The method includes: When the wooden pen barrel to be inspected is conveyed to the preset inspection station, multiple sensors are simultaneously triggered to collect data on the wooden pen barrel in order to obtain multi-dimensional image data; the multi-dimensional image data includes surface panoramic image data, axial contour sequence image data and internal transmission image data. Based on the fixed spatial position relationship of the wooden pen at the preset detection station and the known physical size benchmark, the spatial coordinate alignment calculation is performed on the surface panoramic image data, axial contour sequence image data and internal transmission image data, and the three types of image data are mapped to a unified three-dimensional coordinate system to generate a multimodal fusion data model of the wooden pen. Based on the multimodal fusion data model, surface defect data and printing defect data are identified from the aligned surface panoramic image data. The external three-dimensional solid model of the wooden pen barrel is reconstructed from the aligned axial contour sequence image data and the corresponding geometric dimension data is calculated. The pen core area is segmented from the aligned internal transmission image data and the spatial posture data of the pen core is calculated. The surface defects and printing defects data, the geometric dimensions data, and the spatial orientation data of the pen refill are input into a preset configurable quality rule knowledge base and a comprehensive evaluation model for integrated analysis, generating a comprehensive quality report and outputting the final quality level judgment instruction; the comprehensive quality report includes specific defect details and quantitative indicators.

2. The production and testing method for wooden pen barrels according to claim 1, characterized in that, Based on the aforementioned multimodal fusion data model, surface defect data and printing defect data are identified from aligned panoramic surface image data, specifically including: The aligned surface panoramic image data is input into a pre-trained first neural network model to extract multi-layered texture and color feature maps from the surface panoramic image data; Based on the multi-layered texture and color feature map, candidate region boxes are generated based on the first neural network model, and the features within the candidate region boxes are classified and bounding box regression is calculated. The specific category label, confidence score, and boundary coordinates in the unified three-dimensional coordinate system of the defect region are output. The preset printing template image is matched with the corresponding area in the surface panoramic image data for feature matching and difference pixel calculation. The integrity percentage of the printed pattern area and the color offset vector relative to the template are output as the alignment deviation value of the surface panoramic image data.

3. The production and testing method for wooden pen barrels according to claim 1, characterized in that, The external 3D solid model of the wooden pen barrel is reconstructed from the aligned axial contour sequence image data, and the corresponding geometric dimensions are calculated. Specifically, this includes: The aligned axial contour sequence image data is filtered and denoised, and the processed axial contour sequence image data is then subjected to three-dimensional reconstruction to generate a continuous external three-dimensional solid model of the wooden pen barrel. Based on the external three-dimensional solid model, multiple cross-sections are cut along the axial direction at preset fixed intervals. The minimum circumscribed circle diameter of each cross-section is calculated, and the standard deviation and range of all cross-section diameters are statistically analyzed as diameter uniformity values. Fit the central axis of the external three-dimensional solid model, and calculate the standard deviation of the distance from each point on the model surface to the central axis as the straightness deviation value; Extract the point cloud sets of the two end faces of the external three-dimensional solid model, fit the plane equation of the end face respectively, and calculate the angle with the ideal vertical plane as the flatness parameter; In the end edge region of the external three-dimensional solid model, chamfer feature segments are identified through cross-sectional profile analysis, and the length and angle of the chamfer feature segments are calculated as chamfer dimension values.

4. The production and testing method for wooden pen barrels according to claim 1, characterized in that, The pen tip region is segmented from the aligned internal transmission image data, and the spatial pose data of the pen tip is calculated, specifically including: The internal transmission image data is input into a pre-trained second neural network model to extract deep features of the internal transmission image data through an encoder, and the deep features are upsampled and classified at the pixel level through a decoder to output a probability map of each pixel belonging to the pen tip or the background. The probability map is thresholded to generate a binarized pen refill pixel region mask, and the largest connected region in the pen refill pixel region mask is extracted as the target pen refill region. Calculate the central moment of the target pen tip region, fit the spatial equation of the central axis of the pen tip pixel region, and extract the theoretical central axis spatial equation from the external three-dimensional solid model. Under the unified three-dimensional coordinate system, the minimum spatial distance between the central axis of the pen core pixel region and the theoretical central axis of the external three-dimensional solid model is calculated as the radial eccentricity distance value, and the angle between the two axis direction vectors is calculated as the axial parallelism angle value. The system analyzes whether the pixel area mask of the pen refill is continuous. If the pixel area mask of the pen refill is discontinuous beyond a preset area threshold, an integrity status indicator indicating that the pen refill is broken or hollow is output. The discontinuity includes breakage or voids.

5. The production and testing method for wooden pen barrels according to claim 1, characterized in that, The surface defects and printing defects data, the geometric dimensions data, and the spatial orientation data of the pen refill are input into a preset configurable quality rule knowledge base and a comprehensive evaluation model for integrated analysis. This generates a comprehensive quality report and outputs the final quality level determination instruction, specifically including: A configurable quality rule knowledge base is constructed; the configurable quality rule knowledge base stores the threshold conditions and logical judgment relationships of various quality defects in the form of a rule list, and the threshold conditions are set for the surface defects and printing defects data, the geometric dimension data, and the spatial posture data of the pen refill respectively; Based on the surface defects and printing defects data, the geometric dimensions data, and the spatial orientation data of the pen refill, each rule in the configurable quality rule knowledge base is traversed, and the current feature value is matched with the triggering conditions in the rule; If all triggering conditions of a rule are met, the corresponding output action is executed, and the output action is added as a defect record to the comprehensive quality report. The defect record includes the triggered rule ID, defect feature name, quantified value, and position information in the unified three-dimensional coordinate system. Based on the severity level of all triggered rules, and following a preset priority logic, a final quality level determination instruction is generated.

6. The production and testing method for wooden pen barrels according to claim 1, characterized in that, Based on the fixed spatial position relationship of the wooden pen at the preset detection station and the known physical dimension benchmark, spatial coordinate alignment calculations are performed on the surface panoramic image data, axial contour sequence image data, and internal transmission image data. The three types of image data are mapped to a unified three-dimensional coordinate system to generate a multimodal fusion data model of the wooden pen, specifically including: The reference axis and key end face features of the wooden pen barrel are extracted from the axial contour sequence image data to establish a unified three-dimensional coordinate system; Based on the calibration transformation matrix between the first imaging sensing module and the second imaging sensing module, each pixel in the surface panoramic image data is mapped to a three-dimensional spatial point in the unified three-dimensional coordinate system, thereby completing the bonding of the surface texture and the three-dimensional model. Based on the projection geometry between the imaging plane of the third imaging sensing module and the unified three-dimensional coordinate system, and the known diameter of the wooden pen barrel, the internal transmission image data is normalized in scale and corrected in spatial position so that the projection position of the pen core in the internal transmission image data is consistent with the actual spatial position in the unified three-dimensional coordinate system. By minimizing the positional error between the feature edges in the surface panoramic image data and the corresponding contour edges in the axial contour sequence image data, as well as the error between the pen tip projection in the internal transmission image data and the theoretical position in the unified three-dimensional coordinate system, the multimodal fusion data model is constructed.

7. The production and testing method for wooden pen barrels according to claim 1, characterized in that, When the wooden pen shaft to be inspected is conveyed to the preset inspection station, multiple sensors are simultaneously triggered to collect data from the wooden pen shaft to obtain multi-dimensional image data, specifically including: Based on the trigger signal that the wooden pen barrel to be detected reaches the preset detection station, an image acquisition command is generated and the image acquisition command is synchronously sent to the preset first imaging sensor module, second imaging sensor module and third imaging sensor module. The circumferential image acquisition unit in the first imaging sensing module is controlled to drive the camera unit surrounding the wooden pen holder to continuously acquire multiple frames of images covering the entire outer surface of the wooden pen holder at a preset fixed frame rate, and then stitch them together to synthesize panoramic image data of the surface. The contour scanning unit in the second imaging sensing module is controlled to perform line-by-line scanning along the axial direction of the wooden pen barrel to obtain continuous axial contour sequence image data of the pen barrel shape. The penetrating imaging unit in the third imaging sensing module is controlled to emit penetrating radiation of a specific wavelength and receive the intensity distribution signal after penetration when the wooden pen is stationary or in uniform motion, thereby generating a two-dimensional projection image that distinguishes the wooden part of the pen and the internal pen core material, which serves as internal transmission image data.

8. The production and testing method for wooden pen barrels according to claim 1, characterized in that, The method further includes: Establish a structured historical inspection database to store the feature index of the multimodal fusion data model of each wooden pen barrel, the full content of the comprehensive quality report, and the corresponding production batch code and key process parameter values; Disputed sample data where manual re-inspection results differ from automatic judgment results are collected at preset time intervals, and incremental training datasets are constructed using the disputed sample data to incrementally train the first neural network model and the second neural network model; the disputed sample data includes sample image data, manually annotated correct defect information, and final quality level. During incremental training, the model weight parameters are updated based on new training data to complete the optimization and iteration of model parameters, thereby achieving continuous self-optimization of the detection model.

9. A production and testing device for wooden pen barrels, characterized in that, The device includes: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a production inspection method for wooden pen barrels as described in any one of claims 1-8.

10. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, When the computer-executable instructions are executed, a production inspection method for wooden pen barrels as described in any one of claims 1-8 is implemented.