IronBarcode 操作指南 图像校正 How to use Image Correction Filters Hairil Hasyimi Bin Omar 已更新:十月 12, 2025 Download IronBarcode NuGet 下载 DLL 下载 Start Free Trial Copy for LLMs Copy for LLMs Copy page as Markdown for LLMs Open in ChatGPT Ask ChatGPT about this page Open in Gemini Ask Gemini about this page Open in Grok Ask Grok about this page Open in Perplexity Ask Perplexity about this page Share Share on Facebook Share on X (Twitter) Share on LinkedIn Copy URL Email article This article was translated from English: Does it need improvement? Translated View the article in English Let's face it. Not every image is perfect, and it is also one of the main factors that a barcode image is unable to be read by IronBarcode. This is not entirely the user's fault. Instead of going through the hassle of recapturing the image or using other image enhancement software, IronBarcode has come up with a feature that enables users to apply filters to the image programmatically. This would help IronBarcode read the image and improve accuracy. Continue reading to learn about available image correction filters in IronBarcode, their effects on images, and how to apply them. Quickstart: Apply Sharpen and Contrast Filters to Improve Barcode Readings In just one step, apply IronBarcode’s SharpenFilter and ContrastFilter using the ImageFilterCollection in BarcodeReaderOptions. This gets you improved barcode scanning with minimal setup and zero need for external tools. Get started making PDFs with NuGet now: Install IronBarcode with NuGet Package Manager PM > Install-Package BarCode Copy and run this code snippet. BarcodeResults results = IronBarCode.BarcodeReader.Read("input.png", new IronBarCode.BarcodeReaderOptions { ImageFilters = new IronBarCode.ImageFilterCollection() { new IronBarCode.SharpenFilter(3.5f), new IronBarCode.ContrastFilter(2.0f) } }); Deploy to test on your live environment Start using IronBarcode in your project today with a free trial Free 30 day Trial Minimal Workflow (5 steps) Download the C# library to use image correction filters Explore all available image correction filters Configure each image correction filter with custom values Apply the filters to the imperfect image sample Retrieve the barcode value from the image with the help of filters Use Image Filters to Improve Read Example To apply the filter, instantiate the ImageFilterCollection class and create instances of each filter individually. Then assign the object to the ImageFilters property of the BarcodeReaderOptions object. Pass the options object into the Read method along with the sample image. Let's use the image below as our sample image. Sample image From the initial look of the image, it appears to be quite blurry. However, the brightness is acceptable, and the white and black colors are distinguishable. Therefore, we need to apply at least the SharpenFilter and ContrastFilter to improve barcode readability. Refer to the code snippet below to apply the filters to the image, read it, and display it on the console. :path=/static-assets/barcode/content-code-examples/how-to/image-correction-apply-filter.cs using IronBarCode; using System; BarcodeReaderOptions options = new BarcodeReaderOptions() { // Choose which filters are to be applied (in order) ImageFilters = new ImageFilterCollection() { new SharpenFilter(3.5f), new ContrastFilter(2) }, }; // Apply options and read the barcode BarcodeResults results = BarcodeReader.Read("sample.png", options); // Write the result value to console foreach (BarcodeResult result in results) { Console.WriteLine(result.Text); } Imports IronBarCode Imports System Private options As New BarcodeReaderOptions() With { .ImageFilters = New ImageFilterCollection() From { New SharpenFilter(3.5F), New ContrastFilter(2) } } ' Apply options and read the barcode Private results As BarcodeResults = BarcodeReader.Read("sample.png", options) ' Write the result value to console For Each result As BarcodeResult In results Console.WriteLine(result.Text) Next result $vbLabelText $csharpLabel From the code snippet above, apart from applying filters and reading the barcode, we also exported the filtered image to disk. The comparison between the sample and filtered images can be seen below. Sample image Filtered sample Explore Image Correction Filters IronBarcode offers multiple image filters specifically designed for image correction. These filters can assist in reading imperfect barcode images and enhancing reading accuracy. However, users will need to understand how these filters work in order to select suitable filter and avoid performance issues due to using too many filters or using the wrong filter. Below are all filters available: AdaptiveThresholdFilter BinaryThresholdFilter BrightnessFilter ContrastFilter InvertFilter SharpenFilter ErodeFilter DilateFilter HistogramEqualizationFilter Blur Filters GaussianBlurFilter BilateralFilter MedianBlurFilter The order in which these filters are applied is based on their placement inside the ImageFilterCollection. Adaptive Threshold Filter AdaptiveThresholdFilter is one of the filters available in IronBarcode that applies Bradley Adaptive Threshold technique to the image, which automatically determines the threshold for binarizing an image. This filter is ideal for images with non-uniform illumination and varying background intensity levels. :path=/static-assets/barcode/content-code-examples/how-to/image-correction-adaptive-threshold.cs using IronBarCode; BarcodeReaderOptions options = new BarcodeReaderOptions() { // Choose which filters are to be applied (in order) ImageFilters = new ImageFilterCollection(true) { new AdaptiveThresholdFilter(0.9f), }, }; // Apply options and read the barcode BarcodeResults results = BarcodeReader.Read("sample.png", options); // Export file to disk results.ExportFilterImagesToDisk("adaptiveThreshold_0.9.png"); Imports IronBarCode Private options As New BarcodeReaderOptions() With { .ImageFilters = New ImageFilterCollection(True) From {New AdaptiveThresholdFilter(0.9F)} } ' Apply options and read the barcode Private results As BarcodeResults = BarcodeReader.Read("sample.png", options) ' Export file to disk results.ExportFilterImagesToDisk("adaptiveThreshold_0.9.png") $vbLabelText $csharpLabel Below are the outputs of applying the filter using different values. Default value 0.9 value The constructor also accepts additional parameters for configuration: Upper: Upper (white) color for thresholding. Lower: Lower (black) color for thresholding. Threshold: Threshold limit (0.0-1.0) for binarization. Rectangle: Rectangle region to apply the processor on. As seen in the output image above, the image is binarized to only have black and white colors. While it still does not seem to be ideal for barcode reading as filters need to be used in combinations. Users will need to experiment with the parameter sensitivity to achieve the best results. Binary Threshold Filter The BinaryThresholdFilter filters an image by splitting the pixels at the given threshold, where it is used to compare the luminance of a color component. Similar to the AdaptiveThresholdFilter, this filter can introduce new or unwanted noise if it is not used correctly. However, IronBarcode has set default values for the properties of the filter. Similar to the AdaptiveThresholdFilter, the BinaryThresholdFilter accepts the same additional parameters for configuration: Upper: Upper (white) color for thresholding. Lower: Lower (black) color for thresholding. Threshold: Threshold limit (0.0-1.0) for binarization. Rectangle: Rectangle region to apply the processor on. :path=/static-assets/barcode/content-code-examples/how-to/image-correction-binary-threshold.cs using IronBarCode; BarcodeReaderOptions options = new BarcodeReaderOptions() { // Choose which filters are to be applied (in order) ImageFilters = new ImageFilterCollection(true) { new BinaryThresholdFilter(0.9f) }, }; // Apply options and read the barcode BarcodeResults results = BarcodeReader.Read("sample.png", options); // Export file to disk results.ExportFilterImagesToDisk("binaryThreshold_0.9.png"); Imports IronBarCode Private options As New BarcodeReaderOptions() With { .ImageFilters = New ImageFilterCollection(True) From {New BinaryThresholdFilter(0.9F)} } ' Apply options and read the barcode Private results As BarcodeResults = BarcodeReader.Read("sample.png", options) ' Export file to disk results.ExportFilterImagesToDisk("binaryThreshold_0.9.png") $vbLabelText $csharpLabel Below is the sample output of applying filters to the sample image. Default value 0.9 value Observing the output image above, we can see that the sample has been binarized into black and white color. However, it can be seen that this filter is clearly not suitable for this image due to barcode bars being eliminated as well as some new noise being introduced. Brightness Filter BrightnessFilter is another essential filter in the image filter collection in IronBarcode. As the name suggests, this filter adjusts the brightness of the barcode image. The input to this constructor can vary the Amount of brightness in the output image. The default value is 1, which leaves the image unchanged. A value of 0 will create a completely black image, while values above 1 will make the image brighter. :path=/static-assets/barcode/content-code-examples/how-to/image-correction-brightness.cs using IronBarCode; BarcodeReaderOptions options = new BarcodeReaderOptions() { // Choose which filters are to be applied (in order) ImageFilters = new ImageFilterCollection(true) { new BrightnessFilter(1.5f), }, }; // Apply options and read the barcode BarcodeResults results = BarcodeReader.Read("sample.png", options); // Export file to disk results.ExportFilterImagesToDisk("brightness_1.5.png"); Imports IronBarCode Private options As New BarcodeReaderOptions() With { .ImageFilters = New ImageFilterCollection(True) From {New BrightnessFilter(1.5F)} } ' Apply options and read the barcode Private results As BarcodeResults = BarcodeReader.Read("sample.png", options) ' Export file to disk results.ExportFilterImagesToDisk("brightness_1.5.png") $vbLabelText $csharpLabel Below is the output image after applying this filter to the sample input. Default value 1.5 value Contrast Filter The ContrastFilter is used to adjust the level of contrast in an image. Image contrast refers to the difference in color intensity between various elements in an image. Increasing the level of contrast enhances the visibility of details, making the image appear vivid and striking, while reducing contrast makes the image appear softer and more subdued. The default value is 1, which leaves the image unchanged. A value of 0 will create a completely gray image, while values above 1 will increase the image contrast. :path=/static-assets/barcode/content-code-examples/how-to/image-correction-contrast.cs using IronBarCode; BarcodeReaderOptions options = new BarcodeReaderOptions() { // Choose which filters are to be applied (in order) ImageFilters = new ImageFilterCollection(true) { new ContrastFilter(1.5f), }, }; // Apply options and read the barcode BarcodeResults results = BarcodeReader.Read("sample.png", options); // Export file to disk results.ExportFilterImagesToDisk("contrast_1.5.png"); Imports IronBarCode Private options As New BarcodeReaderOptions() With { .ImageFilters = New ImageFilterCollection(True) From {New ContrastFilter(1.5F)} } ' Apply options and read the barcode Private results As BarcodeResults = BarcodeReader.Read("sample.png", options) ' Export file to disk results.ExportFilterImagesToDisk("contrast_1.5.png") $vbLabelText $csharpLabel Applying this filter to the sample input will produce the image below. Default value 1.5 value Invert Filter This filter is used to invert the colors inside an image, making the opposite colors, such as white becomes black and black becomes white. It's particularly useful when users are trying to read a barcode image with a background color. Unlike the BinaryThresholdFilter, this filter inverts the colors directly without the need to specify sensitivity. Moreover, this filter can be used with a CropRectangle to specify the location in the image that needs the color to be inverted, instead of inverting the colors for the entire image. :path=/static-assets/barcode/content-code-examples/how-to/image-correction-invert.cs using IronBarCode; BarcodeReaderOptions options = new BarcodeReaderOptions() { // Choose which filters are to be applied (in order) ImageFilters = new ImageFilterCollection(true) { new InvertFilter(), }, }; // Apply options and read the barcode BarcodeResults results = BarcodeReader.Read("sample.png", options); // Export file to disk results.ExportFilterImagesToDisk("invert.png"); Imports IronBarCode Private options As New BarcodeReaderOptions() With { .ImageFilters = New ImageFilterCollection(True) From {New InvertFilter()} } ' Apply options and read the barcode Private results As BarcodeResults = BarcodeReader.Read("sample.png", options) ' Export file to disk results.ExportFilterImagesToDisk("invert.png") $vbLabelText $csharpLabel Output image below is the result of applying this filter to the sample input image. Original image Inverted Sharpen Filter We also provide a sharpening filter in IronBarcode. This filter enhances the sharpness of an image and is very useful when dealing with blurry images. Users can manipulate this filter to adjust the sharpness of an image by adjusting the Sigma value when instantiating the filter object. The default value is 3. Increase the sigma value to increase the image sharpness. :path=/static-assets/barcode/content-code-examples/how-to/image-correction-sharpen.cs using IronBarCode; using System; BarcodeReaderOptions options = new BarcodeReaderOptions() { // Choose which filters are to be applied (in order) ImageFilters = new ImageFilterCollection(true) { new SharpenFilter(0.5f), }, }; // Apply options and read the barcode BarcodeResults results = BarcodeReader.Read("sample.png", options); // Export file to disk results.ExportFilterImagesToDisk("sharpen_0.5.png"); Imports IronBarCode Imports System Private options As New BarcodeReaderOptions() With { .ImageFilters = New ImageFilterCollection(True) From {New SharpenFilter(0.5F)} } ' Apply options and read the barcode Private results As BarcodeResults = BarcodeReader.Read("sample.png", options) ' Export file to disk results.ExportFilterImagesToDisk("sharpen_0.5.png") $vbLabelText $csharpLabel Image below is the sharpened version of the sample input image. Default value 0.5 value Comparing the image above with the original image, it seems sharper and would definitely help in barcode reading using IronBarcode. In most cases, SharpenFilter is always applied together with other filters in the ImageFilterCollection class. Erode Filter The ErodeFilter removes tiny white noise and thickens barcode bars by removing the pixels near the edge of the shapes. This filter is best used in scenarios where the barcode background has lots of white speckles or if the barcode image itself is too low resolution or blurred, resulting in some bars that are merged. The ErodeFilter has the effect of making the bars thicker while also removing the white specks in the background. Users can also increase the erosion's effect by inputting an integer representing kernelSize for the filter. The bigger the kernel size, the stronger the effect on the input image. Also do note that the kernelSize is a square and in this example, it would be a 5x5 kernel. As an example, let's use the ErodeFilter with a larger kernel size to showcase the filter's effects. :path=/static-assets/barcode/content-code-examples/how-to/image-correction-erode.cs using IronBarCode; BarcodeReaderOptions options = new BarcodeReaderOptions() { // Choose which filters are to be applied (in order) ImageFilters = new ImageFilterCollection(true) { new ErodeFilter(5), }, }; // Apply options and read the barcode BarcodeResults results = BarcodeReader.Read("sample.png", options); // Export file to disk results.ExportFilterImagesToDisk("erodeFilter.jpg"); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Original image Erode Filter Applied Comparing the input and output images above, we can see that some bars are visibly thicker due to the more aggressive nature of inputting a larger kernel size to filter. However, the white speckles in the overall picture have decreased. By nature of the erosion filter, the larger the kernel size, you might run into issues erasing thin bars if applied too aggressively, as shown in the picture above, as such developers show test and refine the effect they want by changing the kernel size value they input to the ErodeFilter. Dilate Filter The DilateFilter functions as the inverse of the ErodeFilter, operating by expanding bright regions—typically the background—through the addition of pixels to object boundaries. While this filter is useful for repairing damaged or faint barcodes by filling in small gaps or enhancing low-contrast areas, it’s important to note that its effect on barcode bars differs from intuition. Since dilation enlarges bright spaces, it indirectly thins out dark elements such as black barcode bars (assuming it's a white background). This makes the filter particularly effective in scenarios where barcode bars appear overly thick or merged, but excessive use can degrade scan accuracy by excessively narrowing the bars. Similar to above, users can increase the filter's effect by inputting an integer representing the kernelSize for the filter. For the example below, we'll use a larger kernel size to showcase the effects of the DilateFilter. :path=/static-assets/barcode/content-code-examples/how-to/image-correction-dilate.cs using IronBarCode; BarcodeReaderOptions options = new BarcodeReaderOptions() { // Choose which filters are to be applied (in order) ImageFilters = new ImageFilterCollection(true) { new DilateFilter(5), }, }; // Apply options and read the barcode BarcodeResults results = BarcodeReader.Read("sample.png", options); // Export file to disk results.ExportFilterImagesToDisk("dilateFilter.jpg"); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Original image Dilation Filter Applied As you can see from the image above, the aggressive use of DilateFilter can potentially destroy the barcode structure, merging closely spaced bars and creating quiet zones in the barcodes. Users should test and refine the effects they want on the image by changing the kernel size value to be larger or smaller, depending on the input image. HistogramEqualization Filter The HistogramEqualizationFilter is a filter that enhances the image contrast by redistributing the pixel intensities to improve clarity. It is most commonly used when the barcode is either low contrast, such as faded or washed out images, or images with uneven lighting, such as dark shadows or a bright glare. By analyzing the image histogram, which is the distribution of pixel brightness, it redistributes the pixel values by boosting contrast by stretching the intensity range, where dark pixels become darker and light pixels become lighter. :path=/static-assets/barcode/content-code-examples/how-to/image-correction-histogram-equalization-filter.cs using IronBarCode; BarcodeReaderOptions options = new BarcodeReaderOptions() { // Choose which filters are to be applied (in order) ImageFilters = new ImageFilterCollection(true) { new HistogramEqualizationFilter(), }, }; // Apply options and read the barcode BarcodeResults results = BarcodeReader.Read("sample.png", options); // Export file to disk results.ExportFilterImagesToDisk("histogramEqualizationFilter.jpg"); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Original image Histogram Equalization Filter Applied As you can see from the image above, the black bars are visibly darker, and the spaces are visibly brighter compared to the original image. Blur Filters GaussianBlur Filters The GaussianBlurFilter is used to apply a Gaussian blur to an image. This filter is commonly used to reduce noise in an image. The filter works by averaging neighboring pixel values in the image using a Gaussian function. The method relies on two adjustable factors: Kernel: a matrix used for averaging the pixels. Sigma: a value that controls the intensity of the blur. The default kernel size is 3x3 pixels, and the default Sigma value is 3.0, which produces a moderate blur. Increasing the Sigma value will result in a stronger blur effect. You can also customize the kernel to control the size of the neighborhood that the blur filter averages. :path=/static-assets/barcode/content-code-examples/how-to/image-correction-gaussianblur.cs using IronBarCode; BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions() { // Choose which filters are to be applied (in order) ImageFilters = new ImageFilterCollection(true) { new GaussianBlurFilter(3, 3, 3.0f), }, }; // Apply options and read the barcode BarcodeResults results = BarcodeReader.Read("sharpen.webp", myOptionsExample); // Export file to disk results.ExportFilterImagesToDisk("gaussianBlur.png"); Imports IronBarCode Private myOptionsExample As New BarcodeReaderOptions() With { .ImageFilters = New ImageFilterCollection(True) From {New GaussianBlurFilter(3, 3, 3.0F)} } ' Apply options and read the barcode Private results As BarcodeResults = BarcodeReader.Read("sharpen.webp", myOptionsExample) ' Export file to disk results.ExportFilterImagesToDisk("gaussianBlur.png") $vbLabelText $csharpLabel Applying this filter to the sample input will produce the image below. Sharpen image GaussianBlur image Bilateral Filters The BilateralFilter is used to smooth images while preserving edges. Unlike simple blur techniques, which affect all pixels uniformly, the Bilateral Filter takes both color differences and pixel distance into account, making it effective for edge-preserving smoothing. The method relies on three adjustable factors: NeighborhoodDiameter: Specifies the diameter of the pixel neighborhood used for filtering. A larger diameter includes more surrounding pixels in the filter. The default value is 5. SigmaColor: This represents the color influence. It determines how much the color difference between neighboring pixels affects the filtering. A higher value means that pixels with different colors will influence each other more. The default value is 75.0. SigmaSpace: This represents the spatial influence. It determines how much the distance between pixels affects the filtering. A higher value means that pixels that are farther apart will influence each other more. The default value is 75.0. :path=/static-assets/barcode/content-code-examples/how-to/image-correction-bilateral.cs using IronBarCode; BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions() { // Choose which filters are to be applied (in order) ImageFilters = new ImageFilterCollection(true) { new BilateralFilter(5, 75, 75), }, }; // Apply options and read the barcode BarcodeResults results = BarcodeReader.Read("sharpen.webp", myOptionsExample); // Export file to disk results.ExportFilterImagesToDisk("bilateral.png"); Imports IronBarCode Private myOptionsExample As New BarcodeReaderOptions() With { .ImageFilters = New ImageFilterCollection(True) From {New BilateralFilter(5, 75, 75)} } ' Apply options and read the barcode Private results As BarcodeResults = BarcodeReader.Read("sharpen.webp", myOptionsExample) ' Export file to disk results.ExportFilterImagesToDisk("bilateral.png") $vbLabelText $csharpLabel Applying this filter to the sample input produces the image below. Sharpen image Bilateral image MedianBlur Filters The MedianBlurFilter is a filter used for reducing noise in an image by replacing each pixel’s value with the median value of the surrounding pixels. This filter is particularly effective at preserving edges while removing noise. KernelSize: Defines the size of the neighborhood around each pixel used to calculate the median. The value must be an odd number greater than 0. The default value is 5. :path=/static-assets/barcode/content-code-examples/how-to/image-correction-medianblur.cs using IronBarCode; BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions() { // Choose which filters are to be applied (in order) ImageFilters = new ImageFilterCollection(true) { new MedianBlurFilter(5), }, }; // Apply options and read the barcode BarcodeResults results = BarcodeReader.Read("sharpen.webp", myOptionsExample); // Export file to disk results.ExportFilterImagesToDisk("medianBlur.png"); Imports IronBarCode Private myOptionsExample As New BarcodeReaderOptions() With { .ImageFilters = New ImageFilterCollection(True) From {New MedianBlurFilter(5)} } ' Apply options and read the barcode Private results As BarcodeResults = BarcodeReader.Read("sharpen.webp", myOptionsExample) ' Export file to disk results.ExportFilterImagesToDisk("medianBlur.png") $vbLabelText $csharpLabel Applying this filter to the sample input produces the image below. Sharpen image MedianBlur image Save Iterations When applying multiple filters to the barcode, it can be difficult to view the output after each filter method. This feature allows saving the filtered image after each filter is applied, in the order they are processed. To enable this feature, first pass true to the ImageFilterCollection constructor. Then, use the ExportFilterImagesToDisk method to provide the path and name for the output images. :path=/static-assets/barcode/content-code-examples/how-to/image-correction-save-iterations.cs using IronBarCode; BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions() { // Choose which filters are to be applied (in order) ImageFilters = new ImageFilterCollection(true) { new SharpenFilter(3.5f), new AdaptiveThresholdFilter(0.5f), new ContrastFilter(2) }, }; // Apply options and read the barcode BarcodeResults results = BarcodeReader.Read("sample.webp", myOptionsExample); // Export file to disk results.ExportFilterImagesToDisk("filteredImage.png"); Imports IronBarCode Private myOptionsExample As New BarcodeReaderOptions() With { .ImageFilters = New ImageFilterCollection(True) From { New SharpenFilter(3.5F), New AdaptiveThresholdFilter(0.5F), New ContrastFilter(2) } } ' Apply options and read the barcode Private results As BarcodeResults = BarcodeReader.Read("sample.webp", myOptionsExample) ' Export file to disk results.ExportFilterImagesToDisk("filteredImage.png") $vbLabelText $csharpLabel The filters are applied in the order of the code, and the output images reflect the results of each iteration: Sharpen -> After Sharpen Sharpen + Adaptive Threshold -> After Adaptive Threshold Sharpen + Adaptive Threshold + Contrast -> After Contrast Sample image After Sharpen After Adaptive Threshold After Contrast Apart from the ImageFilters properties, users can also add other properties to BarcodeReaderOptions for more accurate reading; 请参阅此文章以获取更多信息。 常见问题解答 如何在 .NET C# 中提高条码可读性? 通过在 .NET C# 中使用 IronBarcode 应用图像校正滤镜,可以增强条码可读性。过滤器如 AdaptiveThresholdFilter 和 BrightnessFilter 可以解决图像缺陷并提高条码扫描的准确性。 如何以编程方式应用图像校正滤镜? 要以编程方式使用 IronBarcode 应用图像校正滤镜,您需要下载该库,实例化 ImageFilterCollection 类,配置所需的滤镜,并在处理条码图像之前通过 BarcodeReaderOptions 应用它们。 IronBarcode 中有哪些可用于增强图像质量的滤镜? IronBarcode 提供了多种滤镜来增强图像质量,包括 AdaptiveThresholdFilter, BinaryThresholdFilter, BrightnessFilter, ContrastFilter, InvertFilter, SharpenFilter,以及多个模糊滤镜如 GaussianBlurFilter 和 BilateralFilter。 如何在 C# 中配置自适应阈值滤镜? 在 IronBarcode 中,AdaptiveThresholdFilter 可以使用 Bradley 自适应阈值技术进行配置。该滤镜自动确定图像二值化的阈值,特别适用于光照不均匀的情况。 是否可以在过滤的每个步骤保存图像? 是的,IronBarcode 允许您在过滤的每个步骤保存图像,通过在 ImageFilterCollection 中启用迭代保存并使用 ExportFilterImagesToDisk 方法来实现。 应用多个滤镜时应考虑哪些因素? 在 IronBarcode 中应用多个滤镜时,重要的是避免使用过多或不当的滤镜,因为这可能引入噪声或影响性能。了解每个滤镜的功能有助于仅应用必要的滤镜以获得最佳结果。 锐化滤镜会对图像产生什么影响? IronBarcode 中 SharpenFilter 通过调整锐度来增强图像清晰度。它可以配置 Sigma 值,对提高条码图像的边缘清晰度非常有用。 反转滤镜在条码处理过程中扮演什么角色? IronBarcode 中的 InvertFilter 反转图像的颜色,使白色变为黑色,黑色变为白色。这对于具有非常规颜色方案或背景的条码特别有用。 高斯与双边模糊滤镜如何改善图像处理? 在 IronBarcode 中,GaussianBlurFilter 通过应用高斯模糊来减少图像噪声,而 BilateralFilter 在平滑图像的同时保留边缘,考虑颜色差异和像素距离。 Hairil Hasyimi Bin Omar 立即与工程团队聊天 软件工程师 如所有伟大的工程师一般,Hairil 是个热心的学习者。他正在提高对 C#、Python 和 Java 的知识,并利用这些知识为 Iron Software 团队成员增值。Hairil 从马来西亚的玛拉工业大学加入 Iron Software 团队,获得化学与工艺工程学士学位。 准备开始了吗? Nuget 下载 1,935,276 | 版本: 2025.11 刚刚发布 免费 NuGet 下载 总下载量:1,935,276 查看许可证