CN115049595A - Image definition scoring method and system, electronic device and readable storage medium - Google Patents

Image definition scoring method and system, electronic device and readable storage medium Download PDF

Info

Publication number
CN115049595A
CN115049595A CN202210601760.2A CN202210601760A CN115049595A CN 115049595 A CN115049595 A CN 115049595A CN 202210601760 A CN202210601760 A CN 202210601760A CN 115049595 A CN115049595 A CN 115049595A
Authority
CN
China
Prior art keywords
pixel
image
distance
original image
point set
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
Application number
CN202210601760.2A
Other languages
Chinese (zh)
Inventor
曹翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Unisinsight Technology Co Ltd
Original Assignee
Chongqing Unisinsight Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chongqing Unisinsight Technology Co Ltd filed Critical Chongqing Unisinsight Technology Co Ltd
Priority to CN202210601760.2A priority Critical patent/CN115049595A/en
Publication of CN115049595A publication Critical patent/CN115049595A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/10Image enhancement or restoration using non-spatial domain filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Magnetic Resonance Imaging Apparatus (AREA)
  • Electrically Operated Instructional Devices (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to the technical field of image processing, and discloses an image definition scoring method, an image definition scoring system, electronic equipment and a readable storage medium.

Description

Image definition scoring method and system, electronic device and readable storage medium
Technical Field
The invention relates to the technical field of video processing, in particular to an image definition scoring method, an image definition scoring system, electronic equipment and a readable storage medium.
Background
In the existing monitoring device, the front face collecting component includes a camera lens and a lens sensor, the camera lens is used as an optical component for collecting images, and the lens sensor is arranged near the camera lens for acquiring various parameters collected by the camera lens, and correcting the collected images through the parameters to improve the image quality, wherein the image definition is an important parameter for measuring the image quality and is influenced by the distance between the camera lens and the lens sensor. Therefore, the grading accuracy of the image definition algorithm has great influence on the use and production of monitoring equipment, and has important significance on the reason analysis of failed materials.
At present, an image definition algorithm generally acquires specific edge features in an image, so that the definition degree of the current image is judged through a numerical value acquired through edge detection, however, the accuracy of edge detection on edge positioning is low, the number of the edge features is more than one, meanwhile, the induction of the edge detection on noise in the image is unstable, the definition change of the image cannot be correctly sensed through the edge detection, the algorithm steps are complicated, the efficiency of the image definition algorithm is low, the timeliness and the yield of actual production, processing and manufacturing are affected, and the industrial requirements cannot be met.
Disclosure of Invention
The following presents a simplified summary in order to provide a basic understanding of some aspects of the disclosed embodiments. This summary is not an extensive overview nor is intended to identify key/critical elements or to delineate the scope of such embodiments but rather as a prelude to the more detailed description that is presented later.
In view of the above-mentioned shortcomings of the prior art, the present invention discloses an image sharpness scoring method, system, electronic device and readable storage medium, so as to improve the efficiency of the image sharpness algorithm.
The invention discloses an image definition scoring method, which comprises the following steps: acquiring an original image and a focus label corresponding to the original image, and performing Fourier transform on the original image to obtain a frequency domain image corresponding to the original image; determining a target focus from pixel points of the frequency domain image according to the focus label, and grouping the pixel points based on the pixel distance between the target focus and each pixel point to obtain a pixel point set corresponding to a plurality of pixel distance intervals; determining influence coefficients corresponding to the pixel point sets according to pixel distance intervals and/or pixel quantity corresponding to the pixel point sets, and determining definition scores corresponding to the original images based on gray values of the pixels in the pixel point sets and the influence coefficients.
Optionally, the method further comprises at least one of: if the original image comprises a color image, converting the color image into a gray image after acquiring the original image and before performing Fourier change on the original image; after Fourier transformation is carried out on the original image to obtain a frequency domain image corresponding to the original image, and before a target focus is determined from pixel points of the frequency domain image according to the focus label, gray level binarization is carried out on each pixel point in the frequency domain image.
Optionally, grouping the pixel points based on the pixel distance between the target focus and each pixel point to obtain a pixel point set corresponding to a plurality of pixel distance intervals, including: acquiring a first distance threshold, a second distance threshold and a third distance threshold, wherein the first distance threshold is larger than the second distance threshold, and the second distance threshold is larger than the third distance threshold; in the frequency domain image, taking the target focus as a circle center, sequentially taking the first distance threshold, the second distance threshold and the third distance threshold as radii to establish a circular area, and respectively obtaining a first circular area, a second circular area and a third circular area; establishing a first point set according to pixel points outside the first circular area, wherein the pixel distance interval corresponding to the first point set is greater than the first distance threshold; establishing a second point set according to pixel points which are located in the first circular area and outside the second circular area, wherein the pixel distance interval corresponding to the second point set is smaller than the first distance threshold and larger than the second distance threshold; establishing a third point set according to pixel points which are located in the second circular area and outside the third circular area, wherein the pixel distance interval corresponding to the third point set is smaller than the second distance threshold and larger than the third distance threshold; establishing a fourth point set according to the pixel points located in the third circular area, wherein the pixel distance interval corresponding to the fourth point set is smaller than the third distance threshold; determining the first, second, third, and fourth sets of points as a set of pixel points.
Optionally, determining an influence coefficient corresponding to the set of pixel points by the following formula: alpha is alpha i =(S i +β)·(N i + lambda), in which alpha i For the impact coefficient corresponding to the ith pixel point set, S i Is the minimum value in the pixel distance interval corresponding to the ith pixel point set, beta is a preset distance coefficient, N i The number of the pixels corresponding to the ith pixel point set is lambda, which is a preset number coefficient.
Optionally, determining a corresponding sharpness score of the original image by the following formula:
Figure BDA0003669594580000021
in the formula, FV is the definition fraction corresponding to the original image, n is the number of pixel point sets, G i Is the sum of gray values, alpha, corresponding to pixel points in the ith pixel set i And the influence coefficients corresponding to the pixel points in the ith pixel point set are obtained.
Optionally, the method further comprises: acquiring an image acquisition device, wherein the image acquisition device comprises a device lens and a lens sensor; adjusting the testing distance between the camera lens and the lens sensor based on a preset adjusting speed, and acquiring a sample image and a testing distance corresponding to the sample image by the image acquisition equipment after every preset time period; determining a definition score corresponding to each sample image, and determining an optimal distance from the testing distances based on each definition score.
Optionally, the method further comprises: acquiring an image to be detected, wherein the image to be detected comprises a plurality of regions to be detected with the same area; determining any reference region from the image to be detected, wherein the reference region is outside the region to be detected, and the area of the reference region is the same as that of the region to be detected; determining definition scores corresponding to the to-be-detected regions and definition scores corresponding to the reference regions; and comparing the definition scores corresponding to the reference area with the definition scores corresponding to the area to be detected respectively, and determining whether the area to be detected is a dark corner area or not according to the comparison result.
The invention discloses an image definition scoring system, which comprises: the acquisition module is used for acquiring an original image and a focus label corresponding to the original image, and carrying out Fourier change on the original image to obtain a frequency domain image corresponding to the original image; the grouping module is used for determining a target focus from pixel points of the frequency domain image according to the focus label, and grouping the pixel points based on the pixel distance between the target focus and each pixel point to obtain a pixel point set corresponding to a plurality of pixel distance intervals; and the grading module is used for determining the influence coefficient corresponding to the pixel point set according to the pixel distance interval and/or the number of the pixel points corresponding to the pixel point set, and determining the definition score corresponding to the original image based on the gray value of the pixel points in each pixel point set and each influence coefficient.
The invention discloses an electronic device, comprising: a processor and a memory; the memory is used for storing computer programs, and the processor is used for executing the computer programs stored by the memory so as to make the electronic equipment execute the method.
The invention discloses a computer-readable storage medium, on which a computer program is stored: which when executed by a processor implements the method described above.
The invention has the beneficial effects that:
determining a frequency domain image corresponding to an original image through Fourier change, determining a target focus from pixel points of the frequency domain image according to a focus label of the original image, dividing the pixel points into a plurality of pixel point groups based on the pixel distance between the target focus and each pixel point, and determining an influence coefficient corresponding to a pixel point set according to a pixel distance interval and/or the number of the pixel points corresponding to the pixel point set, thereby determining a definition score corresponding to the original image based on a gray value of the pixel points in each pixel point set and each influence coefficient. Therefore, the frequency domain gray value is in direct proportion to the image definition, the original image is converted into the frequency domain image from the time domain image, the pixel point groups are divided according to the distance between the original image and the target focus, the influence coefficient corresponding to each pixel point group is determined, and then the definition score of the original image is determined through the gray value of the pixel point and the influence coefficient of the pixel point group.
Drawings
FIG. 1 is a flow chart of a method for scoring sharpness of an image according to an embodiment of the present invention;
FIG. 2-a is a schematic diagram of a gray scale map corresponding to an original image in an embodiment of the present invention;
FIG. 2-b is a schematic diagram of a frequency domain image corresponding to an original image according to an embodiment of the present invention;
FIG. 2-c is a schematic diagram of a set of pixel points in a frequency domain image in an embodiment of the invention;
FIG. 3 is a schematic flowchart of an optimal distance determining method based on an image sharpness scoring method according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating an image under test according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an image sharpness scoring system according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device in an embodiment of the present invention.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It should be noted that, in the following embodiments and examples, subsamples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
In the following description, numerous details are set forth to provide a more thorough explanation of embodiments of the present invention, however, it will be apparent to one skilled in the art that embodiments of the present invention may be practiced without these specific details, and in other embodiments, well-known structures and devices are shown in block diagram form, rather than in detail, in order to avoid obscuring embodiments of the present invention.
The terms "first," "second," and the like in the description and in the claims, and the above-described drawings of embodiments of the present disclosure, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the present disclosure described herein may be made. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions.
The term "plurality" means two or more unless otherwise specified.
In the embodiment of the present disclosure, the character "/" indicates that the preceding and following objects are in an or relationship. For example, A/B represents: a or B.
The term "and/or" is an associative relationship that describes objects, meaning that three relationships may exist. For example, a and/or B, represents: a or B, or A and B.
With reference to fig. 1, an embodiment of the present disclosure provides an image sharpness scoring method, including:
step S101, acquiring an original image and a focus label corresponding to the original image, and performing Fourier transform on the original image to obtain a frequency domain image corresponding to the original image;
step S102, determining a target focus from pixel points of a frequency domain image according to a focus label, and grouping the pixel points based on the pixel distance between the target focus and each pixel point to obtain a pixel point set corresponding to a plurality of pixel distance intervals;
step S103, determining an influence coefficient corresponding to the pixel point set according to the pixel distance interval and/or the number of pixel points corresponding to the pixel point set;
and step S104, determining the corresponding definition score of the original image based on the gray value of the pixel point in each pixel point set and each influence coefficient.
By adopting the image definition grading method provided by the embodiment of the disclosure, the frequency domain image corresponding to the original image is determined through Fourier change, the target focus is determined from the pixel points of the frequency domain image according to the focus label of the original image, the pixel points are divided into a plurality of pixel point groups based on the pixel distance between the target focus and each pixel point, and the influence coefficient corresponding to the pixel point set is determined according to the pixel distance interval and/or the pixel point number corresponding to the pixel point set, so that the definition score corresponding to the original image is determined based on the gray value of the pixel point in each pixel point set and each influence coefficient. Therefore, the frequency domain gray value is in direct proportion to the image definition, the original image is converted into the frequency domain image from the time domain image, the pixel point groups are divided according to the distance between the original image and the target focus, the influence coefficient corresponding to each pixel point group is determined, and then the definition score of the original image is determined through the gray value of the pixel point and the influence coefficient of the pixel point group.
In some embodiments, the time domain image is converted into the frequency domain image based on the fourier algorithm logic, and the image in any range in the frequency domain image is less clear as the gray value of the pixel in the range is smaller, so that the definition of the time domain image can be assumed to be the superposition of the gray values of the pixel points in the frequency domain image, and the larger the total value obtained by the superposition is, the clearer the time domain image is.
Optionally, the method further comprises at least one of: if the original image comprises a color image, converting the color image into a gray image after the original image is obtained and before Fourier change is carried out on the original image; after Fourier transformation is carried out on the original image to obtain a frequency domain image corresponding to the original image, and before a target focus is determined from pixel points of the frequency domain image according to a focus label, gray level binarization is carried out on each pixel point in the frequency domain image.
Optionally, grouping the pixel points based on the pixel distance between the target focus and each pixel point to obtain a pixel point set corresponding to a plurality of pixel distance intervals, where the grouping includes: acquiring a first distance threshold, a second distance threshold and a third distance threshold, wherein the first distance threshold is larger than the second distance threshold, and the second distance threshold is larger than the third distance threshold; in the frequency domain image, a target focus is used as a circle center, a first distance threshold, a second distance threshold and a third distance threshold are sequentially used as radiuses to establish a circular area, and a first circular area, a second circular area and a third circular area are obtained respectively; establishing a first point set according to pixel points outside the first circular area, wherein the pixel distance interval corresponding to the first point set is greater than a first distance threshold; establishing a second point set according to pixel points which are positioned in the first circular area and outside the second circular area, wherein the pixel distance interval corresponding to the second point set is smaller than the first distance threshold and larger than the second distance threshold; establishing a third point set according to pixel points which are positioned in the second circular area and outside the third circular area, wherein the pixel distance interval corresponding to the third point set is smaller than the second distance threshold and larger than the third distance threshold; establishing a fourth point set according to the pixel points located in the third circular area, wherein the pixel distance interval corresponding to the fourth point set is smaller than a third distance threshold; and determining the first point set, the second point set, the third point set and the fourth point set as pixel point sets.
Optionally, the influence coefficient corresponding to the pixel point set is determined by the following formula:
α i =(S i +β)·(N i +λ),
in the formula, alpha i For the impact coefficient corresponding to the ith pixel point set, S i Is the minimum value in the pixel distance interval corresponding to the ith pixel point set, beta is a preset distance coefficient, N i The number of pixels corresponding to the ith pixel point set is lambdaA number factor is set.
Optionally, the corresponding sharpness score of the original image is determined by the following formula:
Figure BDA0003669594580000061
in the formula, FV is the corresponding definition score of the original image, n is the number of pixel point sets, G i Is the sum of gray values, alpha, corresponding to pixel points in the ith pixel set i And the influence coefficients corresponding to the pixel points in the ith pixel point set are obtained.
In some embodiments, an original image is acquired, the original image is converted into a gray scale map, and the converted gray scale map is shown in FIG. 2-a; performing Fourier transformation on a gray scale image corresponding to the original image to obtain a frequency domain image corresponding to the original image, and performing gray binarization on each pixel point in the frequency domain image to enable the gray scale value of each pixel point to be 0 or 1, wherein the frequency domain image after gray binarization is shown in figure 2-b; determining pixel points in the center of the frequency domain image as target focal points according to the focal point labels, respectively establishing circular areas by using a first distance threshold, a second distance threshold and a third distance threshold based on the target focal points, respectively obtaining a first circular area, a second circular area and a third circular area, and further obtaining a first point set A, a second point set B, a third point set C and a fourth point set D according to the first circular area, the second circular area and the third circular area, wherein the point sets are shown in fig. 2-C; and determining the definition score corresponding to the original image according to the first point set A, the second point set B, the third point set C and the fourth point set D.
Optionally, the method further comprises: acquiring an image acquisition device, wherein the image acquisition device comprises a device lens and a lens sensor; adjusting the testing distance between a camera lens and a lens sensor based on a preset adjusting speed, and acquiring a sample image and a testing distance corresponding to the sample image by image acquisition equipment after every preset time period; and determining the definition scores corresponding to the sample images, and determining the optimal distance from the testing distances based on the definition scores.
Optionally, after acquiring the sample image and the test distance corresponding to the sample image by the image acquisition device every preset time period, the method further includes: the method comprises the steps of taking a testing distance between a camera lens and a lens sensor as an X axis, taking definition scores corresponding to sample images as a Y axis, establishing a definition change graph of the testing distance and the definition scores according to the sample images, and taking the testing distance with the highest definition score as an optimal distance between the camera lens and the lens sensor through the definition change graph.
With reference to fig. 3, an embodiment of the present disclosure provides an optimal distance determining method based on an image sharpness scoring method, including:
step S301, acquiring an image acquisition device, an initialization distance and a final distance;
the image acquisition equipment comprises an equipment lens and a lens sensor;
step S302, taking the initialization distance as a test distance between a camera lens and a lens sensor;
step S303, adjusting the testing distance between the camera lens and the lens sensor based on a preset adjusting speed until the final distance is reached;
wherein adjusting comprises increasing or decreasing;
step S304, collecting sample images and test distances corresponding to the sample images by image collecting equipment after every preset time period when the test distances are adjusted;
step S305, determining the corresponding definition scores of the sample images;
step S306, determining an optimal distance from the test distances based on each definition score;
in step S307, the optimal distance is used as the test distance between the camera lens and the lens sensor.
Optionally, the method further comprises: acquiring an image to be detected, wherein the image to be detected comprises a plurality of regions to be detected with the same area; determining any reference region from the image to be detected, wherein the reference region is outside the region to be detected, and the area of the reference region is the same as that of the region to be detected; determining definition scores corresponding to the regions to be detected and definition scores corresponding to the reference regions; and respectively comparing the definition scores corresponding to the reference area with the definition scores corresponding to the area to be detected, and determining whether the area to be detected is a dark corner area or not according to the comparison result.
In some embodiments, an image to be detected is obtained, wherein a region to be detected E exists at each of four corners of the image to be detected; determining a reference region F from the image to be measured, wherein the image to be measured comprising the region to be measured and the reference region is shown in FIG. 4; determining definition scores corresponding to the region to be detected and the reference region; respectively calculating the score difference value of the definition scores corresponding to the reference region and the definition scores corresponding to the regions to be detected; and if the score difference is larger than the preset threshold, determining that a dark corner exists in the area to be detected corresponding to the score difference.
By adopting the image definition scoring method provided by the embodiment of the disclosure, the frequency domain image corresponding to the original image is determined through Fourier change, the target focus is determined from the pixel points of the frequency domain image according to the focus label of the original image, the pixel points are divided into a plurality of pixel point groups based on the pixel distance between the target focus and each pixel point, and the influence coefficient corresponding to the pixel point set is determined according to the pixel distance interval and/or the pixel point number corresponding to the pixel point set, so that the definition score corresponding to the original image is determined based on the gray value of the pixel point in each pixel point set and each influence coefficient, and the method has the following advantages:
firstly, because the frequency domain gray value is in direct proportion to the image definition, an original image is converted into a frequency domain image from a time domain image, a plurality of pixel point groups are divided according to the distance between the original image and a target focus, the influence coefficient corresponding to each pixel point group is determined, and then the definition score of the original image is determined through the gray value of the pixel points and the influence coefficient of the pixel point groups;
and secondly, the method is implemented on a hardware platform, is popularized to the functions of lens adjustment, vignetting detection and the like, improves the application range of detection and has high test universality.
As shown in fig. 5, an embodiment of the present disclosure provides an image sharpness scoring system, which includes an obtaining module 501, a changing module 502, a grouping module 503, and a scoring module 504, wherein,
the obtaining module 501 is configured to obtain an original image and a focus label corresponding to the original image;
the changing module 502 is configured to perform fourier change on the original image to obtain a frequency domain image corresponding to the original image;
the grouping module 503 is configured to determine a target focus from the pixel points of the frequency domain image according to the focus label, and group the pixel points based on the pixel distance between the target focus and each pixel point to obtain a pixel point set corresponding to a plurality of pixel distance intervals;
the scoring module 504 is configured to determine an influence coefficient corresponding to the pixel point set according to the pixel distance interval and/or the number of the pixel points corresponding to the pixel point set, and determine a sharpness score corresponding to the original image based on the gray-level value of the pixel points in each pixel point set and each influence coefficient.
By adopting the image definition scoring system provided by the embodiment of the disclosure, the frequency domain image corresponding to the original image is determined through Fourier change, the target focus is determined from the pixel points of the frequency domain image according to the focus label of the original image, the pixel points are divided into a plurality of pixel point groups based on the pixel distance between the target focus and each pixel point, and the influence coefficient corresponding to the pixel point set is determined according to the pixel distance interval and/or the pixel point number corresponding to the pixel point set, so that the definition score corresponding to the original image is determined based on the gray value of the pixel point in each pixel point set and each influence coefficient. Therefore, the frequency domain gray value is in direct proportion to the image definition, the original image is converted into the frequency domain image from the time domain image, the pixel point groups are divided according to the distance between the original image and the target focus, the influence coefficient corresponding to each pixel point group is determined, and then the definition score of the original image is determined through the gray value of the pixel point and the influence coefficient of the pixel point group.
As shown in fig. 6, an embodiment of the present disclosure provides an electronic device, including: a processor (processor)600 and a memory (memory) 601; the memory is used for storing computer programs, and the processor is used for executing the computer programs stored in the memory so as to enable the terminal to execute the method in the embodiment. Optionally, the electronic device may further comprise a Communication Interface 602 and a bus 603. The processor 600, the communication interface 602, and the memory 601 may communicate with each other via a bus 603. The communication interface 602 may be used for information transfer. The processor 600 may call logic instructions in the memory 601 to perform the methods in the embodiments described above.
In addition, the logic instructions in the memory 601 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products.
The memory 601 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, such as program instructions/modules corresponding to the methods in the embodiments of the present disclosure. The processor 600 executes the functional application and data processing by executing the program instructions/modules stored in the memory 601, i.e. implements the method in the above-described embodiments.
The memory 601 may include a storage program area and a database file area, wherein the storage program area may store an operating system, an application program required for at least one function; the database file area may store data created according to the use of the terminal device, and the like. In addition, the memory 601 may include a high speed random access memory, and may also include a non-volatile memory.
By adopting the electronic equipment provided by the embodiment of the disclosure, the frequency domain image corresponding to the original image is determined through Fourier change, the target focus is determined from the pixel points of the frequency domain image according to the focus label of the original image, the pixel points are divided into a plurality of pixel point groups based on the pixel distance between the target focus and each pixel point, and the influence coefficient corresponding to the pixel point set is determined according to the pixel distance interval and/or the pixel point number corresponding to the pixel point set, so that the definition score corresponding to the original image is determined based on the gray value of the pixel point in each pixel point set and each influence coefficient. Therefore, the frequency domain gray value is in direct proportion to the image definition, the original image is converted into the frequency domain image from the time domain image, the pixel point groups are divided according to the distance between the original image and the target focus, the influence coefficient corresponding to each pixel point group is determined, and then the definition score of the original image is determined through the gray value of the pixel point and the influence coefficient of the pixel point group.
The disclosed embodiments also provide a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements any of the methods in the embodiments.
The computer-readable storage medium in the embodiments of the present disclosure may be understood by those skilled in the art as follows: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with a computer program. The aforementioned computer program may be stored in a computer readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The electronic device disclosed in this embodiment includes a processor, a memory, a transceiver, and a communication interface, where the memory and the communication interface are connected to the processor and the transceiver and perform mutual communication, the memory is used to store a computer program, the communication interface is used to perform communication, and the processor and the transceiver are used to run the computer program, so that the electronic device performs the steps of the above method.
In this embodiment, the Memory may include a Random Access Memory (RAM), and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
The above description and drawings sufficiently illustrate embodiments of the disclosure to enable those skilled in the art to practice them. Other embodiments may incorporate structural, logical, electrical, process, and other changes. The examples merely typify possible variations. Individual components and functions are optional unless explicitly required, and the sequence of operations may vary. Portions and subsamples of some embodiments may be included in or substituted for portions and subsamples of other embodiments. Furthermore, the words used in the specification are words of description only and are not intended to limit the claims. As used in the description of the embodiments and the claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Similarly, the term "and/or" as used in this application is meant to encompass any and all possible combinations of one or more of the associated listed. Furthermore, the terms "comprises," "comprising," and variations thereof, when used in this application, specify the presence of stated sub-samples, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other sub-samples, integers, steps, operations, elements, components, and/or groups thereof. Without further limitation, an element defined by the phrase "comprising an …" does not exclude the presence of other like elements in a process, method or apparatus that comprises the element. In this document, each embodiment may be described with emphasis on differences from other embodiments, and the same and similar parts between the respective embodiments may be referred to each other. For methods, products, etc. of the embodiment disclosures, reference may be made to the description of the method section for relevance if it corresponds to the method section of the embodiment disclosure.
Those of skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software may depend upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments. It can be clearly understood by the skilled person that, for convenience and brevity of description, the specific working processes of the system, the apparatus and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments disclosed herein, the disclosed methods, products (including but not limited to devices, apparatuses, etc.) may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units may be only one logical division, and there may be other divisions in actual implementation, for example, a plurality of units or components may be combined or may be integrated into another system, or some subsamples may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form. The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to implement the present embodiment. In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. In the description corresponding to the flowcharts and block diagrams in the figures, operations or steps corresponding to different blocks may also occur in different orders than disclosed in the description, and sometimes there is no specific order between the different operations or steps. For example, two sequential operations or steps may in fact be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. Each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

Claims (10)

1. An image sharpness scoring method, characterized by comprising:
acquiring an original image and a focus label corresponding to the original image, and performing Fourier transform on the original image to obtain a frequency domain image corresponding to the original image;
determining a target focus from pixel points of the frequency domain image according to the focus label, and grouping the pixel points based on the pixel distance between the target focus and each pixel point to obtain a pixel point set corresponding to a plurality of pixel distance intervals;
determining influence coefficients corresponding to the pixel point sets according to pixel distance intervals and/or pixel quantity corresponding to the pixel point sets, and determining definition scores corresponding to the original images based on gray values of the pixels in the pixel point sets and the influence coefficients.
2. The method of claim 1, further comprising at least one of:
if the original image comprises a color image, converting the color image into a gray image after acquiring the original image and before performing Fourier change on the original image;
after Fourier transformation is carried out on the original image to obtain a frequency domain image corresponding to the original image, and before a target focus is determined from pixel points of the frequency domain image according to the focus label, gray level binarization is carried out on each pixel point in the frequency domain image.
3. The method of claim 1, wherein grouping the pixels based on the pixel distance between the target focus and each of the pixels to obtain a set of pixel points corresponding to a plurality of pixel distance intervals comprises:
acquiring a first distance threshold, a second distance threshold and a third distance threshold, wherein the first distance threshold is larger than the second distance threshold, and the second distance threshold is larger than the third distance threshold;
in the frequency domain image, taking the target focus as a circle center, sequentially taking the first distance threshold, the second distance threshold and the third distance threshold as radii to establish a circular area, and respectively obtaining a first circular area, a second circular area and a third circular area;
establishing a first point set according to pixel points outside the first circular area, wherein the pixel distance interval corresponding to the first point set is greater than the first distance threshold;
establishing a second point set according to pixel points which are located in the first circular area and outside the second circular area, wherein the pixel distance interval corresponding to the second point set is smaller than the first distance threshold and larger than the second distance threshold;
establishing a third point set according to pixel points which are located in the second circular area and outside the third circular area, wherein the pixel distance interval corresponding to the third point set is smaller than the second distance threshold and larger than the third distance threshold;
establishing a fourth point set according to the pixel points located in the third circular area, wherein the pixel distance interval corresponding to the fourth point set is smaller than the third distance threshold;
determining the first, second, third, and fourth sets of points as a set of pixel points.
4. The method of claim 1, wherein the impact coefficient corresponding to the set of pixel points is determined by the following equation:
α i =(S i +β)·(N i +λ),
in the formula, alpha i For the impact coefficient corresponding to the ith pixel point set, S i Is the minimum value in the pixel distance interval corresponding to the ith pixel point set, beta is a preset distance coefficient, N i The number of the pixels corresponding to the ith pixel point set is lambda, which is a preset number coefficient.
5. The method of claim 4, wherein the sharpness score corresponding to the original image is determined by the following equation:
Figure FDA0003669594570000021
in the formula, FV is the definition fraction corresponding to the original image, n is the number of pixel point sets, G i Is the sum of gray values, alpha, corresponding to pixel points in the ith pixel set i Is the ith pixel pointAnd (5) concentrating influence coefficients corresponding to the pixel points.
6. The method according to any one of claims 1 to 5, further comprising:
acquiring an image acquisition device, wherein the image acquisition device comprises a device lens and a lens sensor;
adjusting the testing distance between the camera lens and the lens sensor based on a preset adjusting speed, and acquiring a sample image and a testing distance corresponding to the sample image by the image acquisition equipment after every preset time period;
determining a definition score corresponding to each sample image, and determining an optimal distance from the testing distances based on each definition score.
7. The method according to any one of claims 1 to 5, further comprising:
acquiring an image to be detected, wherein the image to be detected comprises a plurality of regions to be detected with the same area;
determining any reference region from the image to be detected, wherein the reference region is outside the region to be detected, and the area of the reference region is the same as that of the region to be detected;
determining definition scores corresponding to the regions to be detected and definition scores corresponding to the reference regions;
and comparing the definition scores corresponding to the reference area with the definition scores corresponding to the area to be detected respectively, and determining whether the area to be detected is a dark corner area or not according to the comparison result.
8. An image definition scoring system, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring an original image and a focus label corresponding to the original image;
the change module is used for carrying out Fourier change on the original image to obtain a frequency domain image corresponding to the original image;
the grouping module is used for determining a target focus from pixel points of the frequency domain image according to the focus label, and grouping the pixel points based on the pixel distance between the target focus and each pixel point to obtain a pixel point set corresponding to a plurality of pixel distance intervals;
and the grading module is used for determining the influence coefficients corresponding to the pixel point sets according to the pixel distance intervals and/or the pixel quantity corresponding to the pixel point sets, and determining the definition scores corresponding to the original images based on the gray values of the pixels in the pixel point sets and the influence coefficients.
9. An electronic device, comprising: a processor and a memory;
the memory is configured to store a computer program and the processor is configured to execute the computer program stored by the memory to cause the electronic device to perform the method of any of claims 1 to 7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that:
the computer program, when executed by a processor, implements the method of any one of claims 1 to 7.
CN202210601760.2A 2022-05-30 2022-05-30 Image definition scoring method and system, electronic device and readable storage medium Pending CN115049595A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210601760.2A CN115049595A (en) 2022-05-30 2022-05-30 Image definition scoring method and system, electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210601760.2A CN115049595A (en) 2022-05-30 2022-05-30 Image definition scoring method and system, electronic device and readable storage medium

Publications (1)

Publication Number Publication Date
CN115049595A true CN115049595A (en) 2022-09-13

Family

ID=83160099

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210601760.2A Pending CN115049595A (en) 2022-05-30 2022-05-30 Image definition scoring method and system, electronic device and readable storage medium

Country Status (1)

Country Link
CN (1) CN115049595A (en)

Similar Documents

Publication Publication Date Title
CN112818988B (en) Automatic identification reading method and system for pointer instrument
CN103759758B (en) A kind of method for detecting position of the automobile meter pointer based on mechanical angle and scale identification
CN106651828B (en) Method for measuring sub-pixel of product size under industrial small-scale motion blur imaging condition
CN102428345A (en) Distance measuring device and distance measuring method
CN110766095A (en) Defect detection method based on image gray level features
CN114782329A (en) Bearing defect damage degree evaluation method and system based on image processing
CN110443242B (en) Reading frame detection method, target recognition model training method and related device
CN111428539A (en) Target tracking method and device
CN112198878B (en) Instant map construction method and device, robot and storage medium
CN110633620A (en) Pointer instrument scale identification method and electronic equipment
CN114945938A (en) Method and device for detecting actual area of defect and method and device for detecting display panel
CN113313047A (en) Lane line detection method and system based on lane structure prior
CN111310753A (en) Meter alignment method and device
CN107230212B (en) Vision-based mobile phone size measuring method and system
CN111582270A (en) Identification tracking method based on high-precision bridge region visual target feature points
CN116342538A (en) Method and device for detecting running and leaking, intelligent equipment and storage medium
CN108447092B (en) Method and device for visually positioning marker
CN107392948B (en) Image registration method of amplitude-division real-time polarization imaging system
CN113592839A (en) Distribution network line typical defect diagnosis method and system based on improved fast RCNN
CN115049595A (en) Image definition scoring method and system, electronic device and readable storage medium
CN115588196A (en) Pointer type instrument reading method and device based on machine vision
CN108564571B (en) Image area selection method and terminal equipment
CN116628531A (en) Crowd-sourced map road object element clustering method, system and storage medium
CN115760808A (en) Method, system and device for measuring size of plate glass and readable storage medium
CN114255458A (en) Method and system for identifying reading of pointer instrument in inspection scene

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