Automobile plastic part white nail position display platform based on uniapp
Through the image processing method that combines uniapp and OpenCV.js, the problem of white nail position recognition in low-performance mobile terminals and multi-station scenarios is solved, and efficient, accurate and flexible white nail position detection and display are achieved across platforms, supporting efficient recognition and quality traceability in multi-station scenarios.
Patent Information
- Application Number
- CN202510774462.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-06-11
AI Technical Summary
Existing technologies have difficulty in achieving fast, lightweight, and stable identification of the positions of white nails on automotive plastic parts in low-performance mobile terminals and multi-station scenarios. In addition, they lack cross-platform compatibility and recognition accuracy, and cannot meet the flexible deployment and efficient detection requirements in intelligent manufacturing environments.
A uniapp-based platform for displaying the positions of white nails on automotive plastic parts is used. The front-end camera interface encapsulated by uniapp is used to capture images, and the OpenCV.js module is used for image processing and recognition, including image conversion, filtering, compression, white nail area extraction, and coordinate matching. The results are displayed on the Canvas canvas and uploaded to the cloud server in real time.
It realizes the unified deployment of white nail position detection and display on multi-platform terminals, improves the flexibility and implementation efficiency of detection, improves the robustness and accuracy of image recognition, and supports efficient identification and quality traceability in multi-station scenarios.
Smart Images

Figure CN120689809A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of automobile assembly quality inspection, and in particular relates to a uniapp-based white nail position display platform for automobile plastic parts. Background Art
[0002] Currently, in the automotive parts assembly industry, locating pins (white nails) on plastic parts play a crucial role in ensuring assembly precision and preventing misassembly errors. Traditional white nail detection methods rely primarily on manual visual inspection or industrial cameras coupled with PC-based software analysis. These methods are highly dependent on the equipment environment, personnel experience, and system stability, resulting in low detection efficiency, inconsistent standards, and high deployment costs. For example, some white nail detection systems utilize native C++ applications combined with high-resolution industrial cameras and are deployed on PCs or industrial computers. These systems are only suitable for fixed production line locations and lack mobile deployment capabilities. Existing image recognition algorithms generally employ static thresholds, fixed angles, and Euclidean distance matching, making them inadequate for complex scenarios such as slight angle deviations in white nail installation, image noise, and lighting variations. Furthermore, with the rise of smart manufacturing and multi-station collaborative inspection, the demand for on-site inspection is trending towards mobility, lightweight design, and multi-terminal synchronization. Existing technologies, in terms of cross-platform terminal compatibility, compatibility with low-performance devices, recognition accuracy, and result visualization, fail to fully meet the practical requirements for flexible deployment, rapid deployment, and high-accuracy recognition in emerging manufacturing environments. Therefore, there is an urgent need for a cross-terminal detection method based on emerging software platforms and new information technology service architecture, which can still achieve efficient identification and position error display of white nails in automotive plastic parts under restrictive conditions such as low-performance mobile terminals, multi-station scenarios, and natural light interference, so as to improve the stability, adaptability and overall automation level of the detection process. Summary of the Invention
[0003] In response to the above-mentioned technical deficiencies, the purpose of the present invention is to propose a platform and method for displaying the white nail positions of automotive plastic parts based on Uniapp, aiming to solve the technical problem that the existing detection solutions rely on PCs or dedicated industrial cameras, especially under low-performance mobile terminals and multi-station deployment conditions, and are difficult to achieve fast, lightweight and stable identification of white nail positions and unified display.
[0004] In order to solve the above technical problems, the present invention adopts the following technical solution: The present invention provides a white nail position display platform for automobile plastic parts based on uniapp.
[0005] The uniapp-based automotive plastic parts white nail position display platform includes:
[0006] The template configuration acquisition module is used to call the terminal camera to capture images of automobile plastic parts through the front-end camera interface uni.chooseImage encapsulated by uniapp, and determine the current workstation based on the image of the automobile plastic parts; and download the workstation template configuration corresponding to the current workstation in JSON format from the server through the front-end network request interface uni.request encapsulated by uniapp;
[0007] The image preprocessing and compression module is used to convert images of automotive plastic parts from RGB space to HSV space, perform conditional filtering, and adaptively compress image resolution based on the OpenCV.js module in the uniapp WebView environment to obtain optimized images of automotive plastic parts;
[0008] The position recognition and extraction module is used to call the OpenCV.js interface based on the optimized automotive plastic part image to perform white nail area contour extraction, shape screening and coordinate error matching to obtain white nail detection results;
[0009] The visualization display module is used to graphically display the white nail detection results on the terminal interface based on the uniapp Canvas canvas;
[0010] The result upload and log module is used to upload the image processing results for graphical annotation display to the cloud server in real time and record the detection log.
[0011] Preferably, the workstation template configuration includes: the total number of white nails, the standard white nail coordinate array, and the tolerance distance threshold display style control parameters.
[0012] Preferably, in the image preprocessing and compression module, the OpenCV.js module in the WebView environment of uniapp performs image conversion from RGB space to HSV space processing, conditional filtering processing, and adaptive compression image resolution processing on the image of the automobile plastic part, thereby obtaining the steps of optimizing the image of the automobile plastic part, which specifically include:
[0013] Use the uni.getSystemInfoSync interface combined with the cv.resize interface of OpenCV.js to determine the resolution of the automotive plastic parts image. Preset the resolution threshold of the automotive plastic parts image. For images whose resolution exceeds the resolution threshold, perform geometric scaling first.
[0014] Call the cv.cvtColor interface in OpenCV.js to convert the automotive plastic parts image from RGB space to HSV color space to obtain the HSV image matrix (H(u, v), S(u, v), V(u, v)); where u and v are the two-dimensional pixel coordinates of the automotive plastic parts image, representing the horizontal and vertical positions of a pixel in the automotive plastic parts image, respectively; H(u, v) is the hue component of the pixel (u, v); S(u, v) is the saturation component of the pixel (u, v); and V(u, v) is the brightness component of the pixel (u, v).
[0015] Based on the HSV image matrix, the following threshold conditions are applied to construct the white nail mask Mask white (u,v), Among them, S T =30,V T =200 is the empirical threshold, which is suitable for reflection performance under natural light or industrial lighting;
[0016] According to the constructed white nail mask Mask white (u, v) Determine the candidate white nail area. First, use cv2.medianBlur to perform median filtering to remove isolated noise points in the candidate white nail area. Then use cv2.morphologyEx to perform an opening operation to eliminate the interference area. Finally, perform a dilation operation to enhance the outline of the candidate white nail area.
[0017] Get the current terminal processor model and memory capacity through the uni.getsystemInfosync interface, and calculate the device performance score P d The compression ratio α is dynamically set in combination with the image size. The compression ratio α is applied to the automobile plastic part image after the dilation operation enhances the contour of the candidate white nail area, and the optimized automobile plastic part image is obtained.
[0018] Preferably, in the image preprocessing and compression module, Among them, β1 and β2 are compression weight factors, T is the preset standard image area threshold, W0 is the original width of the automobile plastic part image, and H0 is the original height of the automobile plastic part image.
[0019] Preferably, in the position recognition and extraction module, the steps of calling the OpenCV.js interface to perform white nail area contour extraction, shape screening, and coordinate error matching based on the optimized automobile plastic part image specifically include:
[0020] Use cv.findContours interface to extract the white nail area contour from the optimized automobile plastic part image;
[0021] Calculate the roundness index C for each white nail area contour i i , Among them, A i is the contour area of the white nail region contour i, P i is the perimeter of the white nail area contour i; the roundness index threshold C is pre-set T , only keep the i ≥C T The outline of the white nail area;
[0022] Calculate the center coordinates (x i ,y i ), obtain the standard coordinates of the white nail area outline i from the JSON format of the station template configuration corresponding to the current station in the template configuration acquisition module and the current workstation white nail arrangement mode;
[0023] When the white nail arrangement mode is nonlinear, according to the contour center coordinates (x i ,y i ) and white nail standard coordinates The distance error matching method is used to match the error and obtain the tolerance D i ,
[0024] Preset tolerance threshold δ, when D i If ≤δ, it is marked as a qualified white nail, otherwise it is marked as a deviation white nail or missing white nail;
[0025] When the white nail arrangement mode is linear arrangement, according to the contour center coordinates (x i ,y i ) and white nail standard coordinates The direction perception matching method is used for error matching, and the lateral deviation is calculated respectively. With longitudinal deviation Preset lateral tolerance threshold δ x and the longitudinal tolerance threshold δ y , when |Δx i |≤δ x And |Δy i |≤δ y When the white nail is qualified, it is judged as a qualified white nail, otherwise it is judged as a deviation white nail;
[0026] When the white nail arrangement pattern is linear and it is determined to be a deviation white nail, the relative angle θ is introduced i Perform rotation trend analysis to obtain the relative angle θ i , where arctan(·) is the inverse tangent function;
[0027] A white nail detection result is generated based on the above white nail determination result.
[0028] Preferably, in the visualization display module, the step of graphically annotating and displaying the white nail detection results on the terminal interface based on the Canvas canvas of uniapp specifically includes:
[0029] Based on the uniapp Canvas, a green circle is drawn on the white nail position that is determined to be qualified, and a red circle is drawn on the white nail position that is determined to be a deviation white nail, and the tolerance D is marked. i Or lateral deviation Δx i and longitudinal deviation Δy i ; Draw a hollow warning mark for the unmatched standard white nail position and prompt "missing"; all annotation styles are dynamically loaded by the JSON format workstation template configuration corresponding to the current workstation in the template configuration acquisition module to achieve multi-terminal consistency.
[0030] Preferably, in the result uploading and logging module, the image processing results for graphical annotation display are uploaded to the cloud server in real time, and the detection log is recorded, specifically including: uploading the image processing results for graphical annotation display and the white nail detection results in the position recognition and extraction module in JSON format to the cloud server through the HTTP protocol in real time using the uni.uploadFile interface, recording the recognition pattern in each white nail detection result, the error matching result and center coordinates of each white nail, and the processing time-consuming terminal device information; and binding the white nail detection result with the work station number, user ID and timestamp for use in quality traceability and report analysis.
[0031] The present invention also provides a method for displaying the position of white nails on automobile plastic parts based on uniapp, comprising:
[0032] Step S10: Using the front-end camera interface uni.chooseImage encapsulated by uniapp, the terminal camera is called to capture an image of the automobile plastic part, and the current workstation is determined based on the image of the automobile plastic part; and the front-end network request interface uni.request encapsulated by uniapp is used to download the workstation template configuration in JSON format corresponding to the current workstation from the server;
[0033] Step S20: Based on the OpenCV.js module in the WebView environment of uniapp, the image of the automobile plastic part is converted from RGB space to HSV space, conditionally filtered, and adaptively compressed to obtain an optimized image of the automobile plastic part;
[0034] Step S30: Based on the optimized automobile plastic part image, the OpenCV.js interface is called to perform white nail area contour extraction, shape screening and coordinate error matching to obtain white nail detection results;
[0035] Step S40: Graphically display the white nail detection results on the terminal interface based on the Canvas canvas of uniapp;
[0036] Step S50: uploading the image processing results for graphical annotation display to the cloud server in real time and recording the detection log.
[0037] The present invention also provides a device for displaying the positions of white nails on automobile plastic parts based on Uniapp, comprising: a memory, a processor, and a program for displaying the positions of white nails on automobile plastic parts based on Uniapp stored on the memory and runnable on the processor. When the program for displaying the positions of white nails on automobile plastic parts based on Uniapp is executed by the processor, a method for displaying the positions of white nails on automobile plastic parts based on Uniapp is implemented.
[0038] The present invention also provides a computer program product, including a uniapp-based automobile plastic part white nail position display program, which implements the uniapp-based automobile plastic part white nail position display method when executed by a processor.
[0039] The beneficial effects of the present invention are: the present invention builds a multi-terminal adaptive image processing front-end system based on the emerging computer software framework uniapp, and combines the OpenCV.js image recognition module in the WebView environment to realize the unified deployment of white nail position detection and display on multi-platform terminals such as Android, iOS and mini-programs, solving the problems of traditional detection systems relying on dedicated hardware, difficult deployment and serious terminal differentiation, and improving the flexibility and implementation efficiency in mobile quality inspection scenarios.
[0040] This invention integrates new information technology service mechanisms and effectively improves the robustness of image recognition in low-performance devices and complex environments by introducing a "directional perception error matching algorithm" and a "terminal performance adaptive compression control strategy." Combined with cloud-based configuration retrieval and result return services, it realizes a closed-loop quality traceability process for white nail detection from image acquisition, recognition, visual display to cloud-based recording, significantly improving the accuracy and scalability of assembly inspection in the intelligent manufacturing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0042] Figure 1This is a schematic diagram of a first embodiment of a uniapp-based platform for displaying the positions of white nails on automotive plastic parts according to the present invention.
[0043] Figure 2 This is a schematic diagram of a device for displaying the position of white nails on automobile plastic parts based on uniapp. DETAILED DESCRIPTION
[0044] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0045] Example 1: Figure 1 The figure shows a flow chart of the first embodiment of the automobile plastic parts white nail position display platform based on uniapp of the present invention, which proposes the first embodiment of the automobile plastic parts white nail position display platform based on uniapp of the present invention.
[0046] In the first embodiment, the uniapp-based automotive plastic parts white nail position display platform includes:
[0047] The template configuration acquisition module is used to call the terminal camera to capture images of automobile plastic parts through the front-end camera interface uni.chooseImage encapsulated by uniapp, and determine the current workstation based on the image of the automobile plastic parts; and download the workstation template configuration corresponding to the current workstation in JSON format from the server through the front-end network request interface uni.request encapsulated by uniapp;
[0048] It should be noted that uniapp is a cross-platform development framework based on Vue.js. It enables "develop once, publish to multiple platforms"—that is, using a single set of code to simultaneously publish to multiple platforms. This makes it suitable for rapid cross-platform application development, especially for scenarios that require coverage of mini-programs, H5 apps, and apps. The "determining the current workstation based on an image of an automotive plastic part" process can be accomplished by pre-setting a workstation QR code or workstation number identification area in the image acquisition interface. The current workstation is automatically identified by parsing the QR code content or embedded text in the image, or the operator can manually select and confirm the workstation.
[0049] It is understandable that this module implements cross-terminal calls to a uniformly encapsulated front-end API on the uniapp platform, ensuring the consistency of image acquisition and configuration pull logic on systems such as Android, iOS, and WeChat mini-programs, avoiding data structure parsing errors or template incompatibility issues caused by platform differences.
[0050] For example, when it is detected that the current image contains the workstation number W012 corresponding to the label "left front door interior panel", the server address / template / W012.json will be automatically accessed through the uni.request interface to download the configuration parameters including the number of white nails that the component should have (6), the position coordinate array ([{x:120, y:340}]), the roundness threshold (0.85), the horizontal tolerance (10 pixels), the vertical tolerance (6 pixels), as well as green for qualified marks and red for abnormal marks, which are used to guide subsequent image processing and UI display.
[0051] The image preprocessing and compression module is used to convert images of automotive plastic parts from RGB space to HSV space, perform conditional filtering, and adaptively compress image resolution based on the OpenCV.js module in the uniapp WebView environment to obtain optimized images of automotive plastic parts;
[0052] It should be noted that in the image preprocessing and compression module, the OpenCV.js module in the WebView environment of uniapp performs image conversion from RGB space to HSV space processing, conditional filtering processing and adaptive compression image resolution processing on the automobile plastic parts image, and obtains the steps of optimizing the automobile plastic parts image, which specifically include: using the interface uni.getSystemInfoSync combined with the cv.resize interface of OpenCV.js to determine the resolution size of the automobile plastic parts image, presetting the resolution threshold of the automobile plastic parts image, and first performing the image whose resolution exceeds the resolution threshold of the automobile plastic parts image. Row geometric scaling processing; call the cv.cvtColor interface in OpenCV.js to convert the automotive plastic parts image from RGB space to HSV color space to obtain the HSV image matrix (H(u, v), S(u, v), V(u, v)); where u and v are the two-dimensional pixel coordinates of the automotive plastic parts image, representing the horizontal and vertical positions of a pixel in the automotive plastic parts image, respectively; H(u, v) is the hue component of the pixel (u, v); S(u, v) is the saturation component of the pixel (u, v); V(u, v) is the brightness component of the pixel (u, v); based on the HSV image matrix, apply the following threshold conditions to construct a white nail mask Mask white (u,v), Among them, S T =30,V T =200 is the empirical threshold, which is suitable for reflection performance under natural light or industrial light; according to the constructed white nail mask Mask white(u, v) determines the candidate white nail area, first uses cv.medianBlur to perform median filtering to remove isolated noise points in the candidate white nail area, then uses cv.morphologyEx to perform an opening operation to eliminate the interference area, and finally performs a dilation operation to enhance the outline of the candidate white nail area; obtains the current terminal processor model and memory capacity through the uni.getsystemInfosync interface, and calculates the device performance score P d , and dynamically set the compression ratio α in combination with the image size, and apply the compression ratio α to the automobile plastic part image after the expansion operation enhances the outline of the candidate white nail area to perform image adaptive compression, and obtain the optimized automobile plastic part image. In the image preprocessing and compression module, the compression ratio Among them, β1 and β2 are compression weight factors, T is the preset standard image area threshold, W0 is the original width of the automobile plastic part image, and H0 is the original height of the automobile plastic part image.
[0053] It is understandable that the above-mentioned adaptive compression mechanism combines the two dimensions of terminal performance and image resources for comprehensive evaluation, increasing the compression ratio when device resources are weak and retaining more feature information when the image resolution is small, thereby taking into account both computing efficiency and recognition accuracy.
[0054] It should be understood that the module runs as a whole in the WebView environment provided by uniapp, uses OpenCV.js for image matrix-level operations, has high cross-platform compatibility, does not rely on the operating system's local C / C++ image processing library, is adapted to Android, iOS, and mini-programs and other operating environments, and is suitable for factory quality inspection scenarios with high consistency deployment requirements.
[0055] For example, the original image size collected in a certain Android terminal is 1920×1080. After evaluation by the performance scoring algorithm, it is concluded that the device has a medium performance level. The compression ratio α is calculated to be 0.6, and the final image is geometrically compressed to a size of 1152×648. This not only reduces the computational burden of subsequent contour extraction and error analysis, but also retains sufficient white nail image details for matching, ensuring a balance between recognition accuracy and operation smoothness.
[0056] The position recognition and extraction module is used to call the OpenCV.js interface based on the optimized automotive plastic part image to perform white nail area contour extraction, shape screening and coordinate error matching to obtain white nail detection results;
[0057] It should be noted that in the position recognition and extraction module, based on the optimized automobile plastic part image, the OpenCV.js interface is called to perform the steps of white nail area contour extraction, shape screening and coordinate error matching. Specifically, the steps include: extracting the white nail area contour from the optimized automobile plastic part image through the cv.findContours interface; calculating the roundness index C of each white nail area contour i; i , Among them, A i is the contour area of the white nail region contour i, P i is the perimeter of the white nail area contour i; the roundness index threshold C is pre-set T , only keep the i ≥C T The white nail area contour; calculate the contour center coordinates (x i ,y i ), obtain the standard coordinates of the white nail area outline i from the JSON format of the station template configuration corresponding to the current station in the template configuration acquisition module and the current workstation white nail arrangement mode; when the white nail arrangement mode is nonlinear, according to the contour center coordinates (x i ,y i ) and white nail standard coordinates The distance error matching method is used to match the error and obtain the tolerance D i , Preset tolerance threshold δ, when D i ≤δ, it is marked as a qualified white nail, otherwise it is marked as a deviation white nail or missing white nail; when the white nail arrangement mode is linear arrangement, according to the contour center coordinate (x i ,y i ) and white nail standard coordinates The direction perception matching method is used for error matching, and the lateral deviation is calculated respectively. With longitudinal deviation Preset lateral tolerance threshold δ x and the longitudinal tolerance threshold δ y , when |Δx i |≤δ x And |Δy i |≤δ y When the white nail arrangement mode is linear and it is judged as a deviation white nail, the relative angle θ is introduced. i Perform rotation trend analysis to obtain the relative angle θ i , Wherein arctan(·) is an inverse tangent function; a white nail detection result is generated according to the above white nail determination result.
[0058] It is understandable that the introduction of the white nail arrangement pattern enables the platform to flexibly select matching methods based on the actual structures of different components (such as linear door panels and nonlinear bumpers), thereby improving the accuracy of error identification and engineering practicality.
[0059] It should be understood that the direction-aware matching method not only supports independent threshold control of the X / Y direction error components, but can also further determine the overall deflection trend during the installation process when necessary to avoid misidentification due to local rotation.
[0060] For example, for a white nail with standard coordinates of (150, 300) and the detected contour center coordinates of (158, 306), then Δx = 8, Δy = 6; if δ x =10,δ y =10, the white nail is judged to be qualified; if the white nails are arranged in a straight line structure and the rotation angle difference between adjacent white nails is 8°, which exceeds the preset θ T =5°, the white nail can be further determined as "installation trend deviation" and marked with a special icon in the display.
[0061] The visualization display module is used to graphically display the white nail detection results on the terminal interface based on the uniapp Canvas canvas;
[0062] It should be noted that in the visualization module, the steps of graphically displaying the white nail detection results on the terminal interface based on the uniapp Canvas canvas include: drawing green circular marks on the white nail positions that are determined to be qualified white nails, drawing red circles on the white nail positions that are determined to be deviation white nails, and marking the tolerance D. i Or lateral deviation Δx i and longitudinal deviation Δy i ; Draw a hollow warning mark for the unmatched standard white nail position and prompt "missing"; all annotation styles are dynamically loaded by the JSON format workstation template configuration corresponding to the current workstation in the template configuration acquisition module to achieve multi-terminal consistency.
[0063] It can be understood that the Canvas is the underlying graphics container that can be rendered across terminals in uniapp. The annotation logic controls context operations through JS scripts, and has the advantages of high drawing efficiency and low refresh delay. It is particularly suitable for embedding in detection-type light applications to provide real-time feedback on recognition results.
[0064] It should be understood that this module does not directly modify the original image content during the annotation process, but instead outputs the annotations in a layered manner, so that the real image and recognition results can coexist in the user interface, while avoiding the annotation offset problem caused by quality loss after image compression.
[0065] For example, when the platform identifies 6 white nails, the 1st, 2nd, 4th and 5th are qualified, the 3rd is deviated (deviation is: horizontal +8px, vertical -5px), and the 6th is missing, the Canvas will draw: 4 green circles; 1 red circle with "x: +8, y: -5" marked next to it; 1 gray hollow circle with the text "missing" next to it; all mark positions, colors, and font sizes are automatically rendered according to the workstation template settings, and the operator can identify the problem location at a glance through the terminal page.
[0066] The result upload and log module is used to upload the image processing results for graphical annotation display to the cloud server in real time and record the detection log.
[0067] It should be noted that in the result upload and log module, the image processing results for graphical annotation display are uploaded to the cloud server in real time, and the steps of recording the detection log are specifically included: the image processing results for graphical annotation display are uploaded to the cloud server in real time through the HTTP protocol in JSON format using the uni.uploadFile interface and the white nail detection results in the position recognition and extraction module, and the recognition pattern in each white nail detection result, the error matching result and center coordinates of each white nail, and the processing time-consuming terminal device information are recorded; and the white nail detection result is bound to the work station number, user ID and timestamp for use in quality traceability and report analysis. For example, a JSON format record can be {"Workstation number":"W013","User ID":"U00821","Timestamp":"2025-05-16T10:18:30Z","Recognition mode":"local / OpenCV.js","White nail detection results":[{"id":1,"Status":"Qualified","x":120,"y":340,"Δx":0,"Δy":0},{"id":2,"Status":"Deviation","x":182,"y":291,"Δx":8,"Δy":-5},{"id":3,"Status":"Missing"}],"Terminal information":{"System":"Android 13","Device model":"Mi 10","CPU score":2450,"Memory":"6GB"},"Processing time in ms":1080}.
[0068] It is understandable that the "upload to the cloud server" does not rely on a third-party image recognition platform, but only realizes data archiving and unified management based on the company's self-built quality inspection data middle platform or industrial Internet platform to ensure data security and project controllability.
[0069] It should be understood that the "Recognition Mode" field in the log is used to distinguish whether the detection was processed by the local OpenCV.js module or whether the cloud-assisted recognition mechanism was triggered. This provides a basis for judgment in subsequent performance evaluation and algorithm selection.
[0070] For example, after the inspector completes the image inspection of the W013 workstation on the mobile terminal, the system completes the labeling within 1 second and uploads the data through uni.uploadFile. The cloud can then use the backend system to trace back all white nail deviations in the inspection in a graphical manner, and identify inefficient equipment or abnormal working conditions based on terminal performance information. If it is subsequently discovered that a certain workstation continues to have deviations and white nails exceeding the limit, it can be traced back to the corresponding batch, operator, and specific image to achieve closed-loop control.
[0071] Embodiment 2: In addition, the present invention provides a method for displaying the position of white nails on automobile plastic parts based on uniapp, which adopts a platform for displaying the position of white nails on automobile plastic parts based on uniapp in the above embodiment, and can solve the technical problem of displaying the position of white nails on automobile plastic parts based on uniapp. Compared with the prior art, the beneficial effects of the method for displaying the position of white nails on automobile plastic parts based on uniapp provided by the present invention are the same as the beneficial effects of the platform for displaying the position of white nails on automobile plastic parts based on uniapp provided in the above embodiment, and the other technical features of the method for displaying the position of white nails on automobile plastic parts based on uniapp are the same as the features disclosed in the above embodiment method, and are not described in detail here.
[0072] Example 3: The present invention provides a device for displaying the position of white nails on automobile plastic parts based on uniapp, please refer to Figure 2A device for displaying the position of white nails on automobile plastic parts based on uniapp includes: at least one processor; and a memory in communication with the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for displaying the position of white nails on automobile plastic parts based on uniapp in the above-mentioned embodiment 1. A device for displaying the position of white nails on automobile plastic parts based on uniapp in the embodiment of the present invention may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. A device for displaying the position of white nails on automobile plastic parts based on uniapp is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present invention. A uniapp-based device for displaying the locations of white nails on automotive plastic parts may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the uniapp-based device for displaying the locations of white nails on automotive plastic parts. Processing device 1001, ROM 1002, and RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following platforms can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow a uniapp-based automotive plastic part white nail position display device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a uniapp-based automotive plastic part white nail position display device with various platforms, it should be understood that it is not required to implement or have all the platforms shown. More or fewer platforms may be implemented or have instead.
[0073] Example 4: The present invention also provides a computer program product, comprising a computer program. When executed by a processor, the computer program implements the steps of the aforementioned method for displaying the positions of white nails on automotive plastic parts based on Uniapp. The computer program product provided by the present invention can solve the technical problem of displaying the positions of white nails on automotive plastic parts based on Uniapp. Compared to the prior art, the beneficial effects of the computer program product provided by the present invention are the same as those of the method for displaying the positions of white nails on automotive plastic parts based on Uniapp provided in the aforementioned embodiment, and are not further elaborated here.
[0074] In particular, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer platform programs. For example, the embodiments disclosed in the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present invention are performed.
[0075] It should be understood that the various parts disclosed in the present invention can be implemented using hardware, platform, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0076] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A uniapp-based automotive plastic parts white nail position display platform, characterized in that: The platform includes: The template configuration acquisition module is used to call the terminal camera to capture images of automobile plastic parts through the front-end camera interface uni.chooseImage encapsulated by uniapp, and determine the current workstation based on the image of the automobile plastic parts; and download the workstation template configuration corresponding to the current workstation in JSON format from the server through the front-end network request interface uni.request encapsulated by uniapp; The image preprocessing and compression module is used to convert images of automotive plastic parts from RGB space to HSV space, perform conditional filtering, and adaptively compress image resolution based on the OpenCV.js module in the uniapp WebView environment to obtain optimized images of automotive plastic parts; The position recognition and extraction module is used to call the OpenCV.js interface based on the optimized automotive plastic part image to perform white nail area contour extraction, shape screening and coordinate error matching to obtain white nail detection results; The visualization display module is used to graphically display the white nail detection results on the terminal interface based on the uniapp Canvas canvas; The result upload and log module is used to upload the image processing results for graphical annotation display to the cloud server in real time and record the detection log.
2. The uniapp-based automotive plastic parts white nail position display platform according to claim 1, characterized in that: The workstation template configuration includes: total number of white nails, standard white nail coordinate array, and tolerance distance threshold display style control parameters.
3. The uniapp-based automobile plastic parts white nail position display platform according to claim 1, characterized in that: In the image preprocessing and compression module, the OpenCV.js module in the Uniapp WebView environment performs image conversion from RGB space to HSV space, conditional filtering, and adaptive image resolution compression on the automotive plastic part image. The steps to optimize the automotive plastic part image are as follows: Use the uni.getSystemInfoSync interface combined with the cv.resize interface of OpenCV.js to determine the resolution of the automotive plastic parts image. Preset the resolution threshold of the automotive plastic parts image. For images whose resolution exceeds the resolution threshold, perform geometric scaling first. Call the cv.cvtColor interface in OpenCV.js to convert the automotive plastic parts image from RGB space to HSV color space to obtain the HSV image matrix (H(u, v), S(u, v), V(u, v)); where u and v are the two-dimensional pixel coordinates of the automotive plastic parts image, representing the horizontal and vertical positions of a pixel in the automotive plastic parts image, respectively; H(u, v) is the hue component of the pixel (u, v); S(u, v) is the saturation component of the pixel (u, v); and V(u, v) is the brightness component of the pixel (u, v). Based on the HSV image matrix, the following threshold conditions are applied to construct the white nail mask Mask white (u,v), Among them, S T =30,V T =200 is the empirical threshold, which is suitable for reflection performance under natural light or industrial lighting; According to the constructed white nail mask Mask white (u, v) Determine the candidate white nail area. First, use cv2.medianBlur to perform median filtering to remove isolated noise points in the candidate white nail area. Then use cv2.morphologyEx to perform an opening operation to eliminate the interference area. Finally, perform a dilation operation to enhance the outline of the candidate white nail area. Get the current terminal processor model and memory capacity through the uni.getsystemInfosync interface, and calculate the device performance score P d The compression ratio α is dynamically set in combination with the image size. The compression ratio α is applied to the automobile plastic part image after the dilation operation enhances the contour of the candidate white nail area, and the optimized automobile plastic part image is obtained.
4. The uniapp-based automobile plastic parts white nail position display platform as claimed in claim 3, characterized in that: In the image preprocessing and compression module, the compression ratio Among them, β1 and β2 are compression weight factors, T is the preset standard image area threshold, W0 is the original width of the automobile plastic part image, and H0 is the original height of the automobile plastic part image.
5. The uniapp-based automobile plastic parts white nail position display platform as claimed in claim 1, characterized in that: In the position recognition and extraction module, based on the optimized automotive plastic part image, the OpenCV.js interface is called to perform the steps of white nail area contour extraction, shape screening, and coordinate error matching. Specifically, the steps include: Use cv.findContours interface to extract the white nail area contour from the optimized automobile plastic part image; Calculate the roundness index C for each white nail area contour i i , Among them, A i is the contour area of the white nail region contour i, P i is the perimeter of the white nail area contour i; the roundness index threshold C is pre-set T , only keep the i ≥C T The outline of the white nail area; Calculate the center coordinates (x i ,y i ), obtain the standard coordinates of the white nail area outline i from the JSON format of the station template configuration corresponding to the current station in the template configuration acquisition module and the current workstation white nail arrangement mode; When the white nail arrangement mode is nonlinear, according to the contour center coordinates (x i ,y i ) and white nail standard coordinates The distance error matching method is used to match the error and obtain the tolerance D i , Preset tolerance threshold δ, when D i If ≤δ, it is marked as a qualified white nail, otherwise it is marked as a deviation white nail or missing white nail; When the white nail arrangement mode is linear arrangement, according to the contour center coordinates (x i ,y i ) and white nail standard coordinates The direction perception matching method is used for error matching, and the lateral deviation is calculated respectively. With longitudinal deviation Preset lateral tolerance threshold δ x and the longitudinal tolerance threshold δ y , when |Δx i |≤δ x And |Δy i |≤δ y When the white nail is qualified, it is judged as a qualified white nail, otherwise it is judged as a deviation white nail; When the white nail arrangement pattern is linear and it is determined to be a deviation white nail, the relative angle θ is introduced i Perform rotation trend analysis to obtain the relative angle θ i , where arctan(·) is the inverse tangent function; A white nail detection result is generated based on the above white nail determination result.
6. The uniapp-based automobile plastic parts white nail position display platform according to claim 1, characterized in that: In the visualization module, the steps for graphically displaying the white nail detection results on the terminal interface based on the uniapp Canvas canvas include: Based on the uniapp Canvas, a green circle is drawn on the white nail position that is determined to be qualified, and a red circle is drawn on the white nail position that is determined to be a deviation white nail, and the tolerance D is marked. i Or lateral deviation Δx i and longitudinal deviation Δy i ; Draw a hollow warning mark for the unmatched standard white nail position and prompt "missing"; all annotation styles are dynamically loaded by the JSON format workstation template configuration corresponding to the current workstation in the template configuration acquisition module to achieve multi-terminal consistency.
7. The uniapp-based automobile plastic parts white nail position display platform according to claim 1, characterized in that: In the result upload and log module, the image processing results for graphical annotation display are uploaded to the cloud server in real time, and the detection log steps are recorded, specifically including: uploading the image processing results for graphical annotation display and the white nail detection results in the position recognition and extraction module to the cloud server in JSON format through the HTTP protocol using the uni.uploadFile interface in real time, recording the recognition pattern in each white nail detection result, the error matching result and center coordinates of each white nail, and the processing time-consuming terminal device information; and binding the white nail detection result with the work station number, user ID and timestamp for use in quality traceability and report analysis.
8. A method for displaying the position of white nails on automobile plastic parts based on uniapp, applied to a platform for displaying the position of white nails on automobile plastic parts based on uniapp according to any one of claims 1 to 7, characterized in that: Methods include: Step S10: Using the front-end camera interface uni.chooseImage encapsulated by uniapp, the terminal camera is called to capture an image of the automobile plastic part, and the current workstation is determined based on the image of the automobile plastic part; and the front-end network request interface uni.request encapsulated by uniapp is used to download the workstation template configuration in JSON format corresponding to the current workstation from the server; Step S20: Based on the OpenCV.js module in the WebView environment of uniapp, the image of the automobile plastic part is converted from RGB space to HSV space, conditionally filtered, and adaptively compressed to obtain an optimized image of the automobile plastic part; Step S30: Based on the optimized automobile plastic part image, the OpenCV.js interface is called to perform white nail area contour extraction, shape screening and coordinate error matching to obtain white nail detection results; Step S40: Graphically display the white nail detection results on the terminal interface based on the Canvas canvas of uniapp; Step S50: uploading the image processing results for graphical annotation display to the cloud server in real time and recording the detection log.
9. A uniapp-based automobile plastic parts white nail position display device, characterized in that: The uniapp-based automobile plastic parts white nail position display device includes: a memory, a processor, and a uniapp-based automobile plastic parts white nail position display program stored on the memory and runnable on the processor. When the uniapp-based automobile plastic parts white nail position display program is executed by the processor, it implements a uniapp-based automobile plastic parts white nail position display platform according to any one of claims 1 to 7.
10. A computer program product, characterized in that The computer program product includes a uniapp-based automobile plastic parts white nail position display program, and when the uniapp-based automobile plastic parts white nail position display program is executed by a processor, it implements a uniapp-based automobile plastic parts white nail position display platform according to any one of claims 1 to 7.
Citation Information
Patent Citations
Auto part quality detection method based on shape match
CN107886496A
Vehicle part defect detection method and system and electronic equipment
CN114418998A
Machine tool work reporting method, device and equipment and storage medium
CN118674237A
Visual inspection system of automobile door panel assembly
CN119555684A
Automobile plastic member positioning and detecting apparatus
CN204165478U