Agricultural product rapid forming method, system and equipment based on block chain, medium and product
By combining blockchain technology with SFM and MVS methods for 3D reconstruction and path planning of agricultural products, the shortcomings of 3D printing technology in terms of accuracy and efficiency of agricultural product models have been solved, achieving efficient and accurate agricultural product shaping and data traceability.
Patent Information
- Application Number
- CN202411498107.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-10-17
AI Technical Summary
Existing 3D printing technology has shortcomings in terms of the accuracy and efficiency of agricultural product models, especially since traditional 2D image detection methods are difficult to extract comprehensive phenotypic parameters of agricultural products.
A blockchain-based rapid prototyping method for agricultural products is adopted. 3D reconstruction is performed using SFM and MVS methods to generate sparse point cloud and dense point cloud data. The nozzle optimization path is constructed by combining path planning algorithm to control the printing model of the 3D printer, and the data is uploaded to the blockchain network for recording.
It improves the accuracy and efficiency of 3D printing of agricultural product models, enables secure data storage and traceability, and enhances the quality and efficiency of the printing process.
Smart Images

Figure CN120792162A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the field of three-dimensional printing technology, in particular to a blockchain-based rapid forming method, system, device, medium and product for agricultural products. BACKGROUND
[0002] Three-dimensional printing, as a core technology in the current manufacturing industry, can print out product prototypes with highly complex structures and light stability through incremental manufacturing, and is a manufacturing technology with industrial revolution significance. According to research findings, the current three-dimensional printing basic theory is relatively mature, and the application and promotion in various fields are remarkable. Therefore, the current research difficulties are concentrated in how to further improve the product precision and forming efficiency, and complete three-dimensional reconstruction according to the surface characteristics of the target part, so as to optimize the model support structure and nozzle path planning in three-dimensional printing, and reduce the overall printing cost.
[0003] Since the development of three-dimensional printing technology, three-dimensional printers can be divided into fused deposition modeling (FDM), stereolithography (SLA), selective laser sintering (SLS) and the like according to the specific implementation mechanism. Among them, FDM is a relatively typical one, and according to statistics, FDM printing currently accounts for about 60% of the market share. Computer vision detection is widely used in agricultural product variety identification and quality detection, but the traditional agricultural product phenotype detection method based on two-dimensional images lacks spatial dimension information, and it is difficult to extract comprehensive agricultural product phenotype parameters, so it is of great significance to establish an agricultural product three-dimensional model and then extract comprehensive agricultural product phenotype parameters. SUMMARY
[0004] The purpose of the present application is to provide a blockchain-based rapid forming method, system, device, medium and product for agricultural products, which can improve the three-dimensional printing efficiency and precision of the agricultural product model.
[0005] To achieve the above-mentioned purpose, the present application provides the following solutions:
[0006] In a first aspect, the present application provides a blockchain-based rapid forming method for agricultural products, which is applied to a rapid forming device, and the rapid forming system comprises a three-dimensional printer, a control module and a blockchain network; the control module is connected with the three-dimensional printer and the blockchain network respectively.
[0007] The blockchain-based rapid forming method for agricultural products comprises the following steps:
[0008] acquire a plurality of two-dimensional images of a target; the target is agricultural products; the plurality of two-dimensional images are taken at different angles;
[0009] based on the plurality of two-dimensional images of the target, use the SFM (Structure from Motion) method to perform three-dimensional reconstruction on the target to determine sparse point cloud data of the target;
[0010] use the MVS (Multi-View Stereo) method to perform dense reconstruction on the sparse point cloud data to determine dense point cloud data of the target;
[0011] triangulate the dense point cloud data to determine a target manifold model;
[0012] slice the target manifold model to obtain a polygon closed contour;
[0013] use a path planning algorithm to construct a nozzle optimization path for each polygon closed contour, and construct a nozzle optimization path sequence in a bottom-up order;
[0014] control a three-dimensional printer to run according to the nozzle optimization path to obtain a target printed model.
[0015] Optionally, after controlling the three-dimensional printer to run according to the optimization path sequence to obtain the target printed model, the method further comprises:
[0016] upload data of the process of printing the target printed model to a blockchain network.
[0017] Optionally, the data of the process of printing the target printed model includes two-dimensional images, sparse point cloud data, dense point cloud data, a target manifold model, a polygon closed contour, and an optimization path sequence.
[0018] Optionally, based on the plurality of two-dimensional images of the target, use the SFM method to perform three-dimensional reconstruction on the target to determine sparse point cloud data of the target, comprising:
[0019] determine feature points in each two-dimensional image;
[0020] use the RANSAC (Random Sample Consensus) algorithm to match the feature points in the plurality of two-dimensional images to determine geometric transformation relationships between different two-dimensional images;
[0021] based on the geometric transformation relationships between different two-dimensional images, determine the pose of each camera; the pose includes the position and direction of the camera;
[0022] based on the pose of each camera, use a triangulation method to perform three-dimensional reconstruction on each two-dimensional image respectively;
[0023] Fusing the three-dimensional reconstruction results of all two-dimensional images by using a BA (Bundle Adjustment) algorithm to obtain sparse point cloud data of the target.
[0024] Optionally, determining the feature points in each two-dimensional image comprises:
[0025] Determining any two-dimensional image as a current two-dimensional image;
[0026] Extracting a plurality of feature points in the current two-dimensional image by using a SIFT (Scale-Invariant Feature Transform) algorithm;
[0027] Updating the current two-dimensional image and returning to the step of extracting the plurality of feature points in the current two-dimensional image by using the SIFT algorithm until all two-dimensional images of the target are traversed to obtain the feature points in each two-dimensional image.
[0028] Optionally, performing slicing processing on the target manifold model to obtain a polygon closed contour, comprising:
[0029] Determining a plurality of slicing planes according to a preset interval;
[0030] Determining any slicing plane as a current slicing plane;
[0031] Constructing an empty set as a contour sequence;
[0032] Based on a point-line relationship and a line-surface relationship of the target manifold model, determining any triangular facet intersecting with the current slicing plane as a current triangular facet;
[0033] Determining an intersection point coordinate of the current triangular facet and the current slicing plane;
[0034] Adding the current intersection point as a last element to the contour sequence;
[0035] Determining a triangular facet intersecting with the current slicing plane and connected with the current triangular facet as a next triangular facet;
[0036] Taking the next triangular facet as the current triangular facet, and returning to the step of determining the intersection point coordinate of the current triangular facet and the current slicing plane as the current intersection point coordinate until all triangular facets intersecting with the current slicing plane are traversed to sequentially connect the intersection points in the contour sequence to obtain a polygon closed contour corresponding to the current slicing plane;
[0037] Updating the current slicing plane and returning to the step of constructing the empty set as the contour sequence until all slicing planes are traversed to obtain polygon closed contours corresponding to all slicing planes.
[0038] In a second aspect, the present application provides a blockchain-based agricultural product rapid prototyping system, which applies the blockchain-based agricultural product rapid prototyping method, and comprises:
[0039] a two-dimensional image acquisition module configured to acquire a plurality of two-dimensional images of a target, the target being an agricultural product, the plurality of two-dimensional images being captured at different angles;
[0040] a three-dimensional reconstruction module configured to perform three-dimensional reconstruction on the target based on the plurality of two-dimensional images of the target by using an SFM method, and determine sparse point cloud data of the target;
[0041] a dense reconstruction module configured to perform dense reconstruction on the sparse point cloud data by using an MVS method, and determine dense point cloud data of the target;
[0042] a triangulation processing module configured to perform triangulation processing on the dense point cloud data, and determine a target manifold model;
[0043] a slicing processing module configured to perform slicing processing on the target manifold model, and obtain a polygon closed contour;
[0044] a nozzle path planning module configured to construct a nozzle optimization path of each polygon closed contour by using a path planning algorithm, and construct a nozzle optimization path sequence in a bottom-up order;
[0045] a three-dimensional printing module configured to control a three-dimensional printer to operate according to the nozzle optimization path, and obtain a target printing model.
[0046] In a third aspect, the present application provides a computer device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the blockchain-based agricultural product rapid prototyping method.
[0047] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program executable on a processor to implement the blockchain-based agricultural product rapid prototyping method.
[0048] In a fifth aspect, the present application provides a computer program product, which comprises a computer program executable on a processor to implement the blockchain-based agricultural product rapid prototyping method.
[0049] According to the embodiments of the present application, the following technical effects are achieved:
[0050] The application provides a blockchain-based agricultural product rapid forming method, system, device, medium and product. The SFM method is used for three-dimensional reconstruction of a target to determine sparse point cloud data of the target. The MVS method is used for dense reconstruction of the sparse point cloud data to determine dense point cloud data of the target. The dense point cloud data is subjected to triangulation processing to determine a target manifold model. The target manifold model is subjected to slicing processing to obtain a polygon closed contour. A path planning algorithm is used to construct a nozzle optimization path of each polygon closed contour, and a nozzle optimization path sequence is constructed in a bottom-up order to control the operation of a three-dimensional printer. The application can improve the three-dimensional printing efficiency and accuracy of an agricultural product model by performing three-dimensional reconstruction and dense reconstruction on multiple two-dimensional images of a target to obtain a target manifold model, and performing slicing processing and nozzle path planning on the target manifold model. BRIEF DESCRIPTION OF DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0052] Figure 1 A flow chart of a blockchain-based agricultural product rapid forming method in an embodiment of the present application.
[0053] Figure 2 A principle diagram of a blockchain-based agricultural product rapid forming method in an embodiment of the present application.
[0054] Figure 3 An interaction logic diagram of model layering and nozzle path planning in an embodiment of the present application.
[0055] Figure 4 A module design diagram of a blockchain-based agricultural product rapid forming system in another embodiment of the present application.
[0056] Figure 5 A structural schematic diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0058] The above and other objects, features and advantages of the present application will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings in which:
[0059] In one exemplary embodiment, as shown in Figure 1 A blockchain-based agricultural product rapid prototyping method is provided, which is applied to a rapid prototyping device. The rapid prototyping system comprises a three-dimensional printer, a control module and a blockchain network. The control module is connected with the three-dimensional printer and the blockchain network respectively.
[0060] The blockchain-based agricultural product rapid prototyping method comprises:
[0061] Step 101: Obtain multiple two-dimensional images of a target. The target is an agricultural product. The multiple two-dimensional images are taken from different angles.
[0062] Step 102: Based on the multiple two-dimensional images of the target, use the SFM method to perform three-dimensional reconstruction on the target to determine the sparse point cloud data of the target.
[0063] Step 103: Use the MVS method to perform dense reconstruction on the sparse point cloud data to determine the dense point cloud data of the target.
[0064] Step 104: Triangulate the dense point cloud data to determine the target manifold model.
[0065] Step 105: Slice the target manifold model to obtain a polygon closed contour.
[0066] Step 106: Use a path planning algorithm to construct a nozzle optimization path for each polygon closed contour, and construct a nozzle optimization path sequence in a bottom-up order.
[0067] Step 107: Control the three-dimensional printer to run according to the nozzle optimization path to obtain a target printing model.
[0068] Step 108: Upload the data of the printing target printing model process to the blockchain network. The data of the printing target printing model process includes two-dimensional images, sparse point cloud data, dense point cloud data, target manifold model, polygon closed contour and optimization path sequence.
[0069] Step 102 comprises: determining feature points in each two-dimensional image. The RANSAC algorithm is used to match the feature points in the plurality of two-dimensional images, to determine the geometric transformation relationship between different two-dimensional images. Based on the geometric transformation relationship between different two-dimensional images, the pose of each camera is determined. The pose includes the camera position and the camera direction. Based on the pose of each camera, the triangulation method is used to perform three-dimensional reconstruction on each two-dimensional image respectively. The BA algorithm is used to fuse the three-dimensional reconstruction results of all two-dimensional images to obtain the sparse point cloud data of the target.
[0070] In the method, the determination of the feature points in each two-dimensional image comprises: determining any two-dimensional image as a current two-dimensional image. The SIFT algorithm is used to extract a plurality of feature points in the current two-dimensional image. The current two-dimensional image is updated and returned to the step of extracting the plurality of feature points in the current two-dimensional image by using the SIFT algorithm until all two-dimensional images of the target are traversed, to obtain the feature points in each two-dimensional image.
[0071] Step 105 comprises: determining a plurality of tangent planes at a preset interval. Any tangent plane is determined as a current tangent plane. An empty set is constructed as a contour sequence. Based on the point-line relationship and the line-surface relationship of the target manifold model, any triangular facet intersecting with the current tangent plane is determined as a current triangular facet. The intersection point coordinates of the current triangular facet and the current tangent plane are determined. The current intersection point is added to the contour sequence as the last element. The triangular facet intersecting with the current tangent plane and connected with the current triangular facet is determined as a next triangular facet. The next triangular facet is taken as the current triangular facet, and the step of determining the intersection point coordinates of the current triangular facet and the current tangent plane as the current intersection point coordinates is returned until all triangular facets intersecting with the current tangent plane are traversed. The intersection points in the contour sequence are sequentially connected to obtain a polygon closed contour corresponding to the current tangent plane. The current tangent plane is updated and returned to the step of constructing the empty set as the contour sequence until all tangent planes are traversed, to obtain polygon closed contours corresponding to all tangent planes.
[0072] The method provided in the embodiment is based on the blockchain and is used for rapid modeling of agricultural products. Figure 2The camera parameters and three-dimensional point coordinates are solved by SFM iteration, that is, the sparse point cloud of the 3D model is reconstructed. First, a plurality of photos of the target agricultural product are continuously taken from different angles. According to the input condition of the target agricultural product picture, some feature points need to be extracted from each picture, and their descriptors are calculated. In the process of feature point extraction, the SIFT algorithm is used. A good feature point needs to have rotation invariance, scale invariance and gray invariance. Then the feature points in different pictures are matched to find their corresponding relationship. The KNN (K-Nearest Neighbor) algorithm is used for feature matching. In the matching process, robust techniques need to be used to avoid the influence of matching errors. The RANSAC algorithm is used for feature point matching to obtain the geometric transformation relationship between different pictures. Through these transformation relationships, the pose of the camera, including the position and direction of the camera, can be estimated. On the basis of camera pose estimation, the three-dimensional position of each feature point in the scene is estimated by triangulation method. Two camera angles are needed for triangulation, which is called triangulation. After completing the three-dimensional reconstruction of each picture, they need to be fused to construct the three-dimensional model of the entire scene. The reconstruction results can be optimized by using BA (Bundle Adjustment) algorithm. It should be noted that since the SFM algorithm is an iterative algorithm, the parameters need to be adjusted and the results need to be optimized at each step to obtain more accurate and stable results.
[0073] Since SFM can only obtain sparse three-dimensional points, if a dense reconstruction result is needed, MVS needs to be used to match dense image points based on camera parameters and images. Dense reconstruction is a process of finding points with photo-consistency in space under the assumption that camera parameters are known, and performing stereo matching of the scene. The purpose of dense point cloud reconstruction is to calculate the three-dimensional point corresponding to each pixel in the image pixel by pixel under the premise that the camera pose is known, to obtain the dense three-dimensional point cloud of the surface of the scene object. The dense point cloud generated by MVS is triangulated, STL format data is successfully generated, and the target agricultural product model is guaranteed to be a manifold (closed entity).
[0074] The application uses a CuraEngine slicing engine to slice an STL data model, which can successfully generate G-Code code. The performance indicators of agricultural product FDM three-dimensional printing include predicted printing time, number of layers, total number of rows, required material, and extrusion head material. Subsequently, by analyzing the G-Code instructions (G code, also known as RS-274, is the most widely used numerical control programming language), the three-dimensional printer layer-by-layer printing process is simulated, that is, the mutual conversion between the nozzle path and the G-Code instructions is realized through calculation. G instructions are usually composed of G plus a number, and the function of the instruction is to inform the nozzle to complete the specified action at the specified time point, such as fast movement, slow extrusion, and straight line interpolation.
[0075] The key of three-dimensional printing technology is to realize layered manufacturing, and the core is to discretely process the data of three-dimensional model, to convert STL format data into G-Code instruction file that can be directly processed by three-dimensional printer through layered slicing and path planning. Layered slicing and path planning are directly related to the forming quality and processing efficiency of the target product, therefore, the application designs different types of layered slicing and path planning algorithms according to the data format and hardware characteristics of three-dimensional printer, aiming to improve product precision, quality and forming efficiency. The interaction logic between model layered slicing and nozzle path planning algorithm is as shown in Figure 3
[0076] For the model layered slicing algorithm, according to whether the triangular facet topological information, model geometric characteristics or model geometric continuity are adopted, the application respectively designs and realizes 3 types of model layered slicing algorithms.
[0077] (1) Slicing algorithm based on triangular facet topological information. According to the relationship between points and lines, lines and surfaces in the STL model, the next triangular facet linked with the target triangular facet intersecting with the slicing plane can be found when the coordinate information of the target triangular facet intersecting with the slicing plane is obtained, and then the intersection is solved again. Repeat the above operation until the intersection point coordinates of the new triangular facet are obtained. Finally, connect the intersection points to obtain the two-dimensional contour line according to the known intersection point sequence.
[0078] (2) Slicing algorithm based on model geometric characteristics. First, classify and grade all triangular facets in the STL model, and then sort the triangular facets to determine the vertex coordinates of the triangular facets. Determine the intersection by intersecting the vertex coordinates of the triangular facets meeting certain relationship, and finally connect the beginning and end to generate a closed contour line. The specific steps are as follows:
[0079] 1. Read in the STL format file: First, the STL format file needs to be read into the system. In order to improve the operation speed, the vertex coordinates of all triangular facets are usually multiplied by a large number to make them integers.
[0080] 2. Classification and hierarchical arrangement of triangular facets: Next, the triangular facets are classified and arranged hierarchically. The triangular facets are classified into different groups according to geometric characteristics, for example, all triangular facets parallel to the X-Y plane are selected as the surface layer, and the remaining triangular facets are used to calculate whether they intersect with Z0+n△Z. Wherein Z0 is the Z surface of the bottom layer of the model, △Z is the slice layer thickness, and n is the number of layers.
[0081] 3. Calculation of intersection line segments: For each layered surface, the intersection line segments of the layer and the triangular facets are calculated. Through projection and calculation, the coordinates of the two end points of the intersection line segments in the XY plane are obtained.
[0082] 4. Determination of grid lines: Finally, the grid lines in the X and Y directions are determined according to the intersection line segments to form the slice pattern.
[0083] (3) Slice algorithm based on geometric continuity of the model. The algorithm uses the continuity of the STL model, including the continuity of all triangles, edges and intersection points intersecting with the slice plane, to establish a link diagram of the data. By layering the triangles, the intersection points of each layer are obtained, and the closed contour line is obtained in sequence. Specifically, by establishing a new intersection triangular facet table of the layered surface of the STL model, the active topological structure of the model is extracted, the triangular facets intersecting with the previous layer of the layered section are saved as the starting triangular facets of the next layer of the layered slice, and the continuity between adjacent layers is used to replace the independent solving method between layers with an incremental method to solve the layered contour, so that the slice contour of each layer is continuously obtained.
[0084] For the nozzle path planning, the application designs and implements a class of scan filling path generation algorithm. The scan filling algorithm first considers the printing filament width, and can realize filament compensation by offsetting the polygon contour obtained by slicing. Secondly, the scan area is constructed, which can be used for scan line generation. Finally, the scan line intersects with the contour line to obtain the two-dimensional filling pattern of each layer, and then the layer-by-layer accumulation of the filling pattern of each layer is performed to complete the filling work of the final target model. The model layering and nozzle path planning algorithm designed and optimized by the application can be determined whether the algorithm needs to be modified or the parameters need to be optimized through offline analysis of the measured results. When optimizing the algorithm, for the layering algorithm, four performance indicators, including layering processing speed, layering efficiency, information storage memory size and processing operation difficulty, are used for measurement; and for the path planning algorithm, three performance indicators, including forming precision, printing speed, density and stability, are used.
[0085] In order to avoid the model slicing algorithm to cause larger volume error (step effect) to the target model, thereby reducing the slicing efficiency, so as to produce redundant and disordered data information, the slice thickness and the best slice direction can be adjusted, and after excluding the non-intersecting triangular facets, the intersection line set of the remaining facets and the slicing plane can be quickly obtained. By optimizing the parameters in the above manner, the link relationship of all intersection lines can be established under the condition of removing redundant information, the ordered line segments are obtained and connected in order, and finally the two-dimensional contour curve is generated, ensuring the efficiency of slice slicing.
[0086] By analyzing the printing speed, printing path and extrusion amount of the three-dimensional printer, the scanning filling path generation algorithm parameters in the nozzle path planning can be adjusted. The printing speed and the nozzle extrusion amount directly affect the quality of the machined surface, and common defects include step effect, stringing and other phenomena, and the non-optimal printing path can cause warping and other deformations. Therefore, in order to reduce the influence of the step effect on the dimensional accuracy, the initial offset value of the slice polygon contour needs to be adjusted repeatedly to ensure that the scanning filling path generation algorithm can achieve the optimal filling effect of the target model.
[0087] Finally, when the process data of the agricultural product rapid forming system is generated, the system uses 4G / 5G communication network to transmit agricultural product data, connects the access interface provided by the background, establishes FISCO BCOS (Financial Blockchain Consortium (Shenzhen)) blockchain network, and realizes the functions of encryption, communication, storage, tamper-proofing, backup and the like of the agricultural product rapid forming data. The remote control network based on the FISCO BCOS platform makes the image information, point cloud information, STL data, slicing data, path planning information, G-Code instruction data and printing parameter information generated by the final hardware driving module real-time synchronized. It meets the needs of high security and traceability of the system, realizes the whole process recording of the data generated in the three-dimensional reconstruction and three-dimensional printing process. Each relationship information in the agricultural product rapid forming is stored in the blockchain, the encryption technology of the FISCO BCOS platform is used to ensure the authenticity of the data, and the time stamp and decentralized characteristics of the data structure are used to realize the transparency and traceability of the historical data, which greatly enhances the security of the system.
[0088] In an exemplary embodiment, a blockchain-based agricultural product rapid prototyping system is provided. The system can realize three-dimensional reconstruction of agricultural product data information, save all agricultural product parameter information collected by the system and user printing operation records through a blockchain, and synchronize all data in an agricultural product three-dimensional printing blockchain network composed of a display layer, a user layer, a business layer, a blockchain layer and a data security layer based on an existing open source framework (FISCO BCOS), to ensure the encryption, communication, storage, tamper-proofing and backup functions of the agricultural product rapid prototyping data, and finally realize effective improvement of the three-dimensional printing performance of agricultural products.
[0089] The blockchain-based agricultural product rapid prototyping system provided in the embodiment is applied to the blockchain-based agricultural product rapid prototyping method, and the blockchain-based agricultural product rapid prototyping system comprises:
[0090] A two-dimensional image acquisition module is configured to acquire multiple two-dimensional images of a target. The target is an agricultural product. The multiple two-dimensional images are captured at different angles.
[0091] A three-dimensional reconstruction module is configured to perform three-dimensional reconstruction on the target based on the multiple two-dimensional images of the target by using an SFM method, and determine sparse point cloud data of the target.
[0092] A dense reconstruction module is configured to perform dense reconstruction on the sparse point cloud data by using an MVS method, and determine dense point cloud data of the target.
[0093] A triangulation processing module is configured to perform triangulation processing on the dense point cloud data, and determine a target manifold model.
[0094] A slicing processing module is configured to perform slicing processing on the target manifold model, and obtain a polygon closed contour.
[0095] A nozzle path planning module is configured to construct a nozzle optimization path of each polygon closed contour by using a path planning algorithm, and construct a nozzle optimization path sequence in a bottom-up order.
[0096] A three-dimensional printing module is configured to control a three-dimensional printer to operate according to the nozzle optimization path, and obtain a target printing model.
[0097] The present application is based on blockchain and three-dimensional printing technology, and realizes the functions of monocular multi-view reconstruction and FDM data conversion by developing an agricultural product rapid prototyping technology. All process data is synchronized to a blockchain network based on a FISCO BCOS platform. The specific module design of a blockchain-based agricultural product rapid prototyping system is shown in Figure 4 .
[0098] The application takes the i3 type three-dimensional printer as the carrier of the three-dimensional printing control system, builds a hardware system mainly composed of an ATmega2560 microcontroller, a RAMPS1.4 expansion board, an A4988 drive module, an MK3 hot bed and a 42-step motor, and establishes a monocular vision model for realizing three-dimensional printing related functions.
[0099] Firstly, the target image is obtained by taking the agricultural product from multiple perspectives, and then the sparse point cloud is generated by SFM. Then, the dense point cloud data is generated by MVS, and the dense point cloud is triangulated into STL format; the STL data is loaded to restore the three-dimensional model through the three-dimensional printing pre-processing technology, the model data is discretely sliced, the slicing can be performed by using the triangular facet topology information, model geometric characteristics and model geometric continuity, then the path planning can be performed on the profile information of each cross-section data after slicing, the scanning filling path generation algorithm is realized, and finally the G-Code instruction code is generated; the G-Code instruction is loaded into the three-dimensional printer to realize the layer-by-layer printing of the three-dimensional model (the three-dimensional printer selects ATmega2560 kernel RAMPS1.4 as the microcontroller), and the effect of rapid forming of the target agricultural product is obtained.
[0100] In the final process, the data generated in each stage, including the target continuous image, the sparse point cloud, the dense point cloud, the STL format data, the model slicing, the nozzle path planning, the G-Code instruction file and the printing parameters generated by the final hardware drive module are synchronized in the FISCO BCOS block chain network. Through the above workflow, the combination of block chain and three-dimensional printing technology can be realized, and the system can be operated efficiently.
[0101] The content of the application relates to the technical frontiers in the field of three-dimensional printing, and can ensure that the system can be long-term, stable and efficient in realizing the target of rapid forming of agricultural products. The application combines block chain and three-dimensional printing technology, and designs and realizes a system for rapid forming of agricultural products. The system generates a sparse point cloud by SFM, then generates dense point cloud data by MVS, triangulates the dense point cloud into STL format, slices the STL model by a slicing engine CuraEngine, and finally successfully generates G-Code code. Through the use of FISCO BCOS block chain network for whole process data synchronization, the rapid forming of the target agricultural product can be realized. The system can provide effective technical application for the rapid forming business of agricultural products, and can effectively improve the model precision, data conversion rate and forming efficiency of agricultural products.
[0102] In an exemplary embodiment, a computer device, which can be a server or a terminal, has an internal structure as shown in Figure 5As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with the terminal outside through the network connection. The computer program is executed by the processor to realize a kind of rapid forming method of agricultural product based on block chain.
[0103] Those skilled in the art can understand that, Figure 5 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0104] In one exemplary embodiment, a computer device is provided, including a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the steps in each of the above method embodiments.
[0105] In one exemplary embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to realize the steps in each of the above method embodiments.
[0106] In one exemplary embodiment, a computer program product is provided, including a computer program, and the computer program is executed by a processor to realize the steps in each of the above method embodiments.
[0107] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0108] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0109] The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a blockchain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combinations of the technical features do not exist contradictory, they should be considered as the scope of the present application. The principles and implementation manners of the present application are described by applying specific examples, and the above embodiment descriptions are only used to help understand the method and core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manners and application range can be changed. In conclusion, the content of the present application should not be understood as a limitation.
Claims
1. A blockchain-based rapid prototyping method for agricultural products, characterized in that: The blockchain-based agricultural product rapid prototyping method is applied to a rapid prototyping device, wherein the rapid prototyping system includes: a three-dimensional printer, a control module, and a blockchain network; the control module is connected to the three-dimensional printer and the blockchain network respectively; The blockchain-based agricultural product rapid prototyping method includes: Acquire multiple two-dimensional images of a target; the target is agricultural products; the multiple two-dimensional images are taken at different angles; Based on multiple two-dimensional images of the target, the SFM method is used to reconstruct the target in three dimensions and determine the sparse point cloud data of the target; Use the MVS method to densely reconstruct the sparse point cloud data and determine the dense point cloud data of the target; triangulate the dense point cloud data to determine a target manifold model; Slicing the target manifold model to obtain a polygonal closed contour; The path planning algorithm is used to construct the nozzle optimization path for each polygonal closed contour, and the nozzle optimization path sequence is constructed in a bottom-up order; Control the 3D printer to run according to the optimized nozzle path to obtain the target printing model.
2. The method for rapid prototyping of agricultural products based on blockchain according to claim 1, characterized in that: After controlling the 3D printer to run according to the optimized path sequence and obtaining the target printing model, the following steps are also included: Upload the data of the target printing model process to the blockchain network.
3. The method for rapid prototyping of agricultural products based on blockchain according to claim 2, characterized in that: The data of the target printing model printing process includes: two-dimensional image, sparse point cloud data, dense point cloud data, target manifold model, polygonal closed contour and optimized path sequence.
4. The method for rapid prototyping of agricultural products based on blockchain according to claim 1, characterized in that: Based on multiple 2D images of the target, the SFM method is used to reconstruct the target in 3D and determine the sparse point cloud data of the target, including: Determine the feature points in each 2D image; Use the RANSAC algorithm to match feature points in multiple two-dimensional images and determine the geometric transformation relationship between different two-dimensional images; Determine the pose of each camera based on the geometric transformation relationship between different two-dimensional images; the pose includes camera position and camera orientation; Based on the pose of each camera, a triangulation method is used to reconstruct each 2D image into 3D. The BA algorithm is used to fuse the 3D reconstruction results of all 2D images to obtain the sparse point cloud data of the target.
5. The method for rapid prototyping of agricultural products based on blockchain according to claim 4, characterized in that: Determining the feature points in each two-dimensional image includes: Determine any two-dimensional image as the current two-dimensional image; Use SIFT algorithm to extract multiple feature points in the current two-dimensional image; Update the current two-dimensional image and return to step "Use the SIFT algorithm to extract multiple feature points in the current two-dimensional image" until all two-dimensional images of the target are traversed and the feature points in each two-dimensional image are obtained.
6. The method for rapid prototyping of agricultural products based on blockchain according to claim 1, characterized in that: Slicing the target manifold model to obtain a polygonal closed contour includes: determining a plurality of cutting planes at preset intervals; Determine any tangent plane as the current tangent plane; Construct the empty set as a contour sequence; Based on the point-line relationship and line-plane relationship of the target manifold model, any triangle intersecting the current tangent plane is determined as the current triangle; Determine the coordinates of the intersection of the current triangle and the current tangent plane; Add the current intersection point as the last element to the contour sequence; Determine the triangle that intersects the current tangent plane and is connected to the current triangle as the next triangle; Set the next triangle as the current triangle and return to step "determine the coordinates of the intersection of the current triangle and the current tangent plane as the current intersection coordinates" until all triangles intersecting the current tangent plane are traversed, and the intersection points in the contour sequence are connected in sequence to obtain the polygonal closed contour corresponding to the current tangent plane; Update the current cutting plane and return to step "Constructing an empty set as a contour sequence" until all cutting planes are traversed and the polygonal closed contours corresponding to all cutting planes are obtained.
7. A blockchain-based agricultural product rapid prototyping system, characterized by: The blockchain-based agricultural product rapid prototyping system applies the blockchain-based agricultural product rapid prototyping method according to any one of claims 1 to 6, and the blockchain-based agricultural product rapid prototyping system includes: A two-dimensional image acquisition module is used to acquire multiple two-dimensional images of a target; the target is agricultural products; the multiple two-dimensional images are taken at different angles; The 3D reconstruction module is used to reconstruct the target in 3D based on multiple 2D images of the target using the SFM method to determine the sparse point cloud data of the target; The dense reconstruction module is used to reconstruct the sparse point cloud data densely using the MVS method to determine the dense point cloud data of the target; A triangulation processing module, configured to perform triangulation processing on the dense point cloud data to determine a target manifold model; a slicing processing module, configured to slice the target manifold model to obtain a polygonal closed contour; The nozzle path planning module is used to construct the nozzle optimization path of each polygonal closed contour using the path planning algorithm, and construct the nozzle optimization path sequence in a bottom-up order; The 3D printing module is used to control the 3D printer to run according to the optimized nozzle path to obtain the target printing model.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the blockchain-based agricultural product rapid prototyping method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the blockchain-based agricultural product rapid prototyping method according to any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the blockchain-based agricultural product rapid prototyping method according to any one of claims 1 to 6 is implemented.