Image boundary sharpening algorithm, device and control system based on FPGA language

By using an image boundary sharpening algorithm based on the Laplace operator, the problem of limited FPGA resources and the inability to perform iterative operations is solved. This algorithm achieves precise sharpening of fine boundaries and reduction of noise, improving image clarity and coherence, and is suitable for image processing in industrial microscopes.

CN116523764BActive Publication Date: 2026-06-16BEIJING RUIZHI AOHENG VISION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING RUIZHI AOHENG VISION TECH CO LTD
Filing Date
2023-01-18
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing image sharpening algorithms, when limited by FPGA resources and unable to perform iterative operations, struggle to achieve precise sharpening of fine boundaries and reduce noise increase, thus failing to meet the image processing requirements of industrial microscopes.

Method used

An image boundary sharpening algorithm based on the Laplace operator is adopted. The RGB signal is converted into YUV data, and the Laplace operator template is used to perform convolution operation to calculate the MaxLine value. Boundary points are judged and sharpened within a preset range. Combined with gradient thresholding and interpolation, isolated point noise is reduced.

Benefits of technology

It achieves precise sharpening of fine boundaries with limited resources, reduces isolated point noise, improves image coherence and clarity, and meets the image processing needs of industrial microscopes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116523764B_ABST
    Figure CN116523764B_ABST
Patent Text Reader

Abstract

The application relates to an image boundary sharpening algorithm, device and control system based on FPGA language, which converts an RGB signal into YUV data by acquiring a picture; performs convolution operation on the Y component of a current pixel point in the picture based on a Laplace operator template, calculates and obtains the MaxLine value of the current pixel point; calculates the MaxLine value of all other pixel points within N*N of the current pixel point, and calculates the sum value of the MaxLine values of all other pixel points; if the sum value of all other pixel points is greater than 0 and the MaxLine value of the current pixel point is equal to 1, the current pixel point is determined as a boundary point needing to be sharpened, and the final sharpening value is calculated. The boundary point meeting the sharpening condition is calculated and found through the Laplace operator template, and the boundary point is subjected to sharpening treatment, which is used for continuous sharpening and higher image effect. The algorithm occupies less resources, and can reduce the noise of isolated points.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the technical field, and in particular to an image boundary sharpening algorithm, apparatus, and control system based on FPGA language. Background Technology

[0002] The camera needs to be implemented on an FPGA, and it requires fast real-time data processing while ensuring low latency, so iterative operations are not possible and resources are limited.

[0003] Currently available algorithms, such as image sharpening algorithms, are image processing methods that make image edges clearer. A common approach is to extract the high-frequency components of the image and superimpose them onto the original image. There are two methods for extracting high-frequency components: one is to use a high-pass filter to obtain the high-frequency components, and the other is to use a low-pass filter to subtract the low frequencies from the original image to obtain the high frequencies. Methods for directly extracting high frequencies include the Sobel algorithm and the Laplcian operator. The Sobel operator is the first derivative of the image and extracts gradient information, which is divided into horizontal and vertical types. It is often used for edge detection and direction determination. The Sobel operator is not zero at slopes, thus producing relatively coarse edges.

[0004] Therefore, the above algorithms mainly enhance the high-frequency components of the image. However, if you want to use small resources and avoid iterative methods, these methods are not very practical. At the same time, sharpening may increase isolated noise.

[0005] However, the demands of industrial microscope environments require precise sharpening of very fine boundaries while ensuring as much continuous sharpening as possible to achieve higher image quality. Therefore, it is necessary to improve the algorithm to enhance the image boundary sharpening effect. Summary of the Invention

[0006] To address the aforementioned issues, this application proposes an image boundary sharpening algorithm, apparatus, and control system based on FPGA language.

[0007] This application proposes an image boundary sharpening algorithm based on FPGA language, characterized by the following steps:

[0008] Acquire the image and convert the RGB signal to YUV data;

[0009] Based on the Laplace operator template, the Y component of the current pixel in the image is convolved to calculate and obtain the MaxLine value of the current pixel.

[0010] Find the MaxLine value of all other pixels within an N×N radius of the current pixel, and calculate the sum of the MaxLine values ​​of all other pixels.

[0011] If the sum of all other pixels is greater than 0 and the MaxLine value of the current pixel is equal to 1, then the current pixel is identified as a boundary point that needs to be sharpened, and the final sharpening value is calculated.

[0012] As an optional implementation of this application, optionally, based on the Laplace operator template, a convolution operation is performed on the Y component of the current pixel in the image to calculate and obtain the MaxLine value of the current pixel, including:

[0013] Use the Laplace operator to construct a Laplace operator template;

[0014] Perform non-maximum X suppression operation, and use the constructed Laplace operator template X to convolve the X component of the current pixel to calculate the gayX component.

[0015] Perform Y component convolution operation, using the constructed Laplace operator template Y to convolve the Y component of the current pixel, and calculate the gayY component;

[0016] Calculate the sum of the absolute values ​​of the gayX component and the gayY component to obtain grad:

[0017] grad = absolute value of gayX component + absolute value of gayY component;

[0018] Let dTemp = grad.

[0019] As an optional implementation of this application, optionally, based on the Laplace operator template, a convolution operation is performed on the Y component of the current pixel in the image to calculate and obtain the MaxLine value of the current pixel, further comprising:

[0020] Calculate the gradient value of the current pixel based on the gayX and gayY components;

[0021] The gradient values ​​are interpolated to obtain the gradient threshold of the current pixel.

[0022] Within a preset range, determine whether the dTemp of the current pixel exceeds the gradient threshold:

[0023] If so, MaxLine = 1, and the current pixel needs to be sharpened;

[0024] Otherwise, if MaxLine = 0, the current pixel does not need to be detected.

[0025] As an optional implementation of this application, optionally, the gradient value of the current pixel is calculated based on the gayX component and the gayY component, including:

[0026] (1) If the gayY component is larger than the gayX component, it means that the derivative direction tends towards the y component, then:

[0027] g2 = grad[nPos - w];

[0028] g4 = grad[nPos + w];

[0029] If the values ​​of the gayX component and the gayY component have the same sign, then:

[0030] g1 = grad[nPos-w-1];

[0031] g3 = grad[nPos + w + 1];

[0032] If the values ​​of the gayX component and the gayY component are not the same (positive and negative), then

[0033] g1 = grad[nPos-w+1];

[0034] g3 = grad[nPos + w - 1];

[0035] (2) If the gayX component is larger than the gayY component, it means that the derivative direction tends towards the x component, then:

[0036] g2 = grad[nPos+1];

[0037] g4 = grad[nPos-1];

[0038] If the values ​​of the gayX component and the gayY component have the same sign, then:

[0039] g1 = grad[nPos + w + 1];

[0040] g3 = grad[nPos-w-1];

[0041] If the values ​​of the gayX component and the gayY component are not the same (positive and negative), then:

[0042] g1 = grad[nPos-w+1];

[0043] g3 = grad[nPos + w - 1];

[0044] Where nPos refers to the current pixel, and w refers to the window size.

[0045] As an optional implementation of this application, the gradient value may be interpolated to obtain the gradient threshold of the current pixel, including:

[0046] Interpolate the gradient using g1 to g4:

[0047] dTemp1 = (g1 + g2) / 2;

[0048] dTemp2=(g3+g4) / 2.

[0049] As an optional implementation of this application, optionally, the MaxLine values ​​of all other pixels within N×N of the current pixel are obtained, and the sum of the MaxLine values ​​of all other pixels is calculated, including:

[0050] Get the dTemp of the current pixel. If (dTemp>=dTemp1) and (dTemp>=dTemp2), then MaxLine=1; otherwise, MaxLine=0.

[0051] Calculate the MaxLine value of all other pixels within N×N of the current pixel using the method described above;

[0052] The MaxLine values ​​of all other pixels within a range of N×N are summed to obtain the sum of the MaxLine values ​​of all other pixels within a range of N×N.

[0053] As an optional implementation of this application, optionally, calculating the final sharpening value includes:

[0054] Get the sharpness value of the current pixel and determine whether the sharpness value is positive or negative:

[0055] When the sharpness value is positive, it is considered an increase; if it is greater than 255 minus the target value, it is equal to 255 minus the target value.

[0056] When the sharpness value is negative, it is determined to decrease. If the sharpness value is greater than the current value, the sharpness value is set to equal the current value. Then, it is added to the center point value of the original value to obtain the final sharpening value.

[0057] In another aspect, this application proposes an apparatus for implementing the aforementioned FPGA-based image boundary sharpening algorithm, comprising:

[0058] The image acquisition module is used to acquire images and convert RGB signals into YUV data;

[0059] The operator convolution module is used to perform convolution operations on the Y component of the current pixel in the image based on the Laplace operator template, and calculate and obtain the MaxLine value of the current pixel.

[0060] The sum calculation module is used to obtain the MaxLine value of all other pixels within N×N of the current pixel, and to calculate the sum of the MaxLine values ​​of all other pixels;

[0061] The boundary point recognition module is used to identify the current pixel as a boundary point that needs to be sharpened if the sum of the values ​​of all other pixels is greater than 0 and the MaxLine value of the current pixel is equal to 1, and then calculates the final sharpening value.

[0062] In another aspect, this application also proposes a control system, comprising:

[0063] processor;

[0064] Memory used to store processor-executable instructions;

[0065] The processor is configured to implement the FPGA-based image boundary sharpening algorithm when executing the executable instructions.

[0066] Technical effects of the present invention:

[0067] This application acquires an image and converts the RGB signal into YUV data. Based on the Laplace operator template, it performs a convolution operation on the Y component of the current pixel in the image to calculate and obtain the MaxLine value of the current pixel. It then calculates the MaxLine values ​​of all other pixels within an N×N radius of the current pixel and sums these MaxLine values. If the sum of all other pixels is greater than 0 and the MaxLine value of the current pixel is equal to 1, the current pixel is identified as a boundary point requiring sharpening, and the final sharpening value is calculated. The Laplace operator template is used to calculate and find boundary points that meet the sharpening conditions, and these points are then sharpened. The Laplace operator is more suitable for image sharpening than the Sobel operator. For the demands of industrial microscope environments, images need precise sharpening of very fine boundaries while ensuring as much coherent sharpening as possible to achieve higher image quality. The image boundary sharpening algorithm in this application itself consumes fewer resources and reduces noise from isolated points.

[0068] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0069] The accompanying drawings, which are included in and form part of this specification, illustrate exemplary embodiments, features, and aspects of this disclosure together with the specification and serve to explain the principles of this disclosure.

[0070] Figure 1 The diagram illustrates the implementation flow of the image boundary sharpening algorithm based on FPGA language according to the present invention.

[0071] Figure 2 The image shown is a schematic diagram of the original drawing;

[0072] Figure 3 The image shown is the result of sharpening using the present invention. Detailed Implementation

[0073] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.

[0074] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.

[0075] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.

[0076] The laplcian operator is the second derivative of the image. Its value is not zero at the beginning and end of the image change, but it is zero during the gradual change. Therefore, the laplcian is more suitable for image sharpening than the Sobel operator.

[0077] This application addresses the requirements of industrial microscope environments, which demand precise sharpening of very fine boundaries while ensuring as much continuous sharpening as possible to achieve higher image quality. Therefore, an operator template based on the Laplace operator is used to process the image.

[0078] Example 1

[0079] In this embodiment, a 7x7 RAM buffer row is used to perform small-scale connectivity calculations to determine whether the current pixel is a continuous boundary, thereby performing sharpening calculations based on a specific operator. This reduces noise sharpening of isolated points, thus improving the sharpening effect of line boundaries.

[0080] In this embodiment, the Y component of the current pixel is selected for optimal processing. The U and V components can be processed in the same way as in this embodiment.

[0081] like Figure 1 As shown, this application proposes an image boundary sharpening algorithm based on FPGA language, characterized by the following steps:

[0082] S1. Acquire the image and convert the RGB signal to YUV data;

[0083] The image is the initial image captured by the camera. The technical solution for converting the RGB signals in the image to YUV data involves extracting the luminance information from the three RGB components and placing it into the Y component. Then, the hue and saturation information from the three RGB components are extracted and placed into the U and V components respectively. This process can be referenced from existing RGB to YUV conversion methods.

[0084] S2. Based on the Laplace operator template, perform a convolution operation on the Y component of the current pixel in the image, and calculate and obtain the MaxLine value of the current pixel.

[0085] As an optional implementation of this application, optionally, based on the Laplace operator template, a convolution operation is performed on the Y component of the current pixel in the image to calculate and obtain the MaxLine value of the current pixel, including:

[0086] Use the Laplace operator to construct a Laplace operator template;

[0087] Perform non-maximum X suppression operation, and use the constructed Laplace operator template X to convolve the X component of the current pixel to calculate the gayX component.

[0088] Perform Y component convolution operation, using the constructed Laplace operator template Y to convolve the Y component of the current pixel, and calculate the gayY component;

[0089] Calculate the sum of the absolute values ​​of the gayX component and the gayY component to obtain grad:

[0090] grad = absolute value of gayX component + absolute value of gayY component;

[0091] Let dTemp = grad.

[0092] 1. The Y component uses the Laplace operator. The operator template is as follows:

[0093]

[0094] That is: Y00*(-1)+Y01*(-4)+Y02*(-1)

[0095] +Y10*(-4)+Y11*(20)+Y12*(-4)

[0096] +Y20*(-1)+Y21*(-4)+Y22*(-1)

[0097] =M sharpness value.

[0098] 2. Determine whether to perform non-maximum suppression X operation, and use the following template to calculate gayX:

[0099]

[0100] Convolution is performed on X, gayX=Y00*(1)+Y01*(2)+Y02*(1)

[0101] +Y10*(0)+Y11*(0)+Y12*(0)

[0102] +Y20*(-1)+Y21*(-2)+Y22*(-1)

[0103] Use the following template to calculate gayY:

[0104]

[0105] Convolution is performed on Y, so gayY=Y00*(1)+Y01*(2)+Y02*(1)

[0106] +Y10*(0)+Y11*(0)+Y12*(0)

[0107] +Y20*(-1)+Y21*(-2)+Y22*(-1)

[0108] Then calculate abs(gayX) + abs(gayY) to get grad.

[0109] The absolute value of gayX + the absolute value of gayY = grad;

[0110] Let dTemp = grad.

[0111] Here, after calculating the dTemp of the current pixel, a threshold needs to be set to determine that areas below the threshold are smooth regions and do not require detection, thus avoiding unnecessary noise. This threshold (customizable) is taken as the overall average brightness value.

[0112] The judgment is as follows:

[0113] Calculate the gradient value of the current pixel based on the gayX and gayY components;

[0114] The gradient values ​​are interpolated to obtain the gradient threshold of the current pixel.

[0115] Within a preset range, determine whether the dTemp of the current pixel exceeds the gradient threshold:

[0116] If so, MaxLine = 1, and the current pixel needs to be sharpened;

[0117] Otherwise, if MaxLine = 0, the current pixel does not need to be detected.

[0118] As an optional implementation of this application, optionally, the gradient value of the current pixel is calculated based on the gayX component and the gayY component, including:

[0119] (1) If the gayY component is larger than the gayX component, it means that the derivative direction tends towards the y component, then:

[0120] g2 = grad[nPos - w];

[0121] g4 = grad[nPos + w];

[0122] If the values ​​of the gayX component and the gayY component have the same sign, then:

[0123] g1 = grad[nPos-w-1];

[0124] g3 = grad[nPos + w + 1];

[0125] If the values ​​of the gayX component and the gayY component are not the same (positive and negative), then

[0126] g1 = grad[nPos-w+1];

[0127] g3 = grad[nPos + w - 1];

[0128] (2) If the gayX component is larger than the gayY component, it means that the derivative direction tends towards the x component, then:

[0129] g2 = grad[nPos+1];

[0130] g4 = grad[nPos-1];

[0131] If the values ​​of the gayX component and the gayY component have the same sign, then:

[0132] g1 = grad[nPos + w + 1];

[0133] g3 = grad[nPos-w-1];

[0134] If the values ​​of the gayX component and the gayY component are not the same (positive and negative), then:

[0135] g1 = grad[nPos-w+1];

[0136] g3 = grad[nPos + w - 1];

[0137] Where nPos refers to the current pixel, and w refers to the window size.

[0138] As an optional implementation of this application, the gradient value may be interpolated to obtain the gradient threshold of the current pixel, including:

[0139] Interpolate the gradient using g1 to g4:

[0140] dTemp1 = (g1 + g2) / 2;

[0141] dTemp2=(g3+g4) / 2.

[0142] S3. Calculate the MaxLine value of all other pixels within N×N of the current pixel, and then calculate the sum of the MaxLine values ​​of all other pixels.

[0143] Calculate and obtain the gradient of the current pixel, and determine whether it is the maximum value in a local area (within a 3x3 range). If so, the point may be a boundary point.

[0144] If (dTemp>=dTemp1) and (dTemp>=dTemp2), then MaxLine=1; otherwise, MaxLine=0.

[0145] After calculating the MaxLine value of all points within a 3x3 area of ​​the current pixel, sum the values ​​of the 8 points within the surrounding 3x3 area. If the sum is greater than 0 and the MaxLine value of the current pixel is equal to 1, then the pixel needs to be sharpened.

[0146] S4. If the sum of all other pixels is greater than 0 and the MaxLine value of the current pixel is equal to 1, then the current pixel is identified as the boundary point that needs to be sharpened, and the final sharpening value is calculated.

[0147] As an optional implementation of this application, optionally, the MaxLine values ​​of all other pixels within N×N of the current pixel are obtained, and the sum of the MaxLine values ​​of all other pixels is calculated, including:

[0148] Get the dTemp of the current pixel. If (dTemp>=dTemp1) and (dTemp>=dTemp2), then MaxLine=1; otherwise, MaxLine=0.

[0149] Calculate the MaxLine value of all other pixels within N×N of the current pixel using the method described above;

[0150] The MaxLine values ​​of all other pixels within a range of N×N are summed to obtain the sum of the MaxLine values ​​of all other pixels within a range of N×N.

[0151] As an optional implementation of this application, optionally, calculating the final sharpening value includes:

[0152] Get the sharpness value of the current pixel and determine whether the sharpness value is positive or negative:

[0153] When the sharpness value is positive, it is considered an increase; if it is greater than 255 minus the target value, it is equal to 255 minus the target value.

[0154] When the sharpness value is negative, it is determined to decrease. If the sharpness value is greater than the current value, the sharpness value is set to equal the current value. Then, it is added to the center point value of the original value to obtain the final sharpening value.

[0155] For the sharpness value M of the current pixel that has been calculated according to the Laplace operator template, if the value of M is positive, it is determined to increase; if it is greater than 255 - target value, otherwise it is equal to 255 - target value. If the value of M is negative, it is determined to decrease; if it is greater than the current value, it is equal to the current value. Then it is added to the original value of the center point to obtain the final sharpening value.

[0156] As attached Figure 2 and 3 As shown in the comparison, after processing according to the final sharpening value, the image resolution is improved, making it clearer.

[0157] In this embodiment, to avoid iterative calculations, calculating grayX or grayY requires 3x3 data points. Determining whether the current pixel is a boundary point also requires 3x3 grayX and grayY data points, necessitating iteration. To avoid iteration, 5x5 data points need to be calculated at once. Furthermore, distinguishing whether boundary points are connected requires an additional 3x3 calculation.

[0158] Therefore, this needs to be expanded to 7x7. After expansion, first calculate the 5x5 gray area, and then calculate the 3x3 boundary points. Count whether the 8 points outside the surrounding points are boundary points. If there are more than 0, it is an isolated point, and this point does not need to be enhanced.

[0159] A 7x7 RAM buffer is used to perform small-scale connectivity calculations to determine whether the current pixel is a continuous boundary, thus enabling sharpening calculations based on specific operators. This reduces noise sharpening of isolated points, thereby improving the sharpening effect of line boundaries.

[0160] Therefore, this application achieves higher image quality by performing as much coherent sharpening as possible to reduce noise at isolated points.

[0161] It should be noted that although various matrix operator templates have been described above as examples, those skilled in the art will understand that this disclosure is not limited thereto. In fact, users can flexibly set the matrix values ​​according to the actual application scenario, as long as the technical functions of this application can be achieved by following the above technical methods.

[0162] Obviously, those skilled in the art should understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above control methods.

[0163] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the control methods described above. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.

[0164] Example 2

[0165] Based on the implementation principle of Embodiment 1, this application, in another aspect, proposes an apparatus for implementing the aforementioned image boundary sharpening algorithm based on FPGA language, comprising:

[0166] The image acquisition module is used to acquire images and convert RGB signals into YUV data;

[0167] The operator convolution module is used to perform convolution operations on the Y component of the current pixel in the image based on the Laplace operator template, and calculate and obtain the MaxLine value of the current pixel.

[0168] The sum calculation module is used to obtain the MaxLine value of all other pixels within N×N of the current pixel, and to calculate the sum of the MaxLine values ​​of all other pixels;

[0169] The boundary point recognition module is used to identify the current pixel as a boundary point that needs to be sharpened if the sum of the values ​​of all other pixels is greater than 0 and the MaxLine value of the current pixel is equal to 1, and then calculates the final sharpening value.

[0170] For details on the functions and interactive application principles of the above modules, please refer to Example 1.

[0171] The modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device, or fabricating them separately as individual integrated circuit modules, or fabricating multiple modules or steps into a single integrated circuit module. Thus, the present invention is not limited to any particular hardware and software combination.

[0172] Example 3

[0173] Furthermore, this application also proposes a control system, comprising:

[0174] processor;

[0175] Memory used to store processor-executable instructions;

[0176] The processor is configured to implement the FPGA-based image boundary sharpening algorithm when executing the executable instructions.

[0177] This disclosure discloses an embodiment of a system including a processor and a memory for storing processor-executable instructions. The processor is configured to implement, when executing the executable instructions, one of the image boundary sharpening algorithms based on an FPGA language as described above.

[0178] It should be noted here that the number of processors can be one or more. Furthermore, the control system in this embodiment may also include input devices and output devices. The processors, memory, input devices, and output devices can be connected via a bus or other means, without specific limitations herein.

[0179] As a computer-readable storage medium, memory can be used to store software programs, computer-executable programs, and various modules, such as the program or module corresponding to an image boundary sharpening algorithm based on FPGA language in this disclosure embodiment. The processor executes various functional applications and data processing of the control system by running the software programs or modules stored in the memory.

[0180] Input devices can be used to receive input digital numbers or signals. These signals can be key signals related to user settings and function control of the device / terminal / server. Output devices can include display devices such as screens.

[0181] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. An image boundary sharpening method based on FPGA language, characterized in that, Includes the following steps: Acquire the image and convert the RGB signal to YUV data; Based on the Laplace operator template, a convolution operation is performed on the Y component of the current pixel in the image to calculate and obtain the MaxLine value of the current pixel, including: Use the Laplace operator to construct a Laplace operator template; Perform non-maximum X suppression operation, and use the constructed Laplace operator template X to convolve the X component of the current pixel to calculate the gayX component. Perform Y component convolution operation, using the constructed Laplace operator template Y to convolve the Y component of the current pixel, and calculate the gayY component; Calculate the sum of the absolute values ​​of the gayX component and the gayY component to obtain grad: grad = absolute value of gayX component + absolute value of gayY component; Let dTemp = grad; Calculate the gradient value of the current pixel based on the gayX and gayY components; The gradient values ​​are interpolated to obtain the gradient threshold of the current pixel. Within a preset range, determine whether the dTemp of the current pixel exceeds the gradient threshold: If so, MaxLine = 1, and the current pixel needs to be sharpened; Otherwise, if MaxLine = 0, the current pixel does not need to be detected. (1) If the gayY component is larger than the gayX component, it means that the derivative direction tends towards the y component, then: g2 = grad[nPos-w]; g4 = grad[nPos+w]; If the values ​​of the gayX component and the gayY component have the same sign, then: g1 = grad[nPos-w-1]; g3 = grad[nPos+w+1]; If the values ​​of the gayX component and the gayY component are not the same (positive and negative), then g1 = grad[nPos-w+1]; g3 = grad[nPos+w-1]; (2) If the gayX component is larger than the gayY component, it means that the derivative direction tends towards the x component, then: g2 = grad[nPos+1]; g4 = grad[nPos-1]; If the values ​​of the gayX component and the gayY component have the same sign, then: g1 = grad[nPos+w+1]; g3 = grad[nPos-w-1]; If the values ​​of the gayX component and the gayY component are not the same (positive and negative), then: g1 = grad[nPos-w+1]; g3 = grad[nPos+w-1]; Where nPos refers to the current pixel, and w refers to the window size; Interpolate the gradient using g1~g4: dTemp1 = (g1+g2) / 2; dTemp2 = (g3+g4) / 2; Get the dTemp of the current pixel. If (dTemp >= dTemp1) and (dTemp >= dTemp2), then MaxLine = 1; otherwise, MaxLine = 0. Calculate the MaxLine value of all other pixels within N×N of the current pixel using the method described above; The MaxLine values ​​of all other pixels within N×N of the current pixel are summed to obtain the sum of the MaxLine values ​​of all other pixels within N×N of the current pixel. Find the MaxLine value of all other pixels within an N×N radius of the current pixel, and calculate the sum of the MaxLine values ​​of all other pixels. If the sum of all other pixels is greater than 0 and the MaxLine value of the current pixel is equal to 1, then the current pixel is identified as a boundary point that needs to be sharpened, and the final sharpening value is calculated.

2. The image boundary sharpening method based on FPGA language according to claim 1, characterized in that, Calculate the final sharpening value, including: Get the sharpness value of the current pixel and determine whether the sharpness value is positive or negative: When the sharpness value is positive, it is considered an increase; if it is greater than 255 minus the target value, it is equal to 255 minus the target value. When the sharpness value is negative, it is determined to decrease. If the sharpness value is greater than the current value, the sharpness value is set to equal the current value. Then, it is added to the center point value of the original value to obtain the final sharpening value.

3. An apparatus for implementing the image boundary sharpening method based on FPGA language as described in any one of claims 1-2, characterized in that, include: The image acquisition module is used to acquire images and convert RGB signals into YUV data; The operator convolution module is used to perform convolution operations on the Y component of the current pixel in the image based on the Laplace operator template, and calculate and obtain the MaxLine value of the current pixel. The sum calculation module is used to obtain the MaxLine value of all other pixels within N×N of the current pixel, and to calculate the sum of the MaxLine values ​​of all other pixels; The boundary point recognition module is used to identify the current pixel as a boundary point that needs to be sharpened if the sum of the values ​​of all other pixels is greater than 0 and the MaxLine value of the current pixel is equal to 1, and then calculates the final sharpening value.

4. A control system, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to implement the image boundary sharpening method based on FPGA language as described in any one of claims 1 to 2 when executing the executable instructions.