WO2021114039A1 - Masking-based automatic exposure control method and apparatus, storage medium, and electronic device - Google Patents

Masking-based automatic exposure control method and apparatus, storage medium, and electronic device Download PDF

Info

Publication number
WO2021114039A1
WO2021114039A1 PCT/CN2019/124081 CN2019124081W WO2021114039A1 WO 2021114039 A1 WO2021114039 A1 WO 2021114039A1 CN 2019124081 W CN2019124081 W CN 2019124081W WO 2021114039 A1 WO2021114039 A1 WO 2021114039A1
Authority
WO
WIPO (PCT)
Prior art keywords
mask
selection area
preset
exposure
value
Prior art date
Application number
PCT/CN2019/124081
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 深圳圣诺医疗设备股份有限公司
Priority to PCT/CN2019/124081 priority Critical patent/WO2021114039A1/en
Publication of WO2021114039A1 publication Critical patent/WO2021114039A1/en

Links

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B6/00Apparatus or devices for radiation diagnosis; Apparatus or devices for radiation diagnosis combined with radiation therapy equipment

Definitions

  • the present invention relates to the technical field of image acquisition, and more specifically, to a mask-based automatic exposure control method, device, storage medium and electronic equipment.
  • photography equipment such as digital mammography can usually work in a variety of different photography modes, such as: point pressure photography, puncture photography, axillary pressure photography, magnification photography and other modes of different photography areas, the area covered by the measured object and the block.
  • the light area is more flexible. It is also difficult to accurately calculate the gray value of the area covered by the measured object.
  • the technical problem to be solved by the present invention is to provide a mask-based automatic exposure control method, device, storage medium and electronic equipment in view of the above-mentioned defects of the prior art.
  • the technical solution adopted by the present invention to solve its technical problems is to construct a mask-based automatic exposure control method, including:
  • the preset mask includes a first selection area corresponding to the shooting object and a second selection area set apart from the first selection area;
  • a mask-based automatic exposure control method of the present invention further includes:
  • the occupation ratio is greater than or equal to one-eighth.
  • the first selection area includes a plurality of first selection areas that are isolated from each other; and/or
  • the first selection area is set corresponding to the shooting object.
  • the obtaining the pixel threshold value according to the first average gray scale value includes: taking a half of the first average gray scale value as the pixel threshold value.
  • the obtaining the main exposure parameter according to the effective grayscale value and the preset exposure parameter includes obtaining the main exposure parameter by using the following formula:
  • A is the main exposure parameter
  • B is the target grayscale value
  • C is the effective grayscale value
  • D is the preset exposure parameter
  • the main exposure parameter includes the exposure amount of the main exposure
  • the preset exposure parameter includes the exposure amount of the pre-exposure
  • the present invention also constructs a mask-based automatic exposure control device, including:
  • the first processing unit is configured to perform pre-exposure on the subject according to preset exposure parameters, and obtain an initial image after pre-exposure;
  • the second processing unit is configured to obtain a preset mask according to the photographic subject and the initial image, and perform mask processing on the initial image through the preset mask to obtain a mask corresponding to the initial image An image, wherein the preset mask includes a first selection area corresponding to the shooting object and a second selection area set apart from the first selection area;
  • a first calculation unit configured to calculate a first average gray scale value of all pixels corresponding to the second selection area in the mask image, and obtain a pixel threshold value according to the first average gray scale value
  • An acquiring unit configured to acquire grayscale values of all pixels corresponding to the first selection area in the mask image, and acquire pixels whose grayscale values are less than the pixel threshold as effective pixels;
  • the second calculation unit is configured to calculate the second average gray scale value of all effective pixels and use the second average gray scale value as the effective gray scale value;
  • the third processing unit is configured to obtain the main exposure parameter according to the effective grayscale value and the preset exposure parameter.
  • the present invention also constructs a computer storage medium on which a computer program is stored, and when the computer program is executed by a processor, the automatic exposure control method based on a mask as described in any one of the above is realized.
  • the present invention also constructs an electronic device, including a memory and a processor
  • the memory is used to store a computer program
  • the processor is configured to execute the computer program to implement the mask-based automatic exposure control method as described in any one of the above.
  • a mask-based automatic exposure control method, device, storage medium, and electronic equipment implemented in the present invention have the following beneficial effects: the best exposure parameter can be obtained to obtain the best photographic image.
  • FIG. 1 is a program flowchart of an embodiment of the mask-based automatic exposure control method of the present invention
  • FIG. 2 is a program flowchart of another embodiment of the mask-based automatic exposure control method of the present invention.
  • Fig. 3 is a logical block diagram of an embodiment of the mask-based automatic exposure control device of the present invention.
  • the mask-based automatic exposure control method of the present invention includes:
  • the position of the subject is correct and the state is
  • the preset exposure parameters of the test object can be obtained by entering the automatic exposure mode to obtain the corresponding preset exposure parameters through the fully automatic exposure mode, and perform fully automatic pre-exposure through the preset exposure parameters.
  • the preset exposure parameters can also be set according to empirical values. When setting the empirical values, the type of the tested object and the test position can also be used as the basis for setting the empirical values at the same time.
  • S2 Obtain a preset mask according to the shooting object and the initial image, and perform mask processing on the initial image through the preset mask to obtain a mask image corresponding to the initial image, where the preset mask includes a first mask corresponding to the shooting object.
  • a selection area and a second selection area set apart from the first selection area; specifically, after the initial image is acquired, a corresponding preset mask is set according to the acquired initial image and the shooting object, and the mask may be 1 with the initial image. :1 ratio pixel size.
  • the second selection area can be set farther from the first selection area.
  • the second selection area may be set at a position away from the first selection area and close to the edge of the initial image.
  • the setting of the preset mask can be set according to the subject. For example, when performing mammography, it can be pre-masked according to the regional breast characteristics, that is, according to the size of the subject, the appropriate preset mask can be selected to make the subject Try to fall within the first constituency.
  • the photographing object is also certain.
  • the photographing equipment is a digital mammography machine
  • the photographic object can be understood as performing mammography.
  • the preset masks corresponding to different breasts can be set according to the physical characteristics of the breasts. sheet.
  • the preset mask settings also correspond to the initial image.
  • the acquisition of the initial image corresponds to the photography mode of the photography equipment.
  • the photography modes of the digital breast machine include point pressure photography, puncture photography, axillary pressure photography.
  • magnification photography the initial image obtained is also different according to the photography mode.
  • the photography mode to select the appropriate preset mask. It can be understood here that the obtained mask image actually contains three regions, of which the first and second selections are bare selections. Excluding the first and second selections is the mask selection.
  • the mask selection is Think of it as the background, and in the subsequent processing, the mask selection will not be processed.
  • the second selection area is set at intervals from the first selection area, and One selection area corresponds to the measured object, and the second selection area can be understood as a different area from the measured object.
  • the average value of all pixels in the second selected area that is, the first average grayscale value
  • the second selection area has at least 10 pixels.
  • the main exposure parameter can be obtained according to the preset exposure parameter corresponding to the effective grayscale value, so as to perform main exposure by setting the main exposure parameter to obtain the best photographic image.
  • the mask-based automatic exposure control method of the present invention further includes:
  • step S5 is executed, that is, only the effective pixels in the first selection area are processed.
  • the occupancy ratio does not meet the preset conditions, it can be determined that the second selection area is completely occluded by the subject at this time, and the pixels corresponding to the second selection area in the mask image are actually part of the pixels corresponding to the subject. Determining the corresponding pixels in the first selection area can be understood as all the pixels of the shooting object. At this time, all pixels corresponding to the first selection area can be calculated to obtain the average gray scale value, that is, the third average gray scale value.
  • the third average grayscale value is defined as the effective grayscale value, and step S6 is executed according to the effective grayscale value to obtain the corresponding main exposure parameter.
  • the occupation ratio is greater than or equal to one-eighth.
  • the size of the first selection area will affect the proportion of the object that is occluded.
  • the occupation ratio can be set to be greater than or equal to one-eighth of the number of all pixels in the first selection area when the occupation ratio meets the preset condition. The value of the occupation ratio can be selected according to the shooting object .
  • the first selection area includes a plurality of first selection areas isolated from each other; in another embodiment, the first selection area is set corresponding to the shooting object.
  • the first selection area may be a plurality of first selection areas isolated from each other.
  • the first selection area can be set for multiple contact points.
  • the first selection area should be set as much as possible. Corresponding to the subject to try to ensure that the pixel corresponding to the subject falls within the first selection area.
  • step S3 obtaining the pixel threshold value according to the first average gray scale value includes: taking a half of the first average gray scale value as the pixel threshold value.
  • the acquisition process of the pixel threshold value may take a value of one-half of the first average grayscale value.
  • the pixel threshold can be obtained through clinical experiments. For example, if the threshold needs to cover a subject greater than or equal to 5mm without being lost, a 5mm BR5050 test body membrane is used to place the first selected area, and after exposure to common clinical conditions with this thickness, use Measuring tools to test the grayscale values of the first and second selections respectively. The ratio of the first selection area to the second selection area is the value of the pixel threshold.
  • the target grayscale value is configured according to the selected detector components, and is a configurable constant; according to this formula, the optimal exposure parameters of the main exposure can be obtained.
  • the main exposure parameter includes the exposure amount of the main exposure
  • the preset exposure parameter includes the exposure amount of the pre-exposure.
  • the acquired main exposure parameter includes the exposure amount of the main exposure, which is acquired according to the exposure amount of the pre-exposure.
  • a mask-based automatic exposure control device of the present invention includes:
  • the first processing unit 110 is configured to pre-expose the subject according to preset exposure parameters to obtain an initial image after the pre-exposure;
  • the second processing unit 120 is configured to obtain a preset mask according to the shooting object and the initial image, and perform mask processing on the initial image through the preset mask to obtain a mask image corresponding to the initial image, wherein the preset mask includes A first selection area corresponding to the photographed object and a second selection area set apart from the first selection area;
  • the first calculation unit 130 is configured to calculate the first average gray scale value of all pixels corresponding to the second selection area in the mask image, and obtain the pixel threshold value according to the first average gray scale value;
  • the obtaining unit 140 is configured to obtain the grayscale values of all pixels corresponding to the first selection area in the mask image, and obtain the pixels whose grayscale values are less than the pixel threshold value as effective pixels;
  • the second calculation unit 150 is configured to calculate the second average gray scale value of all effective pixels and use the second average gray scale value as the effective gray scale value;
  • the third processing unit 160 is configured to obtain the main exposure parameter according to the effective grayscale value and the preset exposure parameter.
  • the specific coordination operation process between the units of the mask-based automatic exposure control device can refer to the above-mentioned mask-based automatic exposure control method, which will not be repeated here.
  • an electronic device of the present invention includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program to implement any of the above mask-based automatic exposure control methods.
  • the process described above with reference to the flowchart can be implemented as a computer software program.
  • an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program when the computer program can be downloaded and installed through an electronic device and executed, it executes the above-mentioned functions defined in the method of the embodiment of the present invention.
  • the electronic device in the present invention can be a terminal such as a notebook, a desktop computer, a tablet computer, a smart phone, etc., or a server.
  • a computer storage medium of the present invention has a computer program stored thereon, and when the computer program is executed by a processor, it implements any one of the above mask-based automatic exposure control methods.
  • the above-mentioned computer-readable medium of the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above.
  • Computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein.
  • This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
  • the computer-readable signal medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the above.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.

Landscapes

  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Medical Informatics (AREA)
  • Engineering & Computer Science (AREA)
  • Radiology & Medical Imaging (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Optics & Photonics (AREA)
  • Pathology (AREA)
  • Physics & Mathematics (AREA)
  • High Energy & Nuclear Physics (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Molecular Biology (AREA)
  • Surgery (AREA)
  • Animal Behavior & Ethology (AREA)
  • General Health & Medical Sciences (AREA)
  • Public Health (AREA)
  • Veterinary Medicine (AREA)
  • Studio Devices (AREA)

Abstract

The present invention relates to a masking-based automatic exposure control method and apparatus, a storage medium, and an electronic device, comprising: S1, performing pre-exposure on an image capture object according to a preset exposure parameter so as to acquire an initial image; S2, acquiring a preset mask according to the image capture object and the initial image, and performing masking on the initial image to acquire a masking image, the preset masking comprising a first selection area and a second selection area; S3, calculating first average grayscale values of all pixel points of the second selection area in the masking image, and acquiring a pixel threshold according to the first average grayscale values; S4, acquiring grayscale values of all pixel points of the first selection area in the masking image, and acquiring pixel points the grayscale values of which being less than the pixel threshold as effective pixel points; S5, calculating second average grayscale values of all of the effective pixel points to serve as effective grayscale values; and S6, acquiring a main exposure parameter according to the effective grayscale values and the preset exposure parameter. By implementing the present invention, the optimal exposure parameter can be acquired so as to acquire optimal photographic images.

Description

基于蒙版的自动曝光控制方法、装置、存储介质和电子设备Mask-based automatic exposure control method, device, storage medium and electronic equipment 技术领域Technical field
本发明涉及图像获取技术领域,更具体地说,涉及一种基于蒙版的自动曝光控制方法、装置、存储介质和电子设备。The present invention relates to the technical field of image acquisition, and more specifically, to a mask-based automatic exposure control method, device, storage medium and electronic equipment.
背景技术Background technique
在很多图像获取获取过程中,例如数字乳腺机通常采用计算预曝光整个图像的平均值,以此来获取整个对应的主曝光参数,这样会使更多的没有被被测物体覆盖的区域计算到灰度值当中,使得平均值整体水平偏高,不能精准计算被测物覆盖区域的灰度值,会严重影响主曝光参数的设置,影响最终被测物图像的获取。In many image acquisition processes, for example, digital mammography machines usually calculate the average value of the entire pre-exposure image to obtain the entire corresponding main exposure parameters, which will allow more areas not covered by the object to be measured to be calculated. Among the gray values, the overall average level is too high, and the gray value of the area covered by the test object cannot be accurately calculated, which will seriously affect the setting of the main exposure parameters and affect the acquisition of the final image of the test object.
其次,摄影设备例如数字乳腺机摄影通常可以工作在多种不同的摄影模式下,例如:点压摄影、穿刺摄影、腋压摄影、放大摄影等不同摄影区域的模式,被测物覆盖区域和挡光区域较为灵活。如要精准计算该区域被测物覆盖位置的灰度值,也是比较困难。Secondly, photography equipment such as digital mammography can usually work in a variety of different photography modes, such as: point pressure photography, puncture photography, axillary pressure photography, magnification photography and other modes of different photography areas, the area covered by the measured object and the block. The light area is more flexible. It is also difficult to accurately calculate the gray value of the area covered by the measured object.
技术问题technical problem
本发明要解决的技术问题在于,针对现有技术的上述现有技术的缺陷,提供一种基于蒙版的自动曝光控制方法、装置、存储介质和电子设备。The technical problem to be solved by the present invention is to provide a mask-based automatic exposure control method, device, storage medium and electronic equipment in view of the above-mentioned defects of the prior art.
技术解决方案Technical solutions
本发明解决其技术问题所采用的技术方案是:构造一种基于蒙版的自动曝光控制方法,包括:The technical solution adopted by the present invention to solve its technical problems is to construct a mask-based automatic exposure control method, including:
S1、对拍摄对象按照预设曝光参数进行预曝光,获取预曝光后的初始图像;S1. Perform pre-exposure on the subject according to preset exposure parameters, and obtain an initial image after pre-exposure;
S2、依照所述拍摄对象和所述初始图像获取预设蒙版,通过所述预设蒙版对所述初始图像进行蒙版处理,以获取所述初始图像对应的蒙版图像,其中,所述预设蒙版包括与所述拍摄对象对应的第一选区和与所述第一选区间隔设置的第二选区;S2. Obtain a preset mask according to the subject and the initial image, and perform mask processing on the initial image through the preset mask to obtain a mask image corresponding to the initial image, wherein The preset mask includes a first selection area corresponding to the shooting object and a second selection area set apart from the first selection area;
S3、计算所述蒙版图像中所述第二选区所对应的所有像素点的第一平均灰阶值,并根据所述第一平均灰阶值获取像素阈值;S3. Calculate the first average grayscale value of all pixels corresponding to the second selection area in the mask image, and obtain a pixel threshold value according to the first average grayscale value;
S4、获取所述蒙版图像中所述第一选区对应的所有像素点的灰阶值,并获取所述灰阶值小于所述像素阈值的像素点为有效像素点;S4. Obtain grayscale values of all pixels corresponding to the first selection area in the mask image, and obtain pixels with grayscale values less than the pixel threshold as effective pixels;
S5、计算所有有效像素点的第二平均灰阶值并将所述第二平均灰阶值作为有效灰阶值;S5. Calculate the second average grayscale value of all effective pixels and use the second average grayscale value as the effective grayscale value;
S6、根据所述有效灰阶值和所述预设曝光参数获取主曝光参数。S6. Obtain a main exposure parameter according to the effective grayscale value and the preset exposure parameter.
优选地,本发明的一种基于蒙版的自动曝光控制方法还包括:Preferably, a mask-based automatic exposure control method of the present invention further includes:
S41、获取所述有效像素点在所述第一选区中的占有比例,并确认所述占有比例是否满足预设条件,若是,则执行所述步骤S5,若否,则执行步骤S42;S41. Obtain the occupation ratio of the effective pixels in the first selected area, and confirm whether the occupation ratio meets a preset condition, if yes, execute the step S5, if not, execute the step S42;
S42、获取所述蒙版图像中所述第一选区对应的所有像素点的第三平均灰阶值为所述有效灰阶值,并执行所述步骤S6。S42. Obtain a third average grayscale value of all pixels corresponding to the first selected area in the mask image, and execute the step S6.
优选地,在所述步骤S41中,所述占有比例为大于或等于八分之一。Preferably, in the step S41, the occupation ratio is greater than or equal to one-eighth.
优选地,在所述步骤S2中,Preferably, in the step S2,
所述第一选区包括多个相互隔离的第一选区;和/或The first selection area includes a plurality of first selection areas that are isolated from each other; and/or
所述第一选区与所述拍摄对象对应设置。The first selection area is set corresponding to the shooting object.
优选地,在所述步骤S3中,所述根据所述第一平均灰阶值获取像素阈值包括:以所述第一平均灰阶值的二分之一值为所述像素阈值。Preferably, in the step S3, the obtaining the pixel threshold value according to the first average gray scale value includes: taking a half of the first average gray scale value as the pixel threshold value.
优选地,在所述步骤S6中,所述根据所述有效灰阶值和所述预设曝光参数获取主曝光参数包括采用以下公式获取主曝光参数:Preferably, in the step S6, the obtaining the main exposure parameter according to the effective grayscale value and the preset exposure parameter includes obtaining the main exposure parameter by using the following formula:
A=(B/C)*D;A=(B/C)*D;
其中A为所述主曝光参数,B为目标灰阶值,C为所述有效灰阶值,D为所述预设曝光参数。Wherein A is the main exposure parameter, B is the target grayscale value, C is the effective grayscale value, and D is the preset exposure parameter.
优选地,所述主曝光参数包括主曝光的曝光量,所述预设曝光参数包括预曝光的曝光量。 Preferably, the main exposure parameter includes the exposure amount of the main exposure, and the preset exposure parameter includes the exposure amount of the pre-exposure.
本发明还构造一种基于蒙版的自动曝光控制装置,包括:The present invention also constructs a mask-based automatic exposure control device, including:
第一处理单元,用于对拍摄对象按照预设曝光参数进行预曝光,获取预曝光后的初始图像;The first processing unit is configured to perform pre-exposure on the subject according to preset exposure parameters, and obtain an initial image after pre-exposure;
第二处理单元,用于依照所述拍摄对象和所述初始图像获取预设蒙版,通过所述预设蒙版对所述初始图像进行蒙版处理,以获取所述初始图像对应的蒙版图像,其中,所述预设蒙版包括与所述拍摄对象对应的第一选区和与所述第一选区间隔设置的第二选区;The second processing unit is configured to obtain a preset mask according to the photographic subject and the initial image, and perform mask processing on the initial image through the preset mask to obtain a mask corresponding to the initial image An image, wherein the preset mask includes a first selection area corresponding to the shooting object and a second selection area set apart from the first selection area;
第一计算单元,用于计算所述蒙版图像中所述第二选区所对应的所有像素点的第一平均灰阶值,并根据所述第一平均灰阶值获取像素阈值;A first calculation unit, configured to calculate a first average gray scale value of all pixels corresponding to the second selection area in the mask image, and obtain a pixel threshold value according to the first average gray scale value;
获取单元,用于获取所述蒙版图像中所述第一选区对应的所有像素点的灰阶值,并获取所述灰阶值小于所述像素阈值的像素点为有效像素点;An acquiring unit, configured to acquire grayscale values of all pixels corresponding to the first selection area in the mask image, and acquire pixels whose grayscale values are less than the pixel threshold as effective pixels;
第二计算单元,用于计算所有有效像素点的第二平均灰阶值并将所述第二平均灰阶值作为有效灰阶值;The second calculation unit is configured to calculate the second average gray scale value of all effective pixels and use the second average gray scale value as the effective gray scale value;
第三处理单元,用于根据所述有效灰阶值和所述预设曝光参数获取主曝光参数。The third processing unit is configured to obtain the main exposure parameter according to the effective grayscale value and the preset exposure parameter.
本发明还构造一种计算机存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上面任意一项所述的基于蒙版的自动曝光控制方法。The present invention also constructs a computer storage medium on which a computer program is stored, and when the computer program is executed by a processor, the automatic exposure control method based on a mask as described in any one of the above is realized.
本发明还构造一种电子设备,包括存储器和处理器;The present invention also constructs an electronic device, including a memory and a processor;
所述存储器用于存储计算机程序;The memory is used to store a computer program;
所述处理器用于执行所述计算机程序实现如上面任一项所述的基于蒙版的自动曝光控制方法。The processor is configured to execute the computer program to implement the mask-based automatic exposure control method as described in any one of the above.
有益效果Beneficial effect
实施本发明的一种基于蒙版的自动曝光控制方法、装置、存储介质和电子设备,具有以下有益效果:能够获取最佳的曝光参数以获取最佳的摄影图像。A mask-based automatic exposure control method, device, storage medium, and electronic equipment implemented in the present invention have the following beneficial effects: the best exposure parameter can be obtained to obtain the best photographic image.
附图说明Description of the drawings
下面将结合附图及实施例对本发明作进一步说明,附图中:The present invention will be further described below in conjunction with the accompanying drawings and embodiments. In the accompanying drawings:
图1是本发明基于蒙版的自动曝光控制方法一实施例的程序流程图;FIG. 1 is a program flowchart of an embodiment of the mask-based automatic exposure control method of the present invention;
图2是本发明基于蒙版的自动曝光控制方法另一实施例的程序流程图;2 is a program flowchart of another embodiment of the mask-based automatic exposure control method of the present invention;
图3是本发明基于蒙版的自动曝光控制装置一实施例的逻辑框图。Fig. 3 is a logical block diagram of an embodiment of the mask-based automatic exposure control device of the present invention.
本发明的实施方式Embodiments of the present invention
为了对本发明的技术特征、目的和效果有更加清楚的理解,现对照附图详细说明本发明的具体实施方式。In order to have a clearer understanding of the technical features, objectives and effects of the present invention, the specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
如图1所示,在本发明的基于蒙版的自动曝光控制方法一实施例中,包括:As shown in FIG. 1, in an embodiment of the mask-based automatic exposure control method of the present invention, it includes:
S1、对拍摄对象按照预设曝光参数进行预曝光,获取预曝光后的初始图像;具体的,以数字乳腺机为例,在对被测物进行图像拍摄时,待被测物位置正确,状态准备完成时,可以先根据被测物的特征参数设置对被测物进行摄影的预设曝光参数,通过预设曝光参数获取被测物的预曝光后的初始图像。在这里获取被测物的预设曝光参数可以通过进入自动曝光模式,以通过全自动曝光模式获取对应的预设曝光参数,通过该预设曝光参数进行全自动的预曝光。在一些实施中,预设曝光参数也可以根据经验值进行设置,其在经验值的设置时,也可以同时将被测物种类和测试位置作为其经验值的设置依据。S1. Pre-exposure the subject according to preset exposure parameters to obtain the initial image after pre-exposure; specifically, take a digital mammography machine as an example. When the subject is taken, the position of the subject is correct and the state is When the preparation is complete, you can first set the preset exposure parameters for photographing the test object according to the characteristic parameters of the test object, and obtain the pre-exposed initial image of the test object through the preset exposure parameters. Here, the preset exposure parameters of the test object can be obtained by entering the automatic exposure mode to obtain the corresponding preset exposure parameters through the fully automatic exposure mode, and perform fully automatic pre-exposure through the preset exposure parameters. In some implementations, the preset exposure parameters can also be set according to empirical values. When setting the empirical values, the type of the tested object and the test position can also be used as the basis for setting the empirical values at the same time.
S2、依照拍摄对象和初始图像获取预设蒙版,通过预设蒙版对初始图像进行蒙版处理,以获取初始图像对应的蒙版图像,其中,预设蒙版包括与拍摄对象对应的第一选区和与第一选区间隔设置的第二选区;具体的,在获取初始图像后,根据获取到的初始图像和拍摄对象设置对应的预设蒙版,该蒙版可以为与初始图像为1:1比例像素大小。并通过该预设蒙版对初始图像进行蒙版处理,这样获取到与初始图像对应的蒙版图像,形成的蒙版图像中,其包括与拍摄对象对应的第一选区,以及与第一选区间隔设置的第二选区,其中为了保证第一选区和第二选区能够较好的区分开来,可以将第二选区设置的离第一选区较远。在一实施例中,可以将第二选区设置在远离第一选区的靠近初始图像的边缘的位置。预设蒙版的设置可以根据拍摄对象进行设置,例如,在进行乳腺摄影时,其可以根据地域乳腺特征进行预蒙版,即根据拍摄对象的大小选择合适的预设蒙版,以使拍摄对象尽量的落在第一选区内。在摄影设备确定时,其拍摄对象也为确定的,例如当摄影设备为数字乳腺机时,其摄影对象即可以理解为进行乳腺摄影,那么可以根据乳腺的物理特征设置不同乳腺对应的预设蒙片。同时预设蒙片的设置其也与初始图像对应,这里可以理解初始图像的获取跟摄影设备的摄影模式相对应,例如,数字乳腺机的摄影模式包括点压摄影、穿刺摄影、腋压摄影、放大摄影等不同摄影模式,那么得到的初始图像也根据该摄影模式的不同,也不同,在进行预设蒙版的选择时,要充分考虑的得到的实际的初始图像,或者说与初始图像对定摄影模式,以选择合适的预设蒙版。在此处可以理解,得到的蒙版图像实际上是包含三个区域,其中第一选区和第二选区为裸露选区,剔除第一选区和第二选区即为蒙片选区,该蒙片选区则认为为背景,在后面的处理过程中,对该蒙片选区不做处理。S2. Obtain a preset mask according to the shooting object and the initial image, and perform mask processing on the initial image through the preset mask to obtain a mask image corresponding to the initial image, where the preset mask includes a first mask corresponding to the shooting object. A selection area and a second selection area set apart from the first selection area; specifically, after the initial image is acquired, a corresponding preset mask is set according to the acquired initial image and the shooting object, and the mask may be 1 with the initial image. :1 ratio pixel size. And mask the initial image through the preset mask, so that the mask image corresponding to the initial image is obtained, and the formed mask image includes the first selection area corresponding to the shooting object and the first selection area In order to ensure that the first selection area can be better distinguished from the second selection area, the second selection area can be set farther from the first selection area. In an embodiment, the second selection area may be set at a position away from the first selection area and close to the edge of the initial image. The setting of the preset mask can be set according to the subject. For example, when performing mammography, it can be pre-masked according to the regional breast characteristics, that is, according to the size of the subject, the appropriate preset mask can be selected to make the subject Try to fall within the first constituency. When the photographing equipment is determined, the photographing object is also certain. For example, when the photographing equipment is a digital mammography machine, the photographic object can be understood as performing mammography. Then, the preset masks corresponding to different breasts can be set according to the physical characteristics of the breasts. sheet. At the same time, the preset mask settings also correspond to the initial image. It can be understood that the acquisition of the initial image corresponds to the photography mode of the photography equipment. For example, the photography modes of the digital breast machine include point pressure photography, puncture photography, axillary pressure photography, For different photography modes such as magnification photography, the initial image obtained is also different according to the photography mode. When selecting the preset mask, you must fully consider the actual initial image obtained, or the comparison with the initial image. Set the photography mode to select the appropriate preset mask. It can be understood here that the obtained mask image actually contains three regions, of which the first and second selections are bare selections. Excluding the first and second selections is the mask selection. The mask selection is Think of it as the background, and in the subsequent processing, the mask selection will not be processed.
S3、计算蒙版图像中第二选区所对应的所有像素点的第一平均灰阶值,并根据第一平均灰阶值获取像素阈值;具体的,第二选区与第一选区间隔设置,第一选区对应被测对象,则第二选区可以理解为与被测对象有区别的区域。此时,可以获取第二选区中所有像素点的平均值即第一平均灰阶值,然后根据该第一平均灰阶值设置一个像素阈值。为了避免坏像素点造成的影响,第二选区至少10个像素.S3. Calculate the first average grayscale value of all pixels corresponding to the second selection area in the mask image, and obtain the pixel threshold value according to the first average grayscale value; specifically, the second selection area is set at intervals from the first selection area, and One selection area corresponds to the measured object, and the second selection area can be understood as a different area from the measured object. At this time, the average value of all pixels in the second selected area, that is, the first average grayscale value, can be obtained, and then a pixel threshold value can be set according to the first average grayscale value. In order to avoid the impact of bad pixels, the second selection area has at least 10 pixels.
S4、获取蒙版图像中第一选区对应的所有像素点的灰阶值,并获取灰阶值小于像素阈值的像素点为有效像素点;具体的,对,蒙版图像中的第一选区中像素点进行处理,获取第一选区中所有像素点的灰阶值,将每一个像素点的灰阶值分别与像素阈值进行比较,将灰阶值大于或等于像素阈值的像素点丢掉,只获取灰阶值小于像素阈值的像素点,并将该像素点对应为有效像素点。以此,获取第一选区中的所有有效像素点。S4. Obtain the grayscale values of all pixels corresponding to the first selected area in the mask image, and obtain the pixels whose grayscale values are less than the pixel threshold value as effective pixels; specifically, yes, in the first selected area in the mask image Pixels are processed to obtain the grayscale value of all pixels in the first selection area, and the grayscale value of each pixel is compared with the pixel threshold respectively, and the pixels whose grayscale value is greater than or equal to the pixel threshold are discarded, and only the A pixel with a grayscale value less than the pixel threshold is corresponding to the effective pixel. In this way, all the effective pixels in the first selection area are obtained.
S5、计算所有有效像素点的第二平均灰阶值并将第二平均灰阶值作为有效灰阶值;具体的,计算上面获取的所有有效像素点的平均灰阶值即第二平均灰阶值,并且将该第二平均灰阶值作为有效灰阶值。S5. Calculate the second average gray scale value of all effective pixels and use the second average gray scale value as the effective gray scale value; specifically, calculate the average gray scale value of all effective pixels obtained above, that is, the second average gray scale Value, and use the second average grayscale value as the effective grayscale value.
S6、根据有效灰阶值和预设曝光参数获取主曝光参数。具体的,获取到有效灰阶值后,根据与该有效灰阶值对应的预设曝光参数既可以获取到主曝光参数,以通过设置主曝光参数进行主曝光,获取最佳的摄影图像。S6. Obtain the main exposure parameter according to the effective grayscale value and the preset exposure parameter. Specifically, after the effective grayscale value is obtained, the main exposure parameter can be obtained according to the preset exposure parameter corresponding to the effective grayscale value, so as to perform main exposure by setting the main exposure parameter to obtain the best photographic image.
如图2所示,在本发明的基于蒙版的自动曝光控制方法另一实施例中,还包括:As shown in FIG. 2, in another embodiment of the mask-based automatic exposure control method of the present invention, it further includes:
S41、获取有效像素点在第一选区中的占有比例,并确认占有比例是否满足预设条件,若是,则执行步骤S5,若否,则执行步骤S42; S41. Obtain the occupation ratio of the effective pixels in the first selection area, and confirm whether the occupation ratio meets the preset condition, if yes, execute step S5, if not, execute step S42;
S42、获取蒙版图像中第一选区对应的所有像素点的第三平均灰阶值为有效灰阶值,并执行步骤S6。S42: Obtain the third average grayscale value of all pixels corresponding to the first selected area in the mask image as an effective grayscale value, and execute step S6.
具体的,针对拍摄对象可能全部遮挡第二选区的情况,在获取第一选区的所有有效像素点后,获取所有的有效像素点数量在第一选区的所有像素点中的占有比例,并对该占有比例进行判断,在该占有比例满足预设条件时,则可以判定此时第二选区没有被拍摄对象全部遮挡,蒙版图像中第二选区对应的像素点实际上为拍摄对象对应的像素点,此时执行步骤S5,即只对第一选区中的有效像素点进行处理。在该占有比例不满足预设条件时,可以判定此时第二选区被拍摄对象全部遮挡,蒙版图像中第二选区对应的像素点实际上有部分为拍摄对象对应的像素点,此时可以判定第一选区中对应的像素点即可以理解为全部为拍摄对象的像素点,此时即可以将第一选区对应的所有像素点进行计算获取其平均灰阶值即第三平均灰阶值,将该第三平均灰阶值定义为有效灰阶值,根据该有效灰阶值执行步骤S6,获取对应的主曝光参数。Specifically, for the situation that the subject may completely block the second selection area, after obtaining all the effective pixels in the first selection area, obtain the proportion of all effective pixels in all the pixels in the first selection area, and The occupancy ratio is judged. When the occupancy ratio meets the preset conditions, it can be determined that the second selection area is not completely obscured by the subject at this time, and the pixels corresponding to the second selection area in the mask image are actually the pixels corresponding to the subject At this time, step S5 is executed, that is, only the effective pixels in the first selection area are processed. When the occupancy ratio does not meet the preset conditions, it can be determined that the second selection area is completely occluded by the subject at this time, and the pixels corresponding to the second selection area in the mask image are actually part of the pixels corresponding to the subject. Determining the corresponding pixels in the first selection area can be understood as all the pixels of the shooting object. At this time, all pixels corresponding to the first selection area can be calculated to obtain the average gray scale value, that is, the third average gray scale value. The third average grayscale value is defined as the effective grayscale value, and step S6 is executed according to the effective grayscale value to obtain the corresponding main exposure parameter.
在一实施例中,在步骤S41中,占有比例为大于或等于八分之一。具体的,第一选区的大小,会影响到拍摄对象的所遮挡的占比。对占有比例进行判断,占有比例满足预设条件可以设置为有效像素点数量大于或等于第一选区的所有像素点的数量的八分之一,该占有比例的值的选取可以根据拍摄对象进行选取。In one embodiment, in step S41, the occupation ratio is greater than or equal to one-eighth. Specifically, the size of the first selection area will affect the proportion of the object that is occluded. To judge the occupation ratio, the occupation ratio can be set to be greater than or equal to one-eighth of the number of all pixels in the first selection area when the occupation ratio meets the preset condition. The value of the occupation ratio can be selected according to the shooting object .
一实施例中,在步骤S2中,第一选区包括多个相互隔离的第一选区;在另一实施例中,第一选区与拍摄对象对应设置。具体的,根据拍摄对象的拍摄方式,其第一选区可以为多个相互隔离的第一选区。例如,在数字乳腺机的摄影模式为放大点压摄影中,其可能获取多个接触点的图像,此时,可以对针对多个接触点分别设置第一选区此外,第一选区的设置尽量与拍摄对象对应,以尽量保证拍摄对象对应的像素点落在第一选区内。In one embodiment, in step S2, the first selection area includes a plurality of first selection areas isolated from each other; in another embodiment, the first selection area is set corresponding to the shooting object. Specifically, according to the shooting mode of the subject, the first selection area may be a plurality of first selection areas isolated from each other. For example, in the digital mammography machine's photography mode is zoomed point-pressure photography, it may acquire images of multiple contact points. In this case, the first selection area can be set for multiple contact points. In addition, the first selection area should be set as much as possible. Corresponding to the subject to try to ensure that the pixel corresponding to the subject falls within the first selection area.
一实施例中,在步骤S3中,根据第一平均灰阶值获取像素阈值包括:以第一平均灰阶值的二分之一值为像素阈值。具体的,像素阈值的获取过程可以取值第一平均灰阶值的二分之一值。像素阈值可以通过临床实验获得,比如,该阈值需要涵盖大于或等于5mm的拍摄对象不被丢掉,则使用一块5mm 的BR5050测试体膜放置第一选区,使用该厚度下临床常用条件曝光后,使用测量工具,分别测试第一选区和第二选区的灰阶值。第一选区与第二选区的比,即是像素阈值的取值。In one embodiment, in step S3, obtaining the pixel threshold value according to the first average gray scale value includes: taking a half of the first average gray scale value as the pixel threshold value. Specifically, the acquisition process of the pixel threshold value may take a value of one-half of the first average grayscale value. The pixel threshold can be obtained through clinical experiments. For example, if the threshold needs to cover a subject greater than or equal to 5mm without being lost, a 5mm BR5050 test body membrane is used to place the first selected area, and after exposure to common clinical conditions with this thickness, use Measuring tools to test the grayscale values of the first and second selections respectively. The ratio of the first selection area to the second selection area is the value of the pixel threshold.
一实施例中,在步骤S6中,根据有效灰阶值和预设曝光参数获取主曝光参数包括采用以下公式获取主曝光参数:A=(B/C)*D;其中A为主曝光参数,B为目标灰阶值,C为有效灰阶值,D为预设曝光参数。具体的,目标灰阶值是根据选用的探测器部件实现配置好的,是一个可配置的常量;根据该公式既可以获取到主曝光的最佳曝光参数。In one embodiment, in step S6, obtaining the main exposure parameter according to the effective grayscale value and the preset exposure parameter includes obtaining the main exposure parameter using the following formula: A=(B/C)*D; where A is the main exposure parameter, B is the target grayscale value, C is the effective grayscale value, and D is the preset exposure parameter. Specifically, the target grayscale value is configured according to the selected detector components, and is a configurable constant; according to this formula, the optimal exposure parameters of the main exposure can be obtained.
进一步的,主曝光参数包括主曝光的曝光量,预设曝光参数包括预曝光的曝光量。具体的,在上面的基础上,其获取的主曝光参数包括主曝光的曝光量,其根据预曝光的曝光量获取。Further, the main exposure parameter includes the exposure amount of the main exposure, and the preset exposure parameter includes the exposure amount of the pre-exposure. Specifically, on the basis of the above, the acquired main exposure parameter includes the exposure amount of the main exposure, which is acquired according to the exposure amount of the pre-exposure.
另,本发明的一种基于蒙版的自动曝光控制装置,包括:In addition, a mask-based automatic exposure control device of the present invention includes:
第一处理单元110,用于对拍摄对象按照预设曝光参数进行预曝光,获取预曝光后的初始图像;The first processing unit 110 is configured to pre-expose the subject according to preset exposure parameters to obtain an initial image after the pre-exposure;
第二处理单元120,用于依照拍摄对象和初始图像获取预设蒙版,通过预设蒙版对初始图像进行蒙版处理,以获取初始图像对应的蒙版图像,其中,预设蒙版包括与拍摄对象对应的第一选区和与第一选区间隔设置的第二选区;The second processing unit 120 is configured to obtain a preset mask according to the shooting object and the initial image, and perform mask processing on the initial image through the preset mask to obtain a mask image corresponding to the initial image, wherein the preset mask includes A first selection area corresponding to the photographed object and a second selection area set apart from the first selection area;
第一计算单元130,用于计算蒙版图像中第二选区所对应的所有像素点的第一平均灰阶值,并根据第一平均灰阶值获取像素阈值;The first calculation unit 130 is configured to calculate the first average gray scale value of all pixels corresponding to the second selection area in the mask image, and obtain the pixel threshold value according to the first average gray scale value;
获取单元140,用于获取蒙版图像中第一选区对应的所有像素点的灰阶值,并获取灰阶值小于像素阈值的像素点为有效像素点;The obtaining unit 140 is configured to obtain the grayscale values of all pixels corresponding to the first selection area in the mask image, and obtain the pixels whose grayscale values are less than the pixel threshold value as effective pixels;
第二计算单元150,用于计算所有有效像素点的第二平均灰阶值并将第二平均灰阶值作为有效灰阶值;The second calculation unit 150 is configured to calculate the second average gray scale value of all effective pixels and use the second average gray scale value as the effective gray scale value;
第三处理单元160,用于根据有效灰阶值和预设曝光参数获取主曝光参数。The third processing unit 160 is configured to obtain the main exposure parameter according to the effective grayscale value and the preset exposure parameter.
具体的,这里的基于蒙版的自动曝光控制装置各单元之间具体的配合操作过程具体可以参照上述基于蒙版的自动曝光控制方法,这里不再赘述。Specifically, the specific coordination operation process between the units of the mask-based automatic exposure control device can refer to the above-mentioned mask-based automatic exposure control method, which will not be repeated here.
另,本发明的一种电子设备,包括存储器和处理器;存储器用于存储计算机程序;处理器用于执行计算机程序实现如上面任意的基于蒙版的自动曝光控制方法。具体的,根据本发明的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本发明的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过电子设备下载和安装并且执行时,执行本发明实施例的方法中限定的上述功能。本发明中的电子设备可为笔记本、台式机、平板电脑、智能手机等终端,也可为服务器。In addition, an electronic device of the present invention includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program to implement any of the above mask-based automatic exposure control methods. Specifically, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, when the computer program can be downloaded and installed through an electronic device and executed, it executes the above-mentioned functions defined in the method of the embodiment of the present invention. The electronic device in the present invention can be a terminal such as a notebook, a desktop computer, a tablet computer, a smart phone, etc., or a server.
另,本发明的一种计算机存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上面任意一项的基于蒙版的自动曝光控制方法。具体的,需要说明的是,本发明上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本发明中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本发明中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。In addition, a computer storage medium of the present invention has a computer program stored thereon, and when the computer program is executed by a processor, it implements any one of the above mask-based automatic exposure control methods. Specifically, it should be noted that the above-mentioned computer-readable medium of the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium. The computer-readable signal medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device . The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the above.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.
 可以理解的,以上实施例仅表达了本发明的优选实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明专利范围的限制;应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,可以对上述技术特点进行自由组合,还可以做出若干变形和改进,这些都属于本发明的保护范围;因此,凡跟本发明权利要求范围所做的等同变换与修饰,均应属于本发明权利要求的涵盖范围。It is understandable that the above examples only express the preferred embodiments of the present invention, and the descriptions are more specific and detailed, but they should not be construed as limiting the scope of the patent of the present invention; it should be pointed out that for those of ordinary skill in the art In other words, without departing from the concept of the present invention, the above technical features can be freely combined, and several modifications and improvements can be made. These all belong to the scope of protection of the present invention; therefore, everything that follows the scope of the claims of the present invention All equivalent changes and modifications shall fall within the scope of the claims of the present invention.

Claims (10)

  1. 一种基于蒙版的自动曝光控制方法,其特征在于,包括:A mask-based automatic exposure control method is characterized in that it includes:
    S1、对拍摄对象按照预设曝光参数进行预曝光,获取预曝光后的初始图像;S1. Perform pre-exposure on the subject according to preset exposure parameters, and obtain an initial image after pre-exposure;
    S2、依照所述拍摄对象和所述初始图像获取预设蒙版,通过所述预设蒙版对所述初始图像进行蒙版处理,以获取所述初始图像对应的蒙版图像,其中,所述预设蒙版包括与所述拍摄对象对应的第一选区和与所述第一选区间隔设置的第二选区;S2. Obtain a preset mask according to the subject and the initial image, and perform mask processing on the initial image through the preset mask to obtain a mask image corresponding to the initial image, wherein The preset mask includes a first selection area corresponding to the shooting object and a second selection area set apart from the first selection area;
    S3、计算所述蒙版图像中所述第二选区所对应的所有像素点的第一平均灰阶值,并根据所述第一平均灰阶值获取像素阈值;S3. Calculate the first average grayscale value of all pixels corresponding to the second selection area in the mask image, and obtain a pixel threshold value according to the first average grayscale value;
    S4、获取所述蒙版图像中所述第一选区对应的所有像素点的灰阶值,并获取所述灰阶值小于所述像素阈值的像素点为有效像素点;S4. Obtain grayscale values of all pixels corresponding to the first selection area in the mask image, and obtain pixels with grayscale values less than the pixel threshold as effective pixels;
    S5、计算所有有效像素点的第二平均灰阶值并将所述第二平均灰阶值作为有效灰阶值;S5. Calculate the second average grayscale value of all effective pixels and use the second average grayscale value as the effective grayscale value;
    S6、根据所述有效灰阶值和所述预设曝光参数获取主曝光参数。S6. Obtain a main exposure parameter according to the effective grayscale value and the preset exposure parameter.
  2. 根据权利要求1所述的基于蒙版的自动曝光控制方法,其特征在于,所述方法还包括:The mask-based automatic exposure control method according to claim 1, wherein the method further comprises:
    S41、获取所述有效像素点在所述第一选区中的占有比例,并确认所述占有比例是否满足预设条件,若是,则执行所述步骤S5,若否,则执行步骤S42;S41. Obtain the occupation ratio of the effective pixels in the first selection area, and confirm whether the occupation ratio meets a preset condition, if yes, execute the step S5, if not, execute the step S42;
    S42、获取所述蒙版图像中所述第一选区对应的所有像素点的第三平均灰阶值为所述有效灰阶值,并执行所述步骤S6。S42. Obtain a third average grayscale value of all pixels corresponding to the first selected area in the mask image, and execute the step S6.
  3. 根据权利要求2所述的基于蒙版的自动曝光控制方法,其特征在于,在所述步骤S41中,所述占有比例为大于或等于八分之一。The mask-based automatic exposure control method according to claim 2, wherein in the step S41, the occupation ratio is greater than or equal to one-eighth.
  4. 根据权利要求1所述的基于蒙版的自动曝光控制方法,其特征在于,在所述步骤S2中,The mask-based automatic exposure control method according to claim 1, wherein in the step S2,
    所述第一选区包括多个相互隔离的第一选区;和/或The first selection area includes a plurality of first selection areas that are isolated from each other; and/or
    所述第一选区与所述拍摄对象对应设置。The first selection area is set corresponding to the shooting object.
  5. 根据权利要求1所述的基于蒙版的自动曝光控制方法,其特征在于,在所述步骤S3中,所述根据所述第一平均灰阶值获取像素阈值包括:以所述第一平均灰阶值的二分之一值为所述像素阈值。The mask-based automatic exposure control method according to claim 1, wherein in the step S3, the obtaining the pixel threshold value according to the first average gray level value comprises: using the first average gray level value One half of the order value is the pixel threshold value.
  6. 根据权利要求1所述的基于蒙版的自动曝光控制方法,其特征在于,在所述步骤S6中,所述根据所述有效灰阶值和所述预设曝光参数获取主曝光参数包括采用以下公式获取主曝光参数:The mask-based automatic exposure control method according to claim 1, wherein, in the step S6, the obtaining the main exposure parameter according to the effective grayscale value and the preset exposure parameter comprises using the following Formula to obtain the main exposure parameters:
    A=(B/C)*D;A=(B/C)*D;
    其中A为所述主曝光参数,B为目标灰阶值,C为所述有效灰阶值,D为所述预设曝光参数。Wherein A is the main exposure parameter, B is the target grayscale value, C is the effective grayscale value, and D is the preset exposure parameter.
  7. 根据权利要求6所述的基于蒙版的自动曝光控制方法,其特征在于,所述主曝光参数包括主曝光的曝光量,所述预设曝光参数包括预曝光的曝光量。 The mask-based automatic exposure control method according to claim 6, wherein the main exposure parameter includes the exposure amount of the main exposure, and the preset exposure parameter includes the exposure amount of the pre-exposure.
  8. 一种基于蒙版的自动曝光控制装置,其特征在于,包括:A mask-based automatic exposure control device is characterized in that it comprises:
    第一处理单元,用于对拍摄对象按照预设曝光参数进行预曝光,获取预曝光后的初始图像;The first processing unit is configured to perform pre-exposure on the subject according to preset exposure parameters, and obtain an initial image after pre-exposure;
    第二处理单元,用于依照所述拍摄对象和所述初始图像获取预设蒙版,通过所述预设蒙版对所述初始图像进行蒙版处理,以获取所述初始图像对应的蒙版图像,其中,所述预设蒙版包括与所述拍摄对象对应的第一选区和与所述第一选区间隔设置的第二选区;The second processing unit is configured to obtain a preset mask according to the photographic object and the initial image, and perform mask processing on the initial image through the preset mask to obtain a mask corresponding to the initial image An image, wherein the preset mask includes a first selection area corresponding to the shooting object and a second selection area set apart from the first selection area;
    第一计算单元,用于计算所述蒙版图像中所述第二选区所对应的所有像素点的第一平均灰阶值,并根据所述第一平均灰阶值获取像素阈值;A first calculation unit, configured to calculate a first average gray scale value of all pixels corresponding to the second selection area in the mask image, and obtain a pixel threshold value according to the first average gray scale value;
    获取单元,用于获取所述蒙版图像中所述第一选区对应的所有像素点的灰阶值,并获取所述灰阶值小于所述像素阈值的像素点为有效像素点;An acquiring unit, configured to acquire grayscale values of all pixels corresponding to the first selection area in the mask image, and acquire pixels with grayscale values less than the pixel threshold as effective pixels;
    第二计算单元,用于计算所有有效像素点的第二平均灰阶值并将所述第二平均灰阶值作为有效灰阶值;The second calculation unit is configured to calculate the second average gray scale value of all effective pixels and use the second average gray scale value as the effective gray scale value;
    第三处理单元,用于根据所述有效灰阶值和所述预设曝光参数获取主曝光参数。The third processing unit is configured to obtain the main exposure parameter according to the effective grayscale value and the preset exposure parameter.
  9. 一种计算机存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-7中任意一项所述的基于蒙版的自动曝光控制方法。A computer storage medium with a computer program stored thereon, wherein the computer program implements the mask-based automatic exposure control method according to any one of claims 1-7 when the computer program is executed by a processor.
  10. 一种电子设备,其特征在于,包括存储器和处理器;An electronic device, characterized in that it includes a memory and a processor;
    所述存储器用于存储计算机程序;The memory is used to store a computer program;
    所述处理器用于执行所述计算机程序实现如权利要求1-7任一项所述的基于蒙版的自动曝光控制方法。The processor is configured to execute the computer program to implement the mask-based automatic exposure control method according to any one of claims 1-7.
     To
PCT/CN2019/124081 2019-12-09 2019-12-09 Masking-based automatic exposure control method and apparatus, storage medium, and electronic device WO2021114039A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/124081 WO2021114039A1 (en) 2019-12-09 2019-12-09 Masking-based automatic exposure control method and apparatus, storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/124081 WO2021114039A1 (en) 2019-12-09 2019-12-09 Masking-based automatic exposure control method and apparatus, storage medium, and electronic device

Publications (1)

Publication Number Publication Date
WO2021114039A1 true WO2021114039A1 (en) 2021-06-17

Family

ID=76329292

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/124081 WO2021114039A1 (en) 2019-12-09 2019-12-09 Masking-based automatic exposure control method and apparatus, storage medium, and electronic device

Country Status (1)

Country Link
WO (1) WO2021114039A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113409378A (en) * 2021-06-28 2021-09-17 北京百度网讯科技有限公司 Image processing method, device and equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103705258A (en) * 2013-11-19 2014-04-09 江苏康众数字医疗设备有限公司 Automatic exposure control method and automatic exposure control device for imaging device
CN103886576A (en) * 2013-11-22 2014-06-25 沈阳东软医疗系统有限公司 Glandular tissue characteristic gray scale detection method and device
CN104146724A (en) * 2014-08-29 2014-11-19 重庆邮电大学 Digital X-ray machine automatic exposure control method and device
US20150237248A1 (en) * 2014-02-20 2015-08-20 Asustek Computer Inc. Image processing method and image processing device
CN105447829A (en) * 2015-11-25 2016-03-30 小米科技有限责任公司 Image processing method and device
CN107569248A (en) * 2017-08-07 2018-01-12 沈阳东软医疗系统有限公司 The exposure method and mammary gland machine equipment of a kind of mammary gland machine equipment
CN109587407A (en) * 2018-12-14 2019-04-05 广州华多网络科技有限公司 Exposure amount adjustment method, device and the computer equipment of image taking
CN109745060A (en) * 2017-11-06 2019-05-14 上海西门子医疗器械有限公司 Automatic exposure control method, storage medium and the Medical Devices of X-ray imaging

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103705258A (en) * 2013-11-19 2014-04-09 江苏康众数字医疗设备有限公司 Automatic exposure control method and automatic exposure control device for imaging device
CN103886576A (en) * 2013-11-22 2014-06-25 沈阳东软医疗系统有限公司 Glandular tissue characteristic gray scale detection method and device
US20150237248A1 (en) * 2014-02-20 2015-08-20 Asustek Computer Inc. Image processing method and image processing device
CN104146724A (en) * 2014-08-29 2014-11-19 重庆邮电大学 Digital X-ray machine automatic exposure control method and device
CN105447829A (en) * 2015-11-25 2016-03-30 小米科技有限责任公司 Image processing method and device
CN107569248A (en) * 2017-08-07 2018-01-12 沈阳东软医疗系统有限公司 The exposure method and mammary gland machine equipment of a kind of mammary gland machine equipment
CN109745060A (en) * 2017-11-06 2019-05-14 上海西门子医疗器械有限公司 Automatic exposure control method, storage medium and the Medical Devices of X-ray imaging
CN109587407A (en) * 2018-12-14 2019-04-05 广州华多网络科技有限公司 Exposure amount adjustment method, device and the computer equipment of image taking

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WANG HAO;WANG CHAO;WANG WEI;RAN PENG;LIU SHENGRONG;ZHANG HUIQUAN;LI ZHANGYONG: "Automatic Exposure Control System Design and Implementation of Digital X-ray machine Based on DM6446", LIFE SCIENCE INSTRUMENTS, vol. 12, 26 October 2014 (2014-10-26), pages 34 - 38, XP055821107 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113409378A (en) * 2021-06-28 2021-09-17 北京百度网讯科技有限公司 Image processing method, device and equipment
CN113409378B (en) * 2021-06-28 2024-04-12 北京百度网讯科技有限公司 Image processing method, device and equipment

Similar Documents

Publication Publication Date Title
US10909682B2 (en) Method and device for detecting pulmonary nodule in computed tomography image, and computer-readable storage medium
EP3785603B1 (en) Machine learning-based fundus image detection method, apparatus, and system
US11501428B2 (en) Method, apparatus and system for detecting fundus image based on machine learning
EP3486872A1 (en) Image processing apparatus, image processing method, and program
WO2017215527A1 (en) Hdr scenario detection method, device, and computer storage medium
JP6478136B1 (en) Endoscope system and operation method of endoscope system
CN113609907B (en) Multispectral data acquisition method, device and equipment
KR20210153700A (en) Image processing method and apparatus, electronic device, storage medium and computer program
JP6945620B2 (en) System operating method and program
CN110189269B (en) Correction method, device, terminal and storage medium for 3D distortion of wide-angle lens
CN109859216B (en) Distance measurement method, device and equipment based on deep learning and storage medium
CN112884666B (en) Image processing method, device and computer storage medium
WO2022135581A1 (en) Image testing method, apparatus and system, and device and storage medium
JP2017130794A (en) Information processing apparatus, evaluation chart, evaluation system, and performance evaluation method
CN111325709A (en) Wireless capsule endoscope image detection system and detection method
WO2021114039A1 (en) Masking-based automatic exposure control method and apparatus, storage medium, and electronic device
WO2017158546A1 (en) Contour-based determination of malignant tissue in a thermal image
US9813640B2 (en) Image processing apparatus, image processing method, image processing program, and non-transitory recording for calculating a degree-of-invalidity for a selected subject type
WO2024093800A1 (en) Image calibration method and apparatus, image processing method and apparatus, and electronic device and storage medium
CN111084632B (en) Automatic exposure control method and device based on mask, storage medium and electronic equipment
CN113068016A (en) White balance correction method and device and computer equipment
CN116430069A (en) Machine vision fluid flow velocity measuring method, device, computer equipment and storage medium
TWI552603B (en) Image correction system and method
CN108519215B (en) Pupil distance adaptability test system and method and test host
CN110766631A (en) Face image modification method and device, electronic equipment and computer readable medium

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

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

Country of ref document: EP

Kind code of ref document: A1