WO2020062843A1 - Pill coating image processing method and apparatus, and computer device and storage medium - Google Patents

Pill coating image processing method and apparatus, and computer device and storage medium Download PDF

Info

Publication number
WO2020062843A1
WO2020062843A1 PCT/CN2019/083136 CN2019083136W WO2020062843A1 WO 2020062843 A1 WO2020062843 A1 WO 2020062843A1 CN 2019083136 W CN2019083136 W CN 2019083136W WO 2020062843 A1 WO2020062843 A1 WO 2020062843A1
Authority
WO
WIPO (PCT)
Prior art keywords
spectrum
pill
image
filtering
point set
Prior art date
Application number
PCT/CN2019/083136
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 WO2020062843A1 publication Critical patent/WO2020062843A1/en

Links

Images

Classifications

    • 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
    • G06T5/00Image enhancement or restoration
    • G06T5/10Image enhancement or restoration using non-spatial domain filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • 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/10072Tomographic images
    • G06T2207/10101Optical tomography; Optical coherence tomography [OCT]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20032Median filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • G06T2207/20056Discrete and fast Fourier transform, [DFT, FFT]

Definitions

  • the present application relates to the field of image processing technology, and in particular, to a method, a device, a computer device, and a storage medium for image processing of a pill coating.
  • spectral optical coherence tomography uses a camera to collect the original spectrum. After the original spectrum is Fourier transformed, a depth image of the object to be measured can be obtained. Fast speed, high signal-to-noise ratio, high resolution, non-invasive measurement, low cost and other advantages.
  • the quality of the pill-coated image has problems due to the influence of various noises introduced by the original spectrum.
  • Traditional pill-coated image processing methods in order to eliminate the effects of various noises introduced by the original spectrum, can not completely eliminate the introduction of the original spectrum by subtracting the reference light spectrum or the average value of the original spectrum from the original spectrum. noise. Therefore, eliminating the effects of various noises introduced by the original spectrum and improving the image quality of the pill coating have become technical issues that need to be solved at present.
  • An image processing method for pill coating includes:
  • the performing filtering processing on the original spectrum using multiple filtering windows includes:
  • generating the filtered spectrum by using the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship includes:
  • the impulsive noise point set includes impulsive noise
  • the stationary pixel point set includes stationary noise
  • the denoising processing on the impulsive noise point set and the stationary pixel point set includes:
  • the stationary noise is removed by the curvelet transform.
  • the method further includes:
  • a pill-coated image processing device includes:
  • a spectrum receiving module for receiving the original spectrum uploaded by the pill image detection device
  • a filtering processing module configured to perform filtering processing on the original spectrum by using various filtering windows
  • An image generating module for performing a Fourier transform on the filtered original spectrum to obtain a pill-coated image
  • a pixel classification module configured to classify all pixels of the pill-coated image to obtain a set of impulsive noise points and a set of stationary pixels;
  • a denoising processing module is configured to perform denoising processing on the impulse noise point set and the stationary pixel point set to obtain a decoated pill-coated image.
  • the filtering processing module is further configured to perform average filtering on the original spectrum according to the X-direction filtering window to obtain a first spectrum; perform average filtering on the original spectrum according to the Y-direction filtering window to obtain A second spectrum; performing a mean filtering on the original spectrum using a square filter window to obtain a third spectrum; using the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship, Generate a filtered spectrum.
  • the denoising processing module is further configured to remove the impulse noise concentrated in the impulse noise points through a median filtering process; the pill-coated image after removing the impulse noise concentrated in the impulse noise points Performing a curvelet transform; and removing the stationary noise concentrated in the stationary pixels by the curvelet transform.
  • a computer device includes a memory and a processor.
  • the memory stores a computer program that can run on the processor, and the processor implements the steps in the foregoing method embodiments when the computer program is executed.
  • a computer-readable storage medium stores a computer program thereon.
  • the computer program is executed by a processor, the steps in the foregoing method embodiments are implemented.
  • the above-mentioned pill-coating image processing method, device, computer equipment, and storage medium utilize various filtering windows to filter the original spectrum, thereby eliminating various noises introduced by the original spectrum.
  • the filtered spectrum is used to perform Fourier transform to obtain the pill-coated image.
  • the impulse noise point set and the stationary pixel point set are obtained. Denoising the impulse noise point set and the stationary pixel point set, thereby eliminating the noise of the pill-coated image, thereby improving the quality of the pill-coated image.
  • FIG. 1 is an application environment diagram of a pill coating image processing method in an embodiment
  • FIG. 2 is a schematic diagram of an original spectrum of an embodiment
  • FIG. 3 is a schematic flowchart of a pill coating image processing method in an embodiment
  • FIG. 4 is a schematic diagram of a pill coating image obtained by performing a Fourier transform on a first spectrum in an embodiment
  • FIG. 5 is a schematic diagram of a pill coating image obtained by performing a Fourier transform on a second spectrum in an embodiment
  • FIG. 6 is a schematic diagram of a pill coating image obtained by performing a Fourier transform on the filtered spectrum in an embodiment
  • FIG. 7 is a schematic diagram of a pill coating image obtained after smooth noise is removed by curve wave transformation in an embodiment
  • FIG. 8 is a structural block diagram of a pill-coated image processing device in an embodiment
  • FIG. 9 is an internal structural diagram of a computer device in one embodiment.
  • the pill-coating image processing method provided in the present application can be applied to an application environment as shown in FIG. 1.
  • the terminal 104 receives the original spectrum sent by the pill detection device 102, and the original spectrum is shown in FIG.
  • the terminal 104 performs filtering processing on the original spectrum by using various filtering windows.
  • the terminal 104 performs a Fourier transform on the filtered spectrum to obtain a pill-coated image.
  • the terminal 104 classifies all the pixels of the pill-coated image to obtain a set of impulsive noise points and a set of stationary pixels.
  • the terminal 104 performs denoising processing on the impulse noise point set and the stationary pixel point set to obtain a pill-coated image after denoising.
  • the terminal 104 may be various computers, notebook computers, and tablet computers.
  • a method for processing a pill-coated image is provided.
  • the method is applied to the terminal in FIG. 1 as an example for description, and includes the following steps:
  • Step 302 Receive the original spectrum uploaded by the pill detection device.
  • Step 304 Perform filtering processing on the original spectrum by using various filtering windows.
  • the terminal can use various filtering windows to filter the original spectrum.
  • the multiple filtering windows include filtering windows of different sizes and filtering windows of different shapes.
  • the filtering windows of different sizes include the X direction. Filter window and Y-direction filter window. Filter windows of different shapes include square filter windows.
  • the filtering process includes mean filtering.
  • the terminal uses multiple filtering windows to filter the original spectrum, which can eliminate the influence of noise introduced by the original spectrum, improve the ability to eliminate the original spectral noise, and thus help improve the quality of the pill-coated image. .
  • Step 306 Fourier transform the filtered spectrum to obtain a pill-coated image.
  • a Fourier transform can be performed on the filtered spectrum to obtain a pill-coated image.
  • the terminal uses the X-direction filter window, the Y-direction filter window, and the square filter window of the various filter windows to filter the original spectrum to obtain a filtered spectrum, and performs Fourier transform on the spectrum to obtain a pill coating. image.
  • Step 308 Classify all the pixels of the pill-coated image to obtain a set of impulsive noise points and a set of stationary pixels.
  • the terminal can classify all pixels of the pill-coated image to obtain a set of impulsive noise points and a set of stationary pixels. Specifically, the terminal divides all the pixels of the pill-coated image into a set of impulsive noise points and a set of stationary pixels according to the relationship between the central pixel value in the pill-coated image and the pixel values in the neighborhood. The terminal makes a difference between the pixel value of the central pixel point and the pixel values of the surrounding neighborhood to obtain multiple difference values. The terminal classifies all pixels of the pill-coated image according to multiple differences, and obtains a set of impulsive noise points and a set of stationary pixels.
  • the terminal divides the pixel points corresponding to the difference greater than the positive preset value and the value smaller than the negative preset value into a set of impulsive noise points, and the pixel points corresponding to the difference smaller than the positive direction preset value and the difference greater than the negative preset value correspond to
  • the pixels are divided into a set of stationary pixels.
  • the terminal makes a difference between the pixel value of the central pixel point and the pixel values of the surrounding neighborhood, and when the difference value is greater than or equal to zero, it is the positive direction number of the central pixel point; when the difference value is less than zero, the central pixel point is The number of points in the negative direction.
  • the number of positive directions is greater than the preset value of the positive direction, it means that the value of the central pixel point is greater than that of most neighboring pixels.
  • the terminal divides the pixels corresponding to the number of positive directions greater than the preset value of the positive direction into a set of impulsive noise points. .
  • the terminal divides the pixels corresponding to the number of positive directions that are less than the preset value of the negative direction into a set of impulsive noise points. . In both cases, the terminal divides the central pixel point into a set of impulsive noise points. The terminal divides the pixels corresponding to the number of positive directions smaller than the preset value in the positive direction, the pixels corresponding to the number of negative directions greater than the preset value in the negative direction, and the central pixel point into a stationary pixel point set.
  • Step 310 Denoise the impulse noise point set and the stationary pixel point set to obtain a pill-coated image after denoising.
  • the terminal After the terminal classifies all the pixels of the pill-coated image, and obtains the impulse noise point set and the stationary pixel point set, it can perform denoising processing on the impulse noise point set and the stationary pixel point set to obtain the denoised pill-coated image. Specifically, the terminal performs denoising processing on the set of impulse noise points, and the terminal removes impulse noise from the set of impulse noise points. The terminal performs denoising processing on the stationary pixel set.
  • the stationary pixel set includes normal pixels and stationary noise. The terminal removes the stationary noise concentrated in the stationary pixels to obtain a de-noised pill-coated image.
  • a variety of filtering windows are used to perform filtering processing on the original spectrum, so that various noises introduced by the original spectrum can be eliminated.
  • the filtered spectrum is used to perform Fourier transform to obtain the pill-coated image.
  • the impulse noise point set and the stationary pixel point set are obtained.
  • the terminal performs denoising processing on the impulse noise point set and the stationary pixel point set, thereby eliminating the noise of the pill-coated image, thereby improving the quality of the pill-coated image.
  • the original spectrum is filtered by using multiple filtering windows, including: performing an average filtering on the original spectrum according to the X-direction filtering window to obtain a first spectrum; and performing an average filtering on the original spectrum according to the Y-direction filtering window to obtain The second spectrum; average filtering the original spectrum using a square filter window to obtain a third spectrum; and generating the filtered spectrum using the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship.
  • the terminal filters the original spectrum according to the X-direction filter window, which can remove the high-frequency coherent signals in the original spectrum, obtain the low-frequency noise component, and obtain the first spectrum. As shown in Figure 4, no white lines are present in the pill-coated image.
  • the X-direction filtering window refers to the X-direction filtering window of the width of the pill-coated image, wherein the X-direction filtering window may be a filtering window of a first preset size.
  • the first preset size may be 1 * 5 (one row and five columns) or 1 * 10 (one row and ten columns).
  • the filtering window is used to perform average filtering for the X-direction filtering window of the width of the pill-coated image, and the low-frequency noise component obtained after filtering is inaccurate.
  • Mean filtering, the low-frequency noise component obtained after filtering is more accurate, that is, closer to the real noise.
  • the terminal may perform average filtering on the original spectrum according to the Y-direction filtering window to obtain a second spectrum.
  • the pill coating image is shown in FIG. 5, and there are no bright lines in the pill coating image.
  • the bright line refers to the vertical line formed in the image of the pill coating, because the noise floor corresponding to the original spectrum is significantly higher than other spectral lines due to the reflected light of the sample being too strong.
  • the Y-direction filter window may be a filter window of a second preset size.
  • the second preset size may be 10 * 1 (ten rows and one column).
  • the terminal performs average filtering on the original spectrum according to the Y-direction filter window, which can eliminate bright lines in the pill-coated image.
  • the terminal performs mean filtering on the original spectrum according to the Y-direction filter window to obtain a second spectrum, and then uses a square filter window to perform mean filtering on the original spectrum to obtain a third spectrum.
  • the terminal obtains a pill obtained by Fourier transform of the filtered spectrum.
  • the coating image is shown in FIG. 6, and there are no white lines and bright lines in the pill coating image.
  • the square filter window may be a third pre-sized filter window.
  • the third preset size may be 10 * 10 (ten rows and ten columns).
  • the terminal may use the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship to generate a filtered spectrum.
  • the preset relationship can be addition and subtraction.
  • generating the filtered spectrum by using the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship includes: subtracting the first spectrum and the second spectrum from the original spectrum to obtain an intermediate spectrum; The intermediate spectrum is added to the third spectrum to obtain a filtered spectrum.
  • the terminal subtracts the first spectrum from the original spectrum to eliminate white lines in the pill-coated image.
  • the terminal subtracts the spectrum after subtracting the first spectrum and then subtracts the second spectrum to obtain an intermediate spectrum, which can eliminate bright lines in the pill-coated image.
  • the terminal adds the middle spectrum to the third spectrum to remove the low-frequency noise portion of the spectrum after subtracting the first spectrum, and at the same time removes the white and bright lines in the pill-coated image to maintain the balance of the pill-coated image.
  • the effect of eliminating the noise introduced by the original spectrum is achieved, and the white and bright lines in the pill-coated image can be completely removed, further improving the quality of the pill-coated image.
  • the terminal may also generate an intermediate spectrum by using the original spectrum and a third spectrum, and subtract the first spectrum and the second spectrum by using the intermediate spectrum to obtain a filtered spectrum. That is, when the terminal filters the original spectrum, the processing order of the first spectrum, the second spectrum, and the third spectrum may not be limited. The order of the filtered spectrum obtained by the terminal according to the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship can be freely adjusted.
  • the terminal may adjust the average filtering order of the original spectrum by using the X-direction filtering window, the Y-direction filtering window, and the square filtering window.
  • the terminal uses the original spectrum, the first spectrum, and the preset relationship to eliminate white lines in the pill-coated image.
  • the terminal uses the original spectrum, the second spectrum, and a preset relationship to eliminate bright lines in the pill-coated image.
  • the terminal uses the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship to achieve simultaneous elimination of white lines and bright lines in the pill-coated image and maintain the balance of the pill-coated image.
  • the impulse noise point set includes impulse noise
  • the stationary pixel point set includes stationary noise.
  • Denoising the impulse noise point set and the stationary pixel point set includes the following steps: removing the impulse noise by a median filtering process; Curved wave transform is performed on the pill-coated image after the pulse noise is removed; stationary noise is removed by the curve wave transform.
  • the median filtering process is to sort the pixel values in the filtering window, and use the median to replace the value of the central pixel. It is to process all the pixels in the pill-coated image without difference, and change the details. .
  • the terminal only processes the impulse noise concentrated in the impulse noise points, and does not change the values of other pixels.
  • the filtered pill coating image has higher fidelity, and can retain the basis of pill coating information. This method effectively removes impulse noise in the pill-coated image.
  • Curvelet transform uses wavelet transform to decompose the image into a series of subband image signals with different scales, and then uses local ridge wave transform to analyze each subband image signal.
  • Curve wave transform is essentially a multi-scale ridge wave transform. This transform has strong directional selectivity for signals with singularities in the curve.
  • the terminal performs curve wave transformation on the pill-coated image after removing the impulse noise to directly obtain a description of high-dimensional features such as straight lines and planes.
  • the terminal After the terminal performs curve wave transformation on the pill-coated image after removing the pulse noise, the terminal can remove the stationary noise by curve wave transformation.
  • the edge information of the pill coating image can be well preserved to avoid the lack of edge information leading to the modification of the complete pill coating image.
  • the terminal image of the pill coating obtained by removing the stationary noise through curve wave transformation is shown in Figure 7. The quality of the coated image is obviously better than that of the pill coated image before denoising.
  • the terminal removes impulse noise through a median filtering process, performs curve wave transformation on the pill-coated image after removing the pulse noise, and removes smooth noise by curve wave transformation.
  • the noise in the pill-coated image is completely removed, the edge information is completely retained, and the complete pill-coated image is avoided from being modified, thereby further improving the quality of the pill-coated image.
  • the method further includes: performing edge detection on the denoised pill-coated image; and performing edge detection.
  • the subsequent pill coating image is binarized to obtain a pill coating image after removing the background.
  • the terminal obtains the denoised pill coating image, and the pill coating image well retains the edge information of the pill coating image to avoid the lack of edge information leading to the modification of the complete pill coating image.
  • the quality of the pill-coated image is further improved, and the terminal performs edge detection on the denoised pill-coated image to achieve better detection of the edge position of the pill-coated image.
  • the terminal performs a binarization process on the pill-coated image after edge detection, and can more accurately calculate the thickness of the pill-coated image. After the binarization process, the pill-coated image can be obtained after removing the background.
  • steps in the flowchart of FIG. 3 are sequentially displayed in accordance with the instructions of the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless explicitly stated in this document, the execution of these steps is not strictly limited, and these steps can be performed in other orders. Moreover, at least a part of the steps in FIG. 3 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. The execution of these sub-steps or stages The sequence is not necessarily performed sequentially, but may be performed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
  • a pill-coated image processing device which includes: a spectrum receiving module 802, a filtering processing module 804, an image generating module 806, a pixel classification module 808, and a denoising processing module. 810 of which:
  • the spectrum receiving module 802 is configured to receive an original spectrum uploaded by a pill image detection device.
  • the filtering processing module 804 is configured to perform filtering processing on the original spectrum by using various filtering windows.
  • An image generation module 806 is configured to perform a Fourier transform on the filtered original spectrum to obtain a pill-coated image.
  • the pixel classification module 808 is configured to classify all pixels of the pill-coated image to obtain a set of impulsive noise points and a set of stationary pixels.
  • the denoising processing module 810 is configured to perform denoising processing on the impulse noise point set and the stationary pixel point set, to obtain a denoised pill-coated image.
  • the filtering processing module 804 is further configured to perform average filtering on the original spectrum according to the X-direction filtering window to obtain a first spectrum; perform average filtering on the original spectrum according to the Y-direction filtering window to obtain a second spectrum; use a square
  • the filtering window performs average filtering on the original spectrum to obtain a third spectrum; and uses the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship to generate a filtered spectrum.
  • the filtering processing module 804 is further configured to subtract the first spectrum and the second spectrum from the original spectrum to obtain an intermediate spectrum; and use the intermediate spectrum to add a third spectrum to obtain a filtered spectrum.
  • the denoising processing module 810 is further configured to remove the impulse noise by a median filtering process; perform a curvelet transform on the pill-coated image after removing the impulse noise; and remove stationary noise by the curvelet transform.
  • a binarization processing module is further included, which is used to perform edge detection on the image of the pill-coated image after denoising; and binarize the image of the pill-coated image after the edge detection to obtain the pill package after removing the background. Clothing image.
  • Each module in the above-mentioned pill-coated image processing device may be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the hardware form or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor calls and performs the operations corresponding to the above modules.
  • a computer device is provided.
  • the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 9.
  • the computer equipment includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for running an operating system and computer programs in a non-volatile storage medium.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program is executed by a processor to implement a pill-coated image processing method.
  • the display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen
  • the input device of the computer device may be a touch layer covered on the display screen, or a button, a trackball or a touchpad provided on the computer device casing , Or an external keyboard, trackpad, or mouse.
  • FIG. 9 is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer equipment to which the scheme of the present application is applied.
  • the specific computer equipment may be Include more or fewer parts than shown in the figure, or combine certain parts, or have a different arrangement of parts.
  • a computer-readable storage medium on which a computer program is stored.
  • the computer program is executed by a processor, the steps in the foregoing method embodiments are implemented.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM dual data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain Synchlink DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

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

Abstract

A pill coating image processing method and apparatus, and a computer device and a storage medium. By means of receiving an original spectrum uploaded by a pill image detection device (302), using multiple types of filtering windows to carry out filtering processing on the original spectrum (304), carrying out Fourier transform on the filtered spectrum to obtain a pill coating image (306), classifying all pixel points of the pill coating image to obtain an impulse noise point set and a stable pixel point set (308), and carrying out de-noising processing on the impulse noise point set and the stable pixel point set to obtain a de-noised pill coating image (310), multiple types of noise introduced by the original spectrum can be eliminated. By means of carrying out de-noising processing on an impulse noise point set and a stable pixel point set, noise of a pill coating image can be eliminated, thus improving the quality of the pill coating image.

Description

药丸包衣图像处理方法、装置、计算机设备和存储介质Image processing method and device for pill coating, computer equipment and storage medium 技术领域Technical field
本申请涉及图像处理技术领域,特别是涉及一种药丸包衣图像处理方法、装置、计算机设备和存储介质。The present application relates to the field of image processing technology, and in particular, to a method, a device, a computer device, and a storage medium for image processing of a pill coating.
背景技术Background technique
随着图像处理技术的发展,出现了光谱光学相干层析成像技术,该成像技术利用相机采集原始光谱,原始光谱经过傅里叶变换后就能得到待测物体深度图像,使该成像技术具有采集速度快,信噪比高、分辨率高、无创测量、成本低廉等优势。但是在利用光谱光学相干层析成像技术得到药丸包衣图像的过程中,由于原始光谱引入的多种噪声的影响导致药丸包衣图像的质量出现问题。传统的药丸包衣图像的处理方法,为消除原始光谱引入的多种噪声的影响,通过在原始光谱上减去参考光光谱,或者减去原始光谱的平均值,并不能完全消除原始光谱引入的噪声。因此,消除原始光谱引入的多种噪声的影响,提高药丸包衣图像质量成为目前需要解决的技术问题。With the development of image processing technology, spectral optical coherence tomography has emerged. This imaging technology uses a camera to collect the original spectrum. After the original spectrum is Fourier transformed, a depth image of the object to be measured can be obtained. Fast speed, high signal-to-noise ratio, high resolution, non-invasive measurement, low cost and other advantages. However, in the process of obtaining a pill-coated image by using spectral optical coherence tomography, the quality of the pill-coated image has problems due to the influence of various noises introduced by the original spectrum. Traditional pill-coated image processing methods, in order to eliminate the effects of various noises introduced by the original spectrum, can not completely eliminate the introduction of the original spectrum by subtracting the reference light spectrum or the average value of the original spectrum from the original spectrum. noise. Therefore, eliminating the effects of various noises introduced by the original spectrum and improving the image quality of the pill coating have become technical issues that need to be solved at present.
发明内容Summary of the Invention
基于此,有必要针对上述技术问题,提供一种能够消除原始光谱引入的多种噪声,从而提高药丸包衣图像质量的药丸包衣图像处理方法、装置、计算机设备和存储介质。Based on this, it is necessary to provide a pill coating image processing method, device, computer equipment, and storage medium capable of eliminating various noises introduced by the original spectrum and thereby improving the quality of the pill coating image.
一种药丸包衣图像处理方法,所述方法包括:An image processing method for pill coating, the method includes:
接收药丸图像检测设备上传的原始光谱;Receive the raw spectrum uploaded by the pill image detection equipment;
利用多种滤波窗口对所述原始光谱进行滤波处理;Performing filtering processing on the original spectrum using multiple filtering windows;
对滤波后的光谱进行傅里叶变换得到药丸包衣图像;Fourier transform the filtered spectrum to obtain a pill-coated image;
对所述药丸包衣图像的所有像素点进行分类,得到脉冲噪声点集以及平稳像素点集;Classifying all pixels of the pill-coated image to obtain a set of impulsive noise points and a set of stationary pixels;
对所述脉冲噪声点集以及平稳像素点集进行去噪处理,得到去噪后药丸包衣图像。Denoising the impulse noise point set and stationary pixel point set to obtain a pill-coated image after denoising.
在其中一个实施例中,所述利用多种滤波窗口对所述原始光谱进行滤波处理,包括:In one embodiment, the performing filtering processing on the original spectrum using multiple filtering windows includes:
根据X方向滤波窗口对所述原始光谱进行均值滤波,得到第一光谱;Performing average filtering on the original spectrum according to the X-direction filtering window to obtain a first spectrum;
根据Y方向滤波窗口对所述原始光谱进行均值滤波,得到第二光谱;Performing average filtering on the original spectrum according to the Y-direction filtering window to obtain a second spectrum;
利用方形滤波窗口对所述原始光谱进行均值滤波,得到第三光谱;Average filtering the original spectrum using a square filter window to obtain a third spectrum;
利用所述原始光谱、所述第一光谱、所述第二光谱、所述第三光谱以及预设关系,生成过滤后的光谱。Use the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship to generate a filtered spectrum.
在其中一个实施例中,所述利用所述原始光谱、所述第一光谱、所述第二光谱、所述第三光谱以及预设关系,生成过滤后的光谱包括:In one embodiment, generating the filtered spectrum by using the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship includes:
利用所述原始光谱减去所述第一光谱以及所述第二光谱,得到中间光谱;Subtracting the first spectrum and the second spectrum from the original spectrum to obtain an intermediate spectrum;
利用所述中间光谱加上所述第三光谱,得到过滤后的光谱。Use the intermediate spectrum and the third spectrum to obtain a filtered spectrum.
在其中一个实施例中,所述脉冲噪声点集包括脉冲噪声,所述平稳像素点集包括平稳噪声;所述对所述脉冲噪声点集以及平稳像素点集进行去噪处理包括:In one embodiment, the impulsive noise point set includes impulsive noise, the stationary pixel point set includes stationary noise, and the denoising processing on the impulsive noise point set and the stationary pixel point set includes:
通过中值滤波处理去除所述脉冲噪声;Removing the impulse noise by a median filtering process;
对去除所述脉冲噪声后的药丸包衣图像进行曲波变换;Performing a curvelet transform on the pill-coated image after removing the impulse noise;
通过所述曲波变换去除所述平稳噪声。The stationary noise is removed by the curvelet transform.
在其中一个实施例中,在所述对所述脉冲噪声点集以及平稳像素点集进行去噪处理,得到去噪后药丸包衣图像之后,所述方法还包括:In one embodiment, after performing the denoising processing on the impulsive noise point set and the stationary pixel point set to obtain a denoised pill-coated image, the method further includes:
对所述去噪后药丸包衣图像进行边缘检测;Performing edge detection on the de-noised pill-coated image;
对边缘检测后的药丸包衣图像进行二值化处理,得到去除背景后的药丸包衣图像。Binarize the image of the pill coating after edge detection to obtain the image of the pill coating after removing the background.
一种药丸包衣图像处理装置,所述装置包括:A pill-coated image processing device, the device includes:
光谱接收模块,用于接收药丸图像检测设备上传的原始光谱;A spectrum receiving module for receiving the original spectrum uploaded by the pill image detection device;
滤波处理模块,用于利用多种滤波窗口对所述原始光谱进行滤波处理;A filtering processing module, configured to perform filtering processing on the original spectrum by using various filtering windows;
图像生成模块,用于对滤波后的原始光谱进行傅里叶变换得到药丸包衣图像;An image generating module for performing a Fourier transform on the filtered original spectrum to obtain a pill-coated image;
像素点分类模块,用于对所述药丸包衣图像的所有像素点进行分类,得到脉冲噪声点集以及平稳像素点集;A pixel classification module, configured to classify all pixels of the pill-coated image to obtain a set of impulsive noise points and a set of stationary pixels;
去噪处理模块,用于对所述脉冲噪声点集以及平稳像素点集进行去噪处理,得到去噪后药丸包衣图像。A denoising processing module is configured to perform denoising processing on the impulse noise point set and the stationary pixel point set to obtain a decoated pill-coated image.
在其中一个实施例中,所述滤波处理模块,还用于根据X方向滤波窗口对所述原始光谱进行均值滤波,得到第一光谱;根据Y方向滤波窗口对所述原始光谱进行均值滤波,得到第二光谱;利用方形滤波窗口对所述原始光谱进行均值滤波,得到第三光谱;利用所述原始光谱、所述第一光谱、所述第二光谱、所述第三光谱以及预设关系,生成过滤后的光谱。In one embodiment, the filtering processing module is further configured to perform average filtering on the original spectrum according to the X-direction filtering window to obtain a first spectrum; perform average filtering on the original spectrum according to the Y-direction filtering window to obtain A second spectrum; performing a mean filtering on the original spectrum using a square filter window to obtain a third spectrum; using the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship, Generate a filtered spectrum.
在其中一个实施例中,所述去噪处理模块,还用于通过中值滤波处理去除所述脉冲噪声点集中的脉冲噪声;对去除所述脉冲噪声点集中的脉冲噪声后的药丸包衣图像进行曲波变换;通过所述曲波变换去除所述平稳像素点集中的平 稳噪声。In one of the embodiments, the denoising processing module is further configured to remove the impulse noise concentrated in the impulse noise points through a median filtering process; the pill-coated image after removing the impulse noise concentrated in the impulse noise points Performing a curvelet transform; and removing the stationary noise concentrated in the stationary pixels by the curvelet transform.
一种计算机设备,包括存储器和处理器,所述存储器存储有可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述各个方法实施例中的步骤。A computer device includes a memory and a processor. The memory stores a computer program that can run on the processor, and the processor implements the steps in the foregoing method embodiments when the computer program is executed.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述各个方法实施例中的步骤。A computer-readable storage medium stores a computer program thereon. When the computer program is executed by a processor, the steps in the foregoing method embodiments are implemented.
上述药丸包衣图像处理方法、装置、计算机设备和存储介质,利用多种滤波窗口对原始光谱进行滤波处理,由此能够消除原始光谱引入的多种噪声。利用滤波后的光谱进行傅里叶变换得到药丸包衣图像,通过对药丸包衣图像的所有像素点进行分类,得到脉冲噪声点集以及平稳像素点集。对脉冲噪声点集以及平稳像素点集进行去噪处理,由此可以消除药丸包衣图像的噪声,从而提高了药丸包衣图像的质量。The above-mentioned pill-coating image processing method, device, computer equipment, and storage medium utilize various filtering windows to filter the original spectrum, thereby eliminating various noises introduced by the original spectrum. The filtered spectrum is used to perform Fourier transform to obtain the pill-coated image. By classifying all the pixels of the pill-coated image, the impulse noise point set and the stationary pixel point set are obtained. Denoising the impulse noise point set and the stationary pixel point set, thereby eliminating the noise of the pill-coated image, thereby improving the quality of the pill-coated image.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为一个实施例中药丸包衣图像处理方法的应用环境图;FIG. 1 is an application environment diagram of a pill coating image processing method in an embodiment; FIG.
图2为一个实施例原始光谱的示意图;2 is a schematic diagram of an original spectrum of an embodiment;
图3为一个实施例中药丸包衣图像处理方法的流程示意图;FIG. 3 is a schematic flowchart of a pill coating image processing method in an embodiment; FIG.
图4为一个实施例中对第一光谱进行傅里叶变换得到的药丸包衣图像示意图;4 is a schematic diagram of a pill coating image obtained by performing a Fourier transform on a first spectrum in an embodiment;
图5为一个实施例中对第二光谱的进行傅里叶变换得到的药丸包衣图像示意图;5 is a schematic diagram of a pill coating image obtained by performing a Fourier transform on a second spectrum in an embodiment;
图6为一个实施例中对过滤后的光谱进行傅里叶变换得到的药丸包衣图像示意图;6 is a schematic diagram of a pill coating image obtained by performing a Fourier transform on the filtered spectrum in an embodiment;
图7为一个实施例中通过曲波变换去除平稳噪声后得到的药丸包衣图像示意图;7 is a schematic diagram of a pill coating image obtained after smooth noise is removed by curve wave transformation in an embodiment;
图8为一个实施例中药丸包衣图像处理装置的结构框图;8 is a structural block diagram of a pill-coated image processing device in an embodiment;
图9为一个实施例中计算机设备的内部结构图。FIG. 9 is an internal structural diagram of a computer device in one embodiment.
具体实施方式detailed description
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution, and advantages of the present application clearer, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the application, and are not used to limit the application.
本申请提供的药丸包衣图像处理方法,可以应用于如图1所示的应用环境中。终端104接收药丸检测设备102发送的原始光谱,原始光谱如图2所示。终端104利用多种滤波窗对原始光谱进行滤波处理。终端104对滤波后的光谱进行傅里叶变换得到药丸包衣图像。终端104对药丸包衣图像的所有像素点进行分类,得到脉冲噪声点集以及平稳像素点集。终端104对脉冲噪声点集以及平稳像素点集进行去噪处理,得到去噪后药丸包衣图像。其中,终端104可以是各种计算机、笔记本电脑、平板电脑。The pill-coating image processing method provided in the present application can be applied to an application environment as shown in FIG. 1. The terminal 104 receives the original spectrum sent by the pill detection device 102, and the original spectrum is shown in FIG. The terminal 104 performs filtering processing on the original spectrum by using various filtering windows. The terminal 104 performs a Fourier transform on the filtered spectrum to obtain a pill-coated image. The terminal 104 classifies all the pixels of the pill-coated image to obtain a set of impulsive noise points and a set of stationary pixels. The terminal 104 performs denoising processing on the impulse noise point set and the stationary pixel point set to obtain a pill-coated image after denoising. The terminal 104 may be various computers, notebook computers, and tablet computers.
在一个实施例中,如图3所示,提供了一种药丸包衣图像处理方法,以该方法应用于图1中的终端为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 3, a method for processing a pill-coated image is provided. The method is applied to the terminal in FIG. 1 as an example for description, and includes the following steps:
步骤302,接收药丸检测设备上传的原始光谱。Step 302: Receive the original spectrum uploaded by the pill detection device.
步骤304,利用多种滤波窗口对原始光谱进行滤波处理。Step 304: Perform filtering processing on the original spectrum by using various filtering windows.
终端在接收药丸检测设备上传的原始光谱后,可利用多种滤波窗口对原始光谱进行滤波处理,多种滤波窗口包括不同尺寸的滤波窗口以及不同形状的滤波窗口,不同尺寸的滤波窗口包括X方向滤波窗口以及Y方向滤波窗口,不同 形状的滤波窗口包括方形滤波窗口。滤波处理的方式包括均值滤波。After receiving the original spectrum uploaded by the pill detection device, the terminal can use various filtering windows to filter the original spectrum. The multiple filtering windows include filtering windows of different sizes and filtering windows of different shapes. The filtering windows of different sizes include the X direction. Filter window and Y-direction filter window. Filter windows of different shapes include square filter windows. The filtering process includes mean filtering.
在传统的药丸包衣图像处理方式中,通过在原始光谱上减去参考光光谱,或者在原始光谱上减去所有原始光谱的平均值,并不能完全消除原始光谱引入的多种噪声。而在本实施例中,终端利用多种滤波窗对原始光谱进行滤波处理,能够消除原始光谱引入的噪声的影响,提高了消除原始光谱噪声的能力,从而有助于提高药丸包衣图像的质量。In the traditional image processing method of pill coating, by subtracting the reference light spectrum from the original spectrum, or subtracting the average of all the original spectra from the original spectrum, the various noises introduced by the original spectrum cannot be completely eliminated. In this embodiment, the terminal uses multiple filtering windows to filter the original spectrum, which can eliminate the influence of noise introduced by the original spectrum, improve the ability to eliminate the original spectral noise, and thus help improve the quality of the pill-coated image. .
步骤306,对滤波后的光谱进行傅里叶变换得到药丸包衣图像。Step 306: Fourier transform the filtered spectrum to obtain a pill-coated image.
终端在利用多种滤波窗口对原始光谱进行滤波处理后,可对滤波后的光谱进行傅里叶变换得到药丸包衣图像。具体地,终端利用多种滤波窗口中的X方向滤波窗口、Y方向滤波窗口以及方形滤波窗口对原始光谱进行滤波处理,得到滤波后的光谱,对该光谱进行傅里叶变换,得到药丸包衣图像。After the terminal performs filtering processing on the original spectrum by using various filtering windows, a Fourier transform can be performed on the filtered spectrum to obtain a pill-coated image. Specifically, the terminal uses the X-direction filter window, the Y-direction filter window, and the square filter window of the various filter windows to filter the original spectrum to obtain a filtered spectrum, and performs Fourier transform on the spectrum to obtain a pill coating. image.
步骤308,对药丸包衣图像的所有像素点进行分类,得到脉冲噪声点集以及平稳像素点集。Step 308: Classify all the pixels of the pill-coated image to obtain a set of impulsive noise points and a set of stationary pixels.
终端在对滤波后的光谱进行傅里叶变换得到药丸包衣图像后,可对药丸包衣图像的所有像素点进行分类,得到脉冲噪声点集以及平稳像素点集。具体地,终端根据药丸包衣图像中的中心像素值与邻域内像素值的大小关系,将药丸包衣图像的所有像素点分为脉冲噪声点集以及平稳像素点集。终端将中心像素点的像素值与周围邻域的像素值做差,得到多个差值。终端根据多个差值对药丸包衣图像的所有像素点进行分类,得到脉冲噪声点集以及平稳像素点集。终端将大于正向预设值,以及小于负向预设值的差值对应的像素点划分为脉冲噪声点集,将小于正方向预设值,以及大于负向预设值的差值对应的像素点划分为平稳像素点集。After the terminal performs a Fourier transform on the filtered spectrum to obtain a pill-coated image, the terminal can classify all pixels of the pill-coated image to obtain a set of impulsive noise points and a set of stationary pixels. Specifically, the terminal divides all the pixels of the pill-coated image into a set of impulsive noise points and a set of stationary pixels according to the relationship between the central pixel value in the pill-coated image and the pixel values in the neighborhood. The terminal makes a difference between the pixel value of the central pixel point and the pixel values of the surrounding neighborhood to obtain multiple difference values. The terminal classifies all pixels of the pill-coated image according to multiple differences, and obtains a set of impulsive noise points and a set of stationary pixels. The terminal divides the pixel points corresponding to the difference greater than the positive preset value and the value smaller than the negative preset value into a set of impulsive noise points, and the pixel points corresponding to the difference smaller than the positive direction preset value and the difference greater than the negative preset value correspond to The pixels are divided into a set of stationary pixels.
进一步地,终端将中心像素点的像素值与周围邻域的像素值做差,当差值 大于或等于零时,为该中心像素点的正方向数;当差值小于零时,为该中心像素点的负方向数。当正方向数大于正方向预设值时,表示该中心像素点的值大于绝大多数邻域像素值,终端将大于正方向预设值的正方向数对应的像素点划分为脉冲噪声点集。当负方向数小于负方向预设值时,表示该中心像素点的值小于绝大多数邻域像素值,终端将小于负方向预设值的正方向数对应的像素点划分为脉冲噪声点集。在这两种情况下,终端将该中心像素点划分为脉冲噪声点集。终端将小于正方向预设值的正方向数对应的像素点、大于负方向预设值的负方向数对应的像素点,以及该中心像素点划分为平稳型像素点集。Further, the terminal makes a difference between the pixel value of the central pixel point and the pixel values of the surrounding neighborhood, and when the difference value is greater than or equal to zero, it is the positive direction number of the central pixel point; when the difference value is less than zero, the central pixel point is The number of points in the negative direction. When the number of positive directions is greater than the preset value of the positive direction, it means that the value of the central pixel point is greater than that of most neighboring pixels. The terminal divides the pixels corresponding to the number of positive directions greater than the preset value of the positive direction into a set of impulsive noise points. . When the number of negative directions is less than the preset value of the negative direction, it means that the value of the central pixel point is smaller than most neighboring pixel values. The terminal divides the pixels corresponding to the number of positive directions that are less than the preset value of the negative direction into a set of impulsive noise points. . In both cases, the terminal divides the central pixel point into a set of impulsive noise points. The terminal divides the pixels corresponding to the number of positive directions smaller than the preset value in the positive direction, the pixels corresponding to the number of negative directions greater than the preset value in the negative direction, and the central pixel point into a stationary pixel point set.
步骤310,对脉冲噪声点集以及平稳像素点集进行去噪处理,得到去噪后药丸包衣图像。Step 310: Denoise the impulse noise point set and the stationary pixel point set to obtain a pill-coated image after denoising.
终端对药丸包衣图像的所有像素点进行分类,得到脉冲噪声点集以及平稳像素点集后,可对脉冲噪声点集以及平稳像素点集进行去噪处理,得到去噪后药丸包衣图像。具体地,终端对脉冲噪声点集进行去噪处理,终端去除脉冲噪声点集中的脉冲噪声。终端对平稳像素点集进行去噪处理,平稳像素点集包括正常像素点和平稳噪声,终端去除平稳像素点集中的平稳噪声,得到去噪后的药丸包衣图像。After the terminal classifies all the pixels of the pill-coated image, and obtains the impulse noise point set and the stationary pixel point set, it can perform denoising processing on the impulse noise point set and the stationary pixel point set to obtain the denoised pill-coated image. Specifically, the terminal performs denoising processing on the set of impulse noise points, and the terminal removes impulse noise from the set of impulse noise points. The terminal performs denoising processing on the stationary pixel set. The stationary pixel set includes normal pixels and stationary noise. The terminal removes the stationary noise concentrated in the stationary pixels to obtain a de-noised pill-coated image.
在本实施例中,通过利用多种滤波窗口对原始光谱进行滤波处理,由此能够消除原始光谱引入的多种噪声。利用滤波后的光谱进行傅里叶变换得到药丸包衣图像,通过对药丸包衣图像的所有像素点进行分类,得到脉冲噪声点集以及平稳像素点集。终端对脉冲噪声点集以及平稳像素点集进行去噪处理,由此可以消除药丸包衣图像的噪声,从而提高了药丸包衣图像的质量。In this embodiment, a variety of filtering windows are used to perform filtering processing on the original spectrum, so that various noises introduced by the original spectrum can be eliminated. The filtered spectrum is used to perform Fourier transform to obtain the pill-coated image. By classifying all the pixels of the pill-coated image, the impulse noise point set and the stationary pixel point set are obtained. The terminal performs denoising processing on the impulse noise point set and the stationary pixel point set, thereby eliminating the noise of the pill-coated image, thereby improving the quality of the pill-coated image.
在一个实施例中,利用多种滤波窗口对原始光谱进行滤波处理,包括:根据X方向滤波窗口对原始光谱进行均值滤波,得到第一光谱;根据Y方向滤波 窗口对原始光谱进行均值滤波,得到第二光谱;利用方形滤波窗口对原始光谱进行均值滤波,得到第三光谱;利用原始光谱、第一光谱、第二光谱、第三光谱以及预设关系,生成过滤后的光谱。终端根据X方向滤波窗口对原始光谱进行滤波,可以去除原始光谱中的高频相干信号,得到低频噪声成分,得到第一光谱,终端对第一光谱进行傅里叶变换得到的药丸包衣图像如图4所示,药丸包衣图像中不存在白线。白线是指药丸包衣图像在多个光程差处存在的横线。X方向滤波窗口是指药丸包衣图像宽度的X方向滤波窗口,其中,X方向滤波窗口可以是第一预设尺寸的滤波窗口。例如,第一预设尺寸可以是1*5(一行五列)或者1*10(一行十列)。In one embodiment, the original spectrum is filtered by using multiple filtering windows, including: performing an average filtering on the original spectrum according to the X-direction filtering window to obtain a first spectrum; and performing an average filtering on the original spectrum according to the Y-direction filtering window to obtain The second spectrum; average filtering the original spectrum using a square filter window to obtain a third spectrum; and generating the filtered spectrum using the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship. The terminal filters the original spectrum according to the X-direction filter window, which can remove the high-frequency coherent signals in the original spectrum, obtain the low-frequency noise component, and obtain the first spectrum. As shown in Figure 4, no white lines are present in the pill-coated image. White lines refer to the horizontal lines that exist in the pill-coated image at multiple optical path differences. The X-direction filtering window refers to the X-direction filtering window of the width of the pill-coated image, wherein the X-direction filtering window may be a filtering window of a first preset size. For example, the first preset size may be 1 * 5 (one row and five columns) or 1 * 10 (one row and ten columns).
在传统方式中,利用滤波窗口为药丸包衣图像宽度的X方向滤波窗口进行均值滤波,滤波后得到的低频噪声成分不准确,而在本实施例中,终端利用X方向滤波窗口对原始光谱进行均值滤波,滤波后得到的低频噪声成分更准确,即更接近真实噪声。In the traditional method, the filtering window is used to perform average filtering for the X-direction filtering window of the width of the pill-coated image, and the low-frequency noise component obtained after filtering is inaccurate. Mean filtering, the low-frequency noise component obtained after filtering is more accurate, that is, closer to the real noise.
终端在根据X方向滤波窗口对原始光谱进行均值滤波,得到第一光谱后,可根据Y方向滤波窗口对原始光谱进行均值滤波,得到第二光谱,终端对第二光谱进行傅里叶变换得到的药丸包衣图像如图5所示,药丸包衣图像中不存在亮线。亮线是指样品反射光过强导致原始光谱对应的噪声基底比其它谱线显著提高,在药丸包衣图像中形成的竖线。其中,Y方向滤波窗口可以是第二预设尺寸的滤波窗口。例如,第二预设尺寸可以是10*1(十行一列)。After the terminal performs average filtering on the original spectrum according to the X-direction filtering window to obtain a first spectrum, the terminal may perform average filtering on the original spectrum according to the Y-direction filtering window to obtain a second spectrum. The pill coating image is shown in FIG. 5, and there are no bright lines in the pill coating image. The bright line refers to the vertical line formed in the image of the pill coating, because the noise floor corresponding to the original spectrum is significantly higher than other spectral lines due to the reflected light of the sample being too strong. The Y-direction filter window may be a filter window of a second preset size. For example, the second preset size may be 10 * 1 (ten rows and one column).
在传统方式中,通过在原始光谱上减去参考光光谱,或者在原始光谱上减去参考光光谱,并不能消除药丸包衣图像中的亮线。在本实施例中,终端根据Y方向滤波窗口对原始光谱进行均值滤波,能够消除药丸包衣图像中的亮线。In the traditional way, by subtracting the reference light spectrum from the original spectrum, or subtracting the reference light spectrum from the original spectrum, the bright lines in the pill-coated image cannot be eliminated. In this embodiment, the terminal performs average filtering on the original spectrum according to the Y-direction filter window, which can eliminate bright lines in the pill-coated image.
终端在根据Y方向滤波窗口对原始光谱进行均值滤波,得到第二光谱后, 利用方形滤波窗口对原始光谱进行均值滤波,得到第三光谱,终端对过滤后的光谱进行傅里叶变换得到的药丸包衣图像如图6所示,药丸包衣图像中不存在白线与亮线。其中,方形滤波窗口可以是第三预尺寸的滤波窗口。例如,第三预设尺寸可以是10*10(十行十列)。The terminal performs mean filtering on the original spectrum according to the Y-direction filter window to obtain a second spectrum, and then uses a square filter window to perform mean filtering on the original spectrum to obtain a third spectrum. The terminal obtains a pill obtained by Fourier transform of the filtered spectrum. The coating image is shown in FIG. 6, and there are no white lines and bright lines in the pill coating image. The square filter window may be a third pre-sized filter window. For example, the third preset size may be 10 * 10 (ten rows and ten columns).
终端在利用方形滤波窗口对原始光谱进行均值滤波,得到第三光谱后,可利用原始光谱、第一光谱、第二光谱、第三光谱以及预设关系,生成过滤后的光谱。预设关系可以是加法和减法。After the terminal performs average filtering on the original spectrum using a square filter window to obtain a third spectrum, the terminal may use the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship to generate a filtered spectrum. The preset relationship can be addition and subtraction.
在一个实施例中,利用原始光谱、第一光谱、第二光谱、第三光谱以及预设关系,生成过滤后的光谱包括:利用原始光谱减去第一光谱以及第二光谱,得到中间光谱;利用中间光谱加上第三光谱,得到过滤后的光谱。In one embodiment, generating the filtered spectrum by using the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship includes: subtracting the first spectrum and the second spectrum from the original spectrum to obtain an intermediate spectrum; The intermediate spectrum is added to the third spectrum to obtain a filtered spectrum.
终端利用原始光谱减去第一光谱,可以消除药丸包衣图像中的白线。终端将减去第一光谱后的光谱再减去第二光谱,得到中间光谱,可以消除药丸包衣图像中的亮线。终端将中间光谱加上第三光谱,可以去除减去第一光谱后的光谱中的低频噪声部分,同时去除药丸包衣图像中的白线与亮线,保持药丸包衣图像的平衡。实现消除原始光谱引入的噪声的影响,能够完全去除药丸包衣图像中的白线与亮线,进一步提高了药丸包衣图像的质量。The terminal subtracts the first spectrum from the original spectrum to eliminate white lines in the pill-coated image. The terminal subtracts the spectrum after subtracting the first spectrum and then subtracts the second spectrum to obtain an intermediate spectrum, which can eliminate bright lines in the pill-coated image. The terminal adds the middle spectrum to the third spectrum to remove the low-frequency noise portion of the spectrum after subtracting the first spectrum, and at the same time removes the white and bright lines in the pill-coated image to maintain the balance of the pill-coated image. The effect of eliminating the noise introduced by the original spectrum is achieved, and the white and bright lines in the pill-coated image can be completely removed, further improving the quality of the pill-coated image.
进一步地,终端也可以利用原始光谱加上第三光谱生成中间光谱,利用中间光谱减去第一光谱以及第二光谱,得到过滤后的光谱。也就是说,终端在对原始光谱进行过滤时,第一光谱、第二光谱、第三光谱的处理顺序可以不做限定。终端根据原始光谱、第一光谱、第二光谱、第三光谱以及预设关系进行计算得到过滤后的光谱的顺序可以自由调节。Further, the terminal may also generate an intermediate spectrum by using the original spectrum and a third spectrum, and subtract the first spectrum and the second spectrum by using the intermediate spectrum to obtain a filtered spectrum. That is, when the terminal filters the original spectrum, the processing order of the first spectrum, the second spectrum, and the third spectrum may not be limited. The order of the filtered spectrum obtained by the terminal according to the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship can be freely adjusted.
在本实施例中,终端利用X方向滤波窗口、Y方向滤波窗口、方形滤波窗口对原始光谱进行均值滤波顺序可以调节。终端利用原始光谱、第一光谱以及预 设关系,实现消除药丸包衣图像中的白线。终端利用原始光谱、第二光谱以及预设关系,实现消除药丸包衣图像中的亮线。终端利用原始光谱、第一光谱、第二光谱、第三光谱以及预设关系,实现同时消除药丸包衣图像中的白线与亮线,保持药丸包衣图像的平衡。In this embodiment, the terminal may adjust the average filtering order of the original spectrum by using the X-direction filtering window, the Y-direction filtering window, and the square filtering window. The terminal uses the original spectrum, the first spectrum, and the preset relationship to eliminate white lines in the pill-coated image. The terminal uses the original spectrum, the second spectrum, and a preset relationship to eliminate bright lines in the pill-coated image. The terminal uses the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship to achieve simultaneous elimination of white lines and bright lines in the pill-coated image and maintain the balance of the pill-coated image.
在一个实施例中,脉冲噪声点集包括脉冲噪声,平稳像素点集包括平稳噪声;对脉冲噪声点集以及平稳像素点集进行去噪处理,包括以下步骤:通过中值滤波处理去除脉冲噪声;对去除脉冲噪声后的药丸包衣图像进行曲波变换;通过曲波变换去除平稳噪声。In one embodiment, the impulse noise point set includes impulse noise, and the stationary pixel point set includes stationary noise. Denoising the impulse noise point set and the stationary pixel point set includes the following steps: removing the impulse noise by a median filtering process; Curved wave transform is performed on the pill-coated image after the pulse noise is removed; stationary noise is removed by the curve wave transform.
在传统的方式中,中值滤波处理是将滤波窗口内的像素值进行排序,利用中值代替中心像素点的值,是对药丸包衣图像中所有像素点进行无差别处理,改变了细节信息。而在本实施例中,终端只针对脉冲噪声点集中的脉冲噪声进行处理,不会改变其他像素点的值,滤波后的药丸包衣图像保真性更高,能够在保留药丸包衣信息的基础上有效去除药丸包衣图像中的脉冲噪声。In the traditional method, the median filtering process is to sort the pixel values in the filtering window, and use the median to replace the value of the central pixel. It is to process all the pixels in the pill-coated image without difference, and change the details. . However, in this embodiment, the terminal only processes the impulse noise concentrated in the impulse noise points, and does not change the values of other pixels. The filtered pill coating image has higher fidelity, and can retain the basis of pill coating information. This method effectively removes impulse noise in the pill-coated image.
终端在通过中值滤波处理去除脉冲噪声后,可对去除脉冲噪声后的药丸包衣图像进行曲波变换。曲波变换利用小波变换将图像为分解成一系列具有不同尺度的子带图像信号,然后使用局部脊波变换对每个子带图像信号进行分析。曲波变换本质上是一种多尺度脊波变换,该变换对曲线奇异性的信号,具有很强的方向选择性。终端对去除脉冲噪声后的药丸包衣图像进行曲波变换可直接获得对直线、平面等高维特征变化的描述。实现去除药丸包衣图像中的平稳噪声,需要对药丸包衣图像进行曲波变换,得到曲波系数,再根据一定的阈值函数对曲波系数进行处理,最后利用处理后的曲波系数进行药丸包衣图像重构。After the terminal removes the impulse noise through the median filtering process, the terminal can perform curve wave transformation on the pill-coated image after the impulse noise is removed. Curvelet transform uses wavelet transform to decompose the image into a series of subband image signals with different scales, and then uses local ridge wave transform to analyze each subband image signal. Curve wave transform is essentially a multi-scale ridge wave transform. This transform has strong directional selectivity for signals with singularities in the curve. The terminal performs curve wave transformation on the pill-coated image after removing the impulse noise to directly obtain a description of high-dimensional features such as straight lines and planes. To realize the smooth noise removal of the pill-coated image, it is necessary to perform curve wave transformation on the pill-coated image to obtain the curve coefficient, and then process the curve coefficient according to a certain threshold function, and finally use the processed curve coefficient to perform the pill package. Clothing image reconstruction.
终端在对去除脉冲噪声后的药丸包衣图像进行曲波变换后,可通过曲波变换去除平稳噪声。可以很好地保留了药丸包衣图像边缘信息,避免边缘信息的 缺失导致完整的药丸包衣图像被修改,终端通过曲波变换去除平稳噪声后得到的药丸包衣图像如图7所示,药丸包衣图像的质量明显要比去噪之前的药丸包衣图像要好。After the terminal performs curve wave transformation on the pill-coated image after removing the pulse noise, the terminal can remove the stationary noise by curve wave transformation. The edge information of the pill coating image can be well preserved to avoid the lack of edge information leading to the modification of the complete pill coating image. The terminal image of the pill coating obtained by removing the stationary noise through curve wave transformation is shown in Figure 7. The quality of the coated image is obviously better than that of the pill coated image before denoising.
在本实施例中,终端通过中值滤波处理去除脉冲噪声,对去除脉冲噪声后的药丸包衣图像进行曲波变换,通过曲波变换去除平稳噪声。实现完全去除药丸包衣图像中的噪声,完整地保留了边缘信息,避免修改完整的药丸包衣图像,进一步提高了药丸包衣图像的质量。In this embodiment, the terminal removes impulse noise through a median filtering process, performs curve wave transformation on the pill-coated image after removing the pulse noise, and removes smooth noise by curve wave transformation. The noise in the pill-coated image is completely removed, the edge information is completely retained, and the complete pill-coated image is avoided from being modified, thereby further improving the quality of the pill-coated image.
在一个实施例中,在对脉冲噪声点集以及平稳像素点集进行去噪处理,得到去噪后药丸包衣图像之后,还包括:对去噪后药丸包衣图像进行边缘检测;对边缘检测后的药丸包衣图像进行二值化处理,得到去除背景后的药丸包衣图像。In one embodiment, after performing denoising processing on the impulse noise point set and stationary pixel point set to obtain the denoised pill-coated image, the method further includes: performing edge detection on the denoised pill-coated image; and performing edge detection. The subsequent pill coating image is binarized to obtain a pill coating image after removing the background.
在本实施例中,终端得到去噪后的药丸包衣图像,该药丸包衣图像很好地保留了药丸包衣图像的边缘信息,避免边缘信息的缺失导致完整的药丸包衣图像被修改,进一步提高了药丸包衣图像的质量,终端对去噪后的药丸包衣图像进行边缘检测,实现更好的检测药丸包衣图像的边缘位置。终端对边缘检测后的药丸包衣图像进行二值化处理,能够更准确地计算药丸包衣图像的厚度,经过二值化处理可以得到去除背景后的药丸包衣图像。In this embodiment, the terminal obtains the denoised pill coating image, and the pill coating image well retains the edge information of the pill coating image to avoid the lack of edge information leading to the modification of the complete pill coating image. The quality of the pill-coated image is further improved, and the terminal performs edge detection on the denoised pill-coated image to achieve better detection of the edge position of the pill-coated image. The terminal performs a binarization process on the pill-coated image after edge detection, and can more accurately calculate the thickness of the pill-coated image. After the binarization process, the pill-coated image can be obtained after removing the background.
应该理解的是,虽然图3的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图3中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或 者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flowchart of FIG. 3 are sequentially displayed in accordance with the instructions of the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless explicitly stated in this document, the execution of these steps is not strictly limited, and these steps can be performed in other orders. Moreover, at least a part of the steps in FIG. 3 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. The execution of these sub-steps or stages The sequence is not necessarily performed sequentially, but may be performed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
在一个实施例中,如图8所示,提供了一种药丸包衣图像处理装置,包括:光谱接收模块802、滤波处理模块804、图像生成模块806、像素点分类模块808及去噪处理模块810,其中:In one embodiment, as shown in FIG. 8, a pill-coated image processing device is provided, which includes: a spectrum receiving module 802, a filtering processing module 804, an image generating module 806, a pixel classification module 808, and a denoising processing module. 810 of which:
光谱接收模块802,用于接收药丸图像检测设备上传的原始光谱。The spectrum receiving module 802 is configured to receive an original spectrum uploaded by a pill image detection device.
滤波处理模块804,用于利用多种滤波窗口对原始光谱进行滤波处理。The filtering processing module 804 is configured to perform filtering processing on the original spectrum by using various filtering windows.
图像生成模块806,用于对滤波后的原始光谱进行傅里叶变换得到药丸包衣图像。An image generation module 806 is configured to perform a Fourier transform on the filtered original spectrum to obtain a pill-coated image.
像素点分类模块808,用于对药丸包衣图像的所有像素点进行分类,得到脉冲噪声点集以及平稳像素点集。The pixel classification module 808 is configured to classify all pixels of the pill-coated image to obtain a set of impulsive noise points and a set of stationary pixels.
去噪处理模块810,用于对脉冲噪声点集以及平稳像素点集进行去噪处理,得到去噪后药丸包衣图像。The denoising processing module 810 is configured to perform denoising processing on the impulse noise point set and the stationary pixel point set, to obtain a denoised pill-coated image.
在一个实施例中,滤波处理模块804,还用于根据X方向滤波窗口对原始光谱进行均值滤波,得到第一光谱;根据Y方向滤波窗口对原始光谱进行均值滤波,得到第二光谱;利用方形滤波窗口对原始光谱进行均值滤波,得到第三光谱;利用原始光谱、第一光谱、第二光谱、第三光谱以及预设关系,生成过滤后的光谱。In one embodiment, the filtering processing module 804 is further configured to perform average filtering on the original spectrum according to the X-direction filtering window to obtain a first spectrum; perform average filtering on the original spectrum according to the Y-direction filtering window to obtain a second spectrum; use a square The filtering window performs average filtering on the original spectrum to obtain a third spectrum; and uses the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship to generate a filtered spectrum.
在一个实施例中,滤波处理模块804,还用于利用原始光谱减去第一光谱以及第二光谱,得到中间光谱;利用中间光谱加上第三光谱,得到过滤后的光谱。In one embodiment, the filtering processing module 804 is further configured to subtract the first spectrum and the second spectrum from the original spectrum to obtain an intermediate spectrum; and use the intermediate spectrum to add a third spectrum to obtain a filtered spectrum.
在一个实施例中,去噪处理模块810,还用于通过中值滤波处理去除脉冲噪声;对去除脉冲噪声后的药丸包衣图像进行曲波变换;通过曲波变换去除平稳噪声。In one embodiment, the denoising processing module 810 is further configured to remove the impulse noise by a median filtering process; perform a curvelet transform on the pill-coated image after removing the impulse noise; and remove stationary noise by the curvelet transform.
在一个实施例中,还包括二值化处理模块,用于对去噪后药丸包衣图像进行边缘检测;对边缘检测后的药丸包衣图像进行二值化处理,得到去除背景后的药丸包衣图像。In one embodiment, a binarization processing module is further included, which is used to perform edge detection on the image of the pill-coated image after denoising; and binarize the image of the pill-coated image after the edge detection to obtain the pill package after removing the background. Clothing image.
关于药丸包衣图像处理装置的具体限定可以参见上文中对于药丸包衣图像处理方法的限定,在此不再赘述。上述药丸包衣图像处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Regarding the specific limitation of the pill-coating image processing device, reference may be made to the limitation on the pill-coating image processing method described above, and details are not described herein again. Each module in the above-mentioned pill-coated image processing device may be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules may be embedded in the hardware form or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor calls and performs the operations corresponding to the above modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图9所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种药丸包衣图像处理方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 9. The computer equipment includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running an operating system and computer programs in a non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program is executed by a processor to implement a pill-coated image processing method. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a button, a trackball or a touchpad provided on the computer device casing , Or an external keyboard, trackpad, or mouse.
本领域技术人员可以理解,图9中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 9 is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer equipment to which the scheme of the present application is applied. The specific computer equipment may be Include more or fewer parts than shown in the figure, or combine certain parts, or have a different arrangement of parts.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述各个方法实施例中的步骤。In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the foregoing method embodiments are implemented.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the methods of the foregoing embodiments can be implemented by using a computer program to instruct related hardware. The computer program can be stored in a non-volatile computer-readable storage In the medium, the computer program, when executed, may include the processes of the embodiments of the methods described above. Wherein, any reference to the memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be arbitrarily combined. In order to make the description concise, all possible combinations of the technical features in the above embodiments have not been described. However, as long as there is no contradiction in the combination of these technical features, they should be It is considered to be the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation manners of the present application, and their descriptions are more specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be noted that, for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of this application patent shall be subject to the appended claims.

Claims (10)

  1. 一种药丸包衣图像处理方法,所述方法包括:An image processing method for pill coating, the method includes:
    接收药丸图像检测设备上传的原始光谱;Receive the raw spectrum uploaded by the pill image detection equipment;
    利用多种滤波窗口对所述原始光谱进行滤波处理;Performing filtering processing on the original spectrum using multiple filtering windows;
    对滤波后的光谱进行傅里叶变换得到药丸包衣图像;Fourier transform the filtered spectrum to obtain a pill-coated image;
    对所述药丸包衣图像的所有像素点进行分类,得到脉冲噪声点集以及平稳像素点集;Classifying all pixels of the pill-coated image to obtain a set of impulsive noise points and a set of stationary pixels;
    对所述脉冲噪声点集以及平稳像素点集进行去噪处理,得到去噪后药丸包衣图像。Denoising the impulse noise point set and stationary pixel point set to obtain a pill-coated image after denoising.
  2. 根据权利要求1所述的方法,其特征在于,所述利用多种滤波窗口对所述原始光谱进行滤波处理,包括:The method according to claim 1, wherein the filtering the original spectrum by using multiple filtering windows comprises:
    根据X方向滤波窗口对所述原始光谱进行均值滤波,得到第一光谱;Performing average filtering on the original spectrum according to the X-direction filtering window to obtain a first spectrum;
    根据Y方向滤波窗口对所述原始光谱进行均值滤波,得到第二光谱;Performing average filtering on the original spectrum according to the Y-direction filtering window to obtain a second spectrum;
    利用方形滤波窗口对所述原始光谱进行均值滤波,得到第三光谱;Average filtering the original spectrum using a square filter window to obtain a third spectrum;
    利用所述原始光谱、所述第一光谱、所述第二光谱、所述第三光谱以及预设关系,生成过滤后的光谱。Use the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship to generate a filtered spectrum.
  3. 根据权利要求2所述的方法,其特征在于,所述利用所述原始光谱、所述第一光谱、所述第二光谱、所述第三光谱以及预设关系,生成过滤后的光谱包括:The method according to claim 2, wherein generating the filtered spectrum using the original spectrum, the first spectrum, the second spectrum, the third spectrum, and a preset relationship comprises:
    利用所述原始光谱减去所述第一光谱以及所述第二光谱,得到中间光谱;Subtracting the first spectrum and the second spectrum from the original spectrum to obtain an intermediate spectrum;
    利用所述中间光谱加上所述第三光谱,得到过滤后的光谱。Use the intermediate spectrum and the third spectrum to obtain a filtered spectrum.
  4. 根据权利要求1所述的方法,其特征在于,所述脉冲噪声点集包括脉冲噪声,所述平稳像素点集包括平稳噪声;所述对所述脉冲噪声点集以及平稳像 素点集进行去噪处理包括:The method according to claim 1, wherein the impulse noise point set includes impulse noise, the stationary pixel point set includes stationary noise, and the denoising is performed on the impulse noise point set and the stationary pixel point set. Processing includes:
    通过中值滤波处理去除所述脉冲噪声;Removing the impulse noise by a median filtering process;
    对去除所述脉冲噪声后的药丸包衣图像进行曲波变换;Performing a curvelet transform on the pill-coated image after removing the impulse noise;
    通过所述曲波变换去除所述平稳噪声。The stationary noise is removed by the curvelet transform.
  5. 根据权利要求1所述的方法,其特征在于,在所述对所述脉冲噪声点集以及平稳像素点集进行去噪处理,得到去噪后药丸包衣图像之后,所述方法还包括:The method according to claim 1, wherein after performing the denoising processing on the impulsive noise point set and the stationary pixel point set to obtain a denoised pill-coated image, the method further comprises:
    对所述去噪后药丸包衣图像进行边缘检测;Performing edge detection on the de-noised pill-coated image;
    对边缘检测后的药丸包衣图像进行二值化处理,得到去除背景后的药丸包衣图像。Binarize the image of the pill coating after edge detection to obtain the image of the pill coating after removing the background.
  6. 一种药丸包衣图像处理装置,其特征在于,所述装置包括:A pill-coated image processing device, wherein the device includes:
    光谱接收模块,用于接收药丸图像检测设备上传的原始光谱;A spectrum receiving module for receiving the original spectrum uploaded by the pill image detection device;
    滤波处理模块,用于利用多种滤波窗口对所述原始光谱进行滤波处理;A filtering processing module, configured to perform filtering processing on the original spectrum by using various filtering windows;
    图像生成模块,用于对滤波后的原始光谱进行傅里叶变换得到药丸包衣图像;An image generating module for performing a Fourier transform on the filtered original spectrum to obtain a pill-coated image;
    像素点分类模块,用于对所述药丸包衣图像的所有像素点进行分类,得到脉冲噪声点集以及平稳像素点集;A pixel classification module, configured to classify all pixels of the pill-coated image to obtain a set of impulsive noise points and a set of stationary pixels;
    去噪处理模块,用于对所述脉冲噪声点集以及平稳像素点集进行去噪处理,得到去噪后药丸包衣图像。A denoising processing module is configured to perform denoising processing on the impulse noise point set and the stationary pixel point set to obtain a decoated pill-coated image.
  7. 根据权利要求6所述的装置,其特征在于,所述滤波处理模块,还用于根据X方向滤波窗口对所述原始光谱进行均值滤波,得到第一光谱;根据Y方向滤波窗口对所述原始光谱进行均值滤波,得到第二光谱;利用方形滤波窗口 对所述原始光谱进行均值滤波,得到第三光谱;利用所述原始光谱、所述第一光谱、所述第二光谱、所述第三光谱以及预设关系,生成过滤后的光谱。The apparatus according to claim 6, wherein the filtering processing module is further configured to perform average filtering on the original spectrum according to the X-direction filtering window to obtain a first spectrum; and perform filtering on the original spectrum according to the Y-direction filtering window. The spectrum is average-filtered to obtain a second spectrum; a square filter window is used to average-filter the original spectrum to obtain a third spectrum; the original spectrum, the first spectrum, the second spectrum, and the third spectrum are used; Spectra and preset relationships to generate filtered spectra.
  8. 根据权利要求6所述的装置,所述去噪处理模块,还用于通过中值滤波处理去除所述脉冲噪声点集中的脉冲噪声;对去除所述脉冲噪声点集中的脉冲噪声后的药丸包衣图像进行曲波变换;通过所述曲波变换去除所述平稳像素点集中的平稳噪声。The device according to claim 6, wherein the denoising processing module is further configured to remove the impulse noise concentrated in the impulse noise point by a median filtering process; The clothing image is subjected to a curvelet transform; the curvelet transform is used to remove stationary noise concentrated in the stationary pixels.
  9. 一种计算机设备,包括存储器和处理器,所述存储器存储有可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至5中任一项所述方法的步骤。A computer device includes a memory and a processor, and the memory stores a computer program executable on the processor, wherein the processor implements any one of claims 1 to 5 when executing the computer program. Steps of the method.
  10. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至5中任一项所述方法的步骤。A computer-readable storage medium having stored thereon a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 5.
PCT/CN2019/083136 2018-09-28 2019-04-18 Pill coating image processing method and apparatus, and computer device and storage medium WO2020062843A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811142881.5 2018-09-28
CN201811142881.5A CN109377457B (en) 2018-09-28 2018-09-28 Pill coating image processing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2020062843A1 true WO2020062843A1 (en) 2020-04-02

Family

ID=65402998

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/083136 WO2020062843A1 (en) 2018-09-28 2019-04-18 Pill coating image processing method and apparatus, and computer device and storage medium

Country Status (2)

Country Link
CN (1) CN109377457B (en)
WO (1) WO2020062843A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109377457B (en) * 2018-09-28 2020-10-30 河北华讯方舟太赫兹技术有限公司 Pill coating image processing method and device, computer equipment and storage medium
CN110827274B (en) * 2019-11-19 2022-06-24 深圳市太赫兹科技创新研究院有限公司 Pill coating thickness calculation method and device, terminal equipment and storage medium
CN111179261A (en) * 2019-12-31 2020-05-19 深圳市太赫兹科技创新研究院 Defect detection method, system, terminal device and storage medium
CN111250429B (en) * 2020-01-15 2023-08-25 深圳市太赫兹科技创新研究院有限公司 Method and device for detecting sealing defect
CN113610775B (en) * 2021-07-16 2023-08-08 广州大学 Pill detection method and device for pill plate and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101655977A (en) * 2009-09-17 2010-02-24 浙江大学 Method for eliminating image impulse noise based on differential image detection and filtration by multiple windows
CN103927715A (en) * 2014-03-14 2014-07-16 中瑞科技(常州)有限公司 Ultrasound image speckle noise suppression method
US20180012348A1 (en) * 2016-07-08 2018-01-11 Samsung Electronics Co., Ltd. Method of analyzing lattice strain of semiconductor device
CN108021874A (en) * 2017-11-23 2018-05-11 北京环境特性研究所 A kind of EO-1 hyperion Endmember extraction preprocess method combined based on sky-spectrum
CN109377457A (en) * 2018-09-28 2019-02-22 河北华讯方舟太赫兹技术有限公司 Pill is coated image processing method, device, computer equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102360500B (en) * 2011-07-08 2013-06-12 西安电子科技大学 Treelet curvelet domain denoising- based method for change detection of remote sensing image
US9639915B2 (en) * 2012-08-08 2017-05-02 Samsung Electronics Co., Ltd. Image processing method and apparatus
CN105528768A (en) * 2015-12-10 2016-04-27 国网四川省电力公司天府新区供电公司 Image denoising method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101655977A (en) * 2009-09-17 2010-02-24 浙江大学 Method for eliminating image impulse noise based on differential image detection and filtration by multiple windows
CN103927715A (en) * 2014-03-14 2014-07-16 中瑞科技(常州)有限公司 Ultrasound image speckle noise suppression method
US20180012348A1 (en) * 2016-07-08 2018-01-11 Samsung Electronics Co., Ltd. Method of analyzing lattice strain of semiconductor device
CN108021874A (en) * 2017-11-23 2018-05-11 北京环境特性研究所 A kind of EO-1 hyperion Endmember extraction preprocess method combined based on sky-spectrum
CN109377457A (en) * 2018-09-28 2019-02-22 河北华讯方舟太赫兹技术有限公司 Pill is coated image processing method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN109377457A (en) 2019-02-22
CN109377457B (en) 2020-10-30

Similar Documents

Publication Publication Date Title
WO2020062843A1 (en) Pill coating image processing method and apparatus, and computer device and storage medium
Zahran et al. Automatic weld defect identification from radiographic images
US10168526B2 (en) Cell contour formation apparatus and method of the same, and non-transitory computer readable storage medium storing a cell contour formation program
Ghosh et al. Fast scale-adaptive bilateral texture smoothing
WO2022237397A1 (en) Method and apparatus for evaluating image authenticity, computer device, and storage medium
Goez et al. Preprocessing of 2-dimensional gel electrophoresis images applied to proteomic analysis: a review
CN109801286B (en) Surface defect detection method for LCD light guide plate
CN114240797B (en) OCT image denoising method, device, equipment and medium
Ozcan et al. Automated detection of soma location and morphology in neuronal network cultures
Chen et al. A novel infrared small target detection method based on BEMD and local inverse entropy
WO2018103015A1 (en) Ring artifact correction method and apparatus
CN107103595A (en) Method, device, storage medium and the equipment of detection image change
CN107180418A (en) A kind of Enhancement Methods about Satellite Images and device converted based on Tetrolet
CN114926374B (en) Image processing method, device and equipment based on AI and readable storage medium
KR102195047B1 (en) Method and apparatus for enhancing quality of 3D image
Chen et al. Two-pass bilateral smooth filtering for remote sensing imagery
CN107451986B (en) Single infrared image enhancement method based on fusion technology
CN106651981B (en) Method and device for correcting ring artifact
Yang et al. CSDM: A cross-scale decomposition method for low-light image enhancement
CN113436218A (en) SAR image edge detection method based on Gaussian filtering and mean filtering
CN111311610A (en) Image segmentation method and terminal equipment
Prabha et al. Defect detection of industrial products using image segmentation and saliency
CN115760773A (en) Noise suppression method and system for hyperspectral medical image acquisition
Andrews et al. A Denoising Autoencoder for Improved Kikuchi Pattern Quality and Indexing in Electron Backscatter Diffraction
Ghazdali et al. A blind poisson–gaussian noise separation using learning copula densities

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: 19865586

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19865586

Country of ref document: EP

Kind code of ref document: A1