Monocular vision measurement system and method based on dual-core heterogeneous architecture
By using a dual-core heterogeneous architecture monocular vision measurement system, combined with the collaborative design of STM32 and K230 chips, the real-time performance and accuracy issues of monocular vision measurement in resource-constrained environments are solved, achieving low-power and high-efficiency target size and distance measurement, which is suitable for large-scale industrial deployment.
Patent Information
- Application Number
- CN202610140508.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-02
- Publication Date
- 2026-05-15
- Estimated Expiration
- 2046-02-02
AI Technical Summary
Existing monocular vision measurement technology struggles to achieve high-precision, low-power real-time target size and distance measurement in resource-constrained environments. Traditional methods suffer from insufficient real-time performance, poor environmental robustness, and a significant trade-off between computing power and power consumption.
A monocular vision measurement system based on a dual-core heterogeneous architecture is adopted, including an image acquisition module, a vision processing unit, a current detection module, a control unit, and a human-computer interaction module. The monocular ranging process is optimized by minimum side length extraction and viewing angle correction. Combined with the collaborative design of STM32 series microprocessors and K230 vision processing units, high-precision vision processing and low-power real-time control are achieved.
It significantly improves the robustness and accuracy of measurements, reduces system power consumption, is suitable for resource-constrained industrial scenarios, has low hardware costs, is highly adaptable, and is easy to deploy and expand.
Smart Images

Figure CN121639768B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of computer vision and embedded systems, specifically relating to a monocular vision measurement system and method based on a dual-core heterogeneous architecture, which is particularly suitable for real-time target size and distance measurement in resource-constrained environments. Background Technology
[0002] With the rapid development of industrial automation and smart warehousing, the demand for low-cost, high-efficiency non-contact measurement technologies is becoming increasingly urgent. Traditional contact measurement methods suffer from low efficiency and are prone to damaging the measured object; while in non-contact measurement solutions, low cost and high accuracy are often difficult to achieve simultaneously. In recent years, in particular, machine vision-based non-contact measurement technologies have gradually become a research hotspot in the field of industrial measurement due to their high accuracy, high speed, and non-destructive testing characteristics.
[0003] Monocular vision measurement, as an important branch of computer vision, utilizes a single camera to simulate human visual perception, combining digital image processing and algorithm analysis to achieve the identification, localization, and measurement of target objects. Compared with stereo vision systems, monocular vision systems have significant advantages such as simpler hardware structure, lower cost, and reduced computational complexity, making them more suitable for large-scale deployment and application in industrial environments.
[0004] Monocular vision measurement mainly includes the following three methods in terms of algorithms and computation: (1) Measurement system based on traditional geometric vision, which adopts classic image processing algorithms (such as edge detection, contour extraction, perspective transformation, etc.), combined with camera calibration parameters, and calculates the target size and distance through the principle of similar triangles or PnP (Perspective-n-point) algorithm. It mainly relies on manually designed feature extraction algorithms, which are not stable enough in complex scenarios such as changes in lighting, missing target textures, and occlusion, and have poor environmental robustness; and have defects such as limited real-time performance and insufficient flexibility. (2) End-to-end measurement system based on deep learning, which generally adopts models such as convolutional neural networks or Transformers to directly regress the geometric parameters of the target from the image. Its main defects are: the contradiction between computing power and power consumption is prominent, the power consumption of GPU / NPU platform is high, and it is difficult to deploy for a long time in scenarios with battery power supply or strict heat dissipation restrictions; and it requires a large amount of accurately labeled training data, the labeling cost is high and the generalization ability is limited by the dataset. (3) Lightweight vision system based on single-core microcontroller runs simplified vision algorithms (such as binarization and template matching) on microcontrollers such as STM32. Due to the low main frequency of the microcontroller and the lack of a dedicated vision acceleration unit, it is difficult to handle complex algorithms and cannot meet the requirements of dynamic scenes in terms of measurement accuracy and frame rate. In order to adapt to computing power, the integrity of the algorithm is often sacrificed, resulting in large measurement errors. It is only suitable for extremely simple fixed scenes. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a monocular vision measurement system and method based on a dual-core heterogeneous architecture. It adopts a heterogeneous design of control unit + vision processing unit to achieve synergy between high-performance vision processing and low-power real-time control.
[0006] To address the aforementioned technical challenges, this invention discloses a monocular vision measurement system based on a dual-core heterogeneous architecture. The system includes an image acquisition module, a vision processing unit, a current detection module, a control unit, and a human-machine interface module, achieving effective synergy between high-precision vision processing and low-power real-time control. It is particularly suitable for resource-constrained industrial scenarios. The system employs a self-developed algorithm to optimize the monocular ranging process through minimum side length extraction and viewpoint correction, significantly enhancing the robustness and accuracy of measuring complex targets.
[0007] The image acquisition module is used to acquire monocular images containing a standard reference object and the target object; the vision processing unit is used to execute target detection, contour extraction, perspective transformation, and size measurement algorithms. The vision processing unit receives the monocular images acquired by the image acquisition module and outputs the target measurement results; the current detection module is electrically connected to the control unit and is used to monitor the system power consumption in real time and output a proportional voltage signal; the control unit is used for system scheduling, current signal acquisition, and communication control. The control unit receives the target measurement results input by the vision processing unit and the proportional voltage signal input by the current detection module and outputs them to the human-machine interaction module; the human-machine interaction module is used to display the measurement results and system status.
[0008] Preferably, the standard reference is an A4 sheet of paper, the target object is a rectangular image located on the A4 sheet of paper, and the algorithm executed by the visual processing unit includes the following steps:
[0009] Rectangular contour detection is performed on the input image, and multiple candidate rectangles that meet the rectangle detection conditions are formed into a candidate rectangle set;
[0010] The candidate rectangles in the candidate rectangle set are verified according to the standard ratio in descending order of area. The candidate rectangle with the largest area that meets the standard ratio is designated as the candidate reference rectangle. The candidate reference rectangle is then corrected by perspective transformation to generate a standard reference rectangle without distortion.
[0011] Extract the target rectangle from the standard reference rectangle. The target rectangle is derived from the candidate rectangle set other than the standard reference rectangle, and the target rectangle is completely located inside the standard reference rectangle.
[0012] A region is selected outside the target rectangle and inside the standard reference rectangle, defined as the Region of Interest (ROI). The image within the ROI is binarized, and Blob detection is performed on the binarized image to generate multiple connected pixel regions, defined as feature blobs. Shape recognition and geometric shape verification are performed on each feature blob. Feature blobs that meet the requirements are identified as the target object.
[0013] Based on the known physical and pixel dimensions of the standard reference rectangle, the actual geometric parameters of the target are calculated according to the pixel dimensions of the target object in the image.
[0014] More preferably, all rectangular contours in the image are detected based on edge detection and polygon approximation methods, forming a candidate rectangle set. Based on a perspective geometry model, each rectangular contour is reverse-mapped into a front view, and the aspect ratio R of the rectangular front view is calculated. asp Filter out the aspect ratio R asp This is the standard reference rectangle for the aspect ratio of A4 paper.
[0015] Preferably, the aspect ratio R of the rectangle is selected. asp When formula (1) is satisfied, the candidate rectangle is considered the standard reference rectangle.
[0016] (1),
[0017] in, The aspect ratio of A4 paper. A threshold set manually indicates what is allowed. Distortion within the range.
[0018] Preferred method for filtering candidate reference rectangles:
[0019] Candidate rectangle set sorting: Sort the candidate rectangles in the candidate rectangle set in descending order of area.
[0020] Reference object verification: Starting with the candidate rectangle with the largest area, verify in turn whether its aspect ratio conforms to the standard A4 paper ratio.
[0021] Reference point confirmation: The first candidate rectangle that passes the aspect ratio verification is determined as the candidate reference rectangle.
[0022] Target rectangle search: Among the remaining candidate rectangles, search for whether there exists a target rectangle that is completely inside the candidate reference rectangle.
[0023] If a match exists, the candidate reference rectangle is matched with the target rectangle, and the process ends.
[0024] If it does not exist, proceed with the rollback process;
[0025] Rollback process: Discard the current candidate reference rectangle, take the next candidate rectangle that passes the aspect ratio verification in order of area, repeat the target rectangle search steps until the target rectangle is successfully found or the target rectangle cannot be found inside any of the candidate rectangles, then the process ends.
[0026] Preferably, the method of minimum boundary rectangle angle is used to identify quadrilaterals for each feature spot, and those that meet the quadrilateral requirements are defined as candidate feature spots.
[0027] Using the internal fill rate R of candidate feature spots Area Determine its geometry and internal fill rate R. Area The calculation method is shown in formula (2). (2), where A blob A represents the area of all pixels in the candidate feature blob. minrect Let R be the area of the minimum bounding rectangle corresponding to the candidate feature blob, when the internal fill rate R Area When the fill rate is greater than the threshold, the candidate feature blob is identified as the target object.
[0028] Based on the actual physical size of A4 paper and its pixel size in the image, a scaling factor is obtained. Then, the actual physical size of each target object is the product of its pixel size and the scaling factor, where the minimum side pixel length is used as the feature width.
[0029] The distance D from the target object to the camera is calculated based on the principle of similar triangles under the pinhole camera model. The calculation method is shown in formula (3): (3), among which, This refers to the actual physical width of an A4 sheet of paper. Let be the equivalent focal length of the camera, which is known through camera calibration. The pixel width of the reference object in the image.
[0030] Preferably, the internal fill rate threshold is 0.9.
[0031] Preferably, the current detection module includes a signal conditioning circuit based on an operational amplifier, which amplifies and filters the voltage difference across the sampling resistor before inputting it to the ADC interface of the control unit; the human-machine interaction module is a serial touch screen, which communicates with the control unit via the UART protocol to realize real-time display of measurement data and reception of user commands; the vision processing unit is a K210 or K230 chip, and the control unit is an STM32 series microcontroller, which interact with the control unit via a UART or SPI interface for data and command exchange.
[0032] On the other hand, this invention discloses a monocular vision measurement method based on a dual-core heterogeneous architecture, comprising the following steps:
[0033] The image acquisition module acquires a monocular image containing both a standard reference object and the target object.
[0034] The vision processing unit identifies standard reference objects and performs perspective correction on them, establishing a mapping relationship between image pixels and actual physical dimensions;
[0035] Identify the target object within a standard reference and extract its pixel dimensions;
[0036] Based on the mapping relationship and the pixel size of the target, the actual physical size of the target and its distance from the camera are calculated;
[0037] The control unit synchronously collects the system power consumption and sends the measurement results to the human-machine interaction module for display.
[0038] Preferably, it also includes system power management steps, such as reducing the operating frequency of the vision processing unit when it is idle, and enabling DMA data transfer in the control unit.
[0039] The standard reference object is a rectangle that conforms to the aspect ratio of A4 paper, and the target object is a rectangle that is completely located within the standard reference object and has a fill rate greater than the fill rate threshold. During the identification of the standard reference object, if there are multiple rectangular outlines in the image, they are sorted from largest to smallest area, and proportional verification and inclusion relationship verification are performed in sequence to determine the unique outer frame of the standard reference object and the inner frame of the target object.
[0040] The beneficial effects of this invention are as follows:
[0041] 1. A dual-core heterogeneous architecture combining an STM32 series microprocessor and a K230 vision processing unit is adopted, achieving efficient task decoupling and resource optimization. The control unit handles high-real-time, computationally simple tasks such as high-precision current acquisition, system scheduling, and communication control, while the vision processing unit is dedicated to image target detection, perspective transformation, and size calculation. Its NPU accelerates neural networks and image algorithms, avoiding single-core overload and significantly improving system real-time performance. Furthermore, the STM32 uses DMA transfer to reduce CPU load and dynamic power consumption, while the K230 supports dynamic frequency adjustment to reduce static power consumption, achieving a balance between low power consumption and high energy efficiency.
[0042] 2. Measurement accuracy and robustness are improved. Adaptive geometric correction based on A4 reference is used, and a certain range of skew and perspective distortion errors are allowed. The minimum side pixel length of the quadrilateral is calculated as the feature width to reduce the impact of perspective distortion on size transformation. When determining the target object, the A4 outer frame is located first, and then the target is detected in the ROI inside it to eliminate background interference.
[0043] 3. The system adopts a modular design, making it easy to deploy. The system is divided into an image acquisition module, a vision processing unit, a current detection module, a control unit, and a human-machine interface module. The interfaces are clear and easy to customize and expand. The current detection circuit is based on operational amplifier amplification and filtering, and STM32 ADC acquisition, monitoring system power consumption in real time and providing data support for energy optimization and fault diagnosis.
[0044] 4. Lower cost and greater adaptability. Compared to binocular or multi-camera systems, this invention has lower hardware costs, making it suitable for large-scale industrial deployment; and its algorithm is lightweight, allowing it to run in real time on embedded edge devices. Attached Figure Description
[0045] Figure 1 This is an overall structural diagram of the system of the present invention;
[0046] Figure 2 This is a flowchart illustrating the process of determining the target rectangle in this invention;
[0047] Figure 3 This is a schematic diagram of the process for determining the candidate reference rectangle in this invention;
[0048] Figure 4 This is a circuit diagram of the current detection module in this invention;
[0049] Figure 5 This is a structural diagram of the detected image in this invention;
[0050] Figure 6 This is the result image of the detection. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0052] like Figure 1 As shown, a monocular vision measurement system based on a dual-core heterogeneous architecture includes an image acquisition module, a vision processing unit, a current detection module, a control unit, and a human-computer interaction module, realizing the process from data acquisition to vision processing to control decision-making to human-computer interaction.
[0053] The image acquisition module uses a USB network camera with a resolution of 1920*1080 and a frame rate of 30 FPS. The camera is connected to the vision processing unit K230 via a USB interface and is responsible for acquiring monocular images containing reference objects and the target object to be measured.
[0054] The vision processing unit uses the Canaan K230 edge AI chip, which has a built-in dual-core NPU with a computing power of about 6 TOPs, meeting the real-time requirements of neural network inference and image processing. The K230 communicates with the control unit STM32 through the UART interface to output measurement results such as target distance and size.
[0055] The current detection module is based on the LM358 dual operational amplifier design for current sampling circuit design, such as... Figure 4 As shown in the diagram, the sampling current flows through sampling resistor R8, generating a voltage drop. This voltage drop signal is sent to the inverting input of operational amplifier LM358 U1.1 via resistor R5. After being amplified by U1.1, the signal is output to R1, and then fed back to the inverting input of U1.1 via R3, forming a closed-loop control and enhancing circuit stability. U1.2 amplifies the output of U1.1 twice and outputs it to R2. Finally, it is filtered by capacitor C2 to obtain a stable ADC1 signal. Capacitors C1, C3, C5, C6, and C4 are used in the circuit to stabilize the power supply and signal, reducing interference. This circuit achieves precise amplification and filtering of the current signal, outputting a stable analog signal for sampling by the ADC, and is suitable for applications requiring precise current measurement.
[0056] The control unit uses an STM32F103C8T6 microcontroller as its control unit. It is responsible for acquiring the analog voltage signal output by the current detection module through the ADC channel, receiving the measurement data sent by the K230 through the UART, sending the measurement data to the human-machine interaction module through another UART interface, and system task scheduling and communication protocol processing.
[0057] The human-computer interaction module uses a 7-inch UART serial port touch screen. The display screen is connected to the STM32 via UART to display the target distance, size, system power consumption and status information in real time, and supports touch command input.
[0058] In addition, the entire system is powered by an external 5V / 3A DC power supply, which is regulated to 3.3V by an LDO to supply the STM32 and K230 core circuits.
[0059] like Figure 2 As shown, the process by which this system determines the target object is as follows:
[0060] Phase 1: Image Acquisition and Preprocessing: The image acquisition module acquires images and converts them into the input format for the visual processing unit.
[0061] Phase 2: Rectangular Contour Detection and Candidate Set Generation: The `img.find_rects` function is called to extract all quadrilateral contours in the image based on Canny edge detection and Douglas-Peucker polygon approximation. Each quadrilateral undergoes an inverse perspective transformation and is added to the candidate rectangle set.
[0062] Phase 3: Reference Object and Target Rectangle Selection: such as Figure 3 As shown, the candidate rectangle set is sorted in descending order of area. Starting with the rectangle with the largest area, the rectangle is verified one by one to see if it passes the A4 scale verification. The first rectangle that passes the verification is defined as the candidate reference rectangle. The remaining rectangles are searched to see if there is a rectangle that is completely inside the candidate reference rectangle. If found, it is defined as the target rectangle. Otherwise, the backtracking process is activated: the current candidate reference rectangle is abandoned, and the next rectangle that passes the verification is selected and the search is repeated.
[0063] In this stage, A4 scale verification allows for errors as long as the aspect ratio R of the candidate rectangle's front view is within acceptable limits. asp satisfy (in If the ratio is 0.05, it can be determined that it meets the A4 paper ratio verification.
[0064] Phase 4: Perspective Transformation and ROI Extraction: In the matched candidate reference rectangle and target rectangle view, the ROI region is defined as the area 10 pixels outside the target rectangle. The ROI region is located inside the candidate reference rectangle.
[0065] Phase 5: Blob Detection and Feature Extraction: Convert the ROI region to grayscale, perform binarization (threshold 128), conduct connectivity component analysis, and extract blobs with an area between 100 and 100,000 pixels. For each blob, calculate its minimum bounding rectangle corner points and its fill rate. ,like If the value is greater than 0.9, it is considered a valid target feature spot.
[0066] Phase 6: Size and Distance Calculation: First, the actual width of the A4 paper is known. =210mm, the pixel width in the image is ,and The candidate reference rectangle is selected based on its minimum side length after perspective transformation. Choosing the minimum side length enhances the robustness of the algorithm. The scaling factor is then used. The actual size of each target feature spot is obtained by multiplying the pixel size of its smallest bounding rectangle by the scaling factor k.
[0067] The distance D is calculated based on the pinhole model formula. ,in This can be obtained through camera calibration.
[0068] Phase 7: Data Output and Display: The K230 sends the target distance, size, and coordinate information to the STM32 via UART. The STM32 simultaneously collects current and voltage signals, calculates real-time power consumption, and packages all data to be displayed on the serial port screen.
[0069] Phase 8: Power Management: During the idle period of K230, the frequency reduction API is automatically called to reduce the main frequency to 500MHz, while STM32 enables DMA to transfer ADC data, reducing CPU utilization.
[0070] The pseudocode for this algorithm is shown in Table 1:
[0071] Table 1 Pseudocode of Target Recognition Algorithm
[0072]
[0073]
[0074] This invention also discloses a monocular vision measurement method based on a dual-core heterogeneous architecture, comprising the following steps: acquiring a monocular image containing a standard reference object and a target object through an image acquisition module; identifying the standard reference object and performing perspective correction on it to establish a mapping relationship between image pixels and actual physical dimensions; identifying the target object in the same image and extracting its pixel dimensions; calculating the actual physical dimensions of the target and its distance from the camera based on the mapping relationship and the pixel dimensions of the target; and synchronously acquiring system power consumption by a control unit and sending the measurement results to a human-computer interaction module for display.
[0075] The standard reference is an A4 sheet of paper, and the target object is a rectangular image that is completely located within the standard reference and has a fill rate greater than the fill rate threshold. During the identification of the standard reference, if there are multiple rectangular outlines in the image, they are sorted from largest to smallest area, and proportional verification and inclusion relationship verification are performed in sequence to determine the unique outer frame of the standard reference and the inner frame of the target object.
[0076] like Figure 5 As shown, to verify system performance, four target types are compared: Figure 5 (a) represents the unilateral SS, Figure 5 (b) represents the square composite pattern SNL with a number label. Figure 5 The composite pattern MSS, consisting of multiple separate squares, and the composite pattern POS, consisting of partially overlapping squares, represented in (c), were tested five times using this system and method within a distance range of 115-155 cm.
[0077] The experimental results are as follows Figure 6 As shown in Table 2, the maximum error in distance measurement is ≤4.2%, and the maximum error in side length measurement is ≤4.8%. The system power consumption is shown in Table 2. The above experimental results show that the developed measuring device can control the real-time measurement error of the distance, side length, and area of the moving target within ±5% while maintaining stable system power consumption, thus meeting the design requirements of practical applications.
[0078] Table 2 System power consumption test results
[0079]
[0080] In this embodiment, the reference object is A4 paper, and the target object is a rectangle with a high fill rate. The standard reference object can also be replaced with other objects of known size, and the target object is not limited to a rectangle with a high fill rate.
[0081] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A monocular vision measurement system based on a dual-core heterogeneous architecture, comprising an image acquisition module, characterized in that: It also includes a vision processing unit, a current detection module, a control unit, and a human-machine interaction module, realizing the process from data acquisition to vision processing, control decision-making, and human-machine interaction. The image acquisition module is used to acquire monocular images containing standard reference objects and target objects; The vision processing unit is used to execute target detection, contour extraction, perspective transformation and size measurement algorithms. The vision processing unit receives monocular images acquired by the image acquisition module and outputs target measurement results. The current detection module is electrically connected to the control unit and is used to monitor the system power consumption in real time and output a proportional voltage signal. The control unit is used for system scheduling, current signal acquisition and communication control. The control unit receives the target measurement results input by the vision processing unit and the proportional voltage signal input by the current detection module, and outputs them to the human-machine interaction module. The human-computer interaction module is used to display measurement results and system status; If the standard reference is an A4 sheet of paper and the target object is a rectangular image located on the A4 sheet of paper, then the size measurement algorithm executed by the visual processing unit includes the following steps: Rectangular contour detection is performed on the input image, and multiple candidate rectangles that meet the rectangle detection conditions are formed into a candidate rectangle set; The candidate rectangles in the candidate rectangle set are corrected by perspective transformation, and then the standard ratio is verified in descending order of area. The candidate rectangle with the largest area that meets the standard ratio is designated as the candidate reference rectangle, and a standard reference rectangle without distortion is generated for the candidate reference rectangle. Extract the target rectangle from the standard reference rectangle. The target rectangle is derived from the candidate rectangle set other than the standard reference rectangle, and the target rectangle is completely located inside the standard reference rectangle. Based on the target rectangle, a Region of Interest (ROI) is defined outside the target rectangle and inside the standard reference rectangle. The image within the ROI is binarized, and Blob detection is performed on the binarized image to generate multiple connected pixel regions, which are defined as feature blobs. Shape recognition and geometric shape verification are performed on each feature blob. Feature blobs that meet the requirements are identified as the target object. Based on the known physical and pixel dimensions of the standard reference rectangle, the actual geometric parameters of the target object are calculated according to the pixel dimensions of the target object in the image.
2. The monocular vision measurement system based on a dual-core heterogeneous architecture according to claim 1, characterized in that: All rectangular contours in an image are detected using edge detection and polygon approximation methods, and a candidate rectangle set is formed. Based on the perspective geometry model, the outlines of each rectangle are reverse-mapped into a front view. Calculate the aspect ratio R of the rectangular front view. asp Filter out the aspect ratio R asp This is the standard reference rectangle for the aspect ratio of A4 paper.
3. The monocular vision measurement system based on a dual-core heterogeneous architecture according to claim 2, characterized in that: The aspect ratio R of the candidate rectangle asp When formula (1) is satisfied, the candidate rectangle is considered as the standard reference rectangle. (1), in, The aspect ratio of A4 paper. A threshold set manually indicates what is allowed. Distortion within the range.
4. The monocular vision measurement system based on a dual-core heterogeneous architecture according to claim 3, characterized in that: Filtering candidate reference rectangles; Candidate rectangle set sorting: Sort the candidate rectangles in the candidate rectangle set in descending order of area. Reference object verification: Starting with the candidate rectangle with the largest area, verify in turn whether its aspect ratio conforms to the standard A4 paper ratio. Reference point confirmation: The first candidate rectangle that passes the aspect ratio verification is determined as the candidate reference rectangle. Target rectangle search: Among the remaining candidate rectangles, search for whether there exists a target rectangle that is completely inside the candidate reference rectangle. If a match exists, the candidate reference rectangle is matched with the target rectangle, and the process ends. If it does not exist, proceed with the rollback process; Rollback process: Discard the current candidate reference rectangle, take the next candidate rectangle that passes the aspect ratio verification in order of area, repeat the target rectangle search steps until the target rectangle is successfully found or the target rectangle cannot be found inside any of the candidate rectangles, then the process ends.
5. A monocular vision measurement system based on a dual-core heterogeneous architecture according to claim 1, characterized in that: The method of minimum bounding rectangle angle is used to identify quadrilaterals for each feature spot. Spots that meet the quadrilateral requirement are defined as candidate feature spots. Using the internal fill rate R of candidate feature spots Area Determine its geometry and internal fill rate R. Area The calculation method is shown in formula (2). (2), where A blob A represents the area of all pixels in the candidate feature blob. minrect Let R be the area of the minimum bounding rectangle corresponding to the candidate feature blob, when the internal fill rate R Area When the fill rate is greater than the threshold, the candidate feature blob is determined as the target object; Based on the actual physical size of A4 paper and its pixel size in the image, a scaling factor is obtained. The actual physical size of each target object is then the product of its pixel size and the scaling factor, with the minimum side pixel length used as the feature width. The distance D from the target object to the camera is calculated based on the principle of similar triangles under the pinhole camera model. The calculation method is shown in formula (3): (3), among which, This refers to the actual physical width of an A4 sheet of paper. The pixel representation of the camera's focal length is known through camera calibration. The pixel width of the reference object in the image.
6. The monocular vision measurement system based on a dual-core heterogeneous architecture according to claim 5, characterized in that: Internal fill rate R Area The threshold is 0.
9.
7. A monocular vision measurement system based on a dual-core heterogeneous architecture according to claim 5 or 6, characterized in that: The current detection module includes a signal conditioning circuit based on an operational amplifier, which amplifies and filters the voltage difference across the sampling resistor before inputting it to the ADC interface of the control unit. The human-machine interaction module is a serial port touch screen that communicates with the control unit via the UART protocol to realize the real-time display of measurement data and the reception of user commands; The vision processing unit is a K210 or K230 chip, and the control unit is an STM32 series microcontroller. The two interact with each other for data and instructions through a UART or SPI interface.
8. A monocular vision measurement method based on a dual-core heterogeneous architecture, which utilizes the monocular vision measurement system based on a dual-core heterogeneous architecture as described in claim 7, characterized in that: Includes the following steps: The image acquisition module acquires a monocular image containing both a standard reference object and the target object. The vision processing unit identifies standard reference objects and performs perspective correction on them, establishing a mapping relationship between image pixels and actual physical dimensions; Identify the target object within a standard reference and extract its pixel dimensions; Based on the mapping relationship and the pixel size of the target, the actual physical size of the target and its distance from the camera are calculated; The control unit synchronously collects the system power consumption and sends the measurement results to the human-machine interaction module for display.
9. A monocular vision measurement method based on a dual-core heterogeneous architecture according to claim 8, characterized in that: It also includes system power management steps, such as reducing the operating frequency of the vision processing unit when it is idle, and enabling DMA data transfer in the control unit; The standard reference is an A4 sheet of paper, and the target object is a rectangular image that is completely located within the standard reference and has a fill rate greater than the fill rate threshold. During the identification of the standard reference object, if there are multiple rectangular outlines in the image, they are sorted by area from largest to smallest, and proportional verification and inclusion relationship verification are performed in sequence to determine the unique outer frame of the standard reference object and the inner frame of the target object.