CN111489344A - Method, system and related device for determining image definition - Google Patents
Method, system and related device for determining image definition Download PDFInfo
- Publication number
- CN111489344A CN111489344A CN202010279010.9A CN202010279010A CN111489344A CN 111489344 A CN111489344 A CN 111489344A CN 202010279010 A CN202010279010 A CN 202010279010A CN 111489344 A CN111489344 A CN 111489344A
- Authority
- CN
- China
- Prior art keywords
- image
- determining
- binarization
- module
- transformation
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000003709 image segmentation Methods 0.000 claims abstract description 10
- 230000009466 transformation Effects 0.000 claims description 46
- 238000005260 corrosion Methods 0.000 claims description 13
- 230000007797 corrosion Effects 0.000 claims description 12
- 230000003044 adaptive effect Effects 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 9
- 230000010339 dilation Effects 0.000 claims description 6
- 230000003628 erosive effect Effects 0.000 claims description 6
- 239000011159 matrix material Substances 0.000 claims description 6
- 230000008569 process Effects 0.000 abstract description 10
- 238000006243 chemical reaction Methods 0.000 abstract description 3
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- 230000009471 action Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000000877 morphologic effect Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
- G06T5/30—Erosion or dilatation, e.g. thinning
-
- 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/12—Edge-based segmentation
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The application provides a method for determining image definition, which has the following specific technical scheme: acquiring an original image; converting the original image into a gray scale image; carrying out image segmentation on the gray-scale image to obtain a binary image; calculating the binary image by using a foreground image formula to obtain a corresponding foreground image; calculating the pixel mean value of the foreground image; and comparing the pixel mean value with a preset threshold value, and if the pixel mean value is greater than the preset threshold value, the original image comprises the target to be detected. According to the method and the device, after the original image is obtained, the image can be preprocessed only by carrying out gray level conversion, binarization and image segmentation methods, whether the original image contains the target to be detected or not is determined, the data processing process is simple, the calculated amount is small, and the robustness is high. The application also provides a system for determining the image definition, a computer readable storage medium and an image recognition terminal, which have the beneficial effects.
Description
Technical Field
The present disclosure relates to the field of image recognition, and in particular, to a method, a system, and a related apparatus for determining image sharpness.
Background
In the application of an optical microscope, software is often needed for automatic focusing, wherein a method for calculating definition gradients at different distances by using a definition evaluation function is one of the widely used methods, but several common gradient function algorithms are complex and have large calculation amount, and the definition determination efficiency is difficult to ensure when the original image data volume is large.
Therefore, how to quickly determine the sharpness of a picture is a technical problem that needs to be solved urgently by those skilled in the art.
Disclosure of Invention
The application aims to provide a method, a system, a computer readable storage medium and an image recognition terminal for determining image definition, which can quickly recognize the image definition.
In order to solve the above technical problem, the present application provides a method for determining image sharpness, which has the following specific technical scheme:
acquiring an original image and determining a corresponding gray-scale image;
converting the gray scale map into a first binary map;
carrying out corrosion transformation, expansion transformation and interval transformation on the first binary image to obtain an intermediate image;
carrying out self-adaptive binarization on the intermediate image by using a preset lower limit value to obtain a second binarization image;
obtaining a corresponding foreground image by using a foreground image formula for the second binarization image;
calculating the pixel mean value of the foreground image;
and determining the definition of the original image according to the pixel mean value.
Wherein converting the gray scale map into a first binary map comprises:
and converting the gray scale image into a first binary image by using an adaptive binary formula.
Wherein, the lower limit of the self-adaptive binarization formula is 0, and the upper limit is 255.
Wherein, performing erosion transformation, dilation transformation, and interval transformation on the first binarized map to obtain an intermediate image includes:
carrying out corrosion transformation and expansion transformation twice on the intermediate binary image by using a 3 × 3 matrix kernel to obtain a first intermediate image;
performing the expansion transformation on the first intermediate image for three times to obtain a second intermediate image;
and carrying out interval transformation on the second intermediate image to obtain an intermediate image.
Wherein determining the sharpness of the original image according to the pixel mean comprises:
and determining the definition of the original image according to the comparison result of the pixel mean value and the definition classification table.
The present application further provides a system for determining image sharpness, including:
the acquisition module is used for acquiring an original image and determining a corresponding gray-scale image;
the first binarization module is used for converting the gray-scale image into a first binarization image;
the image segmentation module is used for carrying out corrosion transformation, expansion transformation and interval transformation on the first binary image to obtain an intermediate image;
the second binarization module is used for carrying out self-adaptive binarization on the intermediate image by using a preset lower limit value to obtain a second binarization image;
a foreground image obtaining module, configured to obtain a corresponding foreground image for the second binarized image by using a foreground image formula;
the pixel mean value calculating module is used for calculating the pixel mean value of the foreground image;
and the definition determining module is used for determining the definition of the original image according to the pixel mean value.
The definition determining module is specifically a module for determining the definition of the original image according to the comparison result of the pixel mean and the definition classification table.
The first binarization module is specifically a module for converting the gray-scale image into a first binarization image by using a self-adaptive binarization formula.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method as set forth above.
The application also provides an image recognition terminal, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the steps of the method when calling the computer program in the memory.
The application provides a method for determining image definition, which has the following specific technical scheme: acquiring an original image and determining a corresponding gray-scale image; converting the gray scale map into a first binary map; converting the gray scale image into a first binary image by using a self-adaptive binary formula; carrying out corrosion transformation, expansion transformation and interval transformation on the binary image to obtain an intermediate image; carrying out self-adaptive binarization on the intermediate image by using a preset lower limit value to obtain a second binarization image; obtaining a corresponding foreground image by using a foreground image formula for the second binarization image; calculating the pixel mean value of the foreground image; and determining the definition of the original image according to the pixel mean value.
According to the method and the device, after the original image is obtained, the image can be preprocessed only by carrying out gray level conversion, binarization and image segmentation methods, the definition of the original image can be determined after the pixel mean value is obtained, the higher the pixel mean value is, the clearer the original image is, the simple calculated amount in the data processing process is small, the robustness is strong, and the definition of the image can be rapidly determined. The application also provides a system for determining the image definition, a computer readable storage medium and an image recognition terminal, which have the beneficial effects and are not repeated herein.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for determining image sharpness according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a system for determining image sharpness according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a method for determining image sharpness according to an embodiment of the present application, where the method for determining image sharpness includes:
s101: acquiring an original image and determining a corresponding gray-scale image;
s102: converting the gray scale image into a first binary image;
s103: carrying out corrosion transformation, expansion transformation and interval transformation on the first binary image to obtain an intermediate image;
s104: carrying out self-adaptive binarization on the intermediate image by using a preset lower limit value to obtain a second binarization image;
s105: obtaining a corresponding foreground image by using a foreground image formula for the second binary image;
s106: calculating the pixel mean value of the foreground image;
s107: and determining the definition of the original image according to the pixel mean value.
Step S101 is to obtain an original image and convert the original image into a grayscale image, so as to convert a color RGB image into a grayscale image, thereby converting the image from multiple channels into a single channel, and greatly reducing the computation load of subsequent calculations. Meanwhile, in the subsequent image segmentation process, some image processing algorithms only support a single channel.
After that, image segmentation is also needed to the gray map to obtain the second binary map. More specifically, the image segmentation mainly includes processes such as binarization, erosion transformation, dilation transformation, and interval variation.
Specifically, the step may be performed by the following process:
converting the gray level image into a first binary image by using a self-adaptive binary threshold formula;
converting the gray scale image into a first binary image by adopting a self-adaptive method; the adaptive binary threshold value formula is
The lower threshold is 0 and the upper threshold is 255.
In step S103, the specific process may include:
s1031, performing corrosion transformation and expansion transformation on the intermediate binary image twice by using a 3 × 3 matrix kernel to obtain a first intermediate image;
s1032: performing three times of expansion transformation on the first intermediate image to obtain a second intermediate image;
s1033: and carrying out interval transformation on the second intermediate image to obtain an intermediate image.
=
The erosion transform and the dilation transform are morphological image processing methods, which are mainly used in the present application to eliminate noise. The dilation transform is actually the local maximum, while the erosion transform is the opposite, and is used to find the local minimum of the image.
Performing the corrosion transformation and the expansion transformation twice in step S1031 means performing the corrosion transformation and the expansion transformation in this order as one set, and performing two sets, that is, the actual execution order is "corrosion transformation-expansion transformation-corrosion transformation-expansion transformation".
The preset matrix kernel is not specifically limited, and the 3 × 3 matrix kernel may be used to obtain the first intermediate image, but other matrix kernels, such as 4 × 4, 5 × 5, etc., may also be used, and are not specifically limited, but the 3 × 3 is found to be the best effect through practical application.
And then carrying out three times of expansion transformation on the first intermediate image to obtain a second intermediate image, and carrying out one time of interval transformation on the second intermediate image to obtain an intermediate image.
The interval transformation means that the foreground and the background of the image are distinguished, then the minimum value of the distance from each pixel to the background pixel is calculated, the value of the original pixel is replaced by the minimum value, and a single-channel image is obtained, and the single-channel image is the intermediate image.
Step S105 needs to refer to the adaptive binarization threshold formula described above, but it is different that adaptive binarization is performed here, the lower limit is a preset value, and the lower limit is not specifically limited, and may be set to be 10% of the maximum value, for example.
In step S106, the pixel mean value of the foreground image needs to be calculated, that is, the pixel mean value is obtained by adding each pixel value and dividing by the number of pixels. The higher the pixel mean, the sharper the original image.
Specifically, in step S107, the definition of the original image may be determined according to the comparison result between the pixel mean and the definition classification table. The definition classification table may include definitions corresponding to the pixel averages of the respective intervals.
According to the method and the device, after the original image is obtained, the image can be preprocessed only by carrying out gray level conversion, binarization and image segmentation methods, the definition of the original image can be determined after the pixel mean value is obtained, the higher the pixel mean value is, the clearer the original image is, the simpler the data processing process is, the smaller the calculated amount is, and the robustness is strong.
The following describes an image sharpness determining system provided in an embodiment of the present application, and the following description of the determining system and the foregoing description of the image sharpness determining method may be referred to correspondingly.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a system for determining image sharpness according to an embodiment of the present application, where the system for determining image sharpness includes:
an obtaining module 100, configured to obtain an original image and determine a corresponding grayscale map;
a first binarization module 200 for converting the gray scale map into a first binarization map;
an image segmentation module 300, configured to perform erosion transformation, dilation transformation, and interval transformation on the first binarized map to obtain an intermediate image;
a second binarization module 400, configured to perform adaptive binarization on the intermediate image with a preset lower limit value to obtain a second binarization image;
a foreground image obtaining module 500, configured to obtain a corresponding foreground image for the second binarized image by using a foreground image formula;
a pixel mean calculation module 600, configured to calculate a pixel mean of the foreground map;
a definition determining module 700, configured to determine the definition of the original image according to the pixel mean.
Based on the above embodiment, as a preferred embodiment, the sharpness determining module 700 is specifically a module for determining the sharpness of the original image according to the comparison result of the pixel mean and the sharpness classification table.
Based on the above embodiment, as a preferred embodiment, the first binarization module 200 is specifically a module for converting the gray scale map into a first binarization map by using an adaptive binarization formula.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed, may implement the steps provided by the above-described embodiments. The storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The application also provides an image recognition terminal, which can comprise a memory and a processor, wherein the memory stores a computer program, and the processor can realize the steps provided by the embodiment when calling the computer program in the memory. Of course, the image recognition terminal may further include various network interfaces, power supplies and other components.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system provided by the embodiment, the description is relatively simple because the system corresponds to the method provided by the embodiment, and the relevant points can be referred to the method part for description.
The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Claims (10)
1. A method for determining image sharpness is characterized by comprising the following steps:
acquiring an original image and determining a corresponding gray-scale image;
converting the gray scale map into a first binary map;
carrying out corrosion transformation, expansion transformation and interval transformation on the first binary image to obtain an intermediate image;
carrying out self-adaptive binarization on the intermediate image by using a preset lower limit value to obtain a second binarization image;
obtaining a corresponding foreground image by using a foreground image formula for the second binarization image;
calculating the pixel mean value of the foreground image;
and determining the definition of the original image according to the pixel mean value.
2. The determination method according to claim 1, wherein converting the gray map into a first binarized map comprises:
and converting the gray scale image into a first binary image by using an adaptive binary formula.
3. The method of claim 1, wherein the adaptive binarization formula has a lower limit of 0 and an upper limit of 255.
4. The method of claim 1, wherein performing an erosion transform, a dilation transform, and a spacing transform on the first binarized map to obtain an intermediate image comprises:
carrying out corrosion transformation and expansion transformation twice on the intermediate binary image by using a 3 × 3 matrix kernel to obtain a first intermediate image;
performing expansion transformation on the first intermediate image for 3 times to obtain a second intermediate image;
and carrying out interval transformation on the second intermediate image to obtain an intermediate image.
5. The method of claim 1, wherein determining the sharpness of the original image from the pixel mean comprises:
and determining the definition of the original image according to the comparison result of the pixel mean value and the definition classification table.
6. A system for determining sharpness of an image, comprising:
the acquisition module is used for acquiring an original image and determining a corresponding gray-scale image;
the first binarization module is used for converting the gray-scale image into a first binarization image;
the image segmentation module is used for carrying out corrosion transformation, expansion transformation and interval transformation on the first binary image to obtain an intermediate image;
the second binarization module is used for carrying out self-adaptive binarization on the intermediate image by using a preset lower limit value to obtain a second binarization image;
a foreground image obtaining module, configured to obtain a corresponding foreground image for the second binarized image by using a foreground image formula;
the pixel mean value calculating module is used for calculating the pixel mean value of the foreground image;
and the definition determining module is used for determining the definition of the original image according to the pixel mean value.
7. The determination system of claim 6, wherein the sharpness determination module is a module for determining the sharpness of the original image according to the comparison of the pixel mean and a sharpness classification table.
8. The determination system according to claim 6, wherein the first binarization module is embodied as a module for converting the gray scale map into a first binarization map using an adaptive binarization formula.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the determination method according to any one of claims 1 to 5.
10. An image recognition terminal, characterized in that it comprises a memory in which a computer program is stored and a processor which, when it calls the computer program in the memory, implements the steps of the determination method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010279010.9A CN111489344A (en) | 2020-04-10 | 2020-04-10 | Method, system and related device for determining image definition |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010279010.9A CN111489344A (en) | 2020-04-10 | 2020-04-10 | Method, system and related device for determining image definition |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111489344A true CN111489344A (en) | 2020-08-04 |
Family
ID=71798147
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010279010.9A Pending CN111489344A (en) | 2020-04-10 | 2020-04-10 | Method, system and related device for determining image definition |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111489344A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112233049A (en) * | 2020-12-14 | 2021-01-15 | 成都中轨轨道设备有限公司 | Image fusion method for improving image definition |
CN113037465A (en) * | 2021-03-11 | 2021-06-25 | 钧捷智能(深圳)有限公司 | Automobile data safety processing method and device, electronic equipment and storage medium |
CN113705501A (en) * | 2021-09-02 | 2021-11-26 | 浙江索思科技有限公司 | Offshore target detection method and system based on image recognition technology |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105488511A (en) * | 2015-11-25 | 2016-04-13 | 小米科技有限责任公司 | Image identification method and device |
-
2020
- 2020-04-10 CN CN202010279010.9A patent/CN111489344A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105488511A (en) * | 2015-11-25 | 2016-04-13 | 小米科技有限责任公司 | Image identification method and device |
Non-Patent Citations (1)
Title |
---|
王万鹏: "《基于注意机制的宫颈细胞LCT图像自动分析***的设计与实现》", 《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112233049A (en) * | 2020-12-14 | 2021-01-15 | 成都中轨轨道设备有限公司 | Image fusion method for improving image definition |
CN112233049B (en) * | 2020-12-14 | 2021-03-02 | 成都中轨轨道设备有限公司 | Image fusion method for improving image definition |
CN113037465A (en) * | 2021-03-11 | 2021-06-25 | 钧捷智能(深圳)有限公司 | Automobile data safety processing method and device, electronic equipment and storage medium |
CN113705501A (en) * | 2021-09-02 | 2021-11-26 | 浙江索思科技有限公司 | Offshore target detection method and system based on image recognition technology |
CN113705501B (en) * | 2021-09-02 | 2024-04-26 | 浙江索思科技有限公司 | Marine target detection method and system based on image recognition technology |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10896349B2 (en) | Text detection method and apparatus, and storage medium | |
CN111489344A (en) | Method, system and related device for determining image definition | |
US11107202B2 (en) | Contrast enhancement and reduction of noise in images from cameras | |
CN112215856A (en) | Image segmentation threshold determination method and device, terminal and storage medium | |
CN109729298B (en) | Image processing method and image processing apparatus | |
CN109002823B (en) | Region-of-interest determining method, device, equipment and readable storage medium | |
CN111723634A (en) | Image detection method and device, electronic equipment and storage medium | |
CN113129298B (en) | Method for identifying definition of text image | |
CN110751156A (en) | Method, system, device and medium for table line bulk interference removal | |
CN107680246B (en) | Method and equipment for positioning curve boundary in paper money pattern | |
CN113392455A (en) | House type graph scale detection method and device based on deep learning and electronic equipment | |
JP4967045B2 (en) | Background discriminating apparatus, method and program | |
CN109145918B (en) | Image segmentation and annotation method and device | |
CN112861874B (en) | Expert field denoising method and system based on multi-filter denoising result | |
CN111414919B (en) | Method, device, equipment and storage medium for extracting text of printed body picture with table | |
CN114443873A (en) | Data processing method, device, server and storage medium | |
CN110147790B (en) | Scene image trademark detection method, system and device based on adaptive threshold | |
CN114463764A (en) | Table line detection method and device, computer equipment and storage medium | |
CN114267035A (en) | Document image processing method and system, electronic device and readable medium | |
CN109643451B (en) | Line detection method | |
CN114201999A (en) | Abnormal account identification method, system, computing device and storage medium | |
CN111444932A (en) | Method and device for determining similar images | |
CN111368847B (en) | Character recognition method and device, computer equipment and storage medium | |
CN113569715B (en) | Fingerprint image enhancement method and device | |
CN111259678B (en) | Automatic information reproducing method |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200804 |
|
RJ01 | Rejection of invention patent application after publication |