CN112288754A - Real-time binarization threshold value selection method for high-speed image - Google Patents
Real-time binarization threshold value selection method for high-speed image Download PDFInfo
- Publication number
- CN112288754A CN112288754A CN202011238407.XA CN202011238407A CN112288754A CN 112288754 A CN112288754 A CN 112288754A CN 202011238407 A CN202011238407 A CN 202011238407A CN 112288754 A CN112288754 A CN 112288754A
- Authority
- CN
- China
- Prior art keywords
- acc
- image
- value
- threshold value
- real
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000010187 selection method Methods 0.000 title claims abstract description 10
- 238000000034 method Methods 0.000 claims abstract description 15
- 101100268665 Caenorhabditis elegans acc-1 gene Proteins 0.000 claims abstract description 5
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Facsimile Image Signal Circuits (AREA)
- Image Processing (AREA)
Abstract
The real-time binarization threshold value selection method of the high-speed image adopts the following steps: s1, counting the total number N of pixel points contained in the current processed imageP(ii) a S2, defining a threshold T, and initializing and assigning the threshold T; s3, defining the adjustment accuracy Acc of the current image, where the adjustment accuracy Acc is initialized to Acc ═ T/NP(ii) a S4, reading the gray values V of the pixel points one by one, and comparing the gray values V with a threshold value T; if V is larger than or equal to T, the gray value of the current pixel point is quantized to 1, T is updated to round (T + Acc) and the value of Acc is corrected to Acc +1/NP(ii) a If V is less than T, the gray value of the current pixel point is quantized to 0, T is updated to round (T-Acc), and the value of Acc is corrected to Acc-1/NP(ii) a round is the rounding operation. According to the invention, the selection and updating operation of the threshold value are completed in the image input process, so that the selection efficiency of the threshold value in the image binarization process is obviously improved; in real-time binarization operation of high-speed image, reading process of pixel point of imageThe real-time image binarization operation is realized.
Description
Technical Field
The invention relates to the technical field of image processing, in particular to a real-time binarization threshold value selection method for a high-speed image.
Background
The binary image is an image with each pixel point being black or white, and has the advantage of small occupied space. In digital image processing, a binary image plays a very important role, and the binarization of the image greatly reduces the data volume in the image, so that the outline of an interested target, such as license plate recognition and character recognition, can be highlighted.
The binary image is processed and analyzed by firstly binarizing the gray level image to obtain a binary image, so that the image is advantageous in that when the image is further processed, the collective property of the image is only related to the positions of the points with the gray level value of 0 or 255, the multi-level values of pixels are not related, the processing is simple, and the processing and compression amount of data is small.
In order to obtain an ideal binary image, a closed and connected boundary is generally adopted to define a non-overlapping region, all pixels with the gray levels greater than or equal to a threshold are determined to belong to a specific object and the gray level of the pixels is set to 1, otherwise, the pixels are excluded from the object region and the gray level of the pixels is set to 0.
If a particular object has a uniform gray level inside it and is in a uniform background with gray levels of other levels, a comparable segmentation effect can be obtained using thresholding. If the difference between the object and the background is not represented in the gray scale value, such as different texture, the difference feature can be converted into the difference of gray scale, and then the image is segmented by using a threshold value selection technology.
The existing image binarization threshold value selection method generally needs to cache the whole image, then statistics is carried out on the gray value of pixel points in the whole image, and correlation operation is carried out according to the statistical value, so that the optimal binarization threshold value can be selected. In the real-time processing of high-speed images, the requirement on the processing speed of the images is high, the selection and updating operation of the threshold value needs to be completed in the image input process, and the requirement cannot be met by adopting the existing image binarization threshold value selection method.
Disclosure of Invention
In order to make up for the above deficiencies of the prior art, the invention provides a method for selecting a real-time binarization threshold of a high-speed image, which comprises the steps of sequentially analyzing and counting the gray value of the current input pixel point when image data is input, and updating the threshold in the binarization process based on the current statistical result, so that the operation of selecting and updating the threshold is completed in the image input process, the threshold selection result of the next pixel point is obtained in real time, the binarization operation of the image is completed, and the binarization processing efficiency of the high-speed image is improved.
In order to achieve the above object, the present invention adopts the following aspects.
The real-time binarization threshold value selection method of the high-speed image adopts the following steps:
s1, counting the total number N of pixel points contained in the current processed imageP;
S2, defining a threshold T, and initializing and assigning the threshold T;
s3, defining the adjustment accuracy Acc of the current image, where the adjustment accuracy Acc is initialized to Acc ═ T/NP;
S4, reading the gray values V of the pixel points one by one, and comparing the gray values V with a threshold value T; if V is larger than or equal to T, the gray value of the current pixel point is quantized to 1, T is updated to round (T + Acc) and the value of Acc is corrected to Acc +1/NP(ii) a If V is less than T, the gray value of the current pixel point is quantized to 0, T is updated to round (T-Acc), and the value of Acc is corrected to Acc-1/NP(ii) a round is the rounding operation.
Compared with the prior art, the invention has the beneficial effects that: the selection and updating operation of the threshold value is completed in the image input process, and the selection efficiency of the threshold value in the image binarization process is remarkably improved; when the method is used for real-time binarization operation of high-speed images, real-time image binarization operation is realized in the pixel point reading process of the images.
The present invention will be further described with reference to specific embodiments.
Detailed Description
The real-time binarization threshold value selection method of the high-speed image adopts the following steps:
s1, counting the total number N of pixel points contained in the current processed imageP;
S2, defining a threshold T, and initializing and assigning the threshold T;
s3, defining the adjustment accuracy Acc of the current image, where the adjustment accuracy Acc is initialized to Acc ═ T/NP;
S4, reading the gray values V of the pixel points one by one, and comparing the gray values V with a threshold value T; if V is larger than or equal to T, the gray value of the current pixel point is quantized to 1, T is updated to round (T + Acc) and the value of Acc is corrected to Acc +1/NP(ii) a If V is less than T, the gray value of the current pixel point is quantized to 0, T is updated to round (T-Acc), and the value of Acc is corrected to Acc-1/NP(ii) a round is the rounding operation.
The real-time binarization threshold value selection method of the high-speed image is adopted, and an image A with the resolution of 400 × 300 is taken as an example:
the total number N of the pixel points contained in the image A is counted according to the step S1P=120000;
Defining a threshold value T according to the step S2, and initially assigning a value of 127 to the threshold value T;
defining the adjustment accuracy Acc of the current image according to step S3, where the adjustment accuracy Acc is initialized to Acc ═ T/NPI.e., 0.001;
reading the gray values V of the pixel points one by one according to the step S4, and comparing the gray values V with a threshold T; if V is larger than or equal to T, the gray value of the current pixel point is quantized to 1, T is updated to round (T + Acc) and the value of Acc is corrected to Acc +1/NP(ii) a If V is less than T, the gray value of the current pixel point is quantized to 0, T is updated to round (T-Acc), and the value of Acc is corrected to Acc-1/NP(ii) a round is the rounding operation.
When image data is input, the gray values of the current input pixel points are analyzed and counted in sequence, and the threshold value in the binarization process is updated based on the current statistical result, so that the selection and updating operation of the threshold value are completed in the image input process, the threshold value selection result of the next pixel point is obtained in real time, the binarization operation of the image is completed, and the binarization processing efficiency of the high-speed image is remarkably improved.
In a preferred embodiment, the threshold T is initialized to 127 in step S2.
In a preferred embodiment, in step S4, the pixels are read one by one according to the pixels in the two-dimensional coordinate system, and currentlyThe gray value V of the read pixel point is recorded as V(x,y)。
It will be clear to a person skilled in the art that the scope of protection of the present invention is not limited to details of the foregoing illustrative embodiments, and that all changes which come within the meaning and range of equivalency of the claims are intended to be embraced therein by the appended claims without departing from the spirit or essential characteristics thereof.
Claims (3)
1. The real-time binarization threshold value selection method of the high-speed image is characterized by comprising the following steps of:
s1, counting the total number N of pixel points contained in the current processed imageP;
S2, defining a threshold T, and initializing and assigning the threshold T;
s3, defining the adjustment accuracy Acc of the current image, where the adjustment accuracy Acc is initialized to Acc ═ T/NP;
S4, reading the gray values V of the pixel points one by one, and comparing the gray values V with a threshold value T; if V is larger than or equal to T, the gray value of the current pixel point is quantized to 1, T is updated to round (T + Acc) and the value of Acc is corrected to Acc +1/NP(ii) a If V is less than T, the gray value of the current pixel point is quantized to 0, T is updated to round (T-Acc), and the value of Acc is corrected to Acc-1/NP(ii) a round is the rounding operation.
2. The method for extracting the real-time binary threshold value of the high-speed image as claimed in claim 1, wherein the threshold value T is initialized to 127 in step S2.
3. The method as claimed in claim 1, wherein in step S4, the pixels are read one by one according to the pixels in the two-dimensional coordinate system, and the gray value V of the currently read pixel is recorded as V(x,y)。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011238407.XA CN112288754B (en) | 2020-11-09 | 2020-11-09 | Real-time binarization threshold selection method for high-speed image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011238407.XA CN112288754B (en) | 2020-11-09 | 2020-11-09 | Real-time binarization threshold selection method for high-speed image |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112288754A true CN112288754A (en) | 2021-01-29 |
CN112288754B CN112288754B (en) | 2023-12-05 |
Family
ID=74351633
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011238407.XA Active CN112288754B (en) | 2020-11-09 | 2020-11-09 | Real-time binarization threshold selection method for high-speed image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112288754B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0284966U (en) * | 1988-12-19 | 1990-07-03 | ||
CN102622602A (en) * | 2012-02-28 | 2012-08-01 | 中国农业大学 | Cotton foreign fiber image online dividing method and cotton foreign fiber image online dividing system |
CN104835176A (en) * | 2015-01-20 | 2015-08-12 | 广西机电职业技术学院 | Threshold segmentation method of laser vision image |
CN106127817A (en) * | 2016-06-28 | 2016-11-16 | 广东工业大学 | A kind of image binaryzation method based on passage |
CN106529543A (en) * | 2016-11-02 | 2017-03-22 | 徐庆 | Method and system for dynamically calculating multi-color-grade binary adaptive threshold |
CN107169983A (en) * | 2017-04-13 | 2017-09-15 | 西安电子科技大学 | Multi-threshold image segmentation method based on cross and variation artificial fish-swarm algorithm |
CN108986083A (en) * | 2018-06-28 | 2018-12-11 | 西安电子科技大学 | SAR image change detection based on threshold optimization |
CN109543692A (en) * | 2018-11-27 | 2019-03-29 | 合肥工业大学 | A kind of binarization method being exclusively used in the image of code containing QR |
CN111754538A (en) * | 2019-06-29 | 2020-10-09 | 浙江大学 | Threshold segmentation method for USB surface defect detection |
-
2020
- 2020-11-09 CN CN202011238407.XA patent/CN112288754B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0284966U (en) * | 1988-12-19 | 1990-07-03 | ||
CN102622602A (en) * | 2012-02-28 | 2012-08-01 | 中国农业大学 | Cotton foreign fiber image online dividing method and cotton foreign fiber image online dividing system |
CN104835176A (en) * | 2015-01-20 | 2015-08-12 | 广西机电职业技术学院 | Threshold segmentation method of laser vision image |
CN106127817A (en) * | 2016-06-28 | 2016-11-16 | 广东工业大学 | A kind of image binaryzation method based on passage |
CN106529543A (en) * | 2016-11-02 | 2017-03-22 | 徐庆 | Method and system for dynamically calculating multi-color-grade binary adaptive threshold |
CN107169983A (en) * | 2017-04-13 | 2017-09-15 | 西安电子科技大学 | Multi-threshold image segmentation method based on cross and variation artificial fish-swarm algorithm |
CN108986083A (en) * | 2018-06-28 | 2018-12-11 | 西安电子科技大学 | SAR image change detection based on threshold optimization |
CN109543692A (en) * | 2018-11-27 | 2019-03-29 | 合肥工业大学 | A kind of binarization method being exclusively used in the image of code containing QR |
CN111754538A (en) * | 2019-06-29 | 2020-10-09 | 浙江大学 | Threshold segmentation method for USB surface defect detection |
Non-Patent Citations (5)
Title |
---|
MARTIN HOFMANN等: "Background Segmentation with Feedback: The Pixel-Based Adaptive Segmenter", 《2012 IEEE COMPUTER SOCIETY CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION WORKSHOPS》, pages 38 - 43 * |
PETER TARABEK等: "A Real-Time License Plate Localization Method Based on Vertical Edge Analysis", 《FEDCSIS》, pages 149 * |
吴政峰等: "融合修正OTSU和中值滤波的水上航行器障碍物视觉分割", 《兵工自动化》, vol. 39, no. 7, pages 16 - 19 * |
张南洋生等: "一种变阈值二值化CCD像元细分技术研究", 《半导体光电》, vol. 27, no. 4, pages 471 - 474 * |
李峻;孟正大;: "基于HS分量联合统计的自适应阈值分割算法", 《东南大学学报(自然科学版)》, vol. 40, no. 1, pages 266 - 271 * |
Also Published As
Publication number | Publication date |
---|---|
CN112288754B (en) | 2023-12-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106682629B (en) | Identification algorithm for identity card number under complex background | |
CN107038416B (en) | Pedestrian detection method based on binary image improved HOG characteristics | |
CN115019111B (en) | Data processing method for Internet literary composition | |
CN112270697B (en) | Satellite sequence image moving target detection method combined with super-resolution reconstruction | |
CN113963041A (en) | Image texture recognition method and system | |
CN113159045A (en) | Verification code identification method combining image preprocessing and convolutional neural network | |
CN110428450A (en) | Dimension self-adaption method for tracking target applied to the mobile inspection image of mine laneway | |
CN111986126A (en) | Multi-target detection method based on improved VGG16 network | |
Xie et al. | Bag-of-words feature representation for blind image quality assessment with local quantized pattern | |
CN116704516B (en) | Visual inspection method for water-soluble fertilizer package | |
CN109543686B (en) | Character recognition preprocessing binarization method based on self-adaptive multi-threshold | |
CN112258525A (en) | Image abundance statistics and population recognition algorithm based on bird high frame frequency sequence | |
CN110472632B (en) | Character segmentation method and device based on character features and computer storage medium | |
CN114897782B (en) | Gastric cancer pathological section image segmentation prediction method based on generation type countermeasure network | |
CN111027564A (en) | Low-illumination imaging license plate recognition method and device based on deep learning integration | |
CN109308709B (en) | Vibe moving target detection algorithm based on image segmentation | |
CN115033721A (en) | Image retrieval method based on big data | |
CN105844656A (en) | Image binaryzation target segmentation device and method | |
CN109978916A (en) | Vibe moving target detecting method based on gray level image characteristic matching | |
CN112288754A (en) | Real-time binarization threshold value selection method for high-speed image | |
CN113435389B (en) | Chlorella and golden algae classification and identification method based on image feature deep learning | |
CN114581901A (en) | Method for extracting edges of ancient building wall contaminated inscription character images | |
CN110348452B (en) | Image binarization processing method and system | |
CN113888428A (en) | Infrared dim target detection method and device based on local contrast | |
Zhu et al. | A new image thresholding method based on relative entropy |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |