A method for rapid positioning of the surface contour of engine block and cylinder head machining based on local area
By optimizing the contour matching algorithm through scaling and Gaussian blur preprocessing, the problem of high computational complexity in automotive industry inspection of high-resolution images is solved, achieving fast and accurate feature localization, which is suitable for complex and detailed image analysis.
Patent Information
- Application Number
- CN202411004448.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2044-07-25
AI Technical Summary
In automotive industry inspection, the processing of high-resolution images leads to excessive computational burden. Perspective transformation and contour localization calculations are highly complex, resulting in increased memory consumption and affecting inspection efficiency and accuracy.
A fast localization method for the machining surface contour of engine block and cylinder head based on local regions is adopted. The computational load is reduced by scaling and Gaussian blur preprocessing, and the contour matching algorithm is optimized, including Gaussian blur, contour feature extraction, transformation parameter search and optimal transformation parameter determination.
It significantly reduces computational load, increases processing speed, and maintains matching accuracy, making it suitable for complex and delicate automotive industry inspection tasks.
Smart Images

Figure CN118967790B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual inspection technology in the automotive industry, and is a method for rapid positioning of the surface contour of engine block and cylinder head machining in a local area. Background Technology
[0002] In the manufacturing process of automotive parts, product appearance defects are often a significant factor affecting product quality and reliability. However, traditional manual inspection methods are not only inefficient but also susceptible to subjective factors, making it difficult to guarantee the accuracy and consistency of the inspection.
[0003] With the rapid development of artificial intelligence, machine vision inspection technology has emerged. Utilizing high-precision industrial cameras to mimic human vision and capture product images, and through image processing algorithms, it can quickly and accurately detect defects such as scratches, deformations, dirt, oxidation, cracks, and dents on the surface of automotive parts. This achieves automated inspection, improves work efficiency, and reduces production costs.
[0004] The visual inspection equipment uses a vibratory feeder to automatically feed materials onto the inspection platform. Then, an industrial camera takes high-speed photos of the moving products. The machine vision inspection software system then performs high-speed, high-precision, and high-stability real-time detection, analysis, and calculation on the photos to determine whether the samples are qualified. Finally, the results are output, statistically analyzed, and defective products are automatically rejected.
[0005] Visual inspection equipment is widely used in various manufacturing industries, such as electronics, machinery, automotive, and medical fields. It can detect various surface defects in parts, such as dimensional scratches, cracks, missing materials, breaks, foreign objects, burrs, internal blockages, inner and outer diameter discrepancies, color discrepancies, and mixed materials. Visual inspection equipment can be automated and linked with other production equipment to identify issues such as incorrect or missing materials, and mixed materials. In practical applications, it enables automated control of the entire production process. Furthermore, visual inspection equipment can also automate packaging, thus providing strong support for product quality control throughout the production process.
[0006] In the automotive industry inspection field, image processing is a crucial step in ensuring product quality. Due to the complexity and precision of automotive parts, the images involved are typically high-resolution, with pixel sizes ranging from 5 to 20 megapixels. These high-resolution images provide rich detail for inspection, but also present some challenges.
[0007] First, high-resolution images mean a significantly larger amount of data to process. In image analysis, especially computationally intensive tasks involving perspective transformation and contour localization, the sheer volume of pixel data significantly increases the computational burden. Perspective transformation is a geometric transformation that simulates the projection from three-dimensional space to a two-dimensional plane, typically requiring complex mathematical calculations, including matrix operations and inverse transformations. For high-resolution images, the complexity and time required for these calculations increase exponentially.
[0008] Secondly, contour localization is another crucial step in image processing, particularly in defect detection and feature recognition. In high-resolution images, contours can be very fine or complex, requiring precise edge detection algorithms for identification. These algorithms need to evaluate each pixel, calculate gradient magnitude and direction, and then further refine them through non-maximum suppression and hysteresis thresholding. Performing these operations on high-resolution images results in significant computational latency.
[0009] Furthermore, memory usage becomes an issue when processing such large images. High-resolution images require significant storage space, potentially increasing memory consumption and even exceeding system limits in some cases. This necessitates efficient memory management and image processing algorithms to ensure image processing tasks can be completed even with limited hardware resources. Summary of the Invention
[0010] To address the shortcomings of existing technologies and the challenges they face when processing high-resolution images, particularly in the automotive industry inspection field where image pixel sizes are large (typically between 5 and 20 megapixels), this invention proposes a rapid contour localization method for engine block and cylinder head machining surfaces based on local regions. In this area, perspective transformation and contour localization calculations are not only time-consuming but also computationally resource-intensive.
[0011] This invention provides a method for rapid positioning of the surface contour of an engine block and cylinder head based on a local area. The invention provides the following technical solution:
[0012] A method for rapid positioning of the machining surface contour of engine block and cylinder head based on a local area includes the following steps:
[0013] Step 1: Select a high-resolution reference image. Choose a high-resolution image as the reference image. The image should cover the features to be detected and be captured using a high-pixel industrial camera to ensure image quality.
[0014] Step 2: Adjust the size of the reference image and determine a scaling factor to reduce the size of the reference image;
[0015] Step 3: Gaussian blur processing. Apply Gaussian blur to the scaled reference image to reduce image noise and enhance edge features;
[0016] Step 4: Contour feature extraction. Based on Gaussian blur, extract the contours of the image.
[0017] Step 5: Define the preset search range for transformation parameters, including the search range for rotation angle, perspective transformation parameters, and offset.
[0018] Step 6: Resizing and Feature Extraction of the New Image. Repeat steps 2 and 3 on the new image to obtain the resized and Gaussian blurred image and its contour features;
[0019] Step 7: Contour matching and standard deviation calculation. Within the preset search range, the contour features of the reference image and the new image are matched, and the standard deviation is calculated.
[0020] Step 8: Determine the optimal transformation parameters. Iterate through all parameter combinations defined in Step 5. For each parameter combination, execute Step 7, record the matching score of each parameter combination, and select the parameter combination with the highest score as the optimal solution.
[0021] Step 9: Adjust the 2D homogeneous transformation matrix. Based on the optimal transformation parameters, output the 2D homogeneous transformation matrix and divide the offset in it by the scaling factor to fit the original image size.
[0022] Step 10: Perform precise positioning of the reference image. Use the adjusted 2D homogeneous transformation matrix to transform the reference image to achieve precise positioning in the new image.
[0023] Preferably, step 2 specifically comprises:
[0024] The reference image is scaled using linear interpolation. The scaling factor k is calculated as target size / original size / original size. When the target size is half of the original size, k = 0.5. This scaling factor is then applied to scale the image using nearest neighbor, bilinear, or cubic interpolation methods.
[0025] Preferably, step 3 specifically comprises:
[0026] Define the specific size and standard deviation of the Gaussian kernel, and choose a kernel size of 5×5 or 7×7.
[0027] Preferably, step 4 specifically comprises:
[0028] In the Canny algorithm, two thresholds are set: a high threshold and a low threshold. The high threshold is 50 and the low threshold is 20 to determine strong and weak edges.
[0029] Preferably, step 5 specifically includes:
[0030] Define the search range for rotation angle, perspective transformation parameters, and offset for image matching;
[0031] Determine the search range for the rotation angle θ (-30°, 30°), the search range for the perspective transformation parameters, the translation and scaling factors, and the search range for the offset (dx, dy) (-50 pixels, 50 pixels).
[0032] Preferably, step 7 specifically includes:
[0033] Use Hough transform or other contour feature matching algorithms to identify and match contour features between the reference image and the new image, and then calculate the standard deviation.
[0034] Preferably, the standard deviation operation in step 7 is specifically as follows:
[0035] The standard deviation is normalized to the range of 0-1 to obtain the matching score.
[0036] A rapid positioning system for the surface contour of engine block and cylinder head machining based on a local area, the system comprising:
[0037] The high-resolution reference image selection module selects a high-resolution image as the reference image. The image covers the features to be detected and is captured using a high-pixel industrial camera to ensure image quality.
[0038] A reference image resizing module determines a scaling factor to reduce the size of the reference image.
[0039] The Gaussian blur processing module applies a Gaussian blur to the scaled reference image, reducing image noise and enhancing edge features.
[0040] The contour feature extraction module extracts the contours of the image based on Gaussian blur.
[0041] The preset search module for transformation parameters defines the search range for rotation angle, perspective transformation parameters, and offset.
[0042] The module for resizing and extracting features of a new image repeats the operation on the new image to obtain the new image after resizing and Gaussian blurring, as well as its contour features.
[0043] The contour matching and standard deviation calculation module matches the contour features of the reference image and the new image within a preset search range and calculates the standard deviation.
[0044] The optimal transformation parameter determination module iterates through all parameter combinations, records the matching score of each parameter combination, and selects the parameter combination with the highest score as the optimal solution.
[0045] The 2D homogeneous transformation matrix adjustment module outputs a 2D homogeneous transformation matrix based on the optimal transformation parameters, and divides the offset in the matrix by the scaling factor to adapt it to the original image size.
[0046] The reference image precise positioning module uses an adjusted 2D homogeneous transformation matrix to transform the reference image, thereby achieving precise positioning in the new image.
[0047] A computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement a method for rapid positioning of the machining surface contour of an engine block cylinder head based on a local area.
[0048] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement a method for rapid positioning of the surface contour of an engine block cylinder head based on a local area.
[0049] The present invention has the following beneficial effects:
[0050] Compared with the prior art, the present invention:
[0051] The method of this invention significantly reduces computation and improves processing speed by introducing scaling and Gaussian blur preprocessing during image processing, while maintaining matching accuracy. Furthermore, through an optimized contour matching algorithm, this invention enables fast and accurate feature localization in high-resolution images, making it particularly suitable for complex and detailed image analysis tasks in the automotive industry inspection field. Attached Figure Description
[0052] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0053] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0054] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0055] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0056] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0057] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0058] The present invention will be described in detail below with reference to specific embodiments. Specific Implementation Example 1:
[0060] according to Figure 1 As shown, the specific optimized technical solution adopted by the present invention to solve the above-mentioned technical problems is: The present invention relates to a method for rapid positioning of the surface contour of engine cylinder block and cylinder head machining based on a local area.
[0061] A method for rapid positioning of the machining surface contour of engine block and cylinder head based on a local area includes the following steps:
[0062] Includes the following steps:
[0063] Step 1: Select a high-resolution reference image. Choose a high-resolution image as the reference image. The image should cover the features to be detected and be captured using a high-pixel industrial camera to ensure image quality.
[0064] Step 2: Adjust the size of the reference image and determine a scaling factor to reduce the size of the reference image;
[0065] Step 3: Gaussian blur processing. Apply Gaussian blur to the scaled reference image to reduce image noise and enhance edge features;
[0066] Step 4: Contour feature extraction. Based on Gaussian blur, extract the contours of the image.
[0067] Step 5: Define the preset search range for transformation parameters, including the search range for rotation angle, perspective transformation parameters, and offset.
[0068] Step 6: Resizing and Feature Extraction of the New Image. Repeat steps 2 and 3 on the new image to obtain the resized and Gaussian blurred image and its contour features;
[0069] Step 7: Contour matching and standard deviation calculation. Within the preset search range, the contour features of the reference image and the new image are matched, and the standard deviation is calculated.
[0070] Step 8: Determine the optimal transformation parameters. Iterate through all parameter combinations defined in Step 5. For each parameter combination, execute Step 7, record the matching score of each parameter combination, and select the parameter combination with the highest score as the optimal solution.
[0071] Step 9: Adjust the 2D homogeneous transformation matrix. Based on the optimal transformation parameters, output the 2D homogeneous transformation matrix and divide the offset in it by the scaling factor to fit the original image size.
[0072] Step 10: Perform precise positioning of the reference image. Use the adjusted 2D homogeneous transformation matrix to transform the reference image to achieve precise positioning in the new image.
[0073] This invention significantly reduces computation and improves processing speed by introducing scaling and Gaussian blur preprocessing during image processing, while maintaining matching accuracy. Furthermore, through an optimized contour matching algorithm, this invention enables fast and accurate feature localization in high-resolution images, making it particularly suitable for complex and detailed image analysis tasks in the automotive industry inspection field. Specific Implementation Example 2:
[0075] The difference between Embodiment 2 and Embodiment 1 of the present invention lies only in:
[0076] Step 2 specifically involves:
[0077] The reference image is scaled using linear interpolation. The scaling factor k is calculated as target size / original size / original size. When the target size is half of the original size, k = 0.5. This scaling factor is then applied to scale the image using nearest neighbor, bilinear, or cubic interpolation methods. Specific Implementation Example 3:
[0079] The difference between Embodiment 3 and Embodiment 2 of the present invention lies only in:
[0080] Step 3 specifically involves:
[0081] Define the specific size and standard deviation of the Gaussian kernel, and choose a kernel size of 5×5 or 7×7. Specific Implementation Example 4:
[0083] The only difference between Embodiment 4 and Embodiment 3 of the present invention is that:
[0084] Step 4 specifically involves:
[0085] In the Canny algorithm, two thresholds are set: a high threshold and a low threshold. The high threshold is 50 and the low threshold is 20 to determine strong and weak edges. Specific Implementation Example 5:
[0087] The difference between Embodiment 5 and Embodiment 4 of the present invention lies only in:
[0088] Step 5 specifically involves:
[0089] Define the search range for rotation angle, perspective transformation parameters, and offset for image matching;
[0090] Determine the search range for the rotation angle θ (-30°, 30°), the search range for the perspective transformation parameters, the translation and scaling factors, and the search range for the offset (dx, dy) (-50 pixels, 50 pixels). Specific Implementation Example Six:
[0092] The difference between Embodiment Six and Embodiment Five of the present invention lies only in:
[0093] Step 7 specifically includes:
[0094] Use Hough transform or other contour feature matching algorithms to identify and match contour features between the reference image and the new image, and then calculate the standard deviation. Specific Implementation Example 7:
[0096] The difference between Embodiment Seven and Embodiment Six of the present invention lies only in:
[0097] The standard deviation operation in step 7 is as follows:
[0098] The standard deviation is normalized to the range of 0-1 to obtain the matching score. Specific Implementation Example 8:
[0100] The difference between Embodiment 8 and Embodiment 7 of the present invention lies only in:
[0101] This invention provides a rapid positioning system for the surface contour of engine block and cylinder head machining based on a local area, the system comprising:
[0102] The high-resolution reference image selection module selects a high-resolution image as the reference image. The image covers the features to be detected and is captured using a high-pixel industrial camera to ensure image quality.
[0103] A reference image resizing module determines a scaling factor to reduce the size of the reference image.
[0104] The Gaussian blur processing module applies a Gaussian blur to the scaled reference image, reducing image noise and enhancing edge features.
[0105] The contour feature extraction module extracts the contours of the image based on Gaussian blur.
[0106] The preset search module for transformation parameters defines the search range for rotation angle, perspective transformation parameters, and offset.
[0107] The module for resizing and extracting features of a new image repeats the operation on the new image to obtain the new image after resizing and Gaussian blurring, as well as its contour features.
[0108] The contour matching and standard deviation calculation module matches the contour features of the reference image and the new image within a preset search range and calculates the standard deviation.
[0109] The optimal transformation parameter determination module iterates through all parameter combinations, records the matching score of each parameter combination, and selects the parameter combination with the highest score as the optimal solution.
[0110] The 2D homogeneous transformation matrix adjustment module outputs a 2D homogeneous transformation matrix based on the optimal transformation parameters, and divides the offset in the matrix by the scaling factor to adapt it to the original image size.
[0111] The reference image precise positioning module uses an adjusted 2D homogeneous transformation matrix to transform the reference image, thereby achieving precise positioning in the new image. Specific Implementation Example Nine:
[0113] The difference between Embodiment Nine and Embodiment Eight of the present invention lies only in:
[0114] The present invention provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement a method for rapidly locating the surface contour of an engine block cylinder head based on a local area.
[0115] The technical solution of the present invention includes the following steps:
[0116] Step 1: Selection of high-resolution reference images
[0117] Select a high-resolution image with sufficient detail as a reference image. This image should cover the features to be detected and be captured using a high-resolution industrial camera to ensure image quality.
[0118] Step 2: Resizing the reference image
[0119] Determine a scaling factor to reduce the size of the reference image, thereby reducing the computational burden. Scale the reference image using linear interpolation. Calculate the scaling factor k = target size / original size / original size / target size. For example, if the target size is half the original size, then k = 0.5. Apply this scaling factor to scale the image using methods such as nearest neighbor, bilinear, or cubic interpolation.
[0120] Step 3: Gaussian blur processing
[0121] Gaussian blur is applied to the scaled reference image to reduce image noise and enhance edge features, preparing for subsequent contour extraction.
[0122] Step 4: Contour Feature Extraction
[0123] Building upon Gaussian blur, the Canny edge detection algorithm or other similar algorithms are used to extract the image contours. An appropriate threshold is set to determine edge strength, distinguishing true edges from noise.
[0124] Step 5: Preset search range for transformation parameters
[0125] Define the search ranges for the rotation angle, perspective transformation parameters, and offset, which will be used for image matching in subsequent steps. Determine the search ranges for the rotation angle θ (e.g., -30° to 30°), the perspective transformation parameters (e.g., translation and scaling factors), and the offset (dx, dy) (e.g., -50 pixels to 50 pixels).
[0126] Step 6: Resizing and Feature Extraction of the New Image
[0127] Repeat steps 2 and 3 on the new image to obtain a new image after resizing and Gaussian blurring, along with its contour features.
[0128] Step 7: Contour matching and standard deviation calculation
[0129] Within a preset search range, the contour features of the baseline image and the new image are matched, and the standard deviation between them is calculated. The standard deviation is normalized to the range of 0-1 to obtain the matching score.
[0130] Step 8: Determining the optimal transformation parameters
[0131] Iterate through all parameter combinations defined in step 5, execute step 7 for each parameter combination, record the matching score of each parameter combination, and select the parameter combination with the highest score as the optimal solution.
[0132] Step 9: Adjusting the 2D homogeneous transformation matrix
[0133] Based on the optimal transformation parameters, a 2D homogeneous transformation matrix is output, and the offset in it is divided by the scaling factor to fit the original image size.
[0134] Step 10: Precise positioning of the reference image
[0135] By using the adjusted 2D homogeneous transformation matrix, the reference image is transformed to achieve precise positioning in the new image.
[0136] Preferably, step 3 specifically comprises:
[0137] Define the specific size and standard deviation of the Gaussian kernel. For example, you can choose a kernel size of 5×5 or 7×7, depending on the specific situation of the image.
[0138] Step 4 specifically involves setting two thresholds in the Canny algorithm: a high threshold and a low threshold, for example, a high threshold of 50 and a low threshold of 20, to determine strong and weak edges.
[0139] Step 7 specifically involves using Hough transform or other contour feature matching algorithms to identify and match contour features between the reference image and the new image, and then calculating the standard deviation between them.
[0140] Through these detailed steps, the present invention provides a method for rapid and accurate perspective transformation and contour localization of high-resolution images in automotive industrial inspection.
[0141] The method of this invention significantly reduces computation and improves processing speed by introducing scaling and Gaussian blur preprocessing during image processing, while maintaining matching accuracy. Furthermore, through an optimized contour matching algorithm, this invention enables fast and accurate feature localization in high-resolution images, making it particularly suitable for complex and detailed image analysis tasks in the automotive industry inspection field. Specific Implementation Example 10:
[0143] The only difference between Embodiment 10 and Embodiment 9 of the present invention is that:
[0144] The present invention provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement a method for rapid positioning of the surface contour of an engine block and cylinder head based on a local area.
[0145] The method includes the following steps:
[0146] Step 1: Select a high-resolution reference image. Choose a high-resolution image as the reference image. The image should cover the features to be detected and be captured using a high-pixel industrial camera to ensure image quality.
[0147] Step 2: Adjust the size of the reference image and determine a scaling factor to reduce the size of the reference image;
[0148] Step 3: Gaussian blur processing. Apply Gaussian blur to the scaled reference image to reduce image noise and enhance edge features;
[0149] Step 4: Contour feature extraction. Based on Gaussian blur, extract the contours of the image.
[0150] Step 5: Define the preset search range for transformation parameters, including the search range for rotation angle, perspective transformation parameters, and offset.
[0151] Step 6: Resizing and Feature Extraction of the New Image. Repeat steps 2 and 3 on the new image to obtain the resized and Gaussian blurred image and its contour features;
[0152] Step 7: Contour matching and standard deviation calculation. Within the preset search range, the contour features of the reference image and the new image are matched, and the standard deviation is calculated.
[0153] Step 8: Determine the optimal transformation parameters. Iterate through all parameter combinations defined in Step 5. For each parameter combination, execute Step 7, record the matching score of each parameter combination, and select the parameter combination with the highest score as the optimal solution.
[0154] Step 9: Adjust the 2D homogeneous transformation matrix. Based on the optimal transformation parameters, output the 2D homogeneous transformation matrix and divide the offset in it by the scaling factor to fit the original image size.
[0155] Step 10: Perform precise positioning of the reference image. Use the adjusted 2D homogeneous transformation matrix to transform the reference image to achieve precise positioning in the new image.
[0156] This invention significantly reduces computation and improves processing speed by introducing scaling and Gaussian blur preprocessing during image processing, while maintaining matching accuracy. Furthermore, through an optimized contour matching algorithm, this invention enables fast and accurate feature localization in high-resolution images, making it particularly suitable for complex and detailed image analysis tasks in the automotive industry inspection field. Specific Implementation Example Eleven:
[0158] The only difference between Embodiment Eleven and Embodiment Ten of this invention is that:
[0159] Step 1: Selection of high-resolution reference images
[0160] - Select a high-resolution image with sufficient detail as a reference image, ensuring that the image covers all feature regions to be detected.
[0161] - Use a high-resolution industrial camera to capture images to ensure image quality.
[0162] Step 2: Resizing the reference image
[0163] - Determine a scaling factor to reduce the size of the reference image, thereby reducing the computational burden.
[0164] - The reference image is scaled using a linear interpolation method.
[0165] - Calculate the scaling factor k = target size / original size.
[0166] Step 3: Gaussian blur processing
[0167] - Apply Gaussian blur to the scaled reference image to reduce image noise and enhance edge features, preparing for subsequent contour extraction.
[0168] - Define the specific size and standard deviation of the Gaussian kernel (e.g., choose a kernel size of 5×5 or 7×7).
[0169] Step 4: Contour Feature Extraction
[0170] -Based on Gaussian blur, the Canny edge detection algorithm is used to extract the contours of the image.
[0171] - Set appropriate high and low thresholds to determine edge strength (e.g., a high threshold of 50 and a low threshold of 20).
[0172] Step 5: Preset search range for transformation parameters
[0173] - Define the search range for rotation angle, perspective transformation parameters, and offset.
[0174] - Determine the search range for the rotation angle θ (e.g., -30° to 30°), the search range for the perspective transformation parameters (translation and scaling factors), and the search range for the offset (dx, dy) (e.g., -50 pixels to 50 pixels).
[0175] Step 6: Resizing and Feature Extraction of the New Image
[0176] - Repeat steps 2 and 3 on the new image to obtain a new image after resizing and Gaussian blurring, along with its contour features.
[0177] Step 7: Contour matching and standard deviation calculation
[0178] - Within a preset search range, the contour features of the baseline image and the new image are matched, and the standard deviation between them is calculated.
[0179] - Use Hough transform or other contour feature matching algorithms to identify and match contour features between the reference image and the new image, and then calculate the standard deviation between them.
[0180] Step 8: Determining the optimal transformation parameters
[0181] - Iterate through all the parameter combinations defined in step 5, and execute step 7 for each parameter combination.
[0182] - Record the matching score for each parameter combination and select the parameter combination with the highest score as the optimal solution.
[0183] Step 9: Adjusting the 2D homogeneous transformation matrix
[0184] - Output a 2D homogeneous transformation matrix based on the optimal transformation parameters.
[0185] - Divide the offset by the scaling factor to fit the original image size.
[0186] Step 10: Precise positioning of the reference image
[0187] - By using the adjusted 2D homogeneous transformation matrix, the reference image is transformed to achieve precise positioning in the new image.
[0188] These detailed steps enable fast and accurate perspective transformation and contour localization of high-resolution images, making them particularly suitable for image processing tasks in automotive industry inspection. Each step has been optimized to ensure processing speed and accuracy, guaranteeing feasibility and effectiveness in practical applications.
[0189] The method of this invention significantly reduces computation and improves processing speed by introducing scaling and Gaussian blur preprocessing during image processing, while maintaining matching accuracy. Furthermore, through an optimized contour matching algorithm, this invention enables fast and accurate feature localization in high-resolution images, making it particularly suitable for complex and detailed image analysis tasks in the automotive industry inspection field.
[0190] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or N embodiments or examples. Furthermore, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of the present invention, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified. Any process or method described in the flowcharts or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more N executable instructions for implementing custom logical functions or processes, and the scope of preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order according to the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain. The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection having one or N wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic device, and portable optical disc read-only memory (CDROM).Furthermore, the computer-readable medium can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory. It should be understood that various parts of the invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0191] The above description is merely a preferred embodiment of a method for rapid positioning of the surface contour of a local engine block and cylinder head. The scope of protection for this method is not limited to the above embodiments; all technical solutions falling within this conceptual framework are within the scope of protection of this invention. It should be noted that for those skilled in the art, any improvements and variations made without departing from the principles of this invention should also be considered within the scope of protection of this invention.
Claims
1. A method for rapid positioning of the surface contour of engine block and cylinder head machining based on a local area, characterized in that: Includes the following steps: Step 1: Select a high-resolution reference image. Choose a high-resolution image as the reference image. The image should cover the features to be detected and be captured using a high-pixel industrial camera to ensure image quality. Step 2: Adjust the size of the reference image and determine a scaling factor to reduce the size of the reference image; Step 3: Gaussian blur processing. Apply Gaussian blur to the scaled reference image to reduce image noise and enhance edge features; Step 4: Contour feature extraction. Based on Gaussian blur, extract the contours of the image. Step 4 specifically involves: In the Canny algorithm, two thresholds are set: a high threshold and a low threshold. The high threshold is 50 and the low threshold is 20 to determine strong and weak edges. Step 5: Define the preset search range for transformation parameters, including the search range for rotation angle, perspective transformation parameters, and offset. Step 6: Resizing and feature extraction of the new image. Repeat steps 2 and 3 on the new image to obtain the new image after resizing and Gaussian blurring and its contour features. Step 7: Contour matching and standard deviation calculation. Within the preset search range, the contour features of the reference image and the new image are matched, and the standard deviation is calculated. Step 7 specifically includes: Use Hough transform or other contour feature matching algorithms to identify and match contour features between the reference image and the new image, and then calculate the standard deviation; Step 8: Determine the optimal transformation parameters. Iterate through all parameter combinations defined in Step 5. For each parameter combination, execute Step 7, record the matching score of each parameter combination, and select the parameter combination with the highest score as the optimal solution. Step 9: Adjust the 2D homogeneous transformation matrix. Based on the optimal transformation parameters, output the 2D homogeneous transformation matrix and divide the offset in it by the scaling factor to fit the original image size. Step 10: Perform precise positioning of the reference image. Use the adjusted 2D homogeneous transformation matrix to transform the reference image to achieve precise positioning in the new image.
2. The method according to claim 1, characterized in that: Step 2 specifically involves: The reference image is scaled using a linear interpolation method. The scaling factor k is calculated as target size / original size. When the target size is half of the original size, k = 0.
5. This scaling factor is then applied to scale the image using nearest neighbor, bilinear, or cubic interpolation methods.
3. The method according to claim 2, characterized in that: Step 3 specifically involves: Define the specific size and standard deviation of the Gaussian kernel, and choose a kernel size of 5×5 or 7×7.
4. The method according to claim 3, characterized in that: Step 5 specifically involves: Define the search range for rotation angle, perspective transformation parameters, and offset for image matching; Determine the search range for the rotation angle θ (-30°, 30°), the search range for the perspective transformation parameters, the translation and scaling factors, and the search range for the offset (dx, dy) (-50 pixels, 50 pixels).
5. The method according to claim 4, characterized in that: The standard deviation operation in step 7 is as follows: The standard deviation is normalized to the range of 0-1 to obtain the matching score.
6. A rapid positioning system for the surface contour of an engine block and cylinder head machined in a local area, the system operating based on the method of claim 1, characterized in that: The system includes: The high-resolution reference image selection module selects a high-resolution image as the reference image. The image covers the features to be detected and is captured using a high-pixel industrial camera to ensure image quality. A reference image resizing module determines a scaling factor to reduce the size of the reference image. The Gaussian blur processing module applies a Gaussian blur to the scaled reference image, reducing image noise and enhancing edge features. The contour feature extraction module extracts the contours of the image based on Gaussian blur. The preset search module for transformation parameters defines the search range for rotation angle, perspective transformation parameters, and offset. The module for resizing and extracting features of a new image repeats the operation on the new image to obtain the new image after resizing and Gaussian blurring, as well as its contour features. The contour matching and standard deviation calculation module matches the contour features of the reference image and the new image within a preset search range and calculates the standard deviation. The optimal transformation parameter determination module iterates through all parameter combinations, records the matching score of each parameter combination, and selects the parameter combination with the highest score as the optimal solution. The 2D homogeneous transformation matrix adjustment module outputs a 2D homogeneous transformation matrix based on the optimal transformation parameters, and divides the offset in the matrix by the scaling factor to adapt it to the original image size. The reference image precise positioning module uses an adjusted 2D homogeneous transformation matrix to transform the reference image, thereby achieving precise positioning in the new image.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the method as claimed in any one of claims 1-5.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the method of any one of claims 1-5.
Citation Information
Patent Citations
Image processor, image processing method, program and recording medium
JP2011192066A
