WO2024016632A1 - Bright spot location method, bright spot location apparatus, electronic device and storage medium - Google Patents

Bright spot location method, bright spot location apparatus, electronic device and storage medium Download PDF

Info

Publication number
WO2024016632A1
WO2024016632A1 PCT/CN2023/074781 CN2023074781W WO2024016632A1 WO 2024016632 A1 WO2024016632 A1 WO 2024016632A1 CN 2023074781 W CN2023074781 W CN 2023074781W WO 2024016632 A1 WO2024016632 A1 WO 2024016632A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
bright spot
grayscale image
target
perform
Prior art date
Application number
PCT/CN2023/074781
Other languages
French (fr)
Chinese (zh)
Inventor
陈伟
王谷丰
赵陆洋
Original Assignee
深圳赛陆医疗科技有限公司
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 深圳赛陆医疗科技有限公司 filed Critical 深圳赛陆医疗科技有限公司
Publication of WO2024016632A1 publication Critical patent/WO2024016632A1/en

Links

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/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Definitions

  • the present invention relates to the field of positioning technology, and in particular to a bright spot positioning method, a bright spot positioning device, electronic equipment and a storage medium.
  • the main purpose of the embodiments of the present invention is to propose a bright spot positioning method, a bright spot positioning device, electronic equipment and a storage medium, aiming to improve the accuracy of bright spot positioning.
  • a first aspect of the embodiment of the present invention proposes a bright spot positioning method, which method includes:
  • the target bright spot is positioned through a preset algorithm to obtain the position data and light intensity data of the target bright spot.
  • the step of performing image preprocessing on the original grayscale image to obtain an initial background image includes:
  • the step of performing binary segmentation on the signal-to-noise ratio matrix to obtain a binary image includes:
  • the step of performing image equalization processing on the original grayscale image according to the binary image to obtain an initial grayscale image includes:
  • the original grayscale image is brightness normalized according to the foreground brightness mean value to obtain the initial grayscale image.
  • the step of performing image filtering on the initial grayscale image to obtain a target grayscale image includes:
  • the step of performing bright spot detection on the target grayscale image according to the binary image to obtain the target bright spot includes:
  • the initial bright spots are detected according to preset filtering conditions to obtain the target bright spots.
  • the position data includes sub-pixel center coordinates
  • the light intensity data includes light intensity values
  • the target bright spot is positioned through a preset algorithm to obtain the position data and light intensity of the target bright spot.
  • Steps to strong data include:
  • the brightness of the sub-pixel center coordinates is extracted using a quadratic spline interpolation method to obtain the light intensity value of the target bright spot.
  • a second aspect of the embodiment of the present invention proposes a bright spot positioning device, the device includes:
  • Image acquisition module used to acquire the original grayscale image to be processed
  • An image preprocessing module used to perform image preprocessing on the original grayscale image to obtain an initial background image
  • An image segmentation module used to perform binary segmentation on the signal-to-noise ratio matrix to obtain a binary image
  • An image equalization module configured to perform image equalization processing on the original grayscale image according to the binary image to obtain an initial grayscale image
  • An image filtering module used to perform image filtering processing on the initial grayscale image to obtain a target grayscale image
  • a bright spot detection module configured to perform bright spot detection on the target grayscale image based on the binary image to obtain the target bright spot
  • a positioning module is used to perform positioning processing on the target bright spot through a preset algorithm to obtain position data and light intensity data of the target bright spot.
  • a third aspect of the embodiment of the present invention proposes an electronic device.
  • the electronic device includes a memory, a processor, a program stored on the memory and executable on the processor, and a program for A data bus that implements connection and communication between the processor and the memory.
  • the program is executed by the processor, the method described in the first aspect is implemented.
  • the fourth aspect of the embodiment of the present invention proposes a storage medium.
  • the storage medium is a computer-readable storage medium for computer-readable storage.
  • the storage medium stores one or more programs.
  • the one or more programs may be executed by one or more processors to implement the method described in the first aspect above.
  • the bright spot positioning method, bright spot positioning device, electronic equipment and storage medium proposed by the present invention obtain an original grayscale image to be processed; perform image preprocessing on the original grayscale image to obtain an initial background image; and perform image processing on the original grayscale image and
  • the initial background image is ratio calculated to obtain a signal-to-noise ratio matrix, and the signal-to-noise ratio matrix is binarized and segmented to obtain a binarized image, which can improve the accuracy of image background estimation and image segmentation.
  • image equalization processing is performed on the original grayscale image according to the binary image to obtain an initial grayscale image, which can globally equalize the initial grayscale image.
  • the target grayscale image is obtained.
  • Figure 1 is a flow chart of a bright spot positioning method provided by an embodiment of the present invention
  • FIG. 2 is a flow chart of step S102 in Figure 1;
  • FIG. 3 is a flow chart of step S104 in Figure 1;
  • FIG. 4 is a flow chart of step S105 in Figure 1;
  • FIG. 5 is a flow chart of step S106 in Figure 1;
  • Figure 6 is a flow chart of step S107 in Figure 1;
  • FIG. 7 is a flow chart of step S108 in Figure 1;
  • Figure 8 is a schematic structural diagram of a bright spot positioning device provided by an embodiment of the present invention.
  • Figure 9 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention.
  • Artificial intelligence It is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence; artificial intelligence is a branch of computer science, artificial intelligence Intelligence attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a manner similar to human intelligence. Research in this field includes robotics, language recognition, image recognition, natural language processing, and expert systems. Artificial intelligence can simulate the information process of human consciousness and thinking. Artificial intelligence is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
  • the binarization of the image is to set the grayscale value of the pixels on the image to 0 or 255, which means that the entire image presents an obvious visual effect of only black and white.
  • Center of gravity method In physics, if you want an object to remain vertically stationary or move in a straight line at a uniform speed, then this point is the center of gravity. The center of gravity method first marks the position of each location in the coordinate system, with the purpose of determining the relative distance of each point. In international site selection, longitude and latitude are often used to establish coordinates. Then, based on the horizontal and vertical coordinate values of each point in the coordinate system, the location coordinates X and Y with the lowest transportation cost are obtained.
  • Interpolation Interpolate a continuous function on the basis of discrete data, so that this continuous curve passes through all discrete points, and the approximate value of the function at other points can also be estimated.
  • Spline interpolation A mathematical method that uses variable splines to create a smooth curve through a series of points.
  • the interpolation spline is composed of some polynomials. Each polynomial is determined by two adjacent data points. Any two adjacent polynomials and their derivatives are continuous at the connecting points.
  • Spline interpolation method A function is determined between every two points. This function is a spline. Different functions lead to different splines. Then all splines are segmented into one function, which is the final interpolation function.
  • embodiments of the present invention provide a bright spot positioning method, a bright spot positioning device, electronic equipment and a storage medium, aiming to improve the accuracy of bright spot positioning.
  • the bright spot positioning method, bright spot positioning device, electronic equipment and storage medium provided by the embodiments of the present invention are specifically described through the following embodiments. First, the bright spot positioning method in the embodiment of the present invention is described.
  • Embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology.
  • Artificial Intelligence is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. .
  • Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation/interaction systems, mechatronics and other technologies.
  • Artificial intelligence software technology mainly includes computer vision technology, robotics technology, biometric technology, speech processing technology, natural language processing technology, and machine learning/deep learning.
  • the bright spot positioning method provided by the embodiment of the present invention relates to the field of artificial intelligence technology.
  • the bright spot positioning method provided by the embodiment of the present invention can be applied in a terminal or a server, or can be software running in the terminal or the server.
  • the terminal can be a smartphone, a tablet, a laptop, a desktop computer, etc.
  • the server can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers. It can be configured to provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
  • Server software can be an application that implements a bright spot positioning method, etc., but is not limited to the above forms.
  • the present invention may be used in a variety of general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, including Distributed computing environment for any of the above systems or devices, etc.
  • the present invention can be Described in the general context of computer-executable instructions, such as program modules, being executed by a computer.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • the present invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network.
  • program modules may be located in both local and remote computer storage media including storage devices.
  • Figure 1 is an optional flow chart of a bright spot positioning method provided by an embodiment of the present invention.
  • the method in Figure 1 may include, but is not limited to, steps S101 to S108.
  • Step S101 obtain the original grayscale image to be processed
  • Step S102 perform image preprocessing on the original grayscale image to obtain an initial background image
  • Step S103 perform ratio calculation on the original grayscale image and the initial background image to obtain a signal-to-noise ratio matrix
  • Step S104 perform binary segmentation on the signal-to-noise ratio matrix to obtain a binary image
  • Step S108 perform image equalization processing on the original grayscale image based on the binary image to obtain an initial grayscale image
  • Step S106 perform image filtering processing on the initial grayscale image to obtain the target grayscale image
  • Step S107 Perform bright spot detection on the target grayscale image based on the binary image to obtain the target bright spot;
  • Step S108 perform positioning processing on the target bright spot through a preset algorithm to obtain position data and light intensity data of the target bright spot.
  • the steps S101 to S108 shown in the embodiment of the present invention are to obtain the original grayscale image to be processed; perform image preprocessing on the original grayscale image to obtain an initial background image; and perform a ratio calculation on the original grayscale image and the initial background image. , obtain the signal-to-noise ratio matrix, and perform binary segmentation on the signal-to-noise ratio matrix to obtain a binary image, which can improve the accuracy of image background estimation and image segmentation. Further, image equalization processing is performed on the original grayscale image according to the binary image to obtain an initial grayscale image, which can globally equalize the initial grayscale image. At the same time, by performing image filtering processing on the initial grayscale image, the target grayscale image is obtained. degree image, which can improve the quality of the target image.
  • a fluorescence grayscale image can be acquired by camera shooting, and the captured fluorescence grayscale image can be used as the original grayscale image to be processed, wherein the image format of the original grayscale image can be TIF format, Image size can be 4116 ⁇ 2176.
  • step S102 may include but is not limited to steps S201 to step S203:
  • Step S201 perform histogram statistics on the original grayscale image within a preset interval to obtain a brightness histogram
  • Step S202 perform feature extraction on the brightness histogram to obtain local background values
  • Step S203 perform background subtraction processing on the original grayscale image according to the local background value to obtain an initial background image and an initial background-removed image.
  • the size of the preset interval can be set according to actual business requirements.
  • the size of the preset interval can be n*n, where n is an integer greater than 0, for example, it can be the original grayscale.
  • n is an integer greater than 0, for example, it can be the original grayscale.
  • Hist(i, j) is the brightness histogram of the preset interval [n*n]
  • f is the original grayscale image
  • i, j is the pixel point coordinates of the original grayscale image
  • D n*n is the preset interval
  • I is the light intensity value of the original grayscale image.
  • step S202 of some embodiments feature extraction is performed on the brightness histogram, and the 30th percentile of the brightness histogram is taken as the local background value. It should be noted that in some other embodiments, other quantiles on the brightness histogram can also be selected as the local background value, but it is not limited thereto.
  • step S203 of some embodiments when performing background subtraction processing on the original grayscale image according to the local background value, the local background value is subtracted from the original grayscale image to obtain the initial background image and the initial de-background image.
  • f 1 is the initial background removal image
  • Hist 30 is the local background value, that is, the initial background image.
  • the above steps S201 to S203 use local histogram statistics to perform background estimation, which can flexibly cope with high-density and low-density fluorescent chips, and can be better compatible with background estimation under different chip densities, thereby improving the accuracy of background estimation. accuracy.
  • SNR is the signal-to-noise ratio matrix
  • f(x, y) is the original grayscale image
  • g(x, y) is the initial background image
  • x, y are the coordinates of the pixel point
  • D is the preset interval.
  • step S103 may include, but is not limited to, steps S301 to S302:
  • Step S301 perform threshold calculation based on the signal-to-noise ratio matrix and the brightness histogram to obtain a binarized threshold
  • Step S302 Binarize and segment the signal-to-noise ratio matrix according to the binarization threshold to obtain a binarized image.
  • the present invention adopts a signal-to-noise ratio screening method that is less affected by illumination to realize the preliminary screening of bright spots.
  • the preliminary screening process is embodied in the present invention. Image segmentation process.
  • T is the binarization threshold
  • mean (SNR) is the mean of the signal-to-noise ratio matrix
  • A is the median of the signal-to-noise ratio matrix
  • A can be Quantile SNR (50), that is, the median is the signal-to-noise ratio matrix
  • the 50th quantile of The quantile of , factor is the preset weight parameter, which is generally 0.5.
  • T mean(SNR)*(factor+Quantile SNR (50)/(Quantile SNR (95)/(Quantile SNR (50)))
  • step S302 of some embodiments the signal-to-noise ratio matrix is binarized and segmented according to the binarization threshold, thereby obtaining the binarized image BI.
  • the above-mentioned steps S301 to S302 perform binary segmentation of the image by using the inverse proportional algorithm of histogram statistical quantiles, which can effectively deal with the segmentation of bright spots under different densities, and can easily change the size of the binarization threshold according to the density. , when the density is high, a smaller binarization threshold is selected, and when the density is low, a larger binarization threshold is selected, thereby solving the problem of overestimation of the background in high-density scenes, thus improving the background estimation and Image segmentation accuracy.
  • step S104 may include, but is not limited to, steps S401 to S402:
  • Step S401 Calculate the brightness of the original grayscale image based on the binarized image to obtain the mean foreground brightness of the binarized image;
  • Step S402 Perform brightness normalization on the original grayscale image according to the average foreground brightness to obtain an initial grayscale image.
  • the fluorescence intensity of different areas of the original grayscale image is first evaluated. Specifically, the average fluorescence intensity within a fixed range around each pixel point can be counted, and the average fluorescence brightness value is used as the average value of the fluorescence intensity of the pixel point. Fluorescence intensity, where the size of the fixed range can be determined according to actual business Requirement settings, no restrictions. For example, find the pixels with a pixel value of 1 in the 161 ⁇ 161 area of the binary image, then obtain the mean value of the foreground elements of these pixels in the foreground image, and use this mean value of the foreground elements as the mean foreground brightness of the binary image .
  • f is the fluorescence evaluation matrix (i.e., the mean value of foreground brightness), m and n represent the height and width of the original grayscale image respectively, and f is the original grayscale image after background removal (i.e., the initial background-removed image).
  • Mean refers to finding the mean value of the foreground elements of the foreground image with a pixel value of 1 in the binary image B in the D area for the structural element D.
  • the fluorescence evaluation matrix can be used to characterize the brightness differences in different regional positions of the original grayscale image. Therefore, the brightness differences in different regional positions can be eliminated according to the fluorescence evaluation matrix, that is, the brightness differences of the original grayscale image.
  • the brightness is global brightness normalized based on the image center to obtain the initial grayscale image.
  • g'(x,y) g(x,y)*center(f')/f'(x,y); where, g'(x,y) is the initial grayscale image, g(x,y) is the original grayscale image.
  • global equalization can be used to effectively eliminate the impact of uneven lighting on image quality when capturing images, improve the detection rate of edge bright spots, reduce the probability of missed detection, and increase the total amount of data.
  • step S105 may include, but is not limited to, steps S501 to S502:
  • Step S501 perform Gaussian filtering on the initial grayscale image to obtain the first filtered image
  • Step S502 Perform Laplacian sharpening processing on the first filtered image to obtain a target grayscale image.
  • the present invention uses a two-step method to perform LoG filtering, that is, first perform Gaussian blur filtering on the initial grayscale image, and then perform Gaussian blur filtering on the image after Gaussian filtering.
  • LoG filtering that is, first perform Gaussian blur filtering on the initial grayscale image, and then perform Gaussian blur filtering on the image after Gaussian filtering.
  • step S501 of some embodiments Gaussian filtering is performed on the initial grayscale image through a Gaussian filter to remove image noise, where the image noise includes Gaussian noise and salt-and-pepper noise, and we obtain First filtered image.
  • the initial grayscale image can be subjected to Gaussian convolution processing according to a window size of 3 ⁇ 3 through a Gaussian filter to obtain the first filtered image, where the Gaussian kernel can be 0.85.
  • step S502 of some embodiments since current image imaging often has problems such as dispersion and astigmatism, the center of the image will be clear and the edges will be blurry.
  • the hat operator adopts a gradient method.
  • the kernel parameters for sharpening are different for different areas of the first filtered image.
  • the kernel parameters are generally determined based on the blur condition of the image in this area. Specifically, through rh Mexico with multiple kernel parameters
  • the hat operator performs sharpening convolution on the first filtered image to obtain the target grayscale image.
  • Gaussian noise and salt-and-pepper noise can be easily removed through Gaussian filtering.
  • Laplacian sharpening can better enhance the highlight features and improve the contrast between the foreground and background of the target grayscale image.
  • the LoG filter operator parameters adopt a regional gradient filtering strategy, which can improve the resolution of the target bright spots and also improve the discrimination of the target bright spots, where the target bright spots can be target fluorescence peak points.
  • step S106 includes but is not limited to steps S601 to S605:
  • Step S601 Perform highlight detection on the target grayscale image based on the binarized image to obtain the average foreground brightness of the binarized image;
  • Step S602 determine the intensity threshold for bright spot detection based on the average foreground brightness
  • Step S603 Construct a bright spot connected graph based on the adjacency relationship between candidate bright spots in the target grayscale image
  • Step S604 Screen the candidate bright spots of the bright spot connected graph according to the brightness values of the candidate bright spots to obtain initial bright spots;
  • Step S605 Detect the initial bright spots according to the preset filtering conditions to obtain the target bright spots.
  • the mean function is used to calculate the brightness of foreground pixels with a pixel of 1 in the binary image to obtain the mean foreground brightness of the binary image.
  • a 4-connected or 8-connected method is often used to construct a bright spot connected graph based on the adjacency relationship between candidate bright spots.
  • an 8-connected method is used to construct a bright spot connected graph for the adjacency relationships between candidate bright spots.
  • step S604 of some embodiments according to the bright spot connected graph, find 8 candidate bright spots adjacent to each candidate bright spot, and compare the 8 candidate bright spots adjacent to each candidate bright spot. If the brightness value of the candidate bright spot at the center is greater than the adjacent the brightness values of the 8 candidate bright spots, then the candidate bright spots are used as the initial bright spots. point.
  • the preset filtering conditions can be set based on multi-dimensional features such as intensity thresholds, binarized area parameters, Gaussian coefficients, and gradient direction fields.
  • the initial bright spot can be detected and filtered based on two inequalities (as shown in formula (6) and formula (7)).
  • the initial bright spot satisfies the following two inequality conditions at the same time, the initial bright spot is used as the target bright spot. .
  • Area>0.5 formula (6) SumIntensity 5*5 *GaussCeof*GradientCeof>Threshold formula (7)
  • Area is the proportion of the foreground with a binary image of 1 in the bright spot connected map, that is, more than half of the pixels in the 3*3 range of the brightness connected map should be pixels representing the foreground.
  • SumIntensity is the integral sum of energy within a range of 5*5 near the initial bright spot. SumIntensity can reflect the amount of energy that the initial bright spot can excite.
  • GaussCeof is the correlation coefficient of window pixels with a window size of 5*5 and a two-dimensional Gaussian distribution. The correlation coefficient can be obtained by performing Gaussian fitting on a large number of known bright points. The correlation coefficient can reflect the bright point shape of the initial bright points.
  • step S601 to step S605 during the process of locating target bright spots, multi-dimensional features such as intensity threshold, binarized area parameter, Gaussian coefficient and gradient direction field are integrated to screen candidate bright spots, which can more accurately find out All bright peak points in the original grayscale image can effectively improve the recall rate and precision rate of target bright spot search.
  • multi-dimensional features such as intensity threshold, binarized area parameter, Gaussian coefficient and gradient direction field are integrated to screen candidate bright spots, which can more accurately find out All bright peak points in the original grayscale image can effectively improve the recall rate and precision rate of target bright spot search.
  • Step S107 may include but is not limited to steps S701 to S702:
  • Step S701 identify the coordinates of the target bright spot through the center of gravity method, and obtain the sub-pixel center coordinates of the target bright spot;
  • Step S702 Extract the brightness of the sub-pixel center coordinates through the quadratic spline interpolation method to obtain the light intensity value of the target bright spot.
  • the relative distance between the target bright spots is calculated through the center of gravity method, and the sub-pixel center coordinates of the target bright spots are obtained according to the size of the relative distance, where the target bright spots are peak points.
  • the brightness of the sub-pixel center coordinates is extracted through quadratic spline interpolation or a quadratic function to obtain the light intensity value of the target bright spot.
  • the x86 instruction set can be used for accelerated processing, so that the highlight positioning method according to the embodiment of the present invention can meet the processing needs of real-time sequencing and industrial production. requirements.
  • the brightness positioning method of the embodiment of the present invention obtains the original grayscale image to be processed; performs image preprocessing on the original grayscale image to obtain an initial background image; and performs image processing on the original grayscale image and the initial background.
  • the image is ratio calculated to obtain a signal-to-noise ratio matrix, and the signal-to-noise ratio matrix is binarized and segmented to obtain a binarized image, which can improve the accuracy of image background estimation and image segmentation.
  • image equalization processing is performed on the original grayscale image according to the binary image to obtain an initial grayscale image, which can globally equalize the initial grayscale image.
  • the target grayscale image is obtained.
  • An embodiment of the present invention also provides a bright spot positioning device that can implement the above bright spot positioning method.
  • the device includes:
  • Image acquisition module 801 used to acquire the original grayscale image to be processed
  • Image preprocessing module 802 is used to perform image preprocessing on the original grayscale image to obtain an initial background image
  • the calculation module 803 is used to calculate the ratio of the original grayscale image and the initial background image to obtain the signal-to-noise ratio matrix
  • Image segmentation module 804 is used to perform binary segmentation on the signal-to-noise ratio matrix to obtain a binary image
  • the image equalization module 805 is used to perform image equalization processing on the original grayscale image based on the binary image to obtain an initial grayscale image;
  • the image filtering module 806 is used to perform image filtering processing on the initial grayscale image to obtain the target grayscale image
  • the bright spot detection module 807 is used to detect bright spots on the target grayscale image based on the binary image to obtain the target bright spots;
  • the positioning module 808 is used to position the target bright spot through a preset algorithm to obtain the position data and light intensity data of the target bright spot.
  • the specific implementation of the bright point positioning device is basically the same as the specific embodiment of the above-mentioned bright point positioning method, and will not be described again here.
  • An embodiment of the present invention also provides an electronic device.
  • the electronic device includes: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. , the above bright spot positioning method is implemented when the program is executed by the processor.
  • the electronic device can be any smart terminal including a tablet computer, a vehicle-mounted computer, etc.
  • the electronic device includes:
  • the processor 901 can be implemented by a general CPU (Central Processing Unit, central processing unit), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement The technical solutions provided by the embodiments of the present invention;
  • CPU Central Processing Unit
  • ASIC Application Specific Integrated Circuit
  • the memory 902 can be a read-only memory (ReadOnlyMemory, ROM) or a static storage device. It can be implemented in the form of equipment, dynamic storage device or random access memory (RandomAccessMemory, RAM).
  • the memory 902 can store operating systems and other application programs. When the technical solutions provided by the embodiments of this specification are implemented through software or firmware, the relevant program codes are stored in the memory 902 and called by the processor 901 to execute the implementation of the present invention. Example of bright spot positioning method;
  • Communication interface 904 is used to realize communication interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wirelessly (such as mobile network, WIFI, Bluetooth, etc.);
  • Bus 905 which transmits information between various components of the device (such as processor 901, memory 902, input/output interface 903, and communication interface 904);
  • the processor 901, the memory 902, the input/output interface 903 and the communication interface 904 implement communication connections between each other within the device through the bus 905.
  • Embodiments of the present invention also provide a storage medium.
  • the storage medium is a computer-readable storage medium for computer-readable storage.
  • the storage medium stores one or more programs, and the one or more programs can be processed by one or more
  • the processor is executed to implement the above bright spot positioning method.
  • memory can be used to store non-transitory software programs and non-transitory computer executable programs.
  • the memory may include high-speed random access memory and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device.
  • the memory may optionally include memory located remotely from the processor, and the remote memory may be connected to the processor via a network. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.
  • the bright spot positioning method, bright spot positioning device, electronic equipment and storage medium provided by embodiments of the present invention obtain an original grayscale image to be processed; perform image preprocessing on the original grayscale image to obtain an initial background image; and perform image preprocessing on the original grayscale image.
  • the ratio between the image and the initial background image is calculated to obtain the signal-to-noise ratio matrix, and the signal-to-noise ratio matrix is binarized and segmented to obtain a binarized image, which can improve the accuracy of image background estimation and image segmentation.
  • image equalization processing is performed on the original grayscale image according to the binary image to obtain an initial grayscale image, which can globally equalize the initial grayscale image.
  • the target grayscale image is obtained. degree image, which can improve the quality of the target image.
  • the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separate, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • At least one (item) refers to one or more, and “plurality” refers to two or more.
  • “And/or” is used to describe the relationship between associated objects, indicating that there can be three relationships. For example, “A and/or B” can mean: only A exists, only B exists, and A and B exist simultaneously. , where A and B can be singular or plural. The character “/” generally indicates that the related objects are in an "or” relationship. “At least one of the following” or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items).
  • At least one item (item) of a, b or c can mean: a, b, c, "a and b", “a and c", “b and c", or "a and b and c” ”, where a, b, c can be single or multiple.
  • the disclosed devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the above units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or may be Integrated into another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • the units described above as separate components may or may not be physically separated.
  • the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software functional units.
  • Integrated units may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as independent products.
  • the technical solution of the present invention is essentially or contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present invention.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc. that can store programs. medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The present invention belongs to the technical field of location. Provided in the embodiments of the present invention are a bright spot location method, a bright spot location apparatus, an electronic device and a storage medium. The method comprises: acquiring an original grayscale image to be processed; performing image preprocessing on the original grayscale image to obtain an initial background image, and performing ratio calculation on the original grayscale image and the initial background image, so as to obtain a signal-to-noise ratio matrix; performing binarization segmentation on the signal-to-noise ratio matrix to obtain a binarized image; according to the binarized image, performing image equalization processing on the original grayscale image, so as to obtain an initial grayscale image; performing image filtering processing on the initial grayscale image to obtain a target grayscale image; according to the binarized image, performing bright spot detection on the target grayscale image, so as to obtain a target bright spot; and by means of a preset algorithm, performing location processing on the target bright spot, so as to obtain position data of and light intensity data of the target bright spot. The embodiments of the present invention can improve the accuracy of bright spot location.

Description

亮点定位方法、亮点定位装置、电子设备及存储介质Highlight positioning method, highlight positioning device, electronic equipment and storage medium
本发明要求于2022年07月22日提交中国专利局、申请号为202210870876.6,申请名称为“亮点定位方法、亮点定位装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本发明中。This invention requires the priority of the Chinese patent application submitted to the China Patent Office on July 22, 2022, with the application number 202210870876.6, and the application name is "Bright spot positioning method, bright spot positioning device, electronic equipment and storage medium", and its entire content has passed This reference is incorporated herein by reference.
技术领域Technical field
本发明涉及定位技术领域,尤其涉及一种亮点定位方法、亮点定位装置、电子设备及存储介质。The present invention relates to the field of positioning technology, and in particular to a bright spot positioning method, a bright spot positioning device, electronic equipment and a storage medium.
背景技术Background technique
目前的亮点定位方法常常在图像处理时存在着背景估计不准确和亮点分割不均匀的问题,影响亮点定位的准确性,因此,如何提高亮点定位的准确性,成为了亟待解决的技术问题。Current bright spot positioning methods often have problems such as inaccurate background estimation and uneven bright spot segmentation during image processing, which affects the accuracy of bright spot positioning. Therefore, how to improve the accuracy of bright spot positioning has become an urgent technical problem to be solved.
发明内容Contents of the invention
本发明实施例的主要目的在于提出一种亮点定位方法、亮点定位装置、电子设备及存储介质,旨在提高亮点定位的准确性。The main purpose of the embodiments of the present invention is to propose a bright spot positioning method, a bright spot positioning device, electronic equipment and a storage medium, aiming to improve the accuracy of bright spot positioning.
为实现上述目的,本发明实施例的第一方面提出了一种亮点定位方法,所述方法包括:In order to achieve the above object, a first aspect of the embodiment of the present invention proposes a bright spot positioning method, which method includes:
获取待处理的原始灰度图像;Get the original grayscale image to be processed;
对所述原始灰度图像进行图像预处理,得到初始背景图像;Perform image preprocessing on the original grayscale image to obtain an initial background image;
对所述原始灰度图像和所述初始背景图像进行比值计算,得到信噪比矩阵;Perform ratio calculation on the original grayscale image and the initial background image to obtain a signal-to-noise ratio matrix;
对所述信噪比矩阵进行二值化分割,得到二值化图像;Perform binary segmentation on the signal-to-noise ratio matrix to obtain a binary image;
根据所述二值化图像对所述原始灰度图像进行图像均衡处理,得到初始灰度图像;Perform image equalization processing on the original grayscale image according to the binary image to obtain an initial grayscale image;
对所述初始灰度图像进行图像滤波处理,得到目标灰度图像;Perform image filtering processing on the initial grayscale image to obtain a target grayscale image;
根据所述二值化图像对所述目标灰度图像进行亮点检测,得到目标亮点;Perform bright spot detection on the target grayscale image according to the binary image to obtain the target bright spot;
通过预设算法对所述目标亮点进行定位处理,得到所述目标亮点的位置数据和光强数据。The target bright spot is positioned through a preset algorithm to obtain the position data and light intensity data of the target bright spot.
在一些实施例,所述对所述原始灰度图像进行图像预处理,得到初始背景图像的步骤,包括:In some embodiments, the step of performing image preprocessing on the original grayscale image to obtain an initial background image includes:
在预设区间内对所述原始灰度图像进行直方图统计,得到亮度直方图; Perform histogram statistics on the original grayscale image within a preset interval to obtain a brightness histogram;
对所述亮度直方图进行特征提取,得到局部背景值;Perform feature extraction on the brightness histogram to obtain local background values;
根据所述局部背景值对所述原始灰度图像进行减背景处理,得到所述初始背景图像和初始去背景图像。Perform background subtraction processing on the original grayscale image according to the local background value to obtain the initial background image and an initial background-removed image.
在一些实施例,所述对所述信噪比矩阵进行二值化分割,得到二值化图像的步骤,包括:In some embodiments, the step of performing binary segmentation on the signal-to-noise ratio matrix to obtain a binary image includes:
根据所述信噪比矩阵和所述亮度直方图进行阈值计算,得到二值化阈值;Perform threshold calculation according to the signal-to-noise ratio matrix and the brightness histogram to obtain a binarized threshold;
根据所述二值化阈值对所述信噪比矩阵进行二值化分割,得到所述二值化图像。Binarize and segment the signal-to-noise ratio matrix according to the binarization threshold to obtain the binarized image.
在一些实施例,所述根据所述二值化图像对所述原始灰度图像进行图像均衡处理,得到初始灰度图像的步骤,包括:In some embodiments, the step of performing image equalization processing on the original grayscale image according to the binary image to obtain an initial grayscale image includes:
根据所述二值化图像对所述原始灰度图像进行亮度计算,得到所述二值化图像的前景亮度均值;Perform brightness calculation on the original grayscale image according to the binarized image to obtain the mean foreground brightness of the binarized image;
根据所述前景亮度均值对所述原始灰度图像进行亮度归一化,得到所述初始灰度图像。The original grayscale image is brightness normalized according to the foreground brightness mean value to obtain the initial grayscale image.
在一些实施例,所述对所述初始灰度图像进行图像滤波处理,得到目标灰度图像的步骤,包括:In some embodiments, the step of performing image filtering on the initial grayscale image to obtain a target grayscale image includes:
对所述初始灰度图像进行高斯滤波处理,得到第一滤波图像;Perform Gaussian filtering on the initial grayscale image to obtain a first filtered image;
对所述第一滤波图像进行拉普拉斯锐化处理,得到所述目标灰度图像。Perform Laplacian sharpening processing on the first filtered image to obtain the target grayscale image.
在一些实施例,所述根据所述二值化图像对所述目标灰度图像进行亮点检测,得到目标亮点的步骤,包括:In some embodiments, the step of performing bright spot detection on the target grayscale image according to the binary image to obtain the target bright spot includes:
根据所述二值化图像对所述目标灰度图像进行亮点检测,得到所述二值化图像的前景亮度均值;Perform highlight detection on the target grayscale image according to the binarized image to obtain the mean foreground brightness of the binarized image;
根据所述前景亮度均值,确定用于亮点检测的强度阈值;Determine an intensity threshold for bright spot detection based on the average foreground brightness;
根据所述目标灰度图像中的候选亮点之间的邻接关系构建亮点连通图;Construct a bright spot connected graph according to the adjacency relationship between candidate bright spots in the target grayscale image;
根据所述候选亮点的亮度值对所述亮点连通图的候选亮点进行筛选处理,得到初始亮点;Filter the candidate bright spots of the bright spot connected graph according to the brightness values of the candidate bright spots to obtain initial bright spots;
根据预设的筛选条件对所述初始亮点进行检测处理,得到所述目标亮点。The initial bright spots are detected according to preset filtering conditions to obtain the target bright spots.
在一些实施例,所述位置数据包括亚像素中心坐标,所述光强数据包括光强值,所述通过预设算法对所述目标亮点进行定位处理,得到所述目标亮点的位置数据和光强数据的步骤,包括:In some embodiments, the position data includes sub-pixel center coordinates, the light intensity data includes light intensity values, and the target bright spot is positioned through a preset algorithm to obtain the position data and light intensity of the target bright spot. Steps to strong data include:
通过重心法对所述目标亮点进行坐标识别,得到所述目标亮点的亚像素中心坐标;Perform coordinate identification on the target bright spot through the center of gravity method to obtain the sub-pixel center coordinates of the target bright spot;
通过二次样条插值法对所述亚像素中心坐标进行亮度提取,得到所述目标亮点的光强值。The brightness of the sub-pixel center coordinates is extracted using a quadratic spline interpolation method to obtain the light intensity value of the target bright spot.
为实现上述目的,本发明实施例的第二方面提出了一种亮点定位装置,所述装置包括: In order to achieve the above object, a second aspect of the embodiment of the present invention proposes a bright spot positioning device, the device includes:
图像获取模块,用于获取待处理的原始灰度图像;Image acquisition module, used to acquire the original grayscale image to be processed;
图像预处理模块,用于对所述原始灰度图像进行图像预处理,得到初始背景图像;An image preprocessing module, used to perform image preprocessing on the original grayscale image to obtain an initial background image;
计算模块,用于对所述原始灰度图像和所述初始背景图像进行比值计算,得到信噪比矩阵;A calculation module for performing ratio calculation on the original grayscale image and the initial background image to obtain a signal-to-noise ratio matrix;
图像分割模块,用于对所述信噪比矩阵进行二值化分割,得到二值化图像;An image segmentation module, used to perform binary segmentation on the signal-to-noise ratio matrix to obtain a binary image;
图像均衡模块,用于根据所述二值化图像对所述原始灰度图像进行图像均衡处理,得到初始灰度图像;An image equalization module, configured to perform image equalization processing on the original grayscale image according to the binary image to obtain an initial grayscale image;
图像滤波模块,用于对所述初始灰度图像进行图像滤波处理,得到目标灰度图像;An image filtering module, used to perform image filtering processing on the initial grayscale image to obtain a target grayscale image;
亮点检测模块,用于根据所述二值化图像对所述目标灰度图像进行亮点检测,得到目标亮点;A bright spot detection module, configured to perform bright spot detection on the target grayscale image based on the binary image to obtain the target bright spot;
定位模块,用于通过预设算法对所述目标亮点进行定位处理,得到所述目标亮点的位置数据和光强数据。A positioning module is used to perform positioning processing on the target bright spot through a preset algorithm to obtain position data and light intensity data of the target bright spot.
为实现上述目的,本发明实施例的第三方面提出了一种电子设备,所述电子设备包括存储器、处理器、存储在所述存储器上并可在所述处理器上运行的程序以及用于实现所述处理器和所述存储器之间的连接通信的数据总线,所述程序被所述处理器执行时实现上述第一方面所述的方法。In order to achieve the above object, a third aspect of the embodiment of the present invention proposes an electronic device. The electronic device includes a memory, a processor, a program stored on the memory and executable on the processor, and a program for A data bus that implements connection and communication between the processor and the memory. When the program is executed by the processor, the method described in the first aspect is implemented.
为实现上述目的,本发明实施例的第四方面提出了一种存储介质,所述存储介质为计算机可读存储介质,用于计算机可读存储,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现上述第一方面所述的方法。In order to achieve the above object, the fourth aspect of the embodiment of the present invention proposes a storage medium. The storage medium is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs. The one or more programs may be executed by one or more processors to implement the method described in the first aspect above.
本发明提出的亮点定位方法、亮点定位装置、电子设备及存储介质,其通过获取待处理的原始灰度图像;对原始灰度图像进行图像预处理,得到初始背景图像;对原始灰度图像和初始背景图像进行比值计算,得到信噪比矩阵,并对信噪比矩阵进行二值化分割,得到二值化图像,能够通过提高图像背景估计的准确性以及图像分割的准确性。进一步地,根据二值化图像对原始灰度图像进行图像均衡处理,得到初始灰度图像,能够使得初始灰度图像全局均衡化,同时,通过对初始灰度图像进行图像滤波处理,得到目标灰度图像,能够提高目标图像质量。最后,根据二值化图像对目标灰度图像进行亮点检测,得到目标亮点;通过预设算法对目标亮点进行定位处理,得到目标亮点的位置数据和光强数据,这一方式能够较为准确地识别出目标亮点以及确定目标亮点的位置,提高了亮点定位的准确性。The bright spot positioning method, bright spot positioning device, electronic equipment and storage medium proposed by the present invention obtain an original grayscale image to be processed; perform image preprocessing on the original grayscale image to obtain an initial background image; and perform image processing on the original grayscale image and The initial background image is ratio calculated to obtain a signal-to-noise ratio matrix, and the signal-to-noise ratio matrix is binarized and segmented to obtain a binarized image, which can improve the accuracy of image background estimation and image segmentation. Further, image equalization processing is performed on the original grayscale image according to the binary image to obtain an initial grayscale image, which can globally equalize the initial grayscale image. At the same time, by performing image filtering processing on the initial grayscale image, the target grayscale image is obtained. degree image, which can improve the quality of the target image. Finally, perform highlight detection on the target grayscale image based on the binary image to obtain the target highlight; perform positioning processing on the target highlight through a preset algorithm to obtain the position data and light intensity data of the target highlight. This method can more accurately identify the target highlight. Identify the target bright spots and determine the location of the target bright spots, thereby improving the accuracy of bright spot positioning.
附图说明Description of drawings
图1是本发明实施例提供的亮点定位方法的流程图; Figure 1 is a flow chart of a bright spot positioning method provided by an embodiment of the present invention;
图2是图1中的步骤S102的流程图;Figure 2 is a flow chart of step S102 in Figure 1;
图3是图1中的步骤S104的流程图;Figure 3 is a flow chart of step S104 in Figure 1;
图4是图1中的步骤S105的流程图;Figure 4 is a flow chart of step S105 in Figure 1;
图5是图1中的步骤S106的流程图;Figure 5 is a flow chart of step S106 in Figure 1;
图6是图1中的步骤S107的流程图;Figure 6 is a flow chart of step S107 in Figure 1;
图7是图1中的步骤S108的流程图;Figure 7 is a flow chart of step S108 in Figure 1;
图8是本发明实施例提供的亮点定位装置的结构示意图;Figure 8 is a schematic structural diagram of a bright spot positioning device provided by an embodiment of the present invention;
图9是本发明实施例提供的电子设备的硬件结构示意图。Figure 9 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention and are not intended to limit the present invention.
需要说明的是,虽然在装置示意图中进行了功能模块划分,在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于装置中的模块划分,或流程图中的顺序执行所示出或描述的步骤。说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that although the functional modules are divided in the device schematic diagram and the logical sequence is shown in the flow chart, in some cases, the modules can be divided into different modules in the device or the order in the flow chart can be executed. The steps shown or described. The terms "first", "second", etc. in the description, claims, and above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific sequence or sequence.
除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本发明实施例的目的,不是旨在限制本发明。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which the invention belongs. The terminology used herein is for the purpose of describing embodiments of the present invention only and is not intended to limit the present invention.
首先,对本发明中涉及的若干名词进行解析:First, some terms involved in this invention are analyzed:
人工智能(artificial intelligence,AI):是研究、开发用于模拟、延伸和扩展人的智能的理论、方法、技术及应用系统的一门新的技术科学;人工智能是计算机科学的一个分支,人工智能企图了解智能的实质,并生产出一种新的能以人类智能相似的方式做出反应的智能机器,该领域的研究包括机器人、语言识别、图像识别、自然语言处理和专家系统等。人工智能可以对人的意识、思维的信息过程的模拟。人工智能还是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。Artificial intelligence (AI): It is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence; artificial intelligence is a branch of computer science, artificial intelligence Intelligence attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a manner similar to human intelligence. Research in this field includes robotics, language recognition, image recognition, natural language processing, and expert systems. Artificial intelligence can simulate the information process of human consciousness and thinking. Artificial intelligence is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
图像的二值化,就是将图像上的像素点的灰度值设置为0或255,也就是将整个图像呈现出明显的只有黑和白的视觉效果。The binarization of the image is to set the grayscale value of the pixels on the image to 0 or 255, which means that the entire image presents an obvious visual effect of only black and white.
重心法:是指在物理中,如果要想使一个物体在垂直不动或是做匀速直线运动,那么这个点为重心。重心法首先要在坐标系中标出各个地点的位置,目的在于确定各点的相对距离,在国际选址中,经常采用经度和纬度建立坐标。然后,根据各点在坐标系中的横纵坐标值求出成本运输最低的位置坐标X和Y。 Center of gravity method: In physics, if you want an object to remain vertically stationary or move in a straight line at a uniform speed, then this point is the center of gravity. The center of gravity method first marks the position of each location in the coordinate system, with the purpose of determining the relative distance of each point. In international site selection, longitude and latitude are often used to establish coordinates. Then, based on the horizontal and vertical coordinate values of each point in the coordinate system, the location coordinates X and Y with the lowest transportation cost are obtained.
插值:在离散数据的基础上插补连续函数,使得这条连续曲线经过全部离散点,同时也可以估计出函数在其他点的近似值。Interpolation: Interpolate a continuous function on the basis of discrete data, so that this continuous curve passes through all discrete points, and the approximate value of the function at other points can also be estimated.
样条插值:一种以可变样条来作出一条经过一系列点的光滑曲线的数学方法。插值样条是由一些多项式组成的,每一个多项式都是由相邻的两个数据点决定的,任意的两个相邻的多项式以及它们的导数在连接点处都是连续的。Spline interpolation: A mathematical method that uses variable splines to create a smooth curve through a series of points. The interpolation spline is composed of some polynomials. Each polynomial is determined by two adjacent data points. Any two adjacent polynomials and their derivatives are continuous at the connecting points.
样条插值法:每两个点之间确定一个函数,这个函数就是一个样条,函数不同,样条就不同,然后把所有样条分段结合成一个函数,就是最终的插值函数。Spline interpolation method: A function is determined between every two points. This function is a spline. Different functions lead to different splines. Then all splines are segmented into one function, which is the final interpolation function.
目前的亮点定位方法常常在图像处理时存在着背景估计不准确和亮点分割不均匀的问题,影响亮点定位的准确性,因此,如何提高亮点定位的准确性,成为了亟待解决的技术问题。Current bright spot positioning methods often have problems such as inaccurate background estimation and uneven bright spot segmentation during image processing, which affects the accuracy of bright spot positioning. Therefore, how to improve the accuracy of bright spot positioning has become an urgent technical problem to be solved.
基于此,本发明实施例提供了一种亮点定位方法、亮点定位装置、电子设备及存储介质,旨在提高亮点定位的准确性。Based on this, embodiments of the present invention provide a bright spot positioning method, a bright spot positioning device, electronic equipment and a storage medium, aiming to improve the accuracy of bright spot positioning.
本发明实施例提供的亮点定位方法、亮点定位装置、电子设备及存储介质,具体通过如下实施例进行说明,首先描述本发明实施例中的亮点定位方法。The bright spot positioning method, bright spot positioning device, electronic equipment and storage medium provided by the embodiments of the present invention are specifically described through the following embodiments. First, the bright spot positioning method in the embodiment of the present invention is described.
本发明实施例可以基于人工智能技术对相关的数据进行获取和处理。其中,人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。Embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. .
人工智能基础技术一般包括如传感器、专用人工智能芯片、云计算、分布式存储、大数据处理技术、操作/交互系统、机电一体化等技术。人工智能软件技术主要包括计算机视觉技术、机器人技术、生物识别技术、语音处理技术、自然语言处理技术以及机器学习/深度学习等几大方向。Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation/interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, robotics technology, biometric technology, speech processing technology, natural language processing technology, and machine learning/deep learning.
本发明实施例提供的亮点定位方法,涉及人工智能技术领域。本发明实施例提供的亮点定位方法可应用于终端中,也可应用于服务器端中,还可以是运行于终端或服务器端中的软件。在一些实施例中,终端可以是智能手机、平板电脑、笔记本电脑、台式计算机等;服务器端可以配置成独立的物理服务器,也可以配置成多个物理服务器构成的服务器集群或者分布式系统,还可以配置成提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN以及大数据和人工智能平台等基础云计算服务的云服务器;软件可以是实现亮点定位方法的应用等,但并不局限于以上形式。The bright spot positioning method provided by the embodiment of the present invention relates to the field of artificial intelligence technology. The bright spot positioning method provided by the embodiment of the present invention can be applied in a terminal or a server, or can be software running in the terminal or the server. In some embodiments, the terminal can be a smartphone, a tablet, a laptop, a desktop computer, etc.; the server can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers. It can be configured to provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Server; software can be an application that implements a bright spot positioning method, etc., but is not limited to the above forms.
本发明可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。本发明可以在 由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本发明,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。The present invention may be used in a variety of general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, including Distributed computing environment for any of the above systems or devices, etc. The present invention can be Described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices.
图1是本发明实施例提供的亮点定位方法的一个可选的流程图,图1中的方法可以包括但不限于包括步骤S101至步骤S108。Figure 1 is an optional flow chart of a bright spot positioning method provided by an embodiment of the present invention. The method in Figure 1 may include, but is not limited to, steps S101 to S108.
步骤S101,获取待处理的原始灰度图像;Step S101, obtain the original grayscale image to be processed;
步骤S102,对原始灰度图像进行图像预处理,得到初始背景图像;Step S102, perform image preprocessing on the original grayscale image to obtain an initial background image;
步骤S103,对原始灰度图像和初始背景图像进行比值计算,得到信噪比矩阵;Step S103, perform ratio calculation on the original grayscale image and the initial background image to obtain a signal-to-noise ratio matrix;
步骤S104,对信噪比矩阵进行二值化分割,得到二值化图像;Step S104, perform binary segmentation on the signal-to-noise ratio matrix to obtain a binary image;
步骤S108,根据二值化图像对原始灰度图像进行图像均衡处理,得到初始灰度图像;Step S108, perform image equalization processing on the original grayscale image based on the binary image to obtain an initial grayscale image;
步骤S106,对初始灰度图像进行图像滤波处理,得到目标灰度图像;Step S106, perform image filtering processing on the initial grayscale image to obtain the target grayscale image;
步骤S107,根据二值化图像对目标灰度图像进行亮点检测,得到目标亮点;Step S107: Perform bright spot detection on the target grayscale image based on the binary image to obtain the target bright spot;
步骤S108,通过预设算法对目标亮点进行定位处理,得到目标亮点的位置数据和光强数据。Step S108: perform positioning processing on the target bright spot through a preset algorithm to obtain position data and light intensity data of the target bright spot.
本发明实施例所示意的步骤S101至步骤S108,通过获取待处理的原始灰度图像;对原始灰度图像进行图像预处理,得到初始背景图像;对原始灰度图像和初始背景图像进行比值计算,得到信噪比矩阵,并对信噪比矩阵进行二值化分割,得到二值化图像,能够通过提高图像背景估计的准确性以及图像分割的准确性。进一步地,根据二值化图像对原始灰度图像进行图像均衡处理,得到初始灰度图像,能够使得初始灰度图像全局均衡化,同时,通过对初始灰度图像进行图像滤波处理,得到目标灰度图像,能够提高目标图像质量。最后,根据二值化图像对目标灰度图像进行亮点检测,得到目标亮点;通过预设算法对目标亮点进行定位处理,得到目标亮点的位置数据和光强数据,这一方式能够较为准确地识别出目标亮点以及确定目标亮点的位置,提高了亮点定位的准确性。The steps S101 to S108 shown in the embodiment of the present invention are to obtain the original grayscale image to be processed; perform image preprocessing on the original grayscale image to obtain an initial background image; and perform a ratio calculation on the original grayscale image and the initial background image. , obtain the signal-to-noise ratio matrix, and perform binary segmentation on the signal-to-noise ratio matrix to obtain a binary image, which can improve the accuracy of image background estimation and image segmentation. Further, image equalization processing is performed on the original grayscale image according to the binary image to obtain an initial grayscale image, which can globally equalize the initial grayscale image. At the same time, by performing image filtering processing on the initial grayscale image, the target grayscale image is obtained. degree image, which can improve the quality of the target image. Finally, perform highlight detection on the target grayscale image based on the binary image to obtain the target highlight; perform positioning processing on the target highlight through a preset algorithm to obtain the position data and light intensity data of the target highlight. This method can more accurately identify the target highlight. Identify the target bright spots and determine the location of the target bright spots, thereby improving the accuracy of bright spot positioning.
在一些实施例的步骤S101中,可通过相机拍摄获取荧光灰度图像,将拍摄得到的荧光灰度图像作为待处理的原始灰度图像,其中,原始灰度图像的图像格式可以为TIF格式,图像尺寸可以为4116×2176。In step S101 of some embodiments, a fluorescence grayscale image can be acquired by camera shooting, and the captured fluorescence grayscale image can be used as the original grayscale image to be processed, wherein the image format of the original grayscale image can be TIF format, Image size can be 4116×2176.
请参阅图2,在一些实施例中,为了提高背景估计的准确性,提高获取的背景图像以及前景图像的图像质量,步骤S102可以包括但不限于包括步骤S201至步骤S203: Please refer to Figure 2. In some embodiments, in order to improve the accuracy of background estimation and improve the image quality of the acquired background image and foreground image, step S102 may include but is not limited to steps S201 to step S203:
步骤S201,在预设区间内对原始灰度图像进行直方图统计,得到亮度直方图;Step S201, perform histogram statistics on the original grayscale image within a preset interval to obtain a brightness histogram;
步骤S202,对亮度直方图进行特征提取,得到局部背景值;Step S202, perform feature extraction on the brightness histogram to obtain local background values;
步骤S203,根据局部背景值对原始灰度图像进行减背景处理,得到初始背景图像和初始去背景图像。Step S203: perform background subtraction processing on the original grayscale image according to the local background value to obtain an initial background image and an initial background-removed image.
在一些实施例的步骤S201中,预设区间的大小可以根据实际的业务需求设置,例如,预设区间的大小可以为n*n,其中,n为大于0的整数,例如可以是原始灰度图像f的n×n范围内,对原始灰度图像的亮度进行直方图统计,得到亮度直方图,其中,亮度直方图可以表示如公式(1):
Hist(i,j)=∑f(i,j)=I|(i,j)∈Dn*n公式(1)
In step S201 of some embodiments, the size of the preset interval can be set according to actual business requirements. For example, the size of the preset interval can be n*n, where n is an integer greater than 0, for example, it can be the original grayscale. Within the n×n range of image f, perform histogram statistics on the brightness of the original grayscale image to obtain a brightness histogram, where the brightness histogram can be expressed as formula (1):
Hist(i,j)=∑f(i,j)=I|(i,j)∈D n*n formula (1)
其中,Hist(i,j)为预设区间[n*n]的亮度直方图,f为原始灰度图像,i,j为原始灰度图像的像素点坐标,Dn*n为预设区间,I为原始灰度图像的光强值。Among them, Hist(i, j) is the brightness histogram of the preset interval [n*n], f is the original grayscale image, i, j is the pixel point coordinates of the original grayscale image, and D n*n is the preset interval , I is the light intensity value of the original grayscale image.
在一些实施例的步骤S202中,对亮度直方图进行特征提取,取亮度直方图的30分位数作为局部背景值。需要说明的是,在一些其他实施例中也可以选择亮度直方图上的其他分位数作为局部背景值,不限于此。In step S202 of some embodiments, feature extraction is performed on the brightness histogram, and the 30th percentile of the brightness histogram is taken as the local background value. It should be noted that in some other embodiments, other quantiles on the brightness histogram can also be selected as the local background value, but it is not limited thereto.
在一些实施例的步骤S203中,在根据局部背景值对原始灰度图像进行减背景处理时,将原始灰度图像减去局部背景值,得到初始背景图像和初始去背景图像,具体过程可以表示如公式(2)所示:
f1={f-Hist30|D}公式(2)
In step S203 of some embodiments, when performing background subtraction processing on the original grayscale image according to the local background value, the local background value is subtracted from the original grayscale image to obtain the initial background image and the initial de-background image. The specific process can be expressed as As shown in formula (2):
f 1 ={f-Hist 30 |D}Formula (2)
其中,f1为初始去背景图像,Hist30为局部背景值,即初始背景图像。Among them, f 1 is the initial background removal image, and Hist 30 is the local background value, that is, the initial background image.
上述步骤S201至步骤S203通过采用局部直方图统计的方式来进行背景估计,可以灵活地应对高密度和低密度的荧光芯片,能够较好地兼容不同芯片密度下的背景估计,从而提高背景估计的准确性。The above steps S201 to S203 use local histogram statistics to perform background estimation, which can flexibly cope with high-density and low-density fluorescent chips, and can be better compatible with background estimation under different chip densities, thereby improving the accuracy of background estimation. accuracy.
在一些实施例的步骤S102中,对原始灰度图像和初始背景图像进行比值计算,可以方便地得到原始灰度图像的信噪比,即信噪比矩阵,其中,信噪比矩阵可以表示如公式(3)所示:
SNR=f/g={f(x,y)/g(x,y)|(x,y)∈D}公式(3)
In step S102 of some embodiments, the ratio calculation of the original grayscale image and the initial background image can be performed to easily obtain the signal-to-noise ratio of the original grayscale image, that is, the signal-to-noise ratio matrix, where the signal-to-noise ratio matrix can be expressed as follows Formula (3) shows:
SNR=f/g={f(x,y)/g(x,y)|(x,y)∈D}Formula (3)
其中,SNR为信噪比矩阵,f(x,y)为原始灰度图像,g(x,y)为初始背景图像,其中,x,y为像素点的坐标,D为预设区间。Among them, SNR is the signal-to-noise ratio matrix, f(x, y) is the original grayscale image, g(x, y) is the initial background image, where x, y are the coordinates of the pixel point, and D is the preset interval.
请参阅图3,在一些实施例中,步骤S103可以包括但不限于包括步骤S301至步骤S302:Referring to Figure 3, in some embodiments, step S103 may include, but is not limited to, steps S301 to S302:
步骤S301,根据信噪比矩阵和亮度直方图进行阈值计算,得到二值化阈值;Step S301, perform threshold calculation based on the signal-to-noise ratio matrix and the brightness histogram to obtain a binarized threshold;
步骤S302,根据二值化阈值对信噪比矩阵进行二值化分割,得到二值化图像。Step S302: Binarize and segment the signal-to-noise ratio matrix according to the binarization threshold to obtain a binarized image.
由于在图像分割过程中,激光光照往往是不均匀的,这会导致通过亮度值 来初步筛选亮点的计算复杂度较高,因此,为了解决这一问题,本发明采用受光照影响较小的信噪比筛选方式来实现亮点的初步筛选,该初步筛选过程具体体现为本发明的图像分割过程。Since laser illumination is often uneven during image segmentation, this will cause the brightness value to pass through The computational complexity of preliminary screening of bright spots is high. Therefore, in order to solve this problem, the present invention adopts a signal-to-noise ratio screening method that is less affected by illumination to realize the preliminary screening of bright spots. The preliminary screening process is embodied in the present invention. Image segmentation process.
在一些实施例的步骤S301中,为了消除传统技术中阈值选取不稳定的问题,本发明实施例利用反比例函数的特征来实现对不同密度的适应。具体地,首先根据信噪比矩阵中的像素点的像素大小,对信噪比矩阵中的像素点进行排序,通过这一方式可以得到一组从小到大排列的数组,例如,该数组为8956416等。进一步地,根据数组求出信噪比矩阵中的信噪比的中位数以及较高分位数,从而根据数组以及求出的中位数A、较高分位数B,计算出二值化阈值,其中,二值化阈值可以表示如公式(4)所示:
T=mean(SNR)*(factor+A/(B/A))公式(4)
In step S301 of some embodiments, in order to eliminate the problem of unstable threshold selection in traditional technology, embodiments of the present invention use the characteristics of the inverse proportional function to achieve adaptation to different densities. Specifically, first sort the pixels in the signal-to-noise ratio matrix according to the pixel size of the pixels in the signal-to-noise ratio matrix. In this way, a set of arrays arranged from small to large can be obtained. For example, the array is 8956416 wait. Further, the median and higher quantile of the signal-to-noise ratio in the signal-to-noise ratio matrix are calculated based on the array, and the binary value is calculated based on the array and the calculated median A and higher quantile B. Binarization threshold, where the binarization threshold can be expressed as shown in formula (4):
T=mean(SNR)*(factor+A/(B/A)) formula (4)
其中,T为二值化阈值,mean(SNR)为信噪比矩阵的均值,A为信噪比矩阵的中位数,A可以取QuantileSNR(50),即中位数为信噪比矩阵的50分位数,B为信噪比矩阵的较高分位数,B可以取QuantileSNR(95),即B为信噪比矩阵的95分位数,其中,QuantileSNR为信噪比矩阵的分位数,factor为预设的权重参数,一般取0.5。Among them, T is the binarization threshold, mean (SNR) is the mean of the signal-to-noise ratio matrix, A is the median of the signal-to-noise ratio matrix, A can be Quantile SNR (50), that is, the median is the signal-to-noise ratio matrix The 50th quantile of The quantile of , factor is the preset weight parameter, which is generally 0.5.
进一步地,上述二值化阈值可以表示为
T=mean(SNR)*(factor+QuantileSNR(50)/(QuantileSNR(95)/(QuantileSNR(50)))
Further, the above binarization threshold can be expressed as
T=mean(SNR)*(factor+Quantile SNR (50)/(Quantile SNR (95)/(Quantile SNR (50)))
在一些实施例的步骤S302中,根据二值化阈值对信噪比矩阵进行二值化分割,从而得到二值化图像BI。In step S302 of some embodiments, the signal-to-noise ratio matrix is binarized and segmented according to the binarization threshold, thereby obtaining the binarized image BI.
上述步骤S301至步骤S302通过采用直方图统计分位数的反比例算法来进行图像二值化分割,可以有效地应对不同密度下的亮点分割,能够根据密度的高低方便地改变二值化阈值的大小,当密度较高时,选取较小的二值化阈值,当密度较低时,选取较大的二值化阈值,从而解决高密度场景下,背景估计过高的问题,从而提高背景估计和图像分割的准确性。The above-mentioned steps S301 to S302 perform binary segmentation of the image by using the inverse proportional algorithm of histogram statistical quantiles, which can effectively deal with the segmentation of bright spots under different densities, and can easily change the size of the binarization threshold according to the density. , when the density is high, a smaller binarization threshold is selected, and when the density is low, a larger binarization threshold is selected, thereby solving the problem of overestimation of the background in high-density scenes, thus improving the background estimation and Image segmentation accuracy.
请参阅图4,在一些实施例中,步骤S104可以包括但不限于包括步骤S401至步骤S402:Referring to Figure 4, in some embodiments, step S104 may include, but is not limited to, steps S401 to S402:
步骤S401,根据二值化图像对原始灰度图像进行亮度计算,得到二值化图像的前景亮度均值;Step S401: Calculate the brightness of the original grayscale image based on the binarized image to obtain the mean foreground brightness of the binarized image;
步骤S402,根据前景亮度均值对原始灰度图像进行亮度归一化,得到初始灰度图像。Step S402: Perform brightness normalization on the original grayscale image according to the average foreground brightness to obtain an initial grayscale image.
由于在拍摄过程中,图像不同区域的光照往往会存在一定的差异,即图像会表现为中央亮,边缘暗,因此,为了平衡图像的不同区域的光照差异,常常需要对图像进行全局亮度均衡化,从而提高图像质量。Since during the shooting process, there are often certain differences in the illumination of different areas of the image, that is, the image will appear bright in the center and dark at the edges. Therefore, in order to balance the illumination differences in different areas of the image, it is often necessary to perform global brightness equalization of the image. , thereby improving image quality.
在一些实施例的步骤S401中,首先评估原始灰度图像的不同区域的荧光强度,具体地,可以统计每个像素点周围固定范围内的荧光强度均值,将该荧光亮度均值作为该像素点的荧光强度,其中,固定范围的大小可以根据实际业务 需求设置,不做限制。例如,求出二值化图像在161×161区域内像素值为1的像素点,然后获取这些像素点在前景图像的前景元素均值,将这一前景元素均值作为二值化图像的前景亮度均值。In step S401 of some embodiments, the fluorescence intensity of different areas of the original grayscale image is first evaluated. Specifically, the average fluorescence intensity within a fixed range around each pixel point can be counted, and the average fluorescence brightness value is used as the average value of the fluorescence intensity of the pixel point. Fluorescence intensity, where the size of the fixed range can be determined according to actual business Requirement settings, no restrictions. For example, find the pixels with a pixel value of 1 in the 161×161 area of the binary image, then obtain the mean value of the foreground elements of these pixels in the foreground image, and use this mean value of the foreground elements as the mean foreground brightness of the binary image .
进一步地,采用形态学计算该D区域内的前景元素均值的过程可以表示如公式(5)所示:
Furthermore, the process of using morphology to calculate the mean value of the foreground elements in the D region can be expressed as shown in formula (5):
其中,f’为荧光评估矩阵(即前景亮度均值),m、n分别表示原始灰度图像的高度和宽度,f为去背景后的原始灰度图像(即初始去背景图像)。Mean是指是对结构元素D,求D区域内二值化图像B中像素值为1的前景图像的前景元素均值,B是原始灰度图像根据二值化阈值T进行分割的二值化图像,B=0表示背景,B=1表示前景。Among them, f’ is the fluorescence evaluation matrix (i.e., the mean value of foreground brightness), m and n represent the height and width of the original grayscale image respectively, and f is the original grayscale image after background removal (i.e., the initial background-removed image). Mean refers to finding the mean value of the foreground elements of the foreground image with a pixel value of 1 in the binary image B in the D area for the structural element D. B is a binary image in which the original grayscale image is segmented according to the binary threshold T. , B=0 represents the background, and B=1 represents the foreground.
在一些实施例的步骤S402中,荧光评估矩阵可以用于表征原始灰度图像的不同区域位置的亮度差异,因此,可以根据荧光评估矩阵来消除不同区域位置的亮度差异,即将原始灰度图像的亮度以图像中心为基准进行全局亮度归一化,得到初始灰度图像。In step S402 of some embodiments, the fluorescence evaluation matrix can be used to characterize the brightness differences in different regional positions of the original grayscale image. Therefore, the brightness differences in different regional positions can be eliminated according to the fluorescence evaluation matrix, that is, the brightness differences of the original grayscale image. The brightness is global brightness normalized based on the image center to obtain the initial grayscale image.
在一个具体实施例中,以均衡化像素点(x,y)为例,首先计算应该评估矩阵的中心与像素点的比值ratio,这一比值可以用于反映该处的应该强度需要提升的倍数,其中,ratio=center(f')/f'(x,y)。进而,比值与原始灰度图像的像素点进行相乘处理,得到该像素点归一化之后的亮度值。最后将原始灰度图像的每个经过归一化的像素点更新到亮度中心,得到初始灰度图像,其中,初始灰度图像可以表示为In a specific embodiment, taking the equalized pixel (x, y) as an example, first calculate the ratio ratio between the center of the evaluation matrix and the pixel point. This ratio can be used to reflect the factor by which the intensity at that location needs to be increased. , where ratio=center(f')/f'(x,y). Furthermore, the ratio is multiplied by the pixel of the original grayscale image to obtain the normalized brightness value of the pixel. Finally, each normalized pixel point of the original grayscale image is updated to the brightness center to obtain the initial grayscale image, where the initial grayscale image can be expressed as
g'(x,y)=g(x,y)*center(f')/f'(x,y);其中,g'(x,y)为初始灰度图像,g(x,y)为原始灰度图像。g'(x,y)=g(x,y)*center(f')/f'(x,y); where, g'(x,y) is the initial grayscale image, g(x,y) is the original grayscale image.
上述步骤S401至步骤S402,通过采用全局均衡化的方式可以有效地消除拍摄图像时光照不均匀对图像质量的影响,提高边缘亮点的检出率,减少漏检概率,提高数据总量。In the above steps S401 to S402, global equalization can be used to effectively eliminate the impact of uneven lighting on image quality when capturing images, improve the detection rate of edge bright spots, reduce the probability of missed detection, and increase the total amount of data.
请参阅图5,在一些实施例中,步骤S105可以包括但不限于包括步骤S501至步骤S502:Referring to Figure 5, in some embodiments, step S105 may include, but is not limited to, steps S501 to S502:
步骤S501,对初始灰度图像进行高斯滤波处理,得到第一滤波图像;Step S501, perform Gaussian filtering on the initial grayscale image to obtain the first filtered image;
步骤S502,对第一滤波图像进行拉普拉斯锐化处理,得到目标灰度图像。Step S502: Perform Laplacian sharpening processing on the first filtered image to obtain a target grayscale image.
为了防止拉普拉斯滤波器计算二次微分时造成更多的图像噪声,本发明采用两步法进行LoG滤波,即对初始灰度图像先进行高斯模糊滤波,再对高斯滤波之后的图像进行拉普拉斯锐化滤波。In order to prevent the Laplacian filter from causing more image noise when calculating the second differential, the present invention uses a two-step method to perform LoG filtering, that is, first perform Gaussian blur filtering on the initial grayscale image, and then perform Gaussian blur filtering on the image after Gaussian filtering. Laplacian sharpening filter.
在一些实施例的步骤S501中,通过高斯滤波器对初始灰度图像进行高斯滤波处理,从而去除图像噪声,其中,图像噪声包括高斯噪声和椒盐噪声,得到 第一滤波图像。具体地,可以通过高斯滤波器对初始灰度图像按照3×3的窗口大小进行高斯卷积处理,得到第一滤波图像,其中,高斯核可以为0.85。In step S501 of some embodiments, Gaussian filtering is performed on the initial grayscale image through a Gaussian filter to remove image noise, where the image noise includes Gaussian noise and salt-and-pepper noise, and we obtain First filtered image. Specifically, the initial grayscale image can be subjected to Gaussian convolution processing according to a window size of 3×3 through a Gaussian filter to obtain the first filtered image, where the Gaussian kernel can be 0.85.
在一些实施例的步骤S502中,由于目前的图像成像常常存在色散,像散等问题,因而会导致图像出现中央清晰,边缘模糊的情况,为了解决这一问题,本发明实施例中的rh墨西哥帽算子采用渐变的方式,对于第一滤波图像的不同区域锐化的核参数是不同的,核参数一般基于该区域图像的模糊情况而确定,具体地,通过具有多种核参数的rh墨西哥帽算子对第一滤波图像进行锐化卷积,得到目标灰度图像。锐化过程可以表示为rh(x,y)=rh*factor,其中,factor为锐化因子,若第一滤波图像的某一像素位置的局部越模糊,则锐化因子factor越大,从而使得该像素位置得到的锐化程度越高。In step S502 of some embodiments, since current image imaging often has problems such as dispersion and astigmatism, the center of the image will be clear and the edges will be blurry. In order to solve this problem, rh Mexico in the embodiment of the present invention The hat operator adopts a gradient method. The kernel parameters for sharpening are different for different areas of the first filtered image. The kernel parameters are generally determined based on the blur condition of the image in this area. Specifically, through rh Mexico with multiple kernel parameters The hat operator performs sharpening convolution on the first filtered image to obtain the target grayscale image. The sharpening process can be expressed as rh(x, y)=rh*factor, where factor is the sharpening factor. If a certain pixel position of the first filtered image is locally blurred, the sharpening factor factor will be larger, so that The pixel position gets a higher degree of sharpening.
上述步骤S501至步骤S502,通过高斯滤波的方式可以方便地去除高斯噪声和椒盐噪声,通过拉普拉斯锐化可以较好地强化亮点特征,提高目标灰度图像的前景和背景之间的对比度,同时,LoG滤波算子参数采用区域渐变的滤波策略,能够提高目标亮点的分辨率,同时也能够提高目标亮点的区分度,其中,目标亮点可以是目标荧光尖峰点。In the above steps S501 to S502, Gaussian noise and salt-and-pepper noise can be easily removed through Gaussian filtering. Laplacian sharpening can better enhance the highlight features and improve the contrast between the foreground and background of the target grayscale image. , At the same time, the LoG filter operator parameters adopt a regional gradient filtering strategy, which can improve the resolution of the target bright spots and also improve the discrimination of the target bright spots, where the target bright spots can be target fluorescence peak points.
请参阅图6,在一些实施例,步骤S106包括但不限于包括步骤S601至步骤S605:Referring to Figure 6, in some embodiments, step S106 includes but is not limited to steps S601 to S605:
步骤S601,根据二值化图像对目标灰度图像进行亮点检测,得到二值化图像的前景亮度均值;Step S601: Perform highlight detection on the target grayscale image based on the binarized image to obtain the average foreground brightness of the binarized image;
步骤S602,根据前景亮度均值,确定用于亮点检测的强度阈值;Step S602, determine the intensity threshold for bright spot detection based on the average foreground brightness;
步骤S603,根据目标灰度图像中的候选亮点之间的邻接关系构建亮点连通图;Step S603: Construct a bright spot connected graph based on the adjacency relationship between candidate bright spots in the target grayscale image;
步骤S604,根据候选亮点的亮度值对亮点连通图的候选亮点进行筛选处理,得到初始亮点;Step S604: Screen the candidate bright spots of the bright spot connected graph according to the brightness values of the candidate bright spots to obtain initial bright spots;
步骤S605,根据预设的筛选条件对初始亮点进行检测处理,得到目标亮点。Step S605: Detect the initial bright spots according to the preset filtering conditions to obtain the target bright spots.
在一些实施例的步骤S601中,采用mean函数对二值化图像中像素为1的前景像素点进行亮度计算,得到二值化图像的前景亮度均值。In step S601 of some embodiments, the mean function is used to calculate the brightness of foreground pixels with a pixel of 1 in the binary image to obtain the mean foreground brightness of the binary image.
在一些实施例的步骤S602中,根据前景亮度均值,确定用于亮点检测的强度阈值的过程可以表示为Threshold=mean(fBI=1),其中,Threshold为强度阈值,fBI=1为二值化图像中值为1的前景像素点,mean(fBI=1)为求取均值。In step S602 of some embodiments, the process of determining the intensity threshold for bright spot detection according to the mean foreground brightness can be expressed as Threshold=mean(f BI=1 ), where Threshold is the intensity threshold and f BI=1 is binary. Value the foreground pixels with a value of 1 in the image, and mean(f BI=1 ) is to find the mean.
在一些实施例的步骤S603中,根据候选亮点之间的邻接关系构建亮点连通图常常采用4连通或者8连通的方式。在本发明中采用8连通的方式来对候选亮点之间的邻接关系构建亮点连通图。In step S603 of some embodiments, a 4-connected or 8-connected method is often used to construct a bright spot connected graph based on the adjacency relationship between candidate bright spots. In the present invention, an 8-connected method is used to construct a bright spot connected graph for the adjacency relationships between candidate bright spots.
在一些实施例的步骤S604中,根据亮点连通图,查找每个候选亮点邻接的8个候选亮点,比较每个候选亮点邻接的8个候选亮点,若处于中心位置的候选亮点的亮度值大于邻接的8个候选亮点的亮度值,则将该候选亮点作为初始亮 点。In step S604 of some embodiments, according to the bright spot connected graph, find 8 candidate bright spots adjacent to each candidate bright spot, and compare the 8 candidate bright spots adjacent to each candidate bright spot. If the brightness value of the candidate bright spot at the center is greater than the adjacent the brightness values of the 8 candidate bright spots, then the candidate bright spots are used as the initial bright spots. point.
在一些实施例的步骤S605中,预设的筛选条件可以综合强度阈值、二值化面积参数、高斯系数以及梯度方向场等多维度特征来设置。具体地,可以基于两个不等式(如公式(6)和公式(7)所示)来对初始亮点进行检测和筛选,当初始亮点同时满足以下两个不等式条件时,将该初始亮点作为目标亮点。
Area>0.5公式(6)
SumIntensity5*5*GaussCeof*GradientCeof>Threshold公式(7)
In step S605 of some embodiments, the preset filtering conditions can be set based on multi-dimensional features such as intensity thresholds, binarized area parameters, Gaussian coefficients, and gradient direction fields. Specifically, the initial bright spot can be detected and filtered based on two inequalities (as shown in formula (6) and formula (7)). When the initial bright spot satisfies the following two inequality conditions at the same time, the initial bright spot is used as the target bright spot. .
Area>0.5 formula (6)
SumIntensity 5*5 *GaussCeof*GradientCeof>Threshold formula (7)
其中,Area为亮点连通图中二值化图像为1的前景所占的比率,即在亮度连通图3*3范围内应当有一半以上的是代表前景的像素点。SumIntensity是初始亮点附近大小为5*5范围以内的能量积分和,SumIntensity能够反映出初始亮点能够激发的能量大小。GaussCeof为窗口大小为5*5的窗口像素以及二维高斯分布的相关系数,该相关系数可以通过对大量的已知亮点进行高斯拟合得到,通过相关系数可以反映出初始亮点的亮点形态,若相关系数越接近于1,则表明当前区域的形态越接近已知亮点的形态。GradienCeof表示窗口大小为5*5的窗口内的梯度方向场,若一个像素点(初始亮点)的水平梯度方向和竖直梯度方向指向中心尖峰,则梯度方向场的数值越大,该参数能够反映图像中的尖峰趋势性。Among them, Area is the proportion of the foreground with a binary image of 1 in the bright spot connected map, that is, more than half of the pixels in the 3*3 range of the brightness connected map should be pixels representing the foreground. SumIntensity is the integral sum of energy within a range of 5*5 near the initial bright spot. SumIntensity can reflect the amount of energy that the initial bright spot can excite. GaussCeof is the correlation coefficient of window pixels with a window size of 5*5 and a two-dimensional Gaussian distribution. The correlation coefficient can be obtained by performing Gaussian fitting on a large number of known bright points. The correlation coefficient can reflect the bright point shape of the initial bright points. If The closer the correlation coefficient is to 1, the closer the shape of the current area is to the shape of the known bright spot. GradienCeof represents the gradient direction field within a window with a window size of 5*5. If the horizontal gradient direction and vertical gradient direction of a pixel (initial bright spot) point to the central peak, the larger the value of the gradient direction field, the more this parameter can reflect Peak trends in images.
上述步骤S601至步骤S605,在进行目标亮点定位的过程中,综合了强度阈值、二值化面积参数、高斯系数以及梯度方向场等多维度特征来对候选亮点进行筛选,能够较为准确地找出原始灰度图像中的所有亮点尖峰点,有效地提高目标亮点查找的查全率和查准率。In the above step S601 to step S605, during the process of locating target bright spots, multi-dimensional features such as intensity threshold, binarized area parameter, Gaussian coefficient and gradient direction field are integrated to screen candidate bright spots, which can more accurately find out All bright peak points in the original grayscale image can effectively improve the recall rate and precision rate of target bright spot search.
请参阅图7,在一些实施例中,位置数据包括亚像素中心坐标,光强数据包括光强值,步骤S107可以包括但不限于包括步骤S701至步骤S702:Please refer to Figure 7. In some embodiments, the position data includes sub-pixel center coordinates, and the light intensity data includes light intensity values. Step S107 may include but is not limited to steps S701 to S702:
步骤S701,通过重心法对目标亮点进行坐标识别,得到目标亮点的亚像素中心坐标;Step S701, identify the coordinates of the target bright spot through the center of gravity method, and obtain the sub-pixel center coordinates of the target bright spot;
步骤S702,通过二次样条插值法对亚像素中心坐标进行亮度提取,得到目标亮点的光强值。Step S702: Extract the brightness of the sub-pixel center coordinates through the quadratic spline interpolation method to obtain the light intensity value of the target bright spot.
在一些实施例的步骤S701和S702中,通过重心法计算目标亮点之间的相对距离,根据相对距离的大小,得到目标亮点的亚像素中心坐标,其中,目标亮点为尖峰点。通过二次样条插值法或者二次函数来对亚像素中心坐标进行亮度提取,得到目标亮点的光强值。In steps S701 and S702 in some embodiments, the relative distance between the target bright spots is calculated through the center of gravity method, and the sub-pixel center coordinates of the target bright spots are obtained according to the size of the relative distance, where the target bright spots are peak points. The brightness of the sub-pixel center coordinates is extracted through quadratic spline interpolation or a quadratic function to obtain the light intensity value of the target bright spot.
需要说明的是,在上述的图像预处理过程以及目标亮点筛选的过程中,可以采用x86指令集来进行加速处理,从而使得本发明实施例的亮点定位方法能够满足实时测序的处理需求和工业生产的要求。It should be noted that in the above-mentioned image preprocessing process and target highlight screening process, the x86 instruction set can be used for accelerated processing, so that the highlight positioning method according to the embodiment of the present invention can meet the processing needs of real-time sequencing and industrial production. requirements.
本发明实施例的亮度定位方法,其通过获取待处理的原始灰度图像;对原始灰度图像进行图像预处理,得到初始背景图像;对原始灰度图像和初始背景 图像进行比值计算,得到信噪比矩阵,并对信噪比矩阵进行二值化分割,得到二值化图像,能够通过提高图像背景估计的准确性以及图像分割的准确性。进一步地,根据二值化图像对原始灰度图像进行图像均衡处理,得到初始灰度图像,能够使得初始灰度图像全局均衡化,同时,通过对初始灰度图像进行图像滤波处理,得到目标灰度图像,能够提高目标图像质量。最后,根据二值化图像对目标灰度图像进行亮点检测,得到目标亮点;通过预设算法对目标亮点进行定位处理,得到目标亮点的位置数据和光强数据,这一方式能够较为准确地识别出目标亮点以及确定目标亮点的位置,提高了亮点定位的准确性。The brightness positioning method of the embodiment of the present invention obtains the original grayscale image to be processed; performs image preprocessing on the original grayscale image to obtain an initial background image; and performs image processing on the original grayscale image and the initial background. The image is ratio calculated to obtain a signal-to-noise ratio matrix, and the signal-to-noise ratio matrix is binarized and segmented to obtain a binarized image, which can improve the accuracy of image background estimation and image segmentation. Further, image equalization processing is performed on the original grayscale image according to the binary image to obtain an initial grayscale image, which can globally equalize the initial grayscale image. At the same time, by performing image filtering processing on the initial grayscale image, the target grayscale image is obtained. degree image, which can improve the quality of the target image. Finally, perform highlight detection on the target grayscale image based on the binary image to obtain the target highlight; perform positioning processing on the target highlight through a preset algorithm to obtain the position data and light intensity data of the target highlight. This method can more accurately identify the target highlight. Identify the target bright spots and determine the location of the target bright spots, thereby improving the accuracy of bright spot positioning.
请参阅图8,本发明实施例还提供一种亮点定位装置,可以实现上述亮点定位方法,该装置包括:Please refer to Figure 8. An embodiment of the present invention also provides a bright spot positioning device that can implement the above bright spot positioning method. The device includes:
图像获取模块801,用于获取待处理的原始灰度图像;Image acquisition module 801, used to acquire the original grayscale image to be processed;
图像预处理模块802,用于对原始灰度图像进行图像预处理,得到初始背景图像;Image preprocessing module 802 is used to perform image preprocessing on the original grayscale image to obtain an initial background image;
计算模块803,用于对原始灰度图像和初始背景图像进行比值计算,得到信噪比矩阵;The calculation module 803 is used to calculate the ratio of the original grayscale image and the initial background image to obtain the signal-to-noise ratio matrix;
图像分割模块804,用于对信噪比矩阵进行二值化分割,得到二值化图像;Image segmentation module 804 is used to perform binary segmentation on the signal-to-noise ratio matrix to obtain a binary image;
图像均衡模块805,用于根据二值化图像对原始灰度图像进行图像均衡处理,得到初始灰度图像;The image equalization module 805 is used to perform image equalization processing on the original grayscale image based on the binary image to obtain an initial grayscale image;
图像滤波模块806,用于对初始灰度图像进行图像滤波处理,得到目标灰度图像;The image filtering module 806 is used to perform image filtering processing on the initial grayscale image to obtain the target grayscale image;
亮点检测模块807,用于根据二值化图像对目标灰度图像进行亮点检测,得到目标亮点;The bright spot detection module 807 is used to detect bright spots on the target grayscale image based on the binary image to obtain the target bright spots;
定位模块808,用于通过预设算法对目标亮点进行定位处理,得到目标亮点的位置数据和光强数据。The positioning module 808 is used to position the target bright spot through a preset algorithm to obtain the position data and light intensity data of the target bright spot.
该亮点定位装置的具体实施方式与上述亮点定位方法的具体实施例基本相同,在此不再赘述。The specific implementation of the bright point positioning device is basically the same as the specific embodiment of the above-mentioned bright point positioning method, and will not be described again here.
本发明实施例还提供了一种电子设备,电子设备包括:存储器、处理器、存储在存储器上并可在处理器上运行的程序以及用于实现处理器和存储器之间的连接通信的数据总线,程序被处理器执行时实现上述亮点定位方法。该电子设备可以为包括平板电脑、车载电脑等任意智能终端。An embodiment of the present invention also provides an electronic device. The electronic device includes: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. , the above bright spot positioning method is implemented when the program is executed by the processor. The electronic device can be any smart terminal including a tablet computer, a vehicle-mounted computer, etc.
请参阅图9,图9示意了另一实施例的电子设备的硬件结构,电子设备包括:Please refer to Figure 9, which illustrates the hardware structure of an electronic device according to another embodiment. The electronic device includes:
处理器901,可以采用通用的CPU(CentralProcessingUnit,中央处理器)、微处理器、应用专用集成电路(ApplicationSpecificIntegratedCircuit,ASIC)、或者一个或多个集成电路等方式实现,用于执行相关程序,以实现本发明实施例所提供的技术方案;The processor 901 can be implemented by a general CPU (Central Processing Unit, central processing unit), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement The technical solutions provided by the embodiments of the present invention;
存储器902,可以采用只读存储器(ReadOnlyMemory,ROM)、静态存储设 备、动态存储设备或者随机存取存储器(RandomAccessMemory,RAM)等形式实现。存储器902可以存储操作系统和其他应用程序,在通过软件或者固件来实现本说明书实施例所提供的技术方案时,相关的程序代码保存在存储器902中,并由处理器901来调用执行本发明实施例的亮点定位方法;The memory 902 can be a read-only memory (ReadOnlyMemory, ROM) or a static storage device. It can be implemented in the form of equipment, dynamic storage device or random access memory (RandomAccessMemory, RAM). The memory 902 can store operating systems and other application programs. When the technical solutions provided by the embodiments of this specification are implemented through software or firmware, the relevant program codes are stored in the memory 902 and called by the processor 901 to execute the implementation of the present invention. Example of bright spot positioning method;
输入/输出接口903,用于实现信息输入及输出;Input/output interface 903, used to implement information input and output;
通信接口904,用于实现本设备与其他设备的通信交互,可以通过有线方式(例如USB、网线等)实现通信,也可以通过无线方式(例如移动网络、WIFI、蓝牙等)实现通信;Communication interface 904 is used to realize communication interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wirelessly (such as mobile network, WIFI, Bluetooth, etc.);
总线905,在设备的各个组件(例如处理器901、存储器902、输入/输出接口903和通信接口904)之间传输信息;Bus 905, which transmits information between various components of the device (such as processor 901, memory 902, input/output interface 903, and communication interface 904);
其中处理器901、存储器902、输入/输出接口903和通信接口904通过总线905实现彼此之间在设备内部的通信连接。The processor 901, the memory 902, the input/output interface 903 and the communication interface 904 implement communication connections between each other within the device through the bus 905.
本发明实施例还提供了一种存储介质,存储介质为计算机可读存储介质,用于计算机可读存储,存储介质存储有一个或者多个程序,一个或者多个程序可被一个或者多个处理器执行,以实现上述亮点定位方法。Embodiments of the present invention also provide a storage medium. The storage medium is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be processed by one or more The processor is executed to implement the above bright spot positioning method.
存储器作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序以及非暂态性计算机可执行程序。此外,存储器可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施方式中,存储器可选包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至该处理器。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。As a non-transitory computer-readable storage medium, memory can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory may include high-speed random access memory and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory located remotely from the processor, and the remote memory may be connected to the processor via a network. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.
本发明实施例提供的亮点定位方法、亮点定位装置、电子设备及存储介质,其通过获取待处理的原始灰度图像;对原始灰度图像进行图像预处理,得到初始背景图像;对原始灰度图像和初始背景图像进行比值计算,得到信噪比矩阵,并对信噪比矩阵进行二值化分割,得到二值化图像,能够通过提高图像背景估计的准确性以及图像分割的准确性。进一步地,根据二值化图像对原始灰度图像进行图像均衡处理,得到初始灰度图像,能够使得初始灰度图像全局均衡化,同时,通过对初始灰度图像进行图像滤波处理,得到目标灰度图像,能够提高目标图像质量。最后,根据二值化图像对目标灰度图像进行亮点检测,得到目标亮点;通过预设算法对目标亮点进行定位处理,得到目标亮点的位置数据和光强数据,这一方式能够较为准确地识别出目标亮点以及确定目标亮点的位置,提高了亮点定位的准确性。The bright spot positioning method, bright spot positioning device, electronic equipment and storage medium provided by embodiments of the present invention obtain an original grayscale image to be processed; perform image preprocessing on the original grayscale image to obtain an initial background image; and perform image preprocessing on the original grayscale image. The ratio between the image and the initial background image is calculated to obtain the signal-to-noise ratio matrix, and the signal-to-noise ratio matrix is binarized and segmented to obtain a binarized image, which can improve the accuracy of image background estimation and image segmentation. Further, image equalization processing is performed on the original grayscale image according to the binary image to obtain an initial grayscale image, which can globally equalize the initial grayscale image. At the same time, by performing image filtering processing on the initial grayscale image, the target grayscale image is obtained. degree image, which can improve the quality of the target image. Finally, perform highlight detection on the target grayscale image based on the binary image to obtain the target highlight; perform positioning processing on the target highlight through a preset algorithm to obtain the position data and light intensity data of the target highlight. This method can more accurately identify the target highlight. Identify the target bright spots and determine the location of the target bright spots, thereby improving the accuracy of bright spot positioning.
本发明实施例描述的实施例是为了更加清楚的说明本发明实施例的技术方案,并不构成对于本发明实施例提供的技术方案的限定,本领域技术人员可知,随着技术的演变和新应用场景的出现,本发明实施例提供的技术方案对于类似的技术问题,同样适用。 The embodiments described in the embodiments of the present invention are to more clearly illustrate the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. Those skilled in the art will know that with the evolution of technology and new technologies, As application scenarios arise, the technical solutions provided by the embodiments of the present invention are also applicable to similar technical problems.
本领域技术人员可以理解的是,图1-7中示出的技术方案并不构成对本发明实施例的限定,可以包括比图示更多或更少的步骤,或者组合某些步骤,或者不同的步骤。Those skilled in the art can understand that the technical solutions shown in Figures 1-7 do not limit the embodiments of the present invention, and may include more or fewer steps than shown, or combine certain steps, or different A step of.
以上所描述的装置实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separate, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、设备中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。Those of ordinary skill in the art can understand that all or some steps, systems, and functional modules/units in the devices disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof.
本发明的说明书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if present) in the description of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe specific objects. Sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the invention described herein are capable of being practiced in sequences other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus that encompasses a series of steps or units and need not be limited to those explicitly listed. Those steps or elements may instead include other steps or elements not expressly listed or inherent to the process, method, product or apparatus.
应当理解,在本发明中,“至少一个(项)”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:只存在A,只存在B以及同时存在A和B三种情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b或c中的至少一项(个),可以表示:a,b,c,“a和b”,“a和c”,“b和c”,或“a和b和c”,其中a,b,c可以是单个,也可以是多个。It should be understood that in the present invention, "at least one (item)" refers to one or more, and "plurality" refers to two or more. "And/or" is used to describe the relationship between associated objects, indicating that there can be three relationships. For example, "A and/or B" can mean: only A exists, only B exists, and A and B exist simultaneously. , where A and B can be singular or plural. The character "/" generally indicates that the related objects are in an "or" relationship. “At least one of the following” or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items). For example, at least one item (item) of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c" ”, where a, b, c can be single or multiple.
在本发明所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the above units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or may be Integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。 The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括多指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例的方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等各种可以存储程序的介质。Integrated units may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as independent products. Based on this understanding, the technical solution of the present invention is essentially or contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc. that can store programs. medium.
以上参照附图说明了本发明实施例的优选实施例,并非因此局限本发明实施例的权利范围。本领域技术人员不脱离本发明实施例的范围和实质内所作的任何修改、等同替换和改进,均应在本发明实施例的权利范围之内。 The preferred embodiments of the embodiments of the present invention have been described above with reference to the accompanying drawings, but the scope of rights of the embodiments of the present invention is not thereby limited. Any modifications, equivalent substitutions and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present invention shall be within the scope of rights of the embodiments of the present invention.

Claims (10)

  1. 一种亮点定位方法,其特征在于,所述方法包括:A bright spot positioning method, characterized in that the method includes:
    获取待处理的原始灰度图像;Get the original grayscale image to be processed;
    对所述原始灰度图像进行图像预处理,得到初始背景图像;Perform image preprocessing on the original grayscale image to obtain an initial background image;
    对所述原始灰度图像和所述初始背景图像进行比值计算,得到信噪比矩阵;Perform ratio calculation on the original grayscale image and the initial background image to obtain a signal-to-noise ratio matrix;
    对所述信噪比矩阵进行二值化分割,得到二值化图像;Perform binary segmentation on the signal-to-noise ratio matrix to obtain a binary image;
    根据所述二值化图像对所述原始灰度图像进行图像均衡处理,得到初始灰度图像;Perform image equalization processing on the original grayscale image according to the binary image to obtain an initial grayscale image;
    对所述初始灰度图像进行图像滤波处理,得到目标灰度图像;Perform image filtering processing on the initial grayscale image to obtain a target grayscale image;
    根据所述二值化图像对所述目标灰度图像进行亮点检测,得到目标亮点;Perform bright spot detection on the target grayscale image according to the binary image to obtain the target bright spot;
    通过预设算法对所述目标亮点进行定位处理,得到所述目标亮点的位置数据和光强数据。The target bright spot is positioned through a preset algorithm to obtain the position data and light intensity data of the target bright spot.
  2. 根据权利要求1所述的亮点定位方法,其特征在于,所述对所述原始灰度图像进行图像预处理,得到初始背景图像的步骤,包括:The bright spot positioning method according to claim 1, characterized in that the step of performing image preprocessing on the original grayscale image to obtain an initial background image includes:
    在预设区间内对所述原始灰度图像进行直方图统计,得到亮度直方图;Perform histogram statistics on the original grayscale image within a preset interval to obtain a brightness histogram;
    对所述亮度直方图进行特征提取,得到局部背景值;Perform feature extraction on the brightness histogram to obtain local background values;
    根据所述局部背景值对所述原始灰度图像进行减背景处理,得到所述初始背景图像和初始去背景图像。Perform background subtraction processing on the original grayscale image according to the local background value to obtain the initial background image and an initial background-removed image.
  3. 根据权利要求2所述的亮点定位方法,其特征在于,所述对所述信噪比矩阵进行二值化分割,得到二值化图像的步骤,包括:The method of locating a bright spot according to claim 2, wherein the step of binary segmenting the signal-to-noise ratio matrix to obtain a binary image includes:
    根据所述信噪比矩阵和所述亮度直方图进行阈值计算,得到二值化阈值;Perform threshold calculation according to the signal-to-noise ratio matrix and the brightness histogram to obtain a binarized threshold;
    根据所述二值化阈值对所述信噪比矩阵进行二值化分割,得到所述二值化图像。Binarize and segment the signal-to-noise ratio matrix according to the binarization threshold to obtain the binarized image.
  4. 根据权利要求1所述的亮点定位方法,其特征在于,所述根据所述二值化图像对所述原始灰度图像进行图像均衡处理,得到初始灰度图像的步骤,包括:The method of locating bright spots according to claim 1, wherein the step of performing image equalization processing on the original grayscale image according to the binary image to obtain an initial grayscale image includes:
    根据所述二值化图像对所述原始灰度图像进行亮度计算,得到所述二值化图像的前景亮度均值;Perform brightness calculation on the original grayscale image according to the binarized image to obtain the mean foreground brightness of the binarized image;
    根据所述前景亮度均值对所述原始灰度图像进行亮度归一化,得到所述初始灰度图像。The original grayscale image is brightness normalized according to the foreground brightness mean value to obtain the initial grayscale image.
  5. 根据权利要求1所述的亮点定位方法,其特征在于,所述对所述初始灰度图像进行图像滤波处理,得到目标灰度图像的步骤,包括:The method of locating bright spots according to claim 1, wherein the step of performing image filtering on the initial grayscale image to obtain a target grayscale image includes:
    对所述初始灰度图像进行高斯滤波处理,得到第一滤波图像;Perform Gaussian filtering on the initial grayscale image to obtain a first filtered image;
    对所述第一滤波图像进行拉普拉斯锐化处理,得到所述目标灰度图像。 Perform Laplacian sharpening processing on the first filtered image to obtain the target grayscale image.
  6. 根据权利要求1所述的亮点定位方法,其特征在于,所述根据所述二值化图像对所述目标灰度图像进行亮点检测,得到目标亮点的步骤,包括:The bright spot positioning method according to claim 1, characterized in that the step of performing bright spot detection on the target grayscale image according to the binary image to obtain the target bright spot includes:
    根据所述二值化图像对所述目标灰度图像进行亮点检测,得到所述二值化图像的前景亮度均值;Perform highlight detection on the target grayscale image according to the binarized image to obtain the mean foreground brightness of the binarized image;
    根据所述前景亮度均值,确定用于亮点检测的强度阈值;Determine an intensity threshold for bright spot detection based on the average foreground brightness;
    根据所述目标灰度图像中的候选亮点之间的邻接关系构建亮点连通图;Construct a bright spot connected graph according to the adjacency relationship between candidate bright spots in the target grayscale image;
    根据所述候选亮点的亮度值对所述亮点连通图的候选亮点进行筛选处理,得到初始亮点;Filter the candidate bright spots of the bright spot connected graph according to the brightness values of the candidate bright spots to obtain initial bright spots;
    根据预设的筛选条件对所述初始亮点进行检测处理,得到所述目标亮点。The initial bright spots are detected according to preset filtering conditions to obtain the target bright spots.
  7. 根据权利要求1至6任一项所述的亮点定位方法,其特征在于,所述位置数据包括亚像素中心坐标,所述光强数据包括光强值,所述通过预设算法对所述目标亮点进行定位处理,得到所述目标亮点的位置数据和光强数据的步骤,包括:The bright spot positioning method according to any one of claims 1 to 6, wherein the position data includes sub-pixel center coordinates, the light intensity data includes a light intensity value, and the target is determined by a preset algorithm. The steps of positioning the bright spot and obtaining the position data and light intensity data of the target bright spot include:
    通过重心法对所述目标亮点进行坐标识别,得到所述目标亮点的亚像素中心坐标;Perform coordinate identification on the target bright spot through the center of gravity method to obtain the sub-pixel center coordinates of the target bright spot;
    通过二次样条插值法对所述亚像素中心坐标进行亮度提取,得到所述目标亮点的光强值。The brightness of the sub-pixel center coordinates is extracted using a quadratic spline interpolation method to obtain the light intensity value of the target bright spot.
  8. 一种亮点定位装置,其特征在于,所述装置包括:A bright spot positioning device, characterized in that the device includes:
    图像获取模块,用于获取待处理的原始灰度图像;Image acquisition module, used to acquire the original grayscale image to be processed;
    图像预处理模块,用于对所述原始灰度图像进行图像预处理,得到初始背景图像;An image preprocessing module, used to perform image preprocessing on the original grayscale image to obtain an initial background image;
    计算模块,用于对所述原始灰度图像和所述初始背景图像进行比值计算,得到信噪比矩阵;A calculation module for performing ratio calculation on the original grayscale image and the initial background image to obtain a signal-to-noise ratio matrix;
    图像分割模块,用于对所述信噪比矩阵进行二值化分割,得到二值化图像;An image segmentation module, used to perform binary segmentation on the signal-to-noise ratio matrix to obtain a binary image;
    图像均衡模块,用于根据所述二值化图像对所述原始灰度图像进行图像均衡处理,得到初始灰度图像;An image equalization module, configured to perform image equalization processing on the original grayscale image according to the binary image to obtain an initial grayscale image;
    图像滤波模块,用于对所述初始灰度图像进行图像滤波处理,得到目标灰度图像;An image filtering module, used to perform image filtering processing on the initial grayscale image to obtain a target grayscale image;
    亮点检测模块,用于根据所述二值化图像对所述目标灰度图像进行亮点检测,得到目标亮点;A bright spot detection module, configured to perform bright spot detection on the target grayscale image based on the binary image to obtain the target bright spot;
    定位模块,用于通过预设算法对所述目标亮点进行定位处理,得到所述目标亮点的位置数据和光强数据。A positioning module is used to perform positioning processing on the target bright spot through a preset algorithm to obtain position data and light intensity data of the target bright spot.
  9. 一种电子设备,其特征在于,所述电子设备包括存储器、处理器、存储在所述存储器上并可在所述处理器上运行的程序以及用于实现所述处理器和所述存储器之间的连接通信的数据总线,所述程序被所述处理器执行时实现如权利要求1至7任一项所述的亮点定位方法的步骤。 An electronic device, characterized in that the electronic device includes a memory, a processor, a program stored on the memory and executable on the processor, and a program for realizing communication between the processor and the memory. A data bus is connected to the communication, and when the program is executed by the processor, the steps of the bright spot positioning method according to any one of claims 1 to 7 are implemented.
  10. 一种存储介质,所述存储介质为计算机可读存储介质,用于计算机可读存储,其特征在于,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现权利要求1至7中任一项所述的亮点定位方法的步骤。 A storage medium, the storage medium is a computer-readable storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs, and the one or more programs can be used by one or more A plurality of processors are executed to implement the steps of the bright spot positioning method described in any one of claims 1 to 7.
PCT/CN2023/074781 2022-07-22 2023-02-07 Bright spot location method, bright spot location apparatus, electronic device and storage medium WO2024016632A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210870876.6 2022-07-22
CN202210870876.6A CN115294035B (en) 2022-07-22 2022-07-22 Bright spot positioning method, bright spot positioning device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2024016632A1 true WO2024016632A1 (en) 2024-01-25

Family

ID=83824011

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/074781 WO2024016632A1 (en) 2022-07-22 2023-02-07 Bright spot location method, bright spot location apparatus, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN115294035B (en)
WO (1) WO2024016632A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115294035B (en) * 2022-07-22 2023-11-10 深圳赛陆医疗科技有限公司 Bright spot positioning method, bright spot positioning device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107945150A (en) * 2016-10-10 2018-04-20 深圳市瀚海基因生物科技有限公司 The image processing method and system of gene sequencing
WO2020037572A1 (en) * 2018-08-22 2020-02-27 深圳市真迈生物科技有限公司 Method and device for detecting bright spot on image, and image registration method and device
CN112289377A (en) * 2018-08-22 2021-01-29 深圳市真迈生物科技有限公司 Method, apparatus and computer program product for detecting bright spots on an image
US20210217177A1 (en) * 2018-08-22 2021-07-15 Genemind Biosciences Company Limited Method and device for detecting bright spots on image, and computer program product
CN115294035A (en) * 2022-07-22 2022-11-04 深圳赛陆医疗科技有限公司 Bright point positioning method, bright point positioning device, electronic equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7333656B2 (en) * 2003-11-26 2008-02-19 Matsushita Electric Industrial Co., Ltd. Image processing method and image processing apparatus
CN103617611B (en) * 2013-11-12 2016-08-17 清华大学 A kind of automatic threshold segmentation spot center and size detecting method
WO2021030952A1 (en) * 2019-08-16 2021-02-25 深圳市真迈生物科技有限公司 Base recognition method and system, computer program product, and sequencing system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107945150A (en) * 2016-10-10 2018-04-20 深圳市瀚海基因生物科技有限公司 The image processing method and system of gene sequencing
WO2020037572A1 (en) * 2018-08-22 2020-02-27 深圳市真迈生物科技有限公司 Method and device for detecting bright spot on image, and image registration method and device
CN112289377A (en) * 2018-08-22 2021-01-29 深圳市真迈生物科技有限公司 Method, apparatus and computer program product for detecting bright spots on an image
US20210217177A1 (en) * 2018-08-22 2021-07-15 Genemind Biosciences Company Limited Method and device for detecting bright spots on image, and computer program product
CN115294035A (en) * 2022-07-22 2022-11-04 深圳赛陆医疗科技有限公司 Bright point positioning method, bright point positioning device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115294035A (en) 2022-11-04
CN115294035B (en) 2023-11-10

Similar Documents

Publication Publication Date Title
Pape et al. 3-D histogram-based segmentation and leaf detection for rosette plants
CN106709500B (en) Image feature matching method
CN111340749B (en) Image quality detection method, device, equipment and storage medium
CN108898132B (en) Terahertz image dangerous article identification method based on shape context description
CN109858438B (en) Lane line detection method based on model fitting
CN109214996B (en) Image processing method and device
CN111144337B (en) Fire detection method and device and terminal equipment
CN111382658B (en) Road traffic sign detection method in natural environment based on image gray gradient consistency
CN110648330B (en) Defect detection method for camera glass
CN111489337A (en) Method and system for removing false defects through automatic optical detection
WO2024016632A1 (en) Bright spot location method, bright spot location apparatus, electronic device and storage medium
CN108960247B (en) Image significance detection method and device and electronic equipment
CN109255311B (en) Image-based information identification method and system
CN114620030A (en) Parking performance testing method and device, server and product
CN112330618B (en) Image offset detection method, device and storage medium
CN107292892B (en) Video frame image segmentation method and device
CN107704864B (en) Salient object detection method based on image object semantic detection
CN111368856B (en) Book spine extraction method and device of book checking system based on vision
CN110889817B (en) Image fusion quality evaluation method and device
CN109741370B (en) Target tracking method and device
CN116129195A (en) Image quality evaluation device, image quality evaluation method, electronic device, and storage medium
CN113239738B (en) Image blurring detection method and blurring detection device
CN111027560B (en) Text detection method and related device
CN114554188A (en) Mobile phone camera detection method and device based on image sensor pixel array
CN110276260B (en) Commodity detection method based on depth camera

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23841710

Country of ref document: EP

Kind code of ref document: A1