WO2017096946A1 - Method and device for locating high-frequency information of image - Google Patents

Method and device for locating high-frequency information of image Download PDF

Info

Publication number
WO2017096946A1
WO2017096946A1 PCT/CN2016/095998 CN2016095998W WO2017096946A1 WO 2017096946 A1 WO2017096946 A1 WO 2017096946A1 CN 2016095998 W CN2016095998 W CN 2016095998W WO 2017096946 A1 WO2017096946 A1 WO 2017096946A1
Authority
WO
WIPO (PCT)
Prior art keywords
sub
block
threshold
image
dark
Prior art date
Application number
PCT/CN2016/095998
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 WO2017096946A1 publication Critical patent/WO2017096946A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • 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
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection

Definitions

  • the present application belongs to the field of Internet video technologies, and in particular, to a method and an apparatus for positioning image high frequency information.
  • the human eye is more sensitive to low frequency information, in the case where the image quality is relatively high and stable, the high frequency information further determines the quality of the image. Especially in places where high-frequency information is dense, such as people's hair, beards, and clothes with dense patterns, etc., in these places to enhance the clarity, the human eye will feel the image quality has been significantly improved.
  • the present application provides a method and apparatus for positioning image high-frequency information, which can quickly locate a high-frequency information area in an image, so as to perform targeted image processing on the high-frequency information area and improve image quality.
  • the present application also provides a positioning electronic device for image high frequency information, a non-transitory computer storage medium, and a computer program product.
  • An embodiment of the present application provides a method for locating high frequency information of an image, including:
  • Whether the sub-block belongs to the image high-frequency information area is determined according to the number of bright pixel points or the number of dark pixel points in the sub-block.
  • the method before determining whether the dark area in each sub-block is more than the bright area, the method includes:
  • a grayscale threshold for each sub-block is preset, the grayscale threshold being a threshold for distinguishing the grayscale of the image of the sub-block.
  • the gray threshold of each sub-block is preset, including:
  • the average gray value is calculated as the grayscale threshold of the sub-block based on the gray value of each pixel in each sub-block.
  • determining whether the dark area in each sub-block is more than a bright area includes:
  • Determining if it is determined that the number of pixels in the sub-block whose gray value is greater than the gray threshold exceeds the number of pixels whose gray value is less than the gray threshold reaches a predetermined first number threshold, determining the sub-block There are more bright areas in the block than dark areas.
  • the determining whether the sub-block belongs to the image high-frequency information area according to the number of bright pixel points or the number of dark pixel points in the sub-block includes:
  • the sub-block is determined to be an image high-frequency information area.
  • the application also provides a positioning device for image high frequency information, comprising:
  • a segmentation module configured to divide the image to be processed into a plurality of N*N sub-blocks
  • a judging module configured to determine whether a dark area in each sub-block is more than a bright area
  • Obtaining a module if yes, using a hat algorithm to obtain a bright pixel in the sub-block; otherwise, using a black hat algorithm to obtain a dark pixel in the sub-block;
  • a determining module configured to determine, according to the number of bright pixel points or the number of dark pixel points in the sub-block, whether the sub-block belongs to an image high-frequency information area.
  • the device described therein further includes:
  • a setting module configured to preset a grayscale threshold of each sub-block, wherein the grayscale threshold is a threshold for distinguishing image grayscale of the sub-block.
  • the setting module is specifically configured to:
  • the average gray value is calculated as the grayscale threshold of the sub-block based on the gray value of each pixel in each sub-block.
  • the determining module is specifically configured to:
  • Determining if it is determined that the number of pixels in the sub-block whose gray value is greater than the gray threshold exceeds the number of pixels whose gray value is less than the gray threshold reaches a predetermined first number threshold, determining the sub-block There are more bright areas in the block than dark areas.
  • the determining module is specifically configured to:
  • the sub-block is determined to be an image high-frequency information area.
  • the present application also provides a non-transitory computer storage medium storing computer executable instructions for performing a method for locating high frequency information of any of the above images of the present application.
  • the application also provides a positioning electronic device for image high frequency information, comprising: at least one processor;
  • the memory stores instructions executable by the one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
  • Whether the sub-block belongs to the image high-frequency information area is determined according to the number of bright pixel points or the number of dark pixel points in the sub-block.
  • the embodiment of the present application further provides a computer program product, the computer program product comprising a computing program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer
  • the computer is caused to perform the method of locating the high frequency information of any of the above images of the present application.
  • the embodiment of the present application divides a to-be-processed image into a plurality of N*N sub-blocks; determines whether a dark area in each sub-block is more than a bright area; if yes, uses a hat-hat algorithm to obtain a bright pixel in the sub-block, otherwise The dark pixel points in the sub-block are obtained using a black hat algorithm.
  • the high-frequency information area in one image can be quickly located, so that the image processing of the high-frequency information area can be performed in a targeted manner to improve the image quality.
  • FIG. 1 is a schematic flowchart diagram of a method for positioning image high frequency information according to an embodiment of the present application
  • 3 is a brightness histogram of an embodiment of the present application.
  • Figure 4 is an original data of an image
  • FIG. 6 is data after gradation expansion based on the gradation corrosion data shown in FIG. 5;
  • Figure 7 is a bright pixel obtained by the hat hat algorithm
  • Figure 8 is an original data of an image
  • FIG. 10 is data after gradation corrosion based on the data after the gray scale expansion shown in FIG. 9;
  • Figure 11 is a dark pixel obtained by the black hat algorithm
  • Figure 12 is an image to be processed adopted in the embodiment of the present application.
  • FIG. 13 is a high frequency information area obtained by the image high frequency information positioning method according to the embodiment of the present application.
  • FIG. 14 is a structural diagram of a positioning apparatus for image high-frequency information according to an embodiment of the present application.
  • FIG. 15 is a structural diagram of a positioning electronic device for image high frequency information according to an embodiment of the present application.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
  • first device if a first device is coupled to a second device, the first device can be directly electrically coupled to the second device, or electrically coupled indirectly through other devices or coupling means. Connected to the second device.
  • the description of the specification is intended to be illustrative of the preferred embodiments of the invention. The scope of protection of the application is subject to the definition of the appended claims.
  • the present application first determines whether the dark area in each sub-block is more than a bright area, and according to different judgment results, one of the hat hat algorithm or the black hat algorithm may be used for each sub-block.
  • FIG. 1 is a schematic flowchart of a method for positioning image high-frequency information according to an embodiment of the present application. As shown in FIG. 1 , the method includes:
  • an image is usually divided into several sub-blocks, one sub-block consisting of one luma pixel block and two additional chroma pixel blocks.
  • the luma block is a 16x16 pixel block
  • the size of the two chroma image block is determined according to the sampling format of the image. For example, for the YUV420 sampled image, the chroma block is an 8x8 pixel block.
  • Each image processing algorithm is processed in sub-blocks, sub-blocks.
  • the image is divided into a plurality of N*N sub-blocks.
  • N can be taken as 16.
  • step 102 determining whether the dark area in each sub-block is more than a bright area; if yes, executing step 103, otherwise performing step 104;
  • the method before determining whether the dark area in each sub-block is more than the bright area, the method includes:
  • a grayscale threshold for each sub-block is preset, the grayscale threshold being a threshold for distinguishing the grayscale of the image of the sub-block.
  • the gray threshold of each sub-block is preset in the embodiment of the present application, including but not limited to the following methods:
  • the average gray value is calculated as the grayscale threshold of the sub-block based on the gray value of each pixel in each sub-block.
  • determining whether the dark area in each sub-block is more than a bright area includes:
  • Determining if it is determined that the number of pixels in the sub-block whose gray value is greater than the gray threshold exceeds the number of pixels whose gray value is less than the gray threshold reaches a predetermined first number threshold, determining the sub-block There are more bright areas in the block than dark areas.
  • Both the top hat algorithm and the black hat algorithm are based on an image grayscale algorithm - grayscale erosion and grayscale expansion.
  • the hat algorithm first performs grayscale erosion on the image, then performs grayscale expansion, and finally subtracts the expanded value from the original data.
  • the black hat algorithm first performs grayscale expansion on the image, performs grayscale erosion, and finally subtracts the original data. This application does not limit this.
  • the method further includes:
  • the sub-block is determined to be an image high-frequency information area if the number of bright pixel points in the sub-block is greater than a preset second threshold, determining that the sub-block is an image high-frequency information area; if the sub-block is dark pixels If the number of points is greater than the preset second threshold number, the sub-block is determined to be an image high-frequency information area.
  • the embodiment of the present application divides a to-be-processed image into a plurality of N*N sub-blocks; determines whether a dark area in each sub-block is more than a bright area; if yes, uses a hat-hat algorithm to obtain a bright pixel in the sub-block, otherwise The dark pixel points in the sub-block are obtained using a black hat algorithm.
  • the high-frequency information area in one image can be quickly located, so that the image processing of the high-frequency information area can be performed in a targeted manner to improve the image quality.
  • a luminance histogram of the grayscale image can be obtained by using a Photoshop program, as shown in the luminance histograms shown in FIG. 2 and FIG. 3, for a region where the grayscale changes frequently, the general grayscale A mutation will occur and will soon change back.
  • the maximum inter-class variance method (OTSU) or the mean division method is used to preset the gray threshold corresponding to each sub-block.
  • the OTSU maximum inter-class variance method can select a threshold in the sub-block that best distinguishes the gray level of the image.
  • the specific algorithm is not discussed, the main principle is to choose Taking a pixel to maximize the variance of the left (dark) portion and the right (light) portion, the gray value corresponding to the selected pixel is the gray threshold of the sub-block.
  • the mean division method is relatively simple, and it is only necessary to use the average value of the gradation of each pixel in the sub-block as the gradation threshold.
  • the OTSU maximum inter-class variance method is more accurate, and the average segmentation method is faster.
  • the top hat algorithm mainly extracts pixels that are bright in the darker areas. Instead, the black hat algorithm extracts dark pixels in brighter areas. Therefore, in areas where a hat hat algorithm is required, the darker grayscale should occupy the majority, and in the region where the black hat algorithm is required, the bright grayscale should be the majority.
  • the grayscale threshold corresponding to each sub-block is preset, if the number of pixels in the sub-block that is smaller than the gray threshold exceeds the threshold of the gray threshold, the number of pixels reaches a predetermined first threshold. If there are many dark areas, the hat algorithm is used; if the number of pixels in the sub-block larger than the gray threshold exceeds the threshold of the gray threshold, the number of pixels reaches a predetermined first threshold, indicating a bright region. More, use the black hat algorithm.
  • the hat algorithm and the black hat algorithm are combined based on the basic image grayscale algorithm - grayscale erosion and grayscale expansion.
  • the hat algorithm first performs grayscale erosion on the image, then performs grayscale expansion, and finally subtracts the expanded value from the original data.
  • the black hat algorithm first performs grayscale expansion on the image, performs grayscale erosion, and finally subtracts the original data.
  • FIG. 4 is the original data of an image
  • FIG. 5 is the data after the grayscale etching based on the original data shown in FIG. 4, as shown in FIG. 4 and FIG. 5, the example adopts a core with a width of 3, and the core The center is in the middle position.
  • the grayscale expansion is different from the grayscale corrosion in that the maximum value in the kernel is taken.
  • FIG. 6 is the data after the grayscale expansion based on the grayscale corrosion shown in FIG. 5, as shown in FIG.
  • the isolated bright spots have been eliminated.
  • the combination of grayscale erosion and grayscale expansion in these two steps is called grayscale opening operation.
  • the isolated bright spots can be used. Extracted, you can get bright pixels, as shown in Figure 7,
  • Figure 7 is the bright pixel points obtained by the hat algorithm.
  • FIG. 9 is the data after the gray scale expansion based on the original data shown in FIG. 8; based on the data of FIG.
  • the etch operation obtains the data shown in FIG. 10, and FIG. 10 shows the gradation-corroded data based on the gray-scale expanded data shown in FIG. 9; it can be seen that the isolated dark value has been "filled in” and used again.
  • the grayscale etched data shown in Fig. 10 is subtracted from the original data to obtain dark pixel points, as shown in Fig. 11, and Fig. 11 is a dark pixel point obtained by the black hat algorithm.
  • each sub-block can be determined by a preset second number threshold (T).
  • T second number threshold
  • the conditions of the high-frequency information area are satisfied, and subsequent operations such as sharpening, contrast adjustment, and the like can be performed to improve the definition.
  • FIG. 12 is an image to be processed used in the embodiment of the present application
  • FIG. 13 is a high-frequency information region obtained by the image high-frequency information positioning method according to the embodiment of the present application.
  • FIG. 14 is a structural diagram of a device for positioning high-frequency information of an image according to an embodiment of the present invention. As shown in FIG. 14, the method includes:
  • a segmentation module 21 configured to divide the image to be processed into a plurality of N*N sub-blocks
  • the determining module 22 is configured to determine whether the dark area in each sub-block is more than a bright area
  • the determining module 24 is configured to determine, according to the number of bright pixel points or the number of dark pixel points in the sub-block, whether the sub-block belongs to an image high-frequency information area.
  • the device further includes:
  • the setting module 25 is configured to preset a gray threshold of each sub-block, where the gray threshold is a threshold for distinguishing the image gray of the sub-block.
  • the setting module 25 is specifically configured to:
  • the determining module 22 is specifically configured to:
  • Determining if it is determined that the number of pixels in the sub-block whose gray value is greater than the gray threshold exceeds the number of pixels whose gray value is less than the gray threshold reaches a predetermined first number threshold, determining the sub-block There are more bright areas in the block than dark areas.
  • the determining module 24 is specifically configured to:
  • the sub-block is determined to be an image high-frequency information area.
  • the apparatus shown in FIG. 14 can perform the method shown in FIG. 1, and its implementation principle and technical effects will not be described again.
  • the embodiment of the present application provides a non-transitory computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions can perform the method for locating high frequency information of the image in any of the foregoing method embodiments.
  • FIG. 15 is a structural diagram of a positioning electronic device for image high frequency information according to an embodiment of the present application, including:
  • processors 31 and memory 32 one processor 31 is exemplified in FIG.
  • the apparatus for locating the image high frequency information may further include: an input device 33 and an output device 34.
  • the processor 31, the memory 32, the input device 33, and the output device 34 may be connected by a bus or other means, as exemplified by a bus connection in FIG.
  • the memory 32 is used as a non-transitory computer readable storage medium, and can be used for storing a non-transitory software program, a non-transitory computer executable program, and a module, such as a program corresponding to the method for locating image high frequency information in the embodiment of the present application. Instruction/module.
  • the processor 31 executes various functional applications and data processing of the server by running non-transitory software programs, instructions and modules stored in the memory 32, that is, a method for positioning image high-frequency information in the above method embodiment.
  • the memory 32 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function; and the storage data area may store data created by use of the positioning device according to the image high frequency information. Wait.
  • memory 32 can include high speed random access memory, and can 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.
  • memory 32 may optionally include memory remotely located relative to processor 31, which may be coupled to the positioning device of the image high frequency information over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the input device 33 can receive input digital or character information, and generate key signal inputs related to user settings and function control of the positioning device of the image high frequency information.
  • Output device 34 can include a display device such as a display screen.
  • the one or more modules are stored in the memory 32, and when executed by the one or more processors 31, perform a method of locating image high frequency information in any of the above method embodiments.
  • the electronic device of the embodiment of the present application exists in various forms, including but not limited to:
  • Mobile communication devices These devices are characterized by mobile communication functions and are mainly aimed at providing voice and data communication.
  • Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
  • Ultra-mobile personal computer equipment This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has mobile Internet access. Such terminals include: PDA, MID and UMPC Wait, such as the iPad.
  • Portable entertainment devices These devices can display and play multimedia content. Such devices include: audio, video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
  • the server consists of a processor, a hard disk, a memory, a system bus, etc.
  • the server is similar to a general-purpose computer architecture, but because of the need to provide highly reliable services, processing power and stability High reliability in terms of reliability, security, scalability, and manageability.
  • the storage medium may be a magnetic disk, an optical disk, a read only memory (ROM), or a random access memory (RAM).

Abstract

Disclosed in the present application are a method and device for locating high-frequency information of an image. The method comprises: dividing an image to be processed into a plurality of N*N subblocks; determining whether the number of dark regions is greater than the number of bright regions in each subblock; and if yes, acquiring bright pixels in the subblock by using a top hat algorithm; and otherwise, acquiring dark pixels in the subblock by using a black hat algorithm. A high-frequency information region in an image can be quickly located, which helps to perform subsequent specific image processing on the high-frequency information region, thereby improving image quality.

Description

图像高频信息的定位方法和装置Method and device for positioning image high frequency information
交叉引用cross reference
本申请引用于2015年12月7日递交的名称为“图像高频信息的定位方法和装置”的第201510890417.4号中国专利申请,其通过引用被全部并入本申请。The present application is hereby incorporated by reference in its entirety in its entirety in its entirety in the entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire entire all all all all all all all each
技术领域Technical field
本申请属于互联网视频技术领域,具体地说,涉及一种图像高频信息的定位方法和装置。The present application belongs to the field of Internet video technologies, and in particular, to a method and an apparatus for positioning image high frequency information.
背景技术Background technique
在图像中,尽管人眼对低频信息更加敏感,但是在图像质量比较高且稳定的情况下,高频信息更加决定图像的质量。尤其是高频信息比较密集的地方,例如人的头发,胡子,花纹比较密的衣服等,在这些地方提升清晰度,则会使人眼感到图像质量有了显著提升。In the image, although the human eye is more sensitive to low frequency information, in the case where the image quality is relatively high and stable, the high frequency information further determines the quality of the image. Especially in places where high-frequency information is dense, such as people's hair, beards, and clothes with dense patterns, etc., in these places to enhance the clarity, the human eye will feel the image quality has been significantly improved.
因此,为了有效率的增强图像质量,一种快速定位图像高频信息的方法亟待提出。Therefore, in order to efficiently enhance image quality, a method for quickly locating high-frequency information of an image needs to be proposed.
发明内容Summary of the invention
有鉴于此,本申请提供了一种图像高频信息的定位方法和装置,可以快速定位一个图像中高频信息区域,以便后续对该高频信息区域进行针对性对的图像处理,提高图像质量。本申请还提供了一种图像高频信息的定位电子设备、一种非暂态计算机存储介质以及一种计算机程序产品。In view of this, the present application provides a method and apparatus for positioning image high-frequency information, which can quickly locate a high-frequency information area in an image, so as to perform targeted image processing on the high-frequency information area and improve image quality. The present application also provides a positioning electronic device for image high frequency information, a non-transitory computer storage medium, and a computer program product.
本申请实施例提供一种图像高频信息的定位方法,包括:An embodiment of the present application provides a method for locating high frequency information of an image, including:
将待处理图像分成若干个N*N的子块; Dividing the image to be processed into a number of N*N sub-blocks;
判断每个子块中的暗区域是否多于亮区域;Determining whether the dark area in each sub-block is more than a bright area;
若是则使用礼帽算法获取所述子块中亮的像素点,否则使用黑帽算法获取所述子块中暗的像素点;If yes, use a hat algorithm to obtain bright pixel points in the sub-block, otherwise use a black hat algorithm to obtain dark pixel points in the sub-block;
根据所述子块中亮的像素点个数或者暗的像素点个数,确定所述子块是否属于图像高频信息区域。Whether the sub-block belongs to the image high-frequency information area is determined according to the number of bright pixel points or the number of dark pixel points in the sub-block.
其中,判断每个子块中的暗区域是否多于亮区域之前,包括:Wherein, before determining whether the dark area in each sub-block is more than the bright area, the method includes:
预设每个子块的灰度阈值,所述灰度阈值是用于区分所述子块的图像灰度的一个阈值。A grayscale threshold for each sub-block is preset, the grayscale threshold being a threshold for distinguishing the grayscale of the image of the sub-block.
其中,预设每个子块的灰度阈值,包括:The gray threshold of each sub-block is preset, including:
利用最大类间方差法,在所述子块的像素点矩阵中选择一个像素点,使得所述像素点在所述像素点矩阵中的左侧部分与右侧部分的方差最大,所述像素点对应的灰度值为所述子块的灰度阈值;或者Selecting, by using a maximum inter-class variance method, a pixel point in a matrix of pixel points of the sub-block, such that a variance of a left-side portion and a right-side portion of the pixel point in the matrix of the pixel points is the largest, the pixel point The corresponding gray value is a grayscale threshold of the sub-block; or
根据每个子块中各像素点的灰度值,计算平均灰度值作为所述子块的灰度阈值。The average gray value is calculated as the grayscale threshold of the sub-block based on the gray value of each pixel in each sub-block.
其中,判断每个子块中的暗区域是否多于亮区域,包括:Wherein, determining whether the dark area in each sub-block is more than a bright area includes:
获取每个子块中各像素点的灰度值,根据每个子块对应的灰度阈值,若确定所述子块中灰度值小于所述灰度阈值的像素点个数超过灰度值大于所述灰度阈值的像素点个数达到预定的第一个数阈值,则确定所述子块中的暗区域多于亮区域;Obtaining a gray value of each pixel in each sub-block, according to the gray threshold corresponding to each sub-block, if it is determined that the number of pixels in the sub-block whose gray value is smaller than the gray threshold exceeds the gray value is greater than Determining that the number of pixels of the gray threshold reaches a predetermined first number threshold, determining that the dark area in the sub-block is more than the bright area;
若确定所述子块中灰度值大于所述灰度阈值的像素点个数超过灰度值小于所述灰度阈值的像素点个数达到预定的第一个数阈值,则确定所述子块中的亮区域多于暗区域。Determining, if it is determined that the number of pixels in the sub-block whose gray value is greater than the gray threshold exceeds the number of pixels whose gray value is less than the gray threshold reaches a predetermined first number threshold, determining the sub-block There are more bright areas in the block than dark areas.
其中,根据所述子块中亮的像素点个数或者暗的像素点个数,确定所述子块是否属于图像高频信息区域,包括:The determining whether the sub-block belongs to the image high-frequency information area according to the number of bright pixel points or the number of dark pixel points in the sub-block includes:
若所述子块中亮的像素点个数大于预设的第二阈值个数,则确定所述子块为图像高频信息区域; If the number of bright pixel points in the sub-block is greater than a preset second threshold, determining that the sub-block is an image high-frequency information area;
若所述子块中暗的像素点个数大于预设的第二阈值个数,则确定所述子块为图像高频信息区域。If the number of dark pixels in the sub-block is greater than a preset second threshold, the sub-block is determined to be an image high-frequency information area.
本申请还提供一种图像高频信息的定位装置,包括:The application also provides a positioning device for image high frequency information, comprising:
分割模块,用于将待处理图像分成若干个N*N的子块;a segmentation module, configured to divide the image to be processed into a plurality of N*N sub-blocks;
判断模块,用于判断每个子块中的暗区域是否多于亮区域;a judging module, configured to determine whether a dark area in each sub-block is more than a bright area;
获取模块,用于若是则使用礼帽算法获取所述子块中亮的像素点,否则使用黑帽算法获取所述子块中暗的像素点;Obtaining a module, if yes, using a hat algorithm to obtain a bright pixel in the sub-block; otherwise, using a black hat algorithm to obtain a dark pixel in the sub-block;
确定模块,用于根据所述子块中亮的像素点个数或者暗的像素点个数,确定所述子块是否属于图像高频信息区域。And a determining module, configured to determine, according to the number of bright pixel points or the number of dark pixel points in the sub-block, whether the sub-block belongs to an image high-frequency information area.
其中所述的装置还包括:The device described therein further includes:
设置模块,用于预设每个子块的灰度阈值,所述灰度阈值是用于区分所述子块的图像灰度的一个阈值。And a setting module, configured to preset a grayscale threshold of each sub-block, wherein the grayscale threshold is a threshold for distinguishing image grayscale of the sub-block.
其中,所述设置模块具体用于:The setting module is specifically configured to:
利用最大类间方差法,在所述子块的像素点矩阵中选择一个像素点,使得所述像素点在所述像素点矩阵中的左侧部分与右侧部分的方差最大,所述像素点对应的灰度值为所述子块的灰度阈值;或者Selecting, by using a maximum inter-class variance method, a pixel point in a matrix of pixel points of the sub-block, such that a variance of a left-side portion and a right-side portion of the pixel point in the matrix of the pixel points is the largest, the pixel point The corresponding gray value is a grayscale threshold of the sub-block; or
根据每个子块中各像素点的灰度值,计算平均灰度值作为所述子块的灰度阈值。The average gray value is calculated as the grayscale threshold of the sub-block based on the gray value of each pixel in each sub-block.
其中,所述判断模块具体用于:The determining module is specifically configured to:
获取每个子块中各像素点的灰度值,根据每个子块对应的灰度阈值,若确定所述子块中灰度值小于所述灰度阈值的像素点个数超过灰度值大于所述灰度阈值的像素点个数达到预定的第一个数阈值,则确定所述子块中的暗区域多于亮区域;Obtaining a gray value of each pixel in each sub-block, according to the gray threshold corresponding to each sub-block, if it is determined that the number of pixels in the sub-block whose gray value is smaller than the gray threshold exceeds the gray value is greater than Determining that the number of pixels of the gray threshold reaches a predetermined first number threshold, determining that the dark area in the sub-block is more than the bright area;
若确定所述子块中灰度值大于所述灰度阈值的像素点个数超过灰度值小于所述灰度阈值的像素点个数达到预定的第一个数阈值,则确定所述子块中的亮区域多于暗区域。 Determining, if it is determined that the number of pixels in the sub-block whose gray value is greater than the gray threshold exceeds the number of pixels whose gray value is less than the gray threshold reaches a predetermined first number threshold, determining the sub-block There are more bright areas in the block than dark areas.
所述确定模块具体用于:The determining module is specifically configured to:
若所述子块中亮的像素点个数大于预设的第二阈值个数,则确定所述子块为图像高频信息区域;If the number of bright pixel points in the sub-block is greater than a preset second threshold, determining that the sub-block is an image high-frequency information area;
若所述子块中暗的像素点个数大于预设的第二阈值个数,则确定所述子块为图像高频信息区域。If the number of dark pixels in the sub-block is greater than a preset second threshold, the sub-block is determined to be an image high-frequency information area.
本申请还提供一种非暂态计算机存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行本申请上述任一项图像高频信息的定位方法。The present application also provides a non-transitory computer storage medium storing computer executable instructions for performing a method for locating high frequency information of any of the above images of the present application.
本申请还提供一种图像高频信息的定位电子设备,包括:至少一个处理器;以及,The application also provides a positioning electronic device for image high frequency information, comprising: at least one processor;
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein
所述存储器存储有可被所述一个处理器执行的指令,所述指令被被所述至少一个处理器执行,以使所述至少一个处理器能够:The memory stores instructions executable by the one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
将待处理图像分成若干个N*N的子块;Dividing the image to be processed into a number of N*N sub-blocks;
判断每个子块中的暗区域是否多于亮区域;Determining whether the dark area in each sub-block is more than a bright area;
若是则使用礼帽算法获取所述子块中亮的像素点,否则使用黑帽算法获取所述子块中暗的像素点;If yes, use a hat algorithm to obtain bright pixel points in the sub-block, otherwise use a black hat algorithm to obtain dark pixel points in the sub-block;
根据所述子块中亮的像素点个数或者暗的像素点个数,确定所述子块是否属于图像高频信息区域。Whether the sub-block belongs to the image high-frequency information area is determined according to the number of bright pixel points or the number of dark pixel points in the sub-block.
本申请实施例还提供了一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行本申请上述任一项图像高频信息的定位方法。The embodiment of the present application further provides a computer program product, the computer program product comprising a computing program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer The computer is caused to perform the method of locating the high frequency information of any of the above images of the present application.
本申请实施例通过将待处理图像分成若干个N*N的子块;判断每个子块中的暗区域是否多于亮区域;若是则使用礼帽算法获取所述子块中亮的像素点,否则使用黑帽算法获取所述子块中暗的像素点。可以快速定位一个图像中高频信息区域,以便后续对该高频信息区域进行针对性对的图像处理,提高图像质量。 The embodiment of the present application divides a to-be-processed image into a plurality of N*N sub-blocks; determines whether a dark area in each sub-block is more than a bright area; if yes, uses a hat-hat algorithm to obtain a bright pixel in the sub-block, otherwise The dark pixel points in the sub-block are obtained using a black hat algorithm. The high-frequency information area in one image can be quickly located, so that the image processing of the high-frequency information area can be performed in a targeted manner to improve the image quality.
附图说明DRAWINGS
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the present application, and are intended to be a part of this application. In the drawing:
图1是本申请实施例的提供的一种图像高频信息的定位方法的流程示意图;FIG. 1 is a schematic flowchart diagram of a method for positioning image high frequency information according to an embodiment of the present application;
图2是本申请实施例的一种亮度直方图;2 is a brightness histogram of an embodiment of the present application;
图3是本申请实施例的一种亮度直方图;3 is a brightness histogram of an embodiment of the present application;
图4为一种图像的原始数据;Figure 4 is an original data of an image;
图5为基于图4所示的原始数据经过灰度腐蚀后的数据;5 is data after gradation corrosion based on the original data shown in FIG. 4;
图6为基于图5所示的灰度腐蚀后的数据经过灰度膨胀后的数据;6 is data after gradation expansion based on the gradation corrosion data shown in FIG. 5;
图7为经过礼帽算法得到的亮的像素点;Figure 7 is a bright pixel obtained by the hat hat algorithm;
图8为一种图像的原始数据;Figure 8 is an original data of an image;
图9为基于图8所示的原始数据经过灰度膨胀后的数据;9 is data after grayscale expansion based on the original data shown in FIG. 8;
图10为基于图9所示的灰度膨胀后的数据经过灰度腐蚀后的数据;10 is data after gradation corrosion based on the data after the gray scale expansion shown in FIG. 9;
图11为经过黑帽算法得到的暗的像素点;Figure 11 is a dark pixel obtained by the black hat algorithm;
图12为本申请实施例采用的一种待处理的图像;Figure 12 is an image to be processed adopted in the embodiment of the present application;
图13为经过本申请实施例所述的图像高频信息定位方法得到的高频信息区域;FIG. 13 is a high frequency information area obtained by the image high frequency information positioning method according to the embodiment of the present application;
图14为本申请实施例提供的一种图像高频信息的定位装置的结构图;FIG. 14 is a structural diagram of a positioning apparatus for image high-frequency information according to an embodiment of the present application;
图15为本申请实施例提供的一种图像高频信息的定位电子设备的结构图。FIG. 15 is a structural diagram of a positioning electronic device for image high frequency information according to an embodiment of the present application.
具体实施方式detailed description
以下将配合附图及实施例来详细说明本申请的实施方式,藉此对本申请如何应用技术手段来解决技术问题并达成技术功效的实现过程能充分理解并 据以实施。The embodiments of the present application will be described in detail below with reference to the accompanying drawings and embodiments, so that the application of the technical means to solve the technical problems and achieve the technical effect can be fully understood. According to the implementation.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory. Memory is an example of a computer readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer readable media includes both permanent and non-persistent, removable and non-removable media. Information storage can be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
如在说明书及权利要求当中调用了某些词汇来指称特定组件。本领域技术人员应可理解,硬件制造商可能会用不同名词来称呼同一个组件。本说明书及权利要求并不以名称的差异来作为区分组件的方式,而是以组件在功能上的差异来作为区分的准则。如在通篇说明书及权利要求当中所提及的“包含”为一开放式用语,故应解释成“包含但不限定于”。“大致”是指在可接收的误差范围内,本领域技术人员能够在一定误差范围内解决所述技术问题,基本达到所述技术效果。此外,“耦接”一词在此包含任何直接及间接的电性耦接手段。因此,若文中描述一第一装置耦接于一第二装置,则代表所述第一装置可直接电性耦接于所述第二装置,或通过其他装置或耦接手段间接地电性耦接至所述第二装置。说明书后续描述为实施本申请的较佳实施方式,然所述描述乃以说明本申请的一般原则为目的,并非用以限定本申请的范围。本申请的保护范围当视所附权利要求所界定者为准。 Certain terms are invoked to refer to particular components throughout the specification and claims. Those skilled in the art will appreciate that hardware manufacturers may refer to the same component by different nouns. The present specification and the claims do not use the difference in the name as the means for distinguishing the components, but the difference in function of the components as the criterion for distinguishing. The word "comprising" as used throughout the specification and claims is an open term and should be interpreted as "including but not limited to". "Substantially" means that within the range of acceptable errors, those skilled in the art will be able to solve the technical problems within a certain error range, substantially achieving the technical effects. In addition, the term "coupled" is used herein to include any direct and indirect electrical coupling means. Therefore, if a first device is coupled to a second device, the first device can be directly electrically coupled to the second device, or electrically coupled indirectly through other devices or coupling means. Connected to the second device. The description of the specification is intended to be illustrative of the preferred embodiments of the invention. The scope of protection of the application is subject to the definition of the appended claims.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的商品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种商品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的商品或者系统中还存在另外的相同要素。It should also be noted that the terms "including", "comprising" or "comprising" or any other variations thereof are intended to encompass a non-exclusive inclusion, such that the item or system comprising a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such goods or systems. An element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the item or system including the element, without further limitation.
申请人在实现本申请的过程中发现:Applicants found in the process of implementing this application:
在灰度形态学中,对于灰度变化较频繁的区域,其一般灰度会发生突变,然后很快会变回来。因此,使用礼帽算法和黑帽算法可提取出图像中的高频信息区域。然而,发明人进一步发现,对于每个子块的处理,不能采用同时使用礼帽算法和黑帽算法然后取结果的最大值,本申请只需提取出每个子块中亮的像素点或者暗的像素点即可,在出现灰度连续变化的情况下,若同时使用礼帽算法和黑帽算法会将整幅图变成白色。会给系统带来额外的消耗(时间和内存的小号)。因此,本申请首先判断每个子块中的暗区域是否多于亮区域,根据不同的判断结果,对每个子块使用礼帽算法或黑帽算法中的一种操作即可。In grayscale morphology, for areas with more frequent grayscale changes, the general grayscale will be abrupt and then will change back soon. Therefore, the high-frequency information area in the image can be extracted using the hat hat algorithm and the black hat algorithm. However, the inventors have further found that for each sub-block processing, the maximum value of the result can be taken by using both the top hat algorithm and the black hat algorithm, and the present application only needs to extract bright pixels or dark pixels in each sub-block. That is, in the case of continuous grayscale changes, if both the top hat algorithm and the black hat algorithm are used, the entire image will be white. Will bring extra consumption (time and memory trumpet) to the system. Therefore, the present application first determines whether the dark area in each sub-block is more than a bright area, and according to different judgment results, one of the hat hat algorithm or the black hat algorithm may be used for each sub-block.
图1是本申请实施例的提供的一种图像高频信息的定位方法的流程示意图,如图1所示,包括:FIG. 1 is a schematic flowchart of a method for positioning image high-frequency information according to an embodiment of the present application. As shown in FIG. 1 , the method includes:
101、将待处理图像分成若干个N*N的子块;101. Divide the image to be processed into a plurality of N*N sub-blocks;
在图像处理技术中,一个图像通常划分成若干子块,一个子块由一个亮度像素块和附加的两个色度像素块组成。一般来说,亮度块为16x16大小的像素块,而两个色度图像像素块的大小依据其图像的采样格式而定,如:对于YUV420采样图像,色度块为8x8大小的像素块。每个图像处理算法以子块为单位,逐个子块进行处理。In image processing technology, an image is usually divided into several sub-blocks, one sub-block consisting of one luma pixel block and two additional chroma pixel blocks. Generally, the luma block is a 16x16 pixel block, and the size of the two chroma image block is determined according to the sampling format of the image. For example, for the YUV420 sampled image, the chroma block is an 8x8 pixel block. Each image processing algorithm is processed in sub-blocks, sub-blocks.
本申请实施例中,将图像分成若干个N*N的子块。一般情况下N取16即可。对于每个子区域,单独做处理。In the embodiment of the present application, the image is divided into a plurality of N*N sub-blocks. Under normal circumstances, N can be taken as 16. For each sub-area, handle it separately.
102、判断每个子块中的暗区域是否多于亮区域;若是,则执行步骤103,否则执行步骤104; 102, determining whether the dark area in each sub-block is more than a bright area; if yes, executing step 103, otherwise performing step 104;
本申请实施例中,判断每个子块中的暗区域是否多于亮区域之前,包括:In the embodiment of the present application, before determining whether the dark area in each sub-block is more than the bright area, the method includes:
预设每个子块的灰度阈值,所述灰度阈值是用于区分所述子块的图像灰度的一个阈值。A grayscale threshold for each sub-block is preset, the grayscale threshold being a threshold for distinguishing the grayscale of the image of the sub-block.
可选的,本申请实施例中预设每个子块的灰度阈值包括但不限于以下方法:Optionally, the gray threshold of each sub-block is preset in the embodiment of the present application, including but not limited to the following methods:
利用最大类间方差法,在所述子块的像素点矩阵中选择一个像素点,使得所述像素点在所述像素点矩阵中的左侧部分与右侧部分的方差最大,所述像素点对应的灰度值为所述子块的灰度阈值;或者Selecting, by using a maximum inter-class variance method, a pixel point in a matrix of pixel points of the sub-block, such that a variance of a left-side portion and a right-side portion of the pixel point in the matrix of the pixel points is the largest, the pixel point The corresponding gray value is a grayscale threshold of the sub-block; or
根据每个子块中各像素点的灰度值,计算平均灰度值作为所述子块的灰度阈值。The average gray value is calculated as the grayscale threshold of the sub-block based on the gray value of each pixel in each sub-block.
本申请实施例中,判断每个子块中的暗区域是否多于亮区域具体实现时包括:In the embodiment of the present application, determining whether the dark area in each sub-block is more than a bright area includes:
获取每个子块中各像素点的灰度值,根据每个子块对应的灰度阈值,若确定所述子块中灰度值小于所述灰度阈值的像素点个数超过灰度值大于所述灰度阈值的像素点个数达到预定的第一个数阈值,则确定所述子块中的暗区域多于亮区域;Obtaining a gray value of each pixel in each sub-block, according to the gray threshold corresponding to each sub-block, if it is determined that the number of pixels in the sub-block whose gray value is smaller than the gray threshold exceeds the gray value is greater than Determining that the number of pixels of the gray threshold reaches a predetermined first number threshold, determining that the dark area in the sub-block is more than the bright area;
若确定所述子块中灰度值大于所述灰度阈值的像素点个数超过灰度值小于所述灰度阈值的像素点个数达到预定的第一个数阈值,则确定所述子块中的亮区域多于暗区域。Determining, if it is determined that the number of pixels in the sub-block whose gray value is greater than the gray threshold exceeds the number of pixels whose gray value is less than the gray threshold reaches a predetermined first number threshold, determining the sub-block There are more bright areas in the block than dark areas.
103、使用礼帽算法获取所述子块中亮的像素点;103. Use a hat algorithm to obtain bright pixel points in the sub-block;
104、使用黑帽算法获取所述子块中暗的像素点。104. Obtain a dark pixel point in the sub-block by using a black hat algorithm.
上述礼帽算法和黑帽算法都是基于图像灰度学算法-灰度腐蚀和灰度膨胀而组合而来的。礼帽算法先对图像进行灰度腐蚀,再进行灰度膨胀,最后用原始数据减去膨胀后的值即可。黑帽算法则先对图像进行灰度膨胀,在进行灰度腐蚀,最后减去原始数据即可。本申请对此不做限定。Both the top hat algorithm and the black hat algorithm are based on an image grayscale algorithm - grayscale erosion and grayscale expansion. The hat algorithm first performs grayscale erosion on the image, then performs grayscale expansion, and finally subtracts the expanded value from the original data. The black hat algorithm first performs grayscale expansion on the image, performs grayscale erosion, and finally subtracts the original data. This application does not limit this.
可选地,上述步骤103或104之后,还包括:Optionally, after the foregoing step 103 or 104, the method further includes:
105、根据所述子块中亮的像素点个数或者暗的像素点个数,确定所述子 块是否属于图像高频信息区域。105. Determine the child according to the number of bright pixel points or the number of dark pixel points in the sub-block. Whether the block belongs to the image high frequency information area.
具体实现时,例如,若所述子块中亮的像素点个数大于预设的第二阈值个数,则确定所述子块为图像高频信息区域;若所述子块中暗的像素点个数大于预设的第二阈值个数,则确定所述子块为图像高频信息区域。In a specific implementation, for example, if the number of bright pixel points in the sub-block is greater than a preset second threshold, determining that the sub-block is an image high-frequency information area; if the sub-block is dark pixels If the number of points is greater than the preset second threshold number, the sub-block is determined to be an image high-frequency information area.
本申请实施例通过将待处理图像分成若干个N*N的子块;判断每个子块中的暗区域是否多于亮区域;若是则使用礼帽算法获取所述子块中亮的像素点,否则使用黑帽算法获取所述子块中暗的像素点。可以快速定位一个图像中高频信息区域,以便后续对该高频信息区域进行针对性对的图像处理,提高图像质量。The embodiment of the present application divides a to-be-processed image into a plurality of N*N sub-blocks; determines whether a dark area in each sub-block is more than a bright area; if yes, uses a hat-hat algorithm to obtain a bright pixel in the sub-block, otherwise The dark pixel points in the sub-block are obtained using a black hat algorithm. The high-frequency information area in one image can be quickly located, so that the image processing of the high-frequency information area can be performed in a targeted manner to improve the image quality.
下面通过具体实现方法对本申请的技术方案进行详细的描述。The technical solutions of the present application are described in detail below through specific implementation methods.
本文采用的是基于宏块的方法,把图像分成若干个N*N的子块。一般情况下N取16即可。对于每个子区域,单独做处理。In this paper, a macroblock-based method is used to divide an image into several N*N sub-blocks. Under normal circumstances, N can be taken as 16. For each sub-area, handle it separately.
本申请实施例中将每个图像子块转换为灰度图像的方法包括但不限于以下:The method of converting each image sub-block into a grayscale image in the embodiment of the present application includes but is not limited to the following:
1.浮点算法:Gray=R*0.3+G*0.59+B*0.111. Floating point algorithm: Gray=R*0.3+G*0.59+B*0.11
2.整数方法:Gray=(R*30+G*59+B*11)/1002. Integer method: Gray=(R*30+G*59+B*11)/100
3.移位方法:Gray=(R*76+G*151+B*28)>>8;3. Shift method: Gray = (R * 76 + G * 151 + B * 28) >> 8;
4.平均值法:Gray=(R+G+B)/3;4. Average method: Gray = (R + G + B) / 3;
5.仅取绿色:Gray=G;5. Take only green: Gray=G;
通过上述任一种方法求得Gray后,将原来的RGB(R,G,B)中的R,G,B统一用Gray替换,形成新的颜色RGB(Gray,Gray,Gray),用它替换原来的RGB(R,G,B)就是灰度图像了。After obtaining Gray by any of the above methods, replace R, G, and B in the original RGB (R, G, B) with Gray to form a new color RGB (Gray, Gray, Gray), and replace it with Gray. The original RGB (R, G, B) is the grayscale image.
其中,基于灰度图像,例如,利用Photoshop程序就可以获得该灰度图像的亮度直方图,如图2和图3所示的亮度直方图,对于灰度变化较频繁的区域,其一般灰度会发生突变,然后很快会变回来。Wherein, based on the grayscale image, for example, a luminance histogram of the grayscale image can be obtained by using a Photoshop program, as shown in the luminance histograms shown in FIG. 2 and FIG. 3, for a region where the grayscale changes frequently, the general grayscale A mutation will occur and will soon change back.
本申请实施例中,采用最大类间方差法(OTSU)或者均值分割法预设每个子块对应的灰度阈值。其中,OTSU最大类间方差法可以在子块中选取一个最能区分开图像灰度的一个阈值。具体的算法就不讨论了,主要原理是选 取一个像素点,使其左侧(暗)的部分和右侧(亮)的部分方差最大,则该选取的像素点对应的灰度值为该子块的灰度阈值。均值分割法比较简单,只需将子块中的各像素点的灰度平均值作为灰度阈值即可。其中,OTSU最大类间方差法定位阈值比较准确,均值分割法运算速度较快。In the embodiment of the present application, the maximum inter-class variance method (OTSU) or the mean division method is used to preset the gray threshold corresponding to each sub-block. Among them, the OTSU maximum inter-class variance method can select a threshold in the sub-block that best distinguishes the gray level of the image. The specific algorithm is not discussed, the main principle is to choose Taking a pixel to maximize the variance of the left (dark) portion and the right (light) portion, the gray value corresponding to the selected pixel is the gray threshold of the sub-block. The mean division method is relatively simple, and it is only necessary to use the average value of the gradation of each pixel in the sub-block as the gradation threshold. Among them, the OTSU maximum inter-class variance method is more accurate, and the average segmentation method is faster.
由于礼帽算法主要提取的是在较暗的区域中亮的像素点。相反黑帽算法提取的是在较亮的区域中暗的像素点。因此在需要使用礼帽算法的区域中,较暗的灰度应该占据大多数,相反在需要做黑帽算法的区域中,亮的灰度应该占大多数。Since the top hat algorithm mainly extracts pixels that are bright in the darker areas. Instead, the black hat algorithm extracts dark pixels in brighter areas. Therefore, in areas where a hat hat algorithm is required, the darker grayscale should occupy the majority, and in the region where the black hat algorithm is required, the bright grayscale should be the majority.
在预设了每个子块对应的灰度阈值后,如果每个子块中小于该灰度阈值的像素点个数超过大于该灰度阈值的像素点个数达到预定的第一个数阈值,说明暗的区域较多,则使用礼帽算法;如果每个子块中大于该灰度阈值的像素点个数超过小于该灰度阈值的像素点个数达到预定的第一个数阈值,说明亮的区域较多,则使用黑帽算法。After the grayscale threshold corresponding to each sub-block is preset, if the number of pixels in the sub-block that is smaller than the gray threshold exceeds the threshold of the gray threshold, the number of pixels reaches a predetermined first threshold. If there are many dark areas, the hat algorithm is used; if the number of pixels in the sub-block larger than the gray threshold exceeds the threshold of the gray threshold, the number of pixels reaches a predetermined first threshold, indicating a bright region. More, use the black hat algorithm.
其中,礼帽算法和黑帽算法都是基于基本的图像灰度学算法-灰度腐蚀和灰度膨胀而组合而来的。礼帽算法先对图像进行灰度腐蚀,再进行灰度膨胀,最后用原始数据减去膨胀后的值即可。黑帽算法则先对图像进行灰度膨胀,在进行灰度腐蚀,最后减去原始数据即可。Among them, the hat algorithm and the black hat algorithm are combined based on the basic image grayscale algorithm - grayscale erosion and grayscale expansion. The hat algorithm first performs grayscale erosion on the image, then performs grayscale expansion, and finally subtracts the expanded value from the original data. The black hat algorithm first performs grayscale expansion on the image, performs grayscale erosion, and finally subtracts the original data.
礼帽操作的过程如下:The process of the top hat operation is as follows:
图4为一种图像的原始数据,图5为基于图4所示的原始数据经过灰度腐蚀后的数据,如图4和图5所示,该例子采用了宽度为3的核,且核中心位于中间的位置。灰度膨胀与灰度腐蚀不一样的是,取核中的最大值,图6为基于图5所示的灰度腐蚀后的数据经过灰度膨胀后的数据,如图6所示,看到孤立的亮点已经被消除掉了,这两步灰度腐蚀和灰度膨胀组合起来又叫做灰度开运算,再用图4所示原始数据减去图6中的数据,即可把孤立的亮点提取出来,即可得到亮的像素点,如图7所示,图7为经过礼帽算法得到的亮的像素点。4 is the original data of an image, and FIG. 5 is the data after the grayscale etching based on the original data shown in FIG. 4, as shown in FIG. 4 and FIG. 5, the example adopts a core with a width of 3, and the core The center is in the middle position. The grayscale expansion is different from the grayscale corrosion in that the maximum value in the kernel is taken. FIG. 6 is the data after the grayscale expansion based on the grayscale corrosion shown in FIG. 5, as shown in FIG. The isolated bright spots have been eliminated. The combination of grayscale erosion and grayscale expansion in these two steps is called grayscale opening operation. After subtracting the data in Fig. 6 from the original data shown in Fig. 4, the isolated bright spots can be used. Extracted, you can get bright pixels, as shown in Figure 7, Figure 7 is the bright pixel points obtained by the hat algorithm.
黑帽操作的过程如下:The process of black hat operation is as follows:
对图8的原始数据先进行灰度膨胀操作,得到图9所示数据,图9为基于图8所示的原始数据经过灰度膨胀后的数据;基于图9的数据,再进行腐 蚀操作得到图10所示的数据,图10为基于图9所示的灰度膨胀后的数据经过灰度腐蚀后的数据;可以看到孤立的暗值已被“填平”,再用于图10所示的灰度腐蚀后的数据减去原始数据,即得到暗的像素点,如图11所示,图11为经过黑帽算法得到的暗的像素点。The original data of FIG. 8 is first subjected to the gray scale expansion operation to obtain the data shown in FIG. 9. FIG. 9 is the data after the gray scale expansion based on the original data shown in FIG. 8; based on the data of FIG. The etch operation obtains the data shown in FIG. 10, and FIG. 10 shows the gradation-corroded data based on the gray-scale expanded data shown in FIG. 9; it can be seen that the isolated dark value has been "filled in" and used again. The grayscale etched data shown in Fig. 10 is subtracted from the original data to obtain dark pixel points, as shown in Fig. 11, and Fig. 11 is a dark pixel point obtained by the black hat algorithm.
对于经过上述礼帽算法计算后可以得到暗的像素点的个数,经过黑帽算法计算后得到亮的像素点的个数,可以通过预设的第二个数阈值(T),判定每个子块中有多少个这样的亮的像素点的个数或者暗的像素点的个数,如果一个子块中亮的像素点的个数大于第二个数阈值(T),则可认为该子块满足高频信息区域的条件,可执行后续的操作,例如锐化,调整对比度等来提升清晰度。图12为本申请实施例采用的一种待处理的图像,图13为经过本申请实施例所述的图像高频信息定位方法得到的高频信息区域。For the number of dark pixels that can be obtained after the above-mentioned hat algorithm calculation, the number of bright pixels is obtained after calculation by the black hat algorithm, and each sub-block can be determined by a preset second number threshold (T). The number of such bright pixels or the number of dark pixels in the middle, if the number of bright pixels in a sub-block is greater than the second threshold (T), the sub-block can be considered The conditions of the high-frequency information area are satisfied, and subsequent operations such as sharpening, contrast adjustment, and the like can be performed to improve the definition. FIG. 12 is an image to be processed used in the embodiment of the present application, and FIG. 13 is a high-frequency information region obtained by the image high-frequency information positioning method according to the embodiment of the present application.
图14为本申请实施例提供的一种图像高频信息的定位装置的结构图,如图14所示,包括:FIG. 14 is a structural diagram of a device for positioning high-frequency information of an image according to an embodiment of the present invention. As shown in FIG. 14, the method includes:
分割模块21,用于将待处理图像分成若干个N*N的子块;a segmentation module 21, configured to divide the image to be processed into a plurality of N*N sub-blocks;
判断模块22,用于判断每个子块中的暗区域是否多于亮区域;The determining module 22 is configured to determine whether the dark area in each sub-block is more than a bright area;
获取模块23,用于若是则使用礼帽算法获取所述子块中亮的像素点,否则使用黑帽算法获取所述子块中暗的像素点;Obtaining module 23, if yes, using a hat algorithm to obtain bright pixel points in the sub-block, otherwise using a black hat algorithm to obtain dark pixel points in the sub-block;
确定模块24,用于根据所述子块中亮的像素点个数或者暗的像素点个数,确定所述子块是否属于图像高频信息区域。The determining module 24 is configured to determine, according to the number of bright pixel points or the number of dark pixel points in the sub-block, whether the sub-block belongs to an image high-frequency information area.
其中,所述的装置还包括:Wherein, the device further includes:
设置模块25,用于预设每个子块的灰度阈值,所述灰度阈值是用于区分所述子块的图像灰度的一个阈值。The setting module 25 is configured to preset a gray threshold of each sub-block, where the gray threshold is a threshold for distinguishing the image gray of the sub-block.
所述设置模块25具体用于:The setting module 25 is specifically configured to:
利用最大类间方差法,在所述子块的像素点矩阵中选择一个像素点,使得所述像素点在所述像素点矩阵中的左侧部分与右侧部分的方差最大,所述像素点对应的灰度值为所述子块的灰度阈值;或者Selecting, by using a maximum inter-class variance method, a pixel point in a matrix of pixel points of the sub-block, such that a variance of a left-side portion and a right-side portion of the pixel point in the matrix of the pixel points is the largest, the pixel point The corresponding gray value is a grayscale threshold of the sub-block; or
根据每个子块中各像素点的灰度值,计算平均灰度值作为所述子块的灰 度阈值。Calculating an average gray value as the gray of the sub-block according to the gray value of each pixel in each sub-block Degree threshold.
所述判断模块22具体用于:The determining module 22 is specifically configured to:
获取每个子块中各像素点的灰度值,根据每个子块对应的灰度阈值,若确定所述子块中灰度值小于所述灰度阈值的像素点个数超过灰度值大于所述灰度阈值的像素点个数达到预定的第一个数阈值,则确定所述子块中的暗区域多于亮区域;Obtaining a gray value of each pixel in each sub-block, according to the gray threshold corresponding to each sub-block, if it is determined that the number of pixels in the sub-block whose gray value is smaller than the gray threshold exceeds the gray value is greater than Determining that the number of pixels of the gray threshold reaches a predetermined first number threshold, determining that the dark area in the sub-block is more than the bright area;
若确定所述子块中灰度值大于所述灰度阈值的像素点个数超过灰度值小于所述灰度阈值的像素点个数达到预定的第一个数阈值,则确定所述子块中的亮区域多于暗区域。Determining, if it is determined that the number of pixels in the sub-block whose gray value is greater than the gray threshold exceeds the number of pixels whose gray value is less than the gray threshold reaches a predetermined first number threshold, determining the sub-block There are more bright areas in the block than dark areas.
所述确定模块24具体用于:The determining module 24 is specifically configured to:
若所述子块中亮的像素点个数大于预设的第二阈值个数,则确定所述子块为图像高频信息区域;If the number of bright pixel points in the sub-block is greater than a preset second threshold, determining that the sub-block is an image high-frequency information area;
若所述子块中暗的像素点个数大于预设的第二阈值个数,则确定所述子块为图像高频信息区域。If the number of dark pixels in the sub-block is greater than a preset second threshold, the sub-block is determined to be an image high-frequency information area.
图14所示的装置可以执行图1所示的方法,其实现原理和技术效果不再赘述。The apparatus shown in FIG. 14 can perform the method shown in FIG. 1, and its implementation principle and technical effects will not be described again.
本申请实施例提供了一种非暂态计算机存储介质,该计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行上述任意方法实施例中的图像高频信息的定位方法。The embodiment of the present application provides a non-transitory computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions can perform the method for locating high frequency information of the image in any of the foregoing method embodiments.
图15为本申请实施例提供的一种图像高频信息的定位电子设备的结构图,包括:FIG. 15 is a structural diagram of a positioning electronic device for image high frequency information according to an embodiment of the present application, including:
一个或多个处理器31以及存储器32,图15中以一个处理器31为例。One or more processors 31 and memory 32, one processor 31 is exemplified in FIG.
图像高频信息的定位方法的设备还可以包括:输入装置33和输出装置34。The apparatus for locating the image high frequency information may further include: an input device 33 and an output device 34.
处理器31、存储器32、输入装置33和输出装置34可以通过总线或者其他方式连接,图15中以通过总线连接为例。 The processor 31, the memory 32, the input device 33, and the output device 34 may be connected by a bus or other means, as exemplified by a bus connection in FIG.
存储器32作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序、非暂态计算机可执行程序以及模块,如本申请实施例中的图像高频信息的定位方法对应的程序指令/模块。处理器31通过运行存储在存储器32中的非暂态软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例图像高频信息的定位方法。The memory 32 is used as a non-transitory computer readable storage medium, and can be used for storing a non-transitory software program, a non-transitory computer executable program, and a module, such as a program corresponding to the method for locating image high frequency information in the embodiment of the present application. Instruction/module. The processor 31 executes various functional applications and data processing of the server by running non-transitory software programs, instructions and modules stored in the memory 32, that is, a method for positioning image high-frequency information in the above method embodiment.
存储器32可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据图像高频信息的定位装置的使用所创建的数据等。此外,存储器32可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施例中,存储器32可选包括相对于处理器31远程设置的存储器,这些远程存储器可以通过网络连接至图像高频信息的定位装置。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 32 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function; and the storage data area may store data created by use of the positioning device according to the image high frequency information. Wait. Moreover, memory 32 can include high speed random access memory, and can 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, memory 32 may optionally include memory remotely located relative to processor 31, which may be coupled to the positioning device of the image high frequency information over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
输入装置33可接收输入的数字或字符信息,以及产生与图像高频信息的定位装置的用户设置以及功能控制有关的键信号输入。输出装置34可包括显示屏等显示设备。The input device 33 can receive input digital or character information, and generate key signal inputs related to user settings and function control of the positioning device of the image high frequency information. Output device 34 can include a display device such as a display screen.
所述一个或者多个模块存储在所述存储器32中,当被所述一个或者多个处理器31执行时,执行上述任意方法实施例中的图像高频信息的定位方法。The one or more modules are stored in the memory 32, and when executed by the one or more processors 31, perform a method of locating image high frequency information in any of the above method embodiments.
上述产品可执行本申请实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本申请实施例所提供的方法。The above products can perform the methods provided by the embodiments of the present application, and have the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the method provided by the embodiments of the present application.
本申请实施例的电子设备以多种形式存在,包括但不限于:The electronic device of the embodiment of the present application exists in various forms, including but not limited to:
(1)移动通信设备:这类设备的特点是具备移动通信功能,并且以提供话音、数据通信为主要目标。这类终端包括:智能手机(例如iPhone)、多媒体手机、功能性手机,以及低端手机等。(1) Mobile communication devices: These devices are characterized by mobile communication functions and are mainly aimed at providing voice and data communication. Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
(2)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设 备等,例如iPad。(2) Ultra-mobile personal computer equipment: This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has mobile Internet access. Such terminals include: PDA, MID and UMPC Wait, such as the iPad.
(3)便携式娱乐设备:这类设备可以显示和播放多媒体内容。该类设备包括:音频、视频播放器(例如iPod),掌上游戏机,电子书,以及智能玩具和便携式车载导航设备。(3) Portable entertainment devices: These devices can display and play multimedia content. Such devices include: audio, video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
(4)服务器:提供计算服务的设备,服务器的构成包括处理器、硬盘、内存、系统总线等,服务器和通用的计算机架构类似,但是由于需要提供高可靠的服务,因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面要求较高。(4) Server: A device that provides computing services. The server consists of a processor, a hard disk, a memory, a system bus, etc. The server is similar to a general-purpose computer architecture, but because of the need to provide highly reliable services, processing power and stability High reliability in terms of reliability, security, scalability, and manageability.
(5)其他具有数据交互功能的电子装置。上述说明示出并描述了本申请的若干优选实施例,但如前所述,应当理解本申请并非局限于本文所披露的形式,不应看作是对其他实施例的排除,而可用于各种其他组合、修改和环境,并能够在本文所述发明构想范围内,通过上述教导或相关领域的技术或知识进行改动。而本领域人员所进行的改动和变化不脱离本发明的精神和范围,则都应在本发明所附权利要求的保护范围内。(5) Other electronic devices with data interaction functions. The above description shows and describes several preferred embodiments of the present application, but as described above, it should be understood that the application is not limited to the forms disclosed herein, and should not be construed as Other combinations, modifications, and environments are possible and can be modified by the above teachings or related art or knowledge within the scope of the inventive concept described herein. All changes and modifications made by those skilled in the art are intended to be within the scope of the appended claims.
最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。 Finally, it should be understood that those skilled in the art can understand that all or part of the process of implementing the above embodiments can be completed by a computer program to instruct related hardware, and the program can be stored in a computer readable. In the storage medium, the program, when executed, may include the flow of an embodiment of the methods as described above. The storage medium may be a magnetic disk, an optical disk, a read only memory (ROM), or a random access memory (RAM).

Claims (13)

  1. 一种图像高频信息的定位方法,其特征在于,包括:A method for locating high frequency information of an image, comprising:
    将待处理图像分成若干个N*N的子块;Dividing the image to be processed into a number of N*N sub-blocks;
    判断每个子块中的暗区域是否多于亮区域;Determining whether the dark area in each sub-block is more than a bright area;
    若是则使用礼帽算法获取所述子块中亮的像素点,否则使用黑帽算法获取所述子块中暗的像素点;If yes, use a hat algorithm to obtain bright pixel points in the sub-block, otherwise use a black hat algorithm to obtain dark pixel points in the sub-block;
    根据所述子块中亮的像素点个数或者暗的像素点个数,确定所述子块是否属于图像高频信息区域。Whether the sub-block belongs to the image high-frequency information area is determined according to the number of bright pixel points or the number of dark pixel points in the sub-block.
  2. 如权利要求1所述的方法,其特征在于,判断每个子块中的暗区域是否多于亮区域之前,包括:The method of claim 1, wherein determining whether the dark area in each sub-block is more than the bright area comprises:
    预设每个子块的灰度阈值,所述灰度阈值是用于区分所述子块的图像灰度的一个阈值。A grayscale threshold for each sub-block is preset, the grayscale threshold being a threshold for distinguishing the grayscale of the image of the sub-block.
  3. 如权利要求2所述的方法,其特征在于,预设每个子块的灰度阈值,包括:The method of claim 2, wherein the grayscale threshold of each sub-block is preset, comprising:
    利用最大类间方差法,在所述子块的像素点矩阵中选择一个像素点,使得所述像素点在所述像素点矩阵中的左侧部分与右侧部分的方差最大,所述像素点对应的灰度值为所述子块的灰度阈值;或者Selecting, by using a maximum inter-class variance method, a pixel point in a matrix of pixel points of the sub-block, such that a variance of a left-side portion and a right-side portion of the pixel point in the matrix of the pixel points is the largest, the pixel point The corresponding gray value is a grayscale threshold of the sub-block; or
    根据每个子块中各像素点的灰度值,计算平均灰度值作为所述子块的灰度阈值。The average gray value is calculated as the grayscale threshold of the sub-block based on the gray value of each pixel in each sub-block.
  4. 如权利要求1-3中任一项所述的方法,其特征在于,判断每个子块中的暗区域是否多于亮区域,包括:The method according to any one of claims 1 to 3, wherein determining whether the dark area in each sub-block is more than a bright area comprises:
    获取每个子块中各像素点的灰度值,根据每个子块对应的灰度阈值,若确定所述子块中灰度值小于所述灰度阈值的像素点个数超过灰度值大于所述灰度阈值的像素点个数达到预定的第一个数阈值,则确定所述子块中的暗区域多于亮区域;Obtaining a gray value of each pixel in each sub-block, according to the gray threshold corresponding to each sub-block, if it is determined that the number of pixels in the sub-block whose gray value is smaller than the gray threshold exceeds the gray value is greater than Determining that the number of pixels of the gray threshold reaches a predetermined first number threshold, determining that the dark area in the sub-block is more than the bright area;
    若确定所述子块中灰度值大于所述灰度阈值的像素点个数超过灰度值 小于所述灰度阈值的像素点个数达到预定的第一个数阈值,则确定所述子块中的亮区域多于暗区域。If it is determined that the number of pixels in the sub-block whose gray value is greater than the gray threshold exceeds the gray value If the number of pixels smaller than the gray threshold reaches a predetermined first number threshold, it is determined that the bright area in the sub-block is more than the dark area.
  5. 如权利要求1所述的方法,其特征在于,根据所述子块中亮的像素点个数或者暗的像素点个数,确定所述子块是否属于图像高频信息区域,包括:The method according to claim 1, wherein determining whether the sub-block belongs to the image high-frequency information area according to the number of bright pixel points or the number of dark pixel points in the sub-block includes:
    若所述子块中亮的像素点个数大于预设的第二阈值个数,则确定所述子块为图像高频信息区域;If the number of bright pixel points in the sub-block is greater than a preset second threshold, determining that the sub-block is an image high-frequency information area;
    若所述子块中暗的像素点个数大于预设的第二阈值个数,则确定所述子块为图像高频信息区域。If the number of dark pixels in the sub-block is greater than a preset second threshold, the sub-block is determined to be an image high-frequency information area.
  6. 一种图像高频信息的定位装置,其特征在于,包括:A positioning device for image high frequency information, comprising:
    分割模块,用于将待处理图像分成若干个N*N的子块;a segmentation module, configured to divide the image to be processed into a plurality of N*N sub-blocks;
    判断模块,用于判断每个子块中的暗区域是否多于亮区域;a judging module, configured to determine whether a dark area in each sub-block is more than a bright area;
    获取模块,用于若是则使用礼帽算法获取所述子块中亮的像素点,否则使用黑帽算法获取所述子块中暗的像素点;Obtaining a module, if yes, using a hat algorithm to obtain a bright pixel in the sub-block; otherwise, using a black hat algorithm to obtain a dark pixel in the sub-block;
    确定模块,用于根据所述子块中亮的像素点个数或者暗的像素点个数,确定所述子块是否属于图像高频信息区域。And a determining module, configured to determine, according to the number of bright pixel points or the number of dark pixel points in the sub-block, whether the sub-block belongs to an image high-frequency information area.
  7. 如权利要求6所述的装置,其特征在于,还包括:The device of claim 6 further comprising:
    设置模块,用于预设每个子块的灰度阈值,所述灰度阈值是用于区分所述子块的图像灰度的一个阈值。And a setting module, configured to preset a grayscale threshold of each sub-block, wherein the grayscale threshold is a threshold for distinguishing image grayscale of the sub-block.
  8. 如权利要求7所述的装置,其特征在于,所述设置模块具体用于:The device according to claim 7, wherein the setting module is specifically configured to:
    利用最大类间方差法,在所述子块的像素点矩阵中选择一个像素点,使得所述像素点在所述像素点矩阵中的左侧部分与右侧部分的方差最大,所述像素点对应的灰度值为所述子块的灰度阈值;或者Selecting, by using a maximum inter-class variance method, a pixel point in a matrix of pixel points of the sub-block, such that a variance of a left-side portion and a right-side portion of the pixel point in the matrix of the pixel points is the largest, the pixel point The corresponding gray value is a grayscale threshold of the sub-block; or
    根据每个子块中各像素点的灰度值,计算平均灰度值作为所述子块的灰度阈值。The average gray value is calculated as the grayscale threshold of the sub-block based on the gray value of each pixel in each sub-block.
  9. 如权利要求6-8中任一项所述的装置,其特征在于,所述判断模块具体用于: The device according to any one of claims 6-8, wherein the determining module is specifically configured to:
    获取每个子块中各像素点的灰度值,根据每个子块对应的灰度阈值,若确定所述子块中灰度值小于所述灰度阈值的像素点个数超过灰度值大于所述灰度阈值的像素点个数达到预定的第一个数阈值,则确定所述子块中的暗区域多于亮区域;Obtaining a gray value of each pixel in each sub-block, according to the gray threshold corresponding to each sub-block, if it is determined that the number of pixels in the sub-block whose gray value is smaller than the gray threshold exceeds the gray value is greater than Determining that the number of pixels of the gray threshold reaches a predetermined first number threshold, determining that the dark area in the sub-block is more than the bright area;
    若确定所述子块中灰度值大于所述灰度阈值的像素点个数超过灰度值小于所述灰度阈值的像素点个数达到预定的第一个数阈值,则确定所述子块中的亮区域多于暗区域。Determining, if it is determined that the number of pixels in the sub-block whose gray value is greater than the gray threshold exceeds the number of pixels whose gray value is less than the gray threshold reaches a predetermined first number threshold, determining the sub-block There are more bright areas in the block than dark areas.
  10. 如权利要求7所述的装置,其特征在于,所述确定模块具体用于:The device according to claim 7, wherein the determining module is specifically configured to:
    若所述子块中亮的像素点个数大于预设的第二阈值个数,则确定所述子块为图像高频信息区域;If the number of bright pixel points in the sub-block is greater than a preset second threshold, determining that the sub-block is an image high-frequency information area;
    若所述子块中暗的像素点个数大于预设的第二阈值个数,则确定所述子块为图像高频信息区域。If the number of dark pixels in the sub-block is greater than a preset second threshold, the sub-block is determined to be an image high-frequency information area.
  11. 一种图像高频信息的定位电子设备,包括:A positioning electronic device for image high frequency information, comprising:
    至少一个处理器;以及,At least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein
    所述存储器存储有可被所述一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:The memory stores instructions executable by the one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
    将待处理图像分成若干个N*N的子块;Dividing the image to be processed into a number of N*N sub-blocks;
    判断每个子块中的暗区域是否多于亮区域;Determining whether the dark area in each sub-block is more than a bright area;
    若是则使用礼帽算法获取所述子块中亮的像素点,否则使用黑帽算法获取所述子块中暗的像素点;If yes, use a hat algorithm to obtain bright pixel points in the sub-block, otherwise use a black hat algorithm to obtain dark pixel points in the sub-block;
    根据所述子块中亮的像素点个数或者暗的像素点个数,确定所述子块是否属于图像高频信息区域。Whether the sub-block belongs to the image high-frequency information area is determined according to the number of bright pixel points or the number of dark pixel points in the sub-block.
  12. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行权利要求1-5任一所述方法。 A non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium stores computer instructions for causing the computer to perform the method of any of claims 1-5 .
  13. 一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1-5任一所述方法。 A computer program product comprising a computing program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to execute The method of any of claims 1-5.
PCT/CN2016/095998 2015-12-07 2016-08-19 Method and device for locating high-frequency information of image WO2017096946A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510890417.4A CN105894491A (en) 2015-12-07 2015-12-07 Image high-frequency information positioning method and device
CN201510890417.4 2015-12-07

Publications (1)

Publication Number Publication Date
WO2017096946A1 true WO2017096946A1 (en) 2017-06-15

Family

ID=57002595

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/095998 WO2017096946A1 (en) 2015-12-07 2016-08-19 Method and device for locating high-frequency information of image

Country Status (2)

Country Link
CN (1) CN105894491A (en)
WO (1) WO2017096946A1 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109993691A (en) * 2019-04-02 2019-07-09 济南大学 Non-uniform image conversion method and system based on piece-wise linear conversion
CN110738603A (en) * 2018-07-18 2020-01-31 中国商用飞机有限责任公司 image gray scale processing method, device, computer equipment and storage medium
CN110782454A (en) * 2019-11-12 2020-02-11 上海电气集团股份有限公司 Identification method and identification device for stator core lamination of generator
CN111462157A (en) * 2020-03-31 2020-07-28 西安工程大学 Infrared image segmentation method based on genetic optimization threshold method
CN111489395A (en) * 2020-04-13 2020-08-04 展讯通信(上海)有限公司 Image signal direction judging method and related equipment
CN111598909A (en) * 2020-05-08 2020-08-28 展讯通信(上海)有限公司 Frequency domain characteristic judgment method of image signal and related equipment
CN111787310A (en) * 2020-07-14 2020-10-16 南昌欧菲晶润科技有限公司 Anti-shake performance testing method and device, computer equipment and storage medium
CN111951214A (en) * 2020-06-24 2020-11-17 北京百度网讯科技有限公司 Method and device for segmenting readable area in image, electronic equipment and storage medium
CN113570507A (en) * 2020-04-29 2021-10-29 浙江宇视科技有限公司 Image noise reduction method, device, equipment and storage medium
CN113763397A (en) * 2021-09-03 2021-12-07 国网山东省电力公司电力科学研究院 Composite insulator fault detection method and system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108053371B (en) * 2017-11-30 2022-04-19 努比亚技术有限公司 Image processing method, terminal and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100040263A1 (en) * 2008-08-15 2010-02-18 Sti Medical Systems Llc Methods for enhancing vascular patterns in cervical imagery
CN101789080A (en) * 2010-01-21 2010-07-28 上海交通大学 Detection method for vehicle license plate real-time positioning character segmentation
CN101989351A (en) * 2010-11-16 2011-03-23 西安理工大学 Suspected lung nodule image enhancement directional scale filtering method
CN104602096A (en) * 2014-12-26 2015-05-06 北京奇艺世纪科技有限公司 Detecting method and device for video subtitle area

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102378037A (en) * 2010-08-04 2012-03-14 致伸科技股份有限公司 Image test method of image acquisition device and image test device using same
CN103824257A (en) * 2012-11-16 2014-05-28 无锡汉兴电子有限公司 Two-dimensional code image preprocessing method
CN103247049A (en) * 2013-05-15 2013-08-14 桂林电子科技大学 SMT (Surface Mounting Technology) welding spot image segmentation method
CN104346806A (en) * 2013-08-09 2015-02-11 联想(北京)有限公司 Image processing method and device
US20150347862A1 (en) * 2014-05-30 2015-12-03 Fuji Xerox Co., Ltd. Image processing apparatus, image processing method, image processing system, and non-transitory computer readable medium storing program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100040263A1 (en) * 2008-08-15 2010-02-18 Sti Medical Systems Llc Methods for enhancing vascular patterns in cervical imagery
CN101789080A (en) * 2010-01-21 2010-07-28 上海交通大学 Detection method for vehicle license plate real-time positioning character segmentation
CN101989351A (en) * 2010-11-16 2011-03-23 西安理工大学 Suspected lung nodule image enhancement directional scale filtering method
CN104602096A (en) * 2014-12-26 2015-05-06 北京奇艺世纪科技有限公司 Detecting method and device for video subtitle area

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110738603A (en) * 2018-07-18 2020-01-31 中国商用飞机有限责任公司 image gray scale processing method, device, computer equipment and storage medium
CN109993691A (en) * 2019-04-02 2019-07-09 济南大学 Non-uniform image conversion method and system based on piece-wise linear conversion
CN109993691B (en) * 2019-04-02 2022-11-11 济南大学 Non-uniform image conversion method and system based on sectional type linear conversion
CN110782454B (en) * 2019-11-12 2022-04-26 上海电气集团股份有限公司 Identification method and identification device for stator core lamination of generator
CN110782454A (en) * 2019-11-12 2020-02-11 上海电气集团股份有限公司 Identification method and identification device for stator core lamination of generator
CN111462157A (en) * 2020-03-31 2020-07-28 西安工程大学 Infrared image segmentation method based on genetic optimization threshold method
CN111462157B (en) * 2020-03-31 2023-04-07 西安工程大学 Infrared image segmentation method based on genetic optimization threshold method
CN111489395B (en) * 2020-04-13 2023-03-14 展讯通信(上海)有限公司 Image signal direction judging method and related equipment
CN111489395A (en) * 2020-04-13 2020-08-04 展讯通信(上海)有限公司 Image signal direction judging method and related equipment
CN113570507A (en) * 2020-04-29 2021-10-29 浙江宇视科技有限公司 Image noise reduction method, device, equipment and storage medium
CN113570507B (en) * 2020-04-29 2024-03-26 浙江宇视科技有限公司 Image noise reduction method, device, equipment and storage medium
CN111598909A (en) * 2020-05-08 2020-08-28 展讯通信(上海)有限公司 Frequency domain characteristic judgment method of image signal and related equipment
CN111598909B (en) * 2020-05-08 2023-03-14 展讯通信(上海)有限公司 Frequency domain characteristic judgment method of image signal and related equipment
CN111951214A (en) * 2020-06-24 2020-11-17 北京百度网讯科技有限公司 Method and device for segmenting readable area in image, electronic equipment and storage medium
CN111951214B (en) * 2020-06-24 2023-07-28 北京百度网讯科技有限公司 Method and device for dividing readable area in image, electronic equipment and storage medium
CN111787310A (en) * 2020-07-14 2020-10-16 南昌欧菲晶润科技有限公司 Anti-shake performance testing method and device, computer equipment and storage medium
CN113763397A (en) * 2021-09-03 2021-12-07 国网山东省电力公司电力科学研究院 Composite insulator fault detection method and system
CN113763397B (en) * 2021-09-03 2024-03-29 国网山东省电力公司电力科学研究院 Composite insulator fault detection method and system

Also Published As

Publication number Publication date
CN105894491A (en) 2016-08-24

Similar Documents

Publication Publication Date Title
WO2017096946A1 (en) Method and device for locating high-frequency information of image
US11151712B2 (en) Method and apparatus for detecting image defects, computing device, and computer readable storage medium
US10803554B2 (en) Image processing method and device
US10896349B2 (en) Text detection method and apparatus, and storage medium
EP3614334B1 (en) Method for image processing and electronic device
CN109272459B (en) Image processing method, image processing device, storage medium and electronic equipment
WO2018028306A1 (en) Method and device for recognizing license plate number
RU2721188C2 (en) Improved contrast and noise reduction on images obtained from cameras
WO2017092431A1 (en) Human hand detection method and device based on skin colour
US20150326845A1 (en) Depth value restoration method and system
US9262690B2 (en) Method and device for detecting glare pixels of image
US20200066024A1 (en) Scene-based foveated rendering of graphics content
WO2021082921A1 (en) Back cover appearance defect detection method for electronic apparatus, and apparatus
WO2015085790A1 (en) Image processing method and apparatus
CN111192190B (en) Method and device for eliminating image watermark and electronic equipment
WO2014074959A1 (en) Real-time face detection using pixel pairs
WO2019000793A1 (en) Pixelating method and device for live broadcasting, electronic device, and storage medium
CN110708568B (en) Video content mutation detection method and device
KR20130115341A (en) Method and apparatus for providing a mechanism for gesture recognition
WO2020108010A1 (en) Video processing method and apparatus, electronic device and storage medium
JP2021119457A (en) Generation device of image without background, device, electronic apparatus, storage medium and computer program
CN108960012B (en) Feature point detection method and device and electronic equipment
JP2014535101A (en) Method and apparatus for facilitating detection of text in an image
US9836823B2 (en) Method and device for enhancing edge of image and digital camera
US9678991B2 (en) Apparatus and method for processing image

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

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

Country of ref document: EP

Kind code of ref document: A1