[go: up one dir, main page]

CN102034091B - A light spot recognition method and device for a digital sun sensor - Google Patents

A light spot recognition method and device for a digital sun sensor Download PDF

Info

Publication number
CN102034091B
CN102034091B CN 201010567899 CN201010567899A CN102034091B CN 102034091 B CN102034091 B CN 102034091B CN 201010567899 CN201010567899 CN 201010567899 CN 201010567899 A CN201010567899 A CN 201010567899A CN 102034091 B CN102034091 B CN 102034091B
Authority
CN
China
Prior art keywords
light spot
frame image
spot
difference
current frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN 201010567899
Other languages
Chinese (zh)
Other versions
CN102034091A (en
Inventor
樊巧云
张广军
魏新国
刘啸峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beihang University
Original Assignee
Beihang University
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 Beihang University filed Critical Beihang University
Priority to CN 201010567899 priority Critical patent/CN102034091B/en
Publication of CN102034091A publication Critical patent/CN102034091A/en
Application granted granted Critical
Publication of CN102034091B publication Critical patent/CN102034091B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The invention provides a light spot identifying method and device for a digital sun sensor. The method comprises the following steps of: obtaining an estimated movement distance of the light spot of a former frame of image of the digital sun sensor in the current frame of image; calculating an actual movement distance of the light spot of the current frame of image relative to the light spot of the former frame of image, comparing the actual movement distance with the estimated movement distance, and marking the light spot of the current frame of image according to a comparison result. In the invention, by identifying the light spot according to the movement track of the light spot, the error generated by distinguishing the light spot with the light spot change rule of the energy cosine effect is overcome, meanwhile, no special narrow belt filter is added for reducing the intensity of the reached earthlight avoiding the effect of the earthlight to the digital sun sensor so that the implementation is simple, and the reliable work of the digital sun sensor is guaranteed; and meanwhile, the device can be realized based on the FPGA (Field Programmable Gata Array), which is beneficial to the integrated design of the digital sun sensor.

Description

一种用于数字式太阳敏感器的光斑识别方法及装置A light spot recognition method and device for a digital sun sensor

技术领域 technical field

本发明涉及图像信号处理技术,尤其涉及一种用于数字式太阳敏感器的光斑识别方法及装置。The invention relates to image signal processing technology, in particular to a light spot recognition method and device for a digital sun sensor.

背景技术 Background technique

太阳敏感器是以太阳为基准方位,用以测量太阳视线与卫星等航天器某一体轴或坐标平面之间夹角的一种姿态敏感器。基于面帧图像传感器和单孔掩膜的数字式太阳敏感器的工作原理如图1所示,太阳光线经光学掩膜的透光小孔O,透射到图像传感器上形成光斑L,太阳光线的入射角度不同,光斑位置就不同,数字式太阳敏感器根据光斑位置测算出太阳光线的入射角度β,从而确定卫星等航天器的姿态。The sun sensor is an attitude sensor that uses the sun as the reference orientation to measure the angle between the sun's line of sight and a certain body axis or coordinate plane of a spacecraft such as a satellite. The working principle of the digital sun sensor based on the surface frame image sensor and single-hole mask is shown in Figure 1. The sunlight passes through the light-transmitting hole O of the optical mask and is transmitted to the image sensor to form a light spot L. The position of the light spot is different for different incident angles. The digital sun sensor calculates the incident angle β of the sun's rays according to the position of the light spot, so as to determine the attitude of spacecraft such as satellites.

通常,地球反照光是影响数字式太阳敏感器可靠工作的主要干扰杂光,目前公开的防止地球反照光影响数字式太阳敏感器可靠工作的方法有:通过特殊的安装方式对数字式太阳敏感器进行安装;或者,通过光谱滤光来尽量避免地球反照光进入数字式太阳敏感器,并通过光斑特征识别并剔除地球反照光,从而在一定程度上克服地球反照光的影响。Usually, the earth reflection light is the main interfering stray light that affects the reliable operation of the digital sun sensor. The currently disclosed methods to prevent the earth reflection light from affecting the reliable operation of the digital sun sensor are: to install the digital sun sensor in a special way Or, try to avoid the reflection of the earth from entering the digital sun sensor through spectral filtering, and identify and eliminate the reflection of the earth through the feature of the light spot, so as to overcome the influence of the reflection of the earth to a certain extent.

但是,采用特殊安装方式的方法时,在卫星非正常姿态的状态下,或遇到地球强镜面反射的情况,如冰川反射,地球反照光就会进入数字式太阳敏感器的视场范围,而且如果地球反照光是正入射方向,太阳光是斜入射方向时,两者形成的光斑将无法按照光强进行区分,进而影响数字式太阳敏感器的可靠工作。However, when using a special installation method, when the satellite is in an abnormal attitude, or when encountering strong specular reflections of the earth, such as glacier reflections, the reflected light from the earth will enter the field of view of the digital sun sensor, and If the earth's reflected light is in the normal incident direction and the sun's light is in the oblique incident direction, the light spots formed by the two will not be able to be distinguished according to the light intensity, which will affect the reliable work of the digital sun sensor.

通过光谱滤光降低到达数字式太阳敏感器的地球反照光强度时,并根据光斑大小和强度来区分太阳光斑和地球反照光形成的地球光斑,来保证数字式太阳敏感器的可靠工作,确定卫星等航天器的状态。然而,这种光谱滤光的方法中根据光斑大小和强度区分太阳光斑和地球光斑的理论依据是:认为光斑光强的变换规律满足能量余弦效应,而这种假设不仅忽略了光谱滤光片会随太阳入射角度的变化而透射率发生变化的特性,且这种特性随着光谱滤光片厚度的增加会越为明显;还忽略了图像传感器的温度特性,即在相同入射光能量的情况下,图像传感器上形成的光斑强度会随着温度的变化而变化。因此,该方法中按照能量余弦效应的变化规律来区分太阳光斑和地球光斑会存在较大误差,甚至会发生误判,使得数字式太阳敏感器工作的可靠性降低。When the intensity of the earth's reflected light reaching the digital sun sensor is reduced by spectral filtering, and the sun's light spot and the earth's light spot formed by the earth's reflected light are distinguished according to the size and intensity of the light spot, so as to ensure the reliable operation of the digital sun sensor and determine the satellite Wait for the status of the spacecraft. However, in this method of spectral filtering, the theoretical basis for distinguishing solar facula and earth facula according to the size and intensity of the facula is: it is believed that the transformation law of facula light intensity satisfies the energy cosine effect, and this assumption not only ignores the The characteristic that the transmittance changes with the change of the incident angle of the sun, and this characteristic will become more obvious as the thickness of the spectral filter increases; the temperature characteristic of the image sensor is also ignored, that is, under the same incident light energy , the intensity of the spot formed on the image sensor will vary with the temperature. Therefore, in this method, according to the change law of the energy cosine effect, there will be a large error in distinguishing the sun spot from the earth spot, and even a misjudgment will occur, which will reduce the reliability of the digital sun sensor.

发明内容 Contents of the invention

有鉴于此,本发明的主要目的在于提供一种用于数字式太阳敏感器的光斑识别方法,能实现太阳光斑和地球光斑的区分,从而避免地球反照光对数字式太阳敏感器的影响,保证数字式太阳敏感器的可靠工作,同时提供一种所述方法的FPGA实现装置,有利于数字式太阳敏感器的集成化设计。In view of this, the main purpose of the present invention is to provide a kind of spot recognition method that is used for digital sun sensor, can realize the distinction of sun spot and earth spot, thereby avoid the impact of the earth reflection light on digital sun sensor, guarantee The reliable operation of the digital solar sensor and an FPGA implementation device of the method are provided, which is beneficial to the integrated design of the digital solar sensor.

为达到上述目的,本发明的技术方案是这样实现的:In order to achieve the above object, technical solution of the present invention is achieved in that way:

一种用于数字式太阳敏感器的光斑识别方法,所述方法包括下述步骤:A method for spot recognition for a digital sun sensor, said method comprising the steps of:

获取数字式太阳敏感器前一帧图像的光斑在当前帧图像中的估计移动距离;计算当前帧图像的光斑相对于前一帧图像的光斑的实际移动距离;将实际移动距离与估计移动距离进行比较,根据比较结果对当前帧图像的光斑进行标记。Obtain the estimated moving distance of the light spot of the previous frame image of the digital sun sensor in the current frame image; calculate the actual moving distance of the light spot of the current frame image relative to the light spot of the previous frame image; compare the actual moving distance with the estimated moving distance Compare, and mark the light spot of the current frame image according to the comparison result.

进一步地,所述计算当前帧图像的光斑相对于前一帧图像的光斑的实际移动距离为:计算前一帧图像的光斑质心与当前帧图像的光斑质心的坐标差值对应的模,得到当前帧图像的光斑相对于前一帧图像的光斑的实际移动距离。Further, the calculation of the actual moving distance of the light spot of the current frame image relative to the light spot of the previous frame image is: calculating the modulus corresponding to the coordinate difference between the light spot centroid of the previous frame image and the light spot centroid of the current frame image, and obtaining the current The actual moving distance of the light spot of the frame image relative to the light spot of the previous frame image.

进一步地,所述将实际移动距离与估计移动距离进行比较,根据比较结果对当前帧图像的光斑进行标记具体为:Further, the step of comparing the actual moving distance with the estimated moving distance, and marking the light spot of the current frame image according to the comparison result is specifically:

计算实际移动距离与估计移动距离的差值绝对值,当差值绝对值小于预设的估计最大偏差时,则差值绝对值与估计最大偏差两者一致,否则,差值绝对值与估计最大偏差两者不一致;Calculate the absolute value of the difference between the actual moving distance and the estimated moving distance. When the absolute value of the difference is less than the preset estimated maximum deviation, the absolute value of the difference is consistent with the estimated maximum deviation. Otherwise, the absolute value of the difference is the same as the estimated maximum deviation. The deviations are inconsistent;

当两者一致,且所述前一帧图像的光斑标记为太阳光斑或地球光斑时,则将所述当前帧图像的光斑标记为太阳光斑或地球光斑,若有另一光斑则标记为地球光斑或太阳光斑;When the two are consistent, and the light spot of the previous frame image is marked as the sun light spot or the earth light spot, then the light spot of the current frame image is marked as the sun light spot or the earth light spot, and if there is another light spot, then it is marked as the earth light spot or sun spots;

当两者不一致,且所述前一帧图像的光斑标记为太阳光斑或地球光斑时,则将所述当前帧图像的光斑标记为地球光斑或太阳光斑,若有另一光斑则标记为太阳光斑或地球光斑。When the two are inconsistent, and the light spot of the previous frame image is marked as the sun light spot or the earth light spot, then the light spot of the current frame image is marked as the earth light spot or the sun light spot, and if there is another light spot, then it is marked as the sun light spot or Earth flares.

其中,当所述前一帧图像的光斑没有光斑标记时,所述方法还包括:Wherein, when the light spot of the previous frame image has no light spot mark, the method further includes:

根据光斑特征匹配当前帧图像的光斑和前一帧图像的光斑,当至少存在一个相匹配的光斑时,将相匹配的光斑标记为假定太阳光斑;Matching the light spot of the current frame image and the light spot of the previous frame image according to the light spot feature, when there is at least one matching light spot, marking the matched light spot as a hypothetical sun light spot;

相应地,所述获取数字式太阳敏感器前一帧图像的光斑在下一帧图像中的估计移动距离具体为:获取数字式太阳敏感器前一帧图像的假定太阳光斑在当前帧图像中的估计移动距离;Correspondingly, the estimated movement distance of the facula in the next frame image of the previous frame image of the digital sun sensor is specifically: the estimation of the assumed sun facula in the current frame image of the previous frame image of the digital sun sensor Moving distance;

所述计算当前帧图像的光斑相对于前一帧图像的光斑的实际移动距离具体为:计算当前帧图像的假定太阳光斑相对于前一帧图像的假定太阳光斑的实际移动距离。The calculating the actual moving distance of the light spot of the current frame image relative to the light spot of the previous frame image is specifically: calculating the actual moving distance of the assumed sun light spot of the current frame image relative to the assumed sun light spot of the previous frame image.

进一步地,所述根据光斑特征匹配当前帧图像的光斑和前一帧图像的光斑具体为:Further, the matching of the light spot of the current frame image and the light spot of the previous frame image according to the feature of the light spot is specifically:

计算前一帧图像的光斑与当前帧图像的光斑的光斑总像素和光斑最大灰度值的差值绝对值;Calculate the absolute value of the difference between the total pixels of the light spot of the previous frame image and the light spot of the current frame image and the maximum gray value of the light spot;

当所述光斑总像素的差值绝对值和所述光斑最大灰度值的差值绝对值分别小于预设的最大总像素差和最大灰度值差时,则两者匹配。When the absolute value of the difference between the total pixels of the light spot and the absolute value of the difference between the maximum gray value of the light spot is smaller than the preset maximum total pixel difference and the maximum gray value difference, the two match.

进一步地,所述将实际移动距离与估计移动距离进行比较,根据比较结果对当前帧图像的光斑进行标记具体为:计算假定太阳光斑的实际移动距离与估计移动距离的差值绝对值,当所述差值绝对值小于预设的估计最大偏差时,则假定标记正确,否则,假定标记不正确;Further, comparing the actual moving distance with the estimated moving distance, and marking the light spot of the current frame image according to the comparison result is specifically: calculating the absolute value of the difference between the actual moving distance and the estimated moving distance of the assumed sun spot, when the When the absolute value of the stated difference is less than the preset estimated maximum deviation, it is assumed that the marking is correct; otherwise, it is assumed that the marking is incorrect;

假定标记正确时,将当前帧图像的假定太阳光斑标记为太阳光斑,若有另一光斑则标记为地球光斑;假定标记不正确时,将当前帧图像的假定太阳光斑标记为地球光斑,若有另一光斑则标记为太阳光斑。If the label is assumed to be correct, mark the assumed sun spot of the current frame image as a sun spot, if there is another spot, mark it as an earth spot; if the label is incorrect, mark the assumed sun spot of the current frame image as an earth spot, if any Another flare is labeled as a sun flare.

一种用于数字式太阳敏感器的光斑识别装置,所述装置包括光斑识别判断模块,用于根据光斑移动轨迹,区分并识别太阳光斑和地球光斑,并根据识别结果,对当前帧图像的光斑进行标记。A light spot recognition device for a digital sun sensor, the device includes a light spot recognition and judgment module, which is used to distinguish and identify the sun light spot and the earth light spot according to the moving track of the light spot, and according to the recognition result, the light spot of the current frame image to mark.

进一步地,所述光斑识别判断模块还包括:光斑最大灰度值比较子模块,用于计算所述前一帧图像的光斑与所述当前帧图像的光斑的光斑最大灰度值的差值绝对值,并对所述差值绝对值与预设的最大灰度值差进行比较;Further, the light spot identification and judgment module further includes: a light spot maximum gray value comparison submodule, which is used to calculate the absolute value of the difference between the light spot maximum gray value of the light spot of the previous frame image and the light spot of the current frame image. value, and compare the absolute value of the difference with the preset maximum gray value difference;

光斑总像素比较子模块,用于计算所述前一帧图像的光斑与所述当前帧图像的光斑的光斑总像素差值绝对值,并对所述差值绝对值与预设的最大总像素差进行比较;The light spot total pixel comparison sub-module is used to calculate the absolute value of the total pixel difference of the light spot between the light spot of the previous frame image and the light spot of the current frame image, and compare the absolute value of the difference with the preset maximum total pixel difference for comparison;

实际移动距离计算子模块,用于计算所述数字式太阳敏感器的存储器存储的所述前一帧图像的光斑质心与存储的所述当前帧图像的光斑质心的坐标差值对应的模,得到所述当前帧图像的光斑相对于所述前一帧图像的光斑的实际移动距离;The actual moving distance calculation sub-module is used to calculate the modulus corresponding to the coordinate difference between the spot centroid of the previous frame image stored in the memory of the digital sun sensor and the stored coordinate difference of the spot centroid of the current frame image, to obtain The actual moving distance of the light spot of the current frame image relative to the light spot of the previous frame image;

移动距离比较子模块,用于计算所述实际移动距离计算子模块得到的实际移动距离与获取的估计移动距离的差值绝对值,并对所述差值绝对值与预设的估计最大偏差进行比较;The moving distance comparison sub-module is used to calculate the absolute value of the difference between the actual moving distance obtained by the actual moving distance calculation sub-module and the obtained estimated moving distance, and perform a calculation on the difference between the absolute value of the difference and the preset estimated maximum deviation Compare;

识别判断状态机,用于根据前一帧图像和当前帧图像的光斑信息,以及上述子模块的输出结果,分析判断,完成对当前帧图像的光斑的识别和标记;读写地址发生器,用于读取所需的光斑信息,并存储识别判断状态机输出的光斑标记结果到光斑标记存储器。The identification and judgment state machine is used to analyze and judge according to the light spot information of the previous frame image and the current frame image, as well as the output results of the above sub-modules, and complete the identification and marking of the light spot of the current frame image; the read-write address generator uses It is used to read the required light spot information, and store the light spot mark result output by the identification and judgment state machine into the light spot mark memory.

进一步地,所述装置基于FPGA实现时,所述光斑最大灰度值比较子模块由减法器和比较器实现,减法器用于计算存储器存储的前一帧图像的光斑的光斑最大灰度值与当前帧图像的光斑的光斑最大灰度值的差值绝对值,比较器用于对所述差值绝对值与预设的最大灰度值差进行比较,并将比较结果输出给识别判断状态机;Further, when the device is implemented based on FPGA, the maximum gray value comparison submodule of the light spot is realized by a subtractor and a comparator, and the subtractor is used to calculate the difference between the maximum gray value of the light spot and the current maximum gray value of the light spot of the previous frame image stored in the memory. The absolute value of the difference of the maximum gray value of the light spot of the frame image, the comparator is used to compare the absolute value of the difference with the preset maximum gray value difference, and output the comparison result to the identification and judgment state machine;

所述光斑总像素比较子模块由减法器和比较器实现,减法器用于计算存储器存储的前一帧图像光斑的光斑总像素与当前帧图像的光斑的光斑总像素差值绝对值,比较器用于对所述差值绝对值与预设的最大总像素差进行比较,并将比较结果输出给识别判断状态机;The total pixel comparison submodule of the light spot is realized by a subtractor and a comparator. The subtractor is used to calculate the absolute value of the total pixel difference between the total pixels of the light spot of the light spot of the previous frame image stored in the memory and the total pixel difference of the light spot of the light spot of the current frame image. The comparator is used for Comparing the absolute value of the difference with a preset maximum total pixel difference, and outputting the comparison result to the recognition and judgment state machine;

所述实际移动距离子模块由X减法器、Y减法器和求模运算器实现,X减法器用于计算所述存储器存储的前一帧图像的光斑质心的X坐标和当前帧图像的光斑质心的X坐标的差值;Y减法器用于计算所述存储器存储的前一帧图像的光斑质心的Y坐标和当前帧图像的光斑质心的Y坐标的差值;求模运算器用于对X减法器和Y减法器得到的坐标差值求模,得到当前帧图像的光斑相对于前一帧图像的光斑的实际移动距离;The actual moving distance sub-module is realized by an X subtractor, a Y subtractor and a modulo operator, and the X subtractor is used to calculate the X coordinate of the spot centroid of the previous frame image stored in the memory and the X coordinate of the spot centroid of the current frame image. The difference of the X coordinates; the Y subtractor is used to calculate the difference between the Y coordinate of the spot centroid of the previous frame image stored in the memory and the Y coordinate of the spot centroid of the current frame image; the modulo operator is used for the X subtractor and The coordinate difference value obtained by the Y subtractor is modulo obtained to obtain the actual moving distance of the light spot of the current frame image relative to the light spot of the previous frame image;

所述移动距离比较子模块由减法器和比较器实现,减法器用于计算求模运算器得到的实际移动距离与获取的估计移动距离的差值绝对值,比较器用于对所述差值绝对值与预设的估计最大偏差进行比较,并将比较结果输出给识别判断状态机。The moving distance comparison submodule is realized by a subtractor and a comparator, the subtractor is used to calculate the absolute value of the difference between the actual moving distance obtained by the modulo operator and the estimated moving distance obtained, and the comparator is used to compare the absolute value of the difference It is compared with the preset estimated maximum deviation, and the comparison result is output to the recognition and judgment state machine.

本发明提供的用于数字式太阳敏感器的光斑识别方法,根据光斑的移动轨迹区分识别太阳光斑和地球光斑,从而避免了地球反照光对数字式太阳敏感器的影响;不仅克服了根据能量余弦效应的光斑变化规律区分光斑所存在的误差性;同时不需要对数字式太阳敏感器添加特殊的窄带滤波以降低到达的地球反照光强度,降低了数字式太阳敏感器的设计难度,保证了数字式太阳敏感器的可靠工作;另外所述装置还可以基于FPGA实现,有利于数字式太阳敏感器的集成化设计。The light spot recognition method for the digital sun sensor provided by the present invention distinguishes and identifies the sun light spot and the earth light spot according to the moving track of the light spot, thereby avoiding the influence of the earth's reflected light on the digital sun sensor; The light spot change law of the effect distinguishes the error of the light spot; at the same time, it is not necessary to add a special narrow-band filter to the digital sun sensor to reduce the intensity of the earth's reflection light, which reduces the design difficulty of the digital sun sensor and ensures the digital Reliable work of the solar sensor; in addition, the device can also be realized based on FPGA, which is beneficial to the integrated design of the digital solar sensor.

附图说明 Description of drawings

图1为数字式太阳敏感器的工作原理示意图;Figure 1 is a schematic diagram of the working principle of the digital sun sensor;

图2为本发明用于数字式太阳敏感器的光斑识别方法的实现流程示意图;Fig. 2 is a schematic flow chart of the realization of the light spot recognition method for the digital sun sensor in the present invention;

图3为本发明用于数字式太阳敏感器的光斑识别装置的功能模块组成示意图;Fig. 3 is the composition schematic diagram of the functional module of the spot recognition device that is used for digital sun sensor of the present invention;

图4为图3用于数字式太阳敏感器的光斑识别装置基于FPGA实现的组成结构示意图。FIG. 4 is a schematic diagram of the composition and structure of the light spot recognition device used in the digital sun sensor in FIG. 3 based on FPGA.

具体实施方式 Detailed ways

本发明的基本思想:获取数字式太阳敏感器前一帧图像光斑在当前帧图像中的估计移动距离;计算当前帧图像光斑相对于前一帧图像的实际移动距离,将实际移动距离与估计移动距离进行比较,根据比较结果对当前帧图像光斑进行标记。The basic idea of the present invention: obtain the estimated moving distance of the light spot of the previous frame image of the digital sun sensor in the current frame image; calculate the actual moving distance of the light spot of the current frame image relative to the previous frame image, and compare the actual moving distance with the estimated moving distance The distance is compared, and the current frame image spot is marked according to the comparison result.

为使本发明的目的、技术方案和优点更加清楚明白,以下举实施例并参照附图,对本发明进一步详细说明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail by citing the following embodiments and referring to the accompanying drawings.

图2示出了本发明用于数字式太阳敏感器的光斑识别方法的实现流程,如图2所示,所述方法包括下述步骤:Fig. 2 shows the implementation process of the present invention for the spot recognition method of digital sun sensor, as shown in Fig. 2, described method comprises the following steps:

步骤S201,数字式太阳敏感器的上电复位信号触发图像序列变量初始化,将图像序列变量K赋值为1;Step S201, the power-on reset signal of the digital sun sensor triggers the initialization of the image sequence variable, and assigns the image sequence variable K to 1;

其中,所述图像序列变量用于表示数字式太阳敏感器当前处理的图像的帧数。Wherein, the image sequence variable is used to indicate the frame number of the image currently processed by the digital sun sensor.

步骤S202,数字式太阳敏感器判断当前帧即第K帧图像的光斑信息处理是否结束,若是,则执行步骤S203,否则,按一定周期或实时重复执行步骤S202;Step S202, the digital sun sensor judges whether the processing of the light spot information of the current frame, that is, the Kth frame image, is finished, if so, then execute step S203, otherwise, execute step S202 repeatedly in a certain period or in real time;

其中,所述光斑信息处理是指获取第K帧图像的光斑质心坐标、光斑个数、光斑总像素、光斑最大灰度值等;所述一定周期可以根据用户的需要进行设定。Wherein, the processing of the light spot information refers to obtaining the coordinates of the center of mass of the light spot, the number of light spots, the total pixels of the light spots, the maximum gray value of the light spots, etc. of the K-th frame image; the certain period can be set according to the needs of the user.

步骤S203,判断第K帧图像是否有光斑,若是,执行步骤S204,否则,执行步骤S216;Step S203, judge whether there is light spot in the image of the Kth frame, if so, execute step S204, otherwise, execute step S216;

本步骤中,具体可以通过判断光斑信息处理中获取的第K帧图像的光斑个数是否大于0,确定第K帧图像是否有光斑:当光斑个数大于0时,则第K帧图像具有光斑;否则第K帧图像没有光斑。In this step, it can be determined whether the Kth frame image has a light spot by judging whether the number of light spots in the Kth frame image obtained in the light spot information processing is greater than 0: when the number of light spots is greater than 0, then the Kth frame image has a light spot ; Otherwise, there is no light spot in the Kth frame image.

步骤S204,进一步判断K是否等于1,若是,则执行步骤S216,否则,执行步骤S205;Step S204, further judge whether K is equal to 1, if so, execute step S216, otherwise, execute step S205;

步骤S205,判断前一帧即第K-1帧图像是否有光斑,若是,执行步骤S206,否则,执行步骤S216;Step S205, judging whether the previous frame, that is, the image of the K-1th frame, has light spots, if so, execute step S206, otherwise, execute step S216;

本步骤中,具体可以通过判断光斑信息处理中获取的第K-1帧图像的光斑个数是否大于0,确定第K-1帧图像是否有光斑:当光斑个数大于0时,则第K-1帧图像具有光斑;否则第K-1帧图像没有光斑。In this step, it can be determined whether there is a light spot in the K-1th frame image by judging whether the number of light spots in the K-1th frame image acquired in the light spot information processing is greater than 0: when the number of light spots is greater than 0, then the K-th The -1 frame image has light spots; otherwise, the K-1th frame image has no light spots.

步骤S206,判断第K-1帧图像的光斑是否具有标记,若是,执行步骤S207,否则,执行步骤S210;Step S206, judging whether the light spot of the K-1th frame image has a mark, if so, execute step S207, otherwise, execute step S210;

本步骤中,当第K-1帧图像的光斑具有光斑标记时,说明已经对第K-1帧图像的光斑进行了区分,并标记出太阳光斑和/或地球光斑,此时需要执行步骤S207;当第K-1帧图像的光斑不具有光斑标记时,说明还未对第K-1帧图像的光斑进行区分,需要执行步骤S210。In this step, when the light spot of the K-1 frame image has a light spot mark, it means that the light spot of the K-1 frame image has been distinguished, and the sun light spot and/or the earth light spot are marked, and step S207 needs to be performed at this time ; When the light spot of the K-1th frame image does not have a light spot mark, it means that the light spot of the K-1th frame image has not been distinguished, and step S210 needs to be executed.

步骤S207,获取数字式太阳敏感器对第K-1帧图像的太阳光斑在下一帧即第K帧图像中的估计移动距离ds^;Step S207, obtaining the estimated moving distance ds of the sun spot of the K-1 frame image in the next frame, that is, the K frame image, by the digital sun sensor;

具体地,本步骤中,当第K-1帧图像既有太阳光斑也有地球光斑时,为了提高处理效率,数字式太阳敏感器可以选择其一进行估计:若对太阳光斑进行估计,则获取太阳光斑的估计移动距离ds^;若对地球光斑进行估计,则获取地球光斑的估计移动距离de^;Specifically, in this step, when the K-1th frame image has both sun facula and earth facula, in order to improve processing efficiency, the digital sun sensor can choose one of them for estimation: if the sun facula is estimated, the sun facula is obtained The estimated moving distance ds^ of the light spot; if the earth's light spot is estimated, the estimated moving distance de^ of the earth's light spot is obtained;

本步骤中,数字式太阳敏感器对太阳光斑或地球光斑进行估计,具体可以根据卫星轨道参数、太阳或地球运动参数,以及已标记太阳光斑或地球光斑在第K-1帧图像中的位置,估计其在下一帧即第K帧图像中的移动距离ds^或de^。In this step, the digital sun sensor estimates the sun facula or the earth's facula, specifically according to the satellite orbit parameters, the sun or the earth's motion parameters, and the position of the marked sun or earth's facula in the K-1 frame image, Estimate its moving distance ds^ or de^ in the next frame, that is, the image of the Kth frame.

步骤S208,计算第K帧图像中某一光斑相对于第K-1帧图像的太阳光斑或地球光斑的实际移动距离d;Step S208, calculating the actual moving distance d of a certain light spot in the Kth frame image relative to the sun light spot or the earth light spot in the K-1th frame image;

当步骤S207是对第K-1帧图像的太阳光斑进行估计得到ds^时,则从第K帧任选一个光斑,计算其相对于第K-1帧图像的太阳光斑的实际移动距离d,具体地,获取光斑信息处理中得到的第K帧图像所述光斑的光斑质心坐标以及获取的第K-1帧图像中太阳光斑的光斑质心坐标,计算获取的所述第K帧图像和第K-1帧图像的光斑质心坐标的坐标差值,并对所述坐标差值求模,即得到所述光斑相对于第K-1帧图像的太阳光斑的实际移动距离d;When step S207 is that the solar facula of the K-1 frame image is estimated to obtain ds, then select a light spot from the K frame, and calculate its actual moving distance d relative to the solar facula of the K-1 frame image, Specifically, acquire the spot centroid coordinates of the spot in the K-th frame image obtained in the spot information processing and the spot centroid coordinates of the sun spot in the acquired K-1 frame image, and calculate the acquired K-th frame image and the K-th The coordinate difference of the center of mass coordinates of the light spot of the -1 frame image, and calculate the modulus of the coordinate difference, that is, obtain the actual moving distance d of the light spot relative to the sun light spot of the K-1th frame image;

当步骤S207是对第K-1帧图像的地球光斑进行估计得到de^时,则从第K帧任选一个光斑,计算其相对于第K-1帧图像中对应的地球光斑的实际移动距离d,具体地,获取光斑信息处理中得到的第K帧图像的所述光斑的光斑质心坐标以及获取的第K-1帧图像中地球光斑的光斑质心坐标,计算获取的所述第K帧图像和第K-1帧图像的光斑质心坐标的坐标差值,并对所述坐标差值求模,即得到所述光斑相对于第K-1帧图像的地球光斑的实际移动距离d。When step S207 is to estimate the earth light spot of the K-1 frame image to obtain de, then select a light spot from the K frame, and calculate its actual moving distance relative to the corresponding earth light spot in the K-1 frame image d. Specifically, acquire the centroid coordinates of the spot of the spot in the K-th frame image obtained in the spot information processing and the spot centroid coordinates of the spot in the acquired K-1 frame image, and calculate the obtained K-th frame image and the coordinate difference of the light spot centroid coordinates of the K-1th frame image, and calculate the modulus of the coordinate difference value, that is, the actual moving distance d of the light spot relative to the earth’s light spot in the K-1th frame image is obtained.

步骤S209,比较所述d和ds^或de^,并根据比较结果对第K帧图像的光斑进行标记,然后执行步骤S216;Step S209, comparing the d and ds^ or de^, and marking the light spot of the Kth frame image according to the comparison result, and then performing step S216;

本步骤中,当步骤S207是对第K-1帧图像的太阳光斑进行估计得到ds^时,则计算所述d与ds^的差值绝对值,如果所述差值绝对值小于预设的估计最大偏差,则两者一致;否则,两者不一致。当比较结果为两者一致时,则将当前光斑标记为太阳光斑,若有另一光斑,则标记为地球光斑;当比较结果为两者不一致时,则将当前光斑标记为地球光斑,若有另一光斑,则标记为太阳光斑。In this step, when step S207 is to estimate the solar spot of the K-1th frame image to obtain ds^, then calculate the absolute value of the difference between d and ds^, if the absolute value of the difference is less than the preset If the maximum deviation is estimated, the two agree; otherwise, the two disagree. When the comparison result is that the two are consistent, the current spot is marked as a sun spot, and if there is another spot, it is marked as an earth spot; when the comparison result is inconsistent, the current spot is marked as an earth spot, if there is another The other spot is marked as a sun spot.

当步骤S207是对第K-1帧图像的地球光斑进行估计得到de^时,则计算所述d与de^的差值绝对值,如果所述差值绝对值小于预设的估计最大偏差时,则两者一致;否则,两者不一致。当比较结果为两者一致时,则将当前光斑标记为地球光斑,若有另一光斑,则标记为太阳光斑;当比较结果为两者不一致时,则将当前光斑标记为太阳光斑,若有另一光斑,则标记为地球光斑。When step S207 is to estimate the earth flare of the K-1th frame image to obtain de^, then calculate the absolute value of the difference between d and de^, if the absolute value of the difference is less than the preset estimated maximum deviation , the two are consistent; otherwise, the two are inconsistent. When the comparison result is that the two are consistent, mark the current spot as the earth spot, if there is another spot, mark it as the sun spot; when the comparison result is inconsistent, mark the current spot as the sun spot, if there is another The other spot is marked as the Earth spot.

步骤S210,根据光斑特征匹配第K帧图像和第K-1帧图像的光斑;Step S210, matching the light spots of the Kth frame image and the K-1th frame image according to the light spot feature;

本步骤中,具体根据第K-1帧图像的光斑的光斑总像素、光斑最大灰度值等和第K帧图像的光斑的光斑总像素、光斑最大灰度值等进行匹配,可以标记第K-1帧图像中的某一光斑的光斑总像素为Pixel(k-1)、光斑最大灰度值为Im(k-1),第K帧图像中某一光斑的光斑总像素为Pixel(k)、光斑最大灰度值为Im(k),则如果满足下式条件:|Pixel(k)-Pixel(k-1)|<10;|Im(k)-Im(k-1)|<15,则可以认为所述第K帧图像中的某一光斑与所述第K-1帧图像中某一光斑相匹配,其中上述公式中的10和15分别为预设的最大总像素差和最大灰度值差,最大总像素差和最大灰度值差可以根据光斑的像素和灰度等级进行具体设置,本实施例中,光斑的灰度等级为1~255,根据实验得到光斑的像素为50~100,较优地,可以设置最大总像素差为10,最大灰度值差为15。In this step, the total pixels of the light spot, the maximum gray value of the light spot, etc. of the light spot of the K-1th frame image are matched with the total pixels of the light spot, the maximum gray value of the light spot, etc. of the light spot of the image of the Kth frame, and the Kth - The total pixels of a certain light spot in one frame image are Pixel(k-1), the maximum gray value of the light spot is Im(k-1), and the total pixels of a certain light spot in the K-th frame image are Pixel(k ), the maximum gray value of the spot is Im(k), if the following conditions are met: |Pixel(k)-Pixel(k-1)|<10; |Im(k)-Im(k-1)|< 15, it can be considered that a certain light spot in the Kth frame image matches a certain light spot in the K-1th frame image, wherein 10 and 15 in the above formula are respectively the preset maximum total pixel difference and The maximum gray value difference, the maximum total pixel difference and the maximum gray value difference can be specifically set according to the pixels and gray levels of the light spot. In this embodiment, the gray level of the light spot is 1 to 255. According to the experiment, the pixels of the light spot 50-100, preferably, the maximum total pixel difference can be set to 10, and the maximum gray value difference can be set to 15.

步骤S211,是否至少存在一个相匹配的光斑,若是,执行步骤S212,否则,执行步骤S216;Step S211, whether there is at least one matching spot, if so, execute step S212, otherwise, execute step S216;

步骤S212,假定该相匹配的光斑为太阳光斑,并标记为假定太阳光斑;Step S212, assuming that the matching light spot is a sun spot, and marking it as an assumed sun spot;

本步骤中,可以将该相匹配的光斑假定为太阳光斑,也可以假定为地球光斑,本实施例中是将该匹配光斑标记为假定太阳光斑,进行说明;当然也可以假定为地球光斑,若将该匹配光斑标记为假定地球光斑,则后续步骤与假定太阳光斑的步骤类似,只是具体按照地球光斑的移动轨迹进行判断,不再赘述。In this step, the matching light spot can be assumed to be a sun spot, or an earth spot. In this embodiment, the matching spot is marked as an assumed sun spot for illustration; of course, it can also be assumed to be an earth spot, if If the matched spot is marked as a hypothetical earth spot, the subsequent steps are similar to the steps for assuming the sun spot, except that the judgment is made according to the moving track of the earth spot, and will not be repeated here.

步骤S213,获取第K-1帧图像中上述假定太阳光斑的估计移动距离ds^;Step S213, obtaining the estimated moving distance ds^ of the above-mentioned hypothetical sun spot in the image of the K-1th frame;

其中,数字式太阳敏感器对假定太阳光斑进行轨迹估计,具体可以根据卫星轨道参数、太阳的运动参数以及假定太阳光斑在第K-1帧图像中的位置,估计其在下一帧即第K帧图像中的移动距离ds^。Among them, the digital sun sensor estimates the trajectory of the hypothetical sun facula. Specifically, according to the satellite orbit parameters, the sun's motion parameters, and the position of the hypothetical sun facula in the K-1th frame image, it can be estimated that it will be in the next frame, that is, the Kth frame. The moving distance ds^ in the image.

步骤S214,计算第K帧图像的假定太阳光斑,相对于第K-1帧图像中假定太阳光斑的实际移动距离d;Step S214, calculating the assumed sun facula of the Kth frame image, relative to the actual moving distance d of the assumed sun facula in the K-1th frame image;

具体为,获取光斑信息处理中获取的第K帧图像的所述假定太阳光斑的光斑质心坐标以及获取的第K-1帧图像的假定太阳光斑的光斑质心坐标,计算获取的所述第K帧图像和第K-1帧图像的假定太阳光斑质心坐标的坐标差值,并对所述坐标差值求模,即:得到所述所述第K帧图像的假定太阳光斑相对于第K-1帧图像的假定太阳光斑的实际移动距离d;Specifically, the spot centroid coordinates of the assumed sun spot of the Kth frame image acquired in the spot information processing and the spot centroid coordinates of the assumed sun spot of the acquired K-1th frame image are obtained, and the acquired Kth frame is calculated. The coordinate difference of the hypothetical solar spot centroid coordinates of the image and the K-1th frame image, and calculate the modulus of the coordinate difference, that is: obtain the K-th frame image of the hypothetical solar spot relative to the K-1th The actual moving distance d of the assumed sun spot of the frame image;

步骤S215,计算所述d与ds^的差值绝对值,当所述差值绝对值小于预设的估计最大偏差时,则差值绝对值与估计最大偏差两者一致;否则,差值绝对值与估计最大偏差两者不一致。当比较结果为两者一致时,则将当前假定太阳光斑标记为太阳光斑,若有另一光斑,则标记为地球光斑;当比较结果为两者不一致时,则将当前假定太阳光斑标记为地球光斑,若有另一光斑,则标记为太阳光斑,然后执行步骤S216;Step S215, calculating the absolute value of the difference between d and ds^, when the absolute value of the difference is less than the preset estimated maximum deviation, the absolute value of the difference is consistent with the estimated maximum deviation; otherwise, the absolute value of the difference is The value does not agree with the estimated maximum deviation. When the comparison result is that the two are consistent, the current assumed sun spot is marked as the sun spot, and if there is another spot, it is marked as the earth spot; when the comparison result is inconsistent, the current assumed sun spot is marked as the earth spot Facula, if there is another facula, it is marked as solar facula, and then step S216 is performed;

步骤S216,对图像序列变量K的值增加1,执行步骤S202。Step S216, increase the value of the image sequence variable K by 1, and execute step S202.

图3示出了本发明用于数字式太阳敏感器的光斑识别装置的功能模块的组成结构,图中的光斑信息处理模块11及轨迹估计模块12为数字式太阳敏感器的其它功能模块,存储器14为数字式太阳敏感器的光斑信息存储装置,其进一步包括光斑标记存储器141、光斑个数存储器142、光斑最大灰度值存储器143、光斑总像素存储器144和光斑质心坐标存储器145;所述装置包括光斑识别判断模块13,用于根据光斑移动轨迹,区分并识别太阳光斑和地球光斑,并根据识别结果,对当前帧图像的光斑进行标记。Fig. 3 has shown the composition structure of the functional module of the light spot recognition device that the present invention is used for digital sun sensor, and light spot information processing module 11 among the figure and trajectory estimation module 12 are other functional modules of digital sun sensor, memory 14 is the light spot information storage device of the digital sun sensor, which further includes a light spot mark memory 141, a light spot number memory 142, a light spot maximum gray value memory 143, a light spot total pixel memory 144 and a light spot centroid coordinate memory 145; the device The light spot identification and judgment module 13 is included, which is used to distinguish and identify the sun light spot and the earth light spot according to the moving track of the light spot, and mark the light spot of the current frame image according to the identification result.

进一步地,光斑识别判断模块13包括光斑最大灰度值比较子模块131、光斑总像素比较子模块132、实际移动距离计算子模块133以及移动距离比较子模块134、识别判断状态机135、读写地址发生器136。Further, the light spot identification and judgment module 13 includes a light spot maximum gray value comparison submodule 131, a light spot total pixel comparison submodule 132, an actual moving distance calculation submodule 133, a moving distance comparison submodule 134, an identification and judgment state machine 135, a read-write address generator 136 .

其中,光斑最大灰度值比较子模块131,用于计算所述前一帧图像的光斑与所述当前帧图像的光斑的光斑最大灰度值的差值绝对值,并对所述差值绝对值与预设的最大灰度值差进行比较;Wherein, the light spot maximum grayscale value comparison submodule 131 is used to calculate the absolute value of the difference between the light spot of the previous frame image and the light spot maximum grayscale value of the light spot of the current frame image, and compare the absolute value of the difference The value is compared with the preset maximum gray value difference;

光斑总像素比较子模块132,用于计算所述前一帧图像的光斑与所述当前帧图像的光斑的光斑总像素差值绝对值,并对所述差值绝对值与预设的最大总像素差进行比较;The light spot total pixel comparison sub-module 132 is used to calculate the absolute value of the total pixel difference of the light spot between the light spot of the previous frame image and the light spot of the current frame image, and compare the difference between the absolute value of the difference and the preset maximum total Pixel difference for comparison;

实际移动距离计算子模块133,用于计算所述存储器存储的所述前一帧图像的光斑质心与存储的所述当前帧图像的光斑质心的坐标差值对应的模,得到所述当前帧图像的光斑相对于所述前一帧图像的光斑的实际移动距离;The actual moving distance calculation sub-module 133 is used to calculate the modulus corresponding to the coordinate difference between the spot centroid of the previous frame image stored in the memory and the stored current frame image's spot centroid, to obtain the current frame image The actual moving distance of the light spot relative to the light spot of the previous frame image;

移动距离比较子模块134,用于计算所述实际移动距离计算子模块得到的实际移动距离与获取的估计移动距离的差值绝对值,并对所述差值绝对值与预设的估计最大偏差进行比较;The moving distance comparison sub-module 134 is used to calculate the absolute value of the difference between the actual moving distance obtained by the actual moving distance calculation sub-module and the estimated moving distance acquired, and calculate the maximum deviation between the absolute value of the difference and the preset estimated maximum Compare;

识别判断状态机135,用于根据连续两帧图像的光斑信息,以及上述子模块的输出结果,分析判断,完成对当前帧图像光斑的识别和标记。The identification and judgment state machine 135 is used to analyze and judge according to the light spot information of two consecutive frames of images and the output results of the above sub-modules, and complete the identification and marking of the current frame image light spots.

读写地址发生器136,用于产生读写光斑标记存储器141、光斑个数存储器142、光斑最大灰度值存储器143、光斑总像素存储器144以及光斑质心坐标存储器145地址信号。The read and write address generator 136 is used to generate address signals for reading and writing the spot mark memory 141 , the spot number memory 142 , the maximum gray value memory 143 of the light spot, the total pixel memory 144 of the light spot and the coordinate memory 145 of the spot center of mass.

另外,所述用于数字式太阳敏感器的光斑识别装置可以基于现场可编程门阵列(Field Programmable Gate Array,FPGA)实现,又由于现有的数字式太阳敏感器大多数也是基于FPGA进行的实现,因此更有利于所述装置与数字式太阳敏感器的集成化设计,图4示出了本发明实现的用于数字式太阳敏感器的光斑识别装置基于FPGA实现的组成结构,其中,所述装置使用的FPGA芯片可以为Xilinx的FPGA芯片XCV300,如图4所示,其中,光斑信息处理模块11、轨迹估计模块12以及存储器14与图3中的相同,不再赘述。In addition, the described light spot recognition device for the digital sun sensor can be realized based on Field Programmable Gate Array (Field Programmable Gate Array, FPGA), and because most of the existing digital sun sensors are also realized based on FPGA , so it is more conducive to the integrated design of the device and the digital sun sensor. Fig. 4 shows the composition structure of the light spot recognition device for the digital sun sensor realized by the present invention based on FPGA, wherein the The FPGA chip used by the device can be FPGA chip XCV300 of Xilinx, as shown in FIG. 4 , wherein the spot information processing module 11 , trajectory estimation module 12 and memory 14 are the same as those in FIG. 3 , and will not be repeated here.

通过高速集成电路硬件描述语言(Very-High-Speed Integrated CircuitHardwareDescription Language,VHDL)对FPGA芯片编程,得到识别判断状态机235的具体实现,识别判断状态机235用于根据获取的光斑信息做分析判断,完成对当前帧图像光斑的识别和标记。By programming the FPGA chip through a high-speed integrated circuit hardware description language (VHDL), the specific realization of the identification and judgment state machine 235 is obtained. The identification and judgment state machine 235 is used to analyze and judge according to the acquired light spot information, Complete the identification and marking of the current frame image spot.

同理通过VHDL对FPGA芯片编程,读写地址发生器236的具体实现,读写地址发生器236用于读取或保存图像的光斑信息,包括光斑标记、光斑个数、光斑最大灰度值、光斑总像素4和光斑质心坐标。In the same way, the FPGA chip is programmed through VHDL, and the read-write address generator 236 is implemented. The read-write address generator 236 is used to read or save the spot information of the image, including the spot mark, the number of spots, the maximum gray value of the spot, The total pixels of the spot 4 and the coordinates of the center of mass of the spot.

同理通过VHDL对FPGA芯片编程,得到减法器2311和比较器2312,减法器2311和比较器2312为图3中光斑最大灰度值比较子模块131的具体实现,减法器2311用于计算光斑最大灰度值存储器143存储的前一帧图像的光斑的光斑最大灰度值与当前帧图像的光斑的光斑最大灰度值的差值绝对值,比较器2312用于对所述差值绝对值与预设的最大灰度值差进行比较,可以设定当所述差值绝对值小于所述最大灰度值差时,输出1,否则输出0,同理,也可以设定当所述差值绝对值小于所述最大灰度值差时,输出0,否则输出1。Similarly, the FPGA chip is programmed through VHDL to obtain a subtractor 2311 and a comparator 2312. The subtractor 2311 and the comparator 2312 are specific implementations of the facula maximum gray value comparison sub-module 131 in FIG. 3. The subtractor 2311 is used to calculate the maximum facula The absolute value of the difference between the maximum gray value of the light spot of the light spot of the previous frame image stored in the gray value memory 143 and the maximum gray value of the light spot of the light spot of the current frame image, and the comparator 2312 is used to compare the absolute value of the difference and the maximum gray value of the light spot of the light spot of the current frame image Compared with the preset maximum gray value difference, it can be set that when the absolute value of the difference is smaller than the maximum gray value difference, output 1, otherwise output 0, similarly, it can also be set when the difference When the absolute value is smaller than the maximum gray value difference, output 0, otherwise output 1.

同理通过VHDL对FPGA芯片编程,得到减法器2321和比较器2322,减法器2321和比较器2322为图3中光斑总像素比较子模块132的具体实现:减法器2321用于计算光斑总像素存储器144存储的前一帧图像光斑的光斑总像素与当前帧图像的光斑的光斑总像素差值绝对值,比较器2322用于对所述差值绝对值与预设的最大总像素差进行比较,可以设定当所述差值绝对值小于所述最大总像素差时,输出1,否则输出0,同理,也可以设定当所述差值绝对值小于所述最大灰度值差时,输出0,否则输出1。In the same way, the FPGA chip is programmed by VHDL, and the subtractor 2321 and the comparator 2322 are obtained. The subtractor 2321 and the comparator 2322 are the concrete realization of the spot total pixel comparison submodule 132 in FIG. 3: the subtractor 2321 is used for calculating the total pixel memory of the spot 144 stores the absolute value of the difference between the total pixels of the light spot of the previous frame image and the total pixel difference of the light spot of the current frame image, and the comparator 2322 is used to compare the absolute value of the difference with the preset maximum total pixel difference, It can be set that when the absolute value of the difference is smaller than the maximum total pixel difference, 1 is output, otherwise 0 is output. Similarly, it can also be set that when the absolute value of the difference is smaller than the maximum gray value difference, Output 0, otherwise output 1.

同理通过VHDL对FPGA芯片编程,得到X减法器2331、Y减法器2332和求模运算器2333,X减法器2331、Y减法器2332和求模运算器2333为图3中实际移动距离计算子模块133的具体实现,X减法器2331用于计算光斑质心坐标存储器145存储的前一帧图像的光斑质心的X坐标和当前帧图像的光斑质心的X坐标的差值;Y减法器2332用于计算光斑质心坐标存储器145存储的前一帧图像的光斑质心的Y坐标和当前帧图像的光斑质心的Y坐标的差值;求模运算器2333用于对X减法器2331和Y减法器2332得到的坐标差值求模,得到当前帧图像的光斑相对于前一帧图像的光斑的实际移动距离。Similarly, program the FPGA chip through VHDL to obtain the X subtractor 2331, the Y subtractor 2332 and the modulo operator 2333, and the X subtractor 2331, the Y subtractor 2332 and the modulo operator 2333 are the actual moving distance calculators in Fig. 3 The specific realization of module 133, X subtractor 2331 is used for calculating the difference between the X coordinate of the spot centroid of the previous frame image stored in the spot centroid coordinate memory 145 and the X coordinate of the spot centroid of the current frame image; Y subtractor 2332 is used for Calculate the difference between the Y coordinate of the spot centroid of the previous frame image stored in the spot centroid coordinate memory 145 and the Y coordinate of the spot centroid of the current frame image; the modulo operator 2333 is used to obtain the X subtractor 2331 and the Y subtractor 2332 Calculate the modulo of the coordinate difference of , and obtain the actual moving distance of the light spot of the current frame image relative to the light spot of the previous frame image.

同理通过VHDL对FPGA芯片编程,得到减法器2341和比较器2342,减法器2341和比较器2342为图3中移动距离比较子模块134的具体实现:减法器2341用于计算求模运算器2333得到的实际移动距离与所述轨迹估计模块12得到的估计移动距离的差值绝对值,比较器2342用于对所述差值绝对值与预设的估计最大偏差进行比较,可以设定当所述差值绝对值小于所述估计最大偏差时,输出1,否则输出0,同理,也可以设定当所述差值绝对值小于所述最大灰度值差时,输出0,否则输出1。Similarly, program the FPGA chip through VHDL to obtain a subtractor 2341 and a comparator 2342, which are the specific implementations of the moving distance comparison sub-module 134 in Figure 3: the subtractor 2341 is used to calculate the modulo operator 2333 to obtain The absolute value of the difference between the actual moving distance and the estimated moving distance obtained by the trajectory estimation module 12, the comparator 2342 is used to compare the absolute value of the difference with the preset estimated maximum deviation, and can be set when the When the absolute value of the difference is smaller than the estimated maximum deviation, 1 is output, otherwise 0 is output. Similarly, when the absolute value of the difference is smaller than the maximum gray value difference, 0 is output, otherwise 1 is output.

本发明提供的用于数字式太阳敏感器的光斑识别方法及装置,根据光斑的移动轨迹区分识别太阳光斑和地球光斑,从而避免了地球反照光对数字式太阳敏感器的影响,不仅克服了根据能量余弦效应的光斑变化规律区分光斑所存在的误差性,同时不需要对数字式太阳敏感器添加特殊的窄带滤波以降低到达的地球反照光强度,降低了数字式太阳敏感器的设计难度,保证了数字式太阳敏感器的可靠工作;同时上述装置还可以基于FPGA进行实现,有利于数字式太阳敏感器的集成化设计。The light spot recognition method and device for the digital sun sensor provided by the present invention distinguish and identify the sun light spot and the earth light spot according to the moving track of the light spot, thereby avoiding the influence of the earth's reflected light on the digital sun sensor, not only overcoming the The light spot change law of the energy cosine effect distinguishes the error of the light spot, and at the same time, it is not necessary to add a special narrow-band filter to the digital sun sensor to reduce the intensity of the earth's reflection light, which reduces the design difficulty of the digital sun sensor and ensures The reliable work of the digital sun sensor is ensured; at the same time, the above-mentioned device can also be realized based on FPGA, which is beneficial to the integrated design of the digital sun sensor.

以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention.

Claims (4)

1.一种用于数字式太阳敏感器的光斑识别方法,其特征在于,所述方法包括下述步骤:1. a method for spot recognition for digital sun sensor, is characterized in that, described method comprises the steps: 当数字式太阳敏感器前一帧图像的光斑具有光斑标记时,获取所述前一帧图像的光斑在当前帧图像中的估计移动距离;When the light spot of the previous frame image of the digital sun sensor has a light spot mark, the estimated moving distance of the light spot of the previous frame image in the current frame image is obtained; 计算当前帧图像的光斑相对于前一帧图像的光斑的实际移动距离;Calculate the actual moving distance of the light spot of the current frame image relative to the light spot of the previous frame image; 计算实际移动距离与估计移动距离的差值绝对值,当差值绝对值小于预设的估计最大偏差时,则差值绝对值与估计最大偏差两者一致,否则,差值绝对值与估计最大偏差两者不一致;当两者一致,且所述前一帧图像的光斑标记为太阳光斑时,则将所述当前帧图像的光斑标记为太阳光斑,若有另一光斑则标记为地球光斑;当两者一致,且所述前一帧图像的光斑标记为地球光斑时,则将所述当前帧图像的光斑标记为地球光斑,若有另一光斑则标记为太阳光斑;当两者不一致,且所述前一帧图像的光斑标记为太阳光斑时,则将所述当前帧图像的光斑标记为地球光斑,若有另一光斑则标记为太阳光斑;当两者不一致,且所述前一帧图像的光斑标记为地球光斑时,则将所述当前帧图像的光斑标记为太阳光斑,若有另一光斑则标记为地球光斑;Calculate the absolute value of the difference between the actual moving distance and the estimated moving distance. When the absolute value of the difference is less than the preset estimated maximum deviation, the absolute value of the difference is consistent with the estimated maximum deviation. Otherwise, the absolute value of the difference is the same as the estimated maximum deviation. The deviations are inconsistent; when the two are consistent, and the light spot of the previous frame image is marked as a sun light spot, then the light spot of the current frame image is marked as a sun light spot, and if there is another light spot, it is marked as an earth light spot; When the two are consistent, and the light spot of the previous frame image is marked as the earth light spot, then the light spot of the current frame image is marked as the earth light spot, and if there is another light spot, then it is marked as the sun light spot; when the two are inconsistent, And when the light spot of the previous frame image is marked as the sun light spot, then the light spot of the current frame image is marked as the earth light spot, and if there is another light spot, it is marked as the sun light spot; when the two are inconsistent, and the previous one When the light spot of the frame image is marked as the earth light spot, the light spot of the current frame image is marked as the sun light spot, and if there is another light spot, then it is marked as the earth light spot; 当所述前一帧图像的光斑没有光斑标记时,计算前一帧图像的光斑与当前帧图像的光斑的光斑总像素和光斑最大灰度值的差值绝对值;当所述光斑总像素的差值绝对值和所述光斑最大灰度值的差值绝对值分别小于预设的最大总像素差和最大灰度值差时,则存在相匹配的光斑,并将相匹配的光斑标记为假定太阳光斑;When the spot of the previous frame image has no spot mark, calculate the absolute value of the difference between the total pixels of the spot of the spot of the previous frame image and the spot of the current frame image and the maximum gray value of the spot; when the total pixel of the spot is When the absolute value of the difference and the absolute value of the difference between the maximum gray value of the light spot are less than the preset maximum total pixel difference and the maximum gray value difference respectively, then there is a matching light spot, and the matching light spot is marked as hypothetical sun spot; 获取数字式太阳敏感器前一帧图像的假定太阳光斑在当前帧图像中的估计移动距离;Obtain the estimated moving distance of the assumed sun spot in the current frame image of the previous frame image of the digital sun sensor; 计算当前帧图像的假定太阳光斑相对于前一帧图像的假定太阳光斑的实际移动距离;Calculate the actual moving distance of the assumed sun facula of the current frame image relative to the assumed sun facula of the previous frame image; 计算假定太阳光斑的实际移动距离与估计移动距离的差值绝对值,当所述差值绝对值小于预设的估计最大偏差时,则假定标记正确,否则,假定标记不正确;假定标记正确时,将当前帧图像的假定太阳光斑标记为太阳光斑,若有另一光斑则标记为地球光斑;假定标记不正确时,将当前帧图像的假定太阳光斑标记为地球光斑,若有另一光斑则标记为太阳光斑。Calculate the absolute value of the difference between the actual moving distance of the assumed sun spot and the estimated moving distance. When the absolute value of the difference is less than the preset estimated maximum deviation, it is assumed that the mark is correct; otherwise, the mark is assumed to be incorrect; when the mark is assumed to be correct , mark the assumed sun spot of the current frame image as a sun spot, if there is another spot, mark it as an earth spot; if the label is incorrect, mark the assumed sun spot of the current frame image as an earth spot, if there is another spot, then Marked as sunspots. 2.根据权利要求1所述的方法,其特征在于,所述计算当前帧图像的光斑相对于前一帧图像的光斑的实际移动距离为:2. The method according to claim 1, wherein the calculation of the actual moving distance of the light spot of the current frame image relative to the light spot of the previous frame image is: 计算前一帧图像的光斑质心与当前帧图像的光斑质心的坐标差值对应的模,得到当前帧图像的光斑相对于前一帧图像的光斑的实际移动距离。Calculate the modulus corresponding to the coordinate difference between the spot centroid of the previous frame image and the spot centroid of the current frame image, and obtain the actual moving distance of the spot of the current frame image relative to the spot of the previous frame image. 3.一种用于数字式太阳敏感器的光斑识别装置,其特征在于,所述装置包括光斑识别判断模块,用于根据光斑移动轨迹,区分并识别太阳光斑和地球光斑,并根据识别结果,对当前帧图像的光斑进行标记;其中,3. A light spot recognition device for a digital sun sensor, characterized in that the device includes a light spot recognition and judgment module for distinguishing and identifying sun light spots and earth light spots according to the moving track of light spots, and according to the recognition result, Mark the spot of the current frame image; where, 所述光斑识别判断模块还包括:The spot recognition and judgment module also includes: 光斑最大灰度值比较子模块,用于计算前一帧图像的光斑与所述当前帧图像的光斑的光斑最大灰度值的差值绝对值,并对所述差值绝对值与预设的最大灰度值差进行比较;The maximum gray value comparison submodule of the light spot is used to calculate the absolute value of the difference between the light spot of the previous frame image and the maximum gray value of the light spot of the light spot of the current frame image, and compare the absolute value of the difference with the preset Compare the maximum gray value difference; 光斑总像素比较子模块,用于计算所述前一帧图像的光斑与所述当前帧图像的光斑的光斑总像素差值绝对值,并对所述差值绝对值与预设的最大总像素差进行比较;The light spot total pixel comparison sub-module is used to calculate the absolute value of the total pixel difference of the light spot between the light spot of the previous frame image and the light spot of the current frame image, and compare the absolute value of the difference with the preset maximum total pixel difference for comparison; 实际移动距离计算子模块,用于计算所述数字式太阳敏感器的存储器存储的所述前一帧图像的光斑质心与存储的所述当前帧图像的光斑质心的坐标差值对应的模,得到所述当前帧图像的光斑相对于所述前一帧图像的光斑的实际移动距离;The actual moving distance calculation sub-module is used to calculate the modulus corresponding to the coordinate difference between the spot centroid of the previous frame image stored in the memory of the digital sun sensor and the stored coordinate difference of the spot centroid of the current frame image, to obtain The actual moving distance of the light spot of the current frame image relative to the light spot of the previous frame image; 移动距离比较子模块,用于计算所述实际移动距离计算子模块得到的实际移动距离与获取的估计移动距离的差值绝对值,并对所述差值绝对值与预设的估计最大偏差进行比较;The moving distance comparison sub-module is used to calculate the absolute value of the difference between the actual moving distance obtained by the actual moving distance calculation sub-module and the obtained estimated moving distance, and perform a calculation on the difference between the absolute value of the difference and the preset estimated maximum deviation Compare; 识别判断状态机,用于根据前一帧图像和当前帧图像的光斑信息,以及上述子模块的输出结果,分析判断,完成对当前帧图像的光斑的识别和标记;读写地址发生器,用于读取所需的光斑信息,并存储识别判断状态机输出的光斑标记结果到光斑标记存储器。The identification and judgment state machine is used to analyze and judge according to the light spot information of the previous frame image and the current frame image, as well as the output results of the above sub-modules, and complete the identification and marking of the light spot of the current frame image; the read-write address generator uses It is used to read the required light spot information, and store the light spot mark result output by the identification and judgment state machine into the light spot mark memory. 4.根据权利要求3所述的装置,其特征在于,所述装置基于FPGA实现时,所述光斑最大灰度值比较子模块由减法器和比较器实现,减法器用于计算存储器存储的前一帧图像的光斑的光斑最大灰度值与当前帧图像的光斑的光斑最大灰度值的差值绝对值,比较器用于对所述差值绝对值与预设的最大灰度值差进行比较,并将比较结果输出给识别判断状态机;4. The device according to claim 3, wherein when the device is implemented based on FPGA, the maximum gray value comparison submodule of the light spot is realized by a subtractor and a comparator, and the subtractor is used to calculate the previous value stored in the memory. The absolute value of the difference between the maximum gray value of the light spot of the frame image and the maximum gray value of the light spot of the current frame image, and the comparator is used to compare the absolute value of the difference with the preset maximum gray value difference, And output the comparison result to the identification and judgment state machine; 所述光斑总像素比较子模块由减法器和比较器实现,减法器用于计算存储器存储的前一帧图像光斑的光斑总像素与当前帧图像的光斑的光斑总像素差值绝对值,比较器用于对所述差值绝对值与预设的最大总像素差进行比较,并将比较结果输出给识别判断状态机;The total pixel comparison submodule of the light spot is realized by a subtractor and a comparator. The subtractor is used to calculate the absolute value of the total pixel difference between the total pixels of the light spot of the light spot of the previous frame image stored in the memory and the total pixel difference of the light spot of the light spot of the current frame image. The comparator is used for Comparing the absolute value of the difference with a preset maximum total pixel difference, and outputting the comparison result to the recognition and judgment state machine; 所述实际移动距离子模块由X减法器、Y减法器和求模运算器实现,X减法器用于计算所述存储器存储的前一帧图像的光斑质心的X坐标和当前帧图像的光斑质心的X坐标的差值;Y减法器用于计算所述存储器存储的前一帧图像的光斑质心的Y坐标和当前帧图像的光斑质心的Y坐标的差值;求模运算器用于对X减法器和Y减法器得到的坐标差值求模,得到当前帧图像的光斑相对于前一帧图像的光斑的实际移动距离;The actual moving distance sub-module is realized by an X subtractor, a Y subtractor and a modulo operator, and the X subtractor is used to calculate the X coordinate of the spot centroid of the previous frame image stored in the memory and the X coordinate of the spot centroid of the current frame image. The difference of the X coordinates; the Y subtractor is used to calculate the difference between the Y coordinate of the spot centroid of the previous frame image stored in the memory and the Y coordinate of the spot centroid of the current frame image; the modulo operator is used for the X subtractor and The coordinate difference value obtained by the Y subtractor is modulo obtained to obtain the actual moving distance of the light spot of the current frame image relative to the light spot of the previous frame image; 所述移动距离比较子模块由减法器和比较器实现,减法器用于计算求模运算器得到的实际移动距离与获取的估计移动距离的差值绝对值,比较器用于对所述差值绝对值与预设的估计最大偏差进行比较,并将比较结果输出给识别判断状态机。The moving distance comparison submodule is realized by a subtractor and a comparator, the subtractor is used to calculate the absolute value of the difference between the actual moving distance obtained by the modulo operator and the estimated moving distance obtained, and the comparator is used to compare the absolute value of the difference It is compared with the preset estimated maximum deviation, and the comparison result is output to the recognition and judgment state machine.
CN 201010567899 2010-12-01 2010-12-01 A light spot recognition method and device for a digital sun sensor Expired - Fee Related CN102034091B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010567899 CN102034091B (en) 2010-12-01 2010-12-01 A light spot recognition method and device for a digital sun sensor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010567899 CN102034091B (en) 2010-12-01 2010-12-01 A light spot recognition method and device for a digital sun sensor

Publications (2)

Publication Number Publication Date
CN102034091A CN102034091A (en) 2011-04-27
CN102034091B true CN102034091B (en) 2013-05-22

Family

ID=43886955

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010567899 Expired - Fee Related CN102034091B (en) 2010-12-01 2010-12-01 A light spot recognition method and device for a digital sun sensor

Country Status (1)

Country Link
CN (1) CN102034091B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103411579B (en) * 2013-07-25 2015-05-27 北京控制工程研究所 Image extraction method in linear array APS sun sensor
CN104182938B (en) * 2014-08-18 2017-01-18 国家电网公司 Solar facula repairing method of all-sky nephogram
CN108827279B (en) * 2018-04-11 2021-10-26 西北工业大学 Simulated sun sensor anti-interference method based on earth albedo
CN111121822B (en) * 2019-12-25 2021-07-20 南京先进激光技术研究院 A method for automatically correcting the pointing of a star-sensitive camera by using image recognition
CN114820767B (en) * 2022-04-15 2025-09-16 昆山丘钛光电科技有限公司 Light spot addressing method, device, equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1907809A (en) * 2006-08-01 2007-02-07 北京航空航天大学 High precision APS sun sensor
CN101089553A (en) * 2007-07-06 2007-12-19 中国科学院上海技术物理研究所 A Method for Preventing Earth Reflection in Digital Sun Sensors
CN101363732A (en) * 2008-09-17 2009-02-11 北京航空航天大学 A high frame rate sun sensor and its realization method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7115851B2 (en) * 2004-08-30 2006-10-03 Yaoming Zhang Heliostat device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1907809A (en) * 2006-08-01 2007-02-07 北京航空航天大学 High precision APS sun sensor
CN101089553A (en) * 2007-07-06 2007-12-19 中国科学院上海技术物理研究所 A Method for Preventing Earth Reflection in Digital Sun Sensors
CN101363732A (en) * 2008-09-17 2009-02-11 北京航空航天大学 A high frame rate sun sensor and its realization method

Also Published As

Publication number Publication date
CN102034091A (en) 2011-04-27

Similar Documents

Publication Publication Date Title
US11074706B2 (en) Accommodating depth noise in visual slam using map-point consensus
CN111210477B (en) A method and system for positioning a moving target
CN104981105B (en) A kind of quickly accurate detection and method for correcting error for obtaining element central and deflection angle
US10248854B2 (en) Hand motion identification method and apparatus
CN102034091B (en) A light spot recognition method and device for a digital sun sensor
CN109325930A (en) Detection method, device and the detection device of boundary defect
CN104704384A (en) Image processing method, particularly used in a vision-based localization of a device
CN104851094A (en) An Improved Method of SLAM Algorithm Based on RGB-D
CN104966300B (en) Bearing roller image detecting system and method and image detection device
CN113705564B (en) Pointer type instrument identification reading method
JP2011043969A (en) Method for extracting image feature point
CN117346846B (en) A method and device for automatically correcting water-measuring weir flow photography monitoring
Xie et al. A4lidartag: Depth-based fiducial marker for extrinsic calibration of solid-state lidar and camera
JP2022009474A (en) Systems and methods for detecting lines in a vision system
CN114757880A (en) Automatic detection method of clock travel time accuracy based on machine vision
Chen et al. Automatic detection and tracking of ship based on mean shift in corrected video sequences
EP3035242B1 (en) Method and electronic device for object tracking in a light-field capture
Ying et al. Anchor points based accurate fault locating in large-scale photovoltaic plants via aerial infrared videos
CN119313732B (en) An infrared/visible light fusion all-day autonomous positioning method and system guided by semantic information in dynamic scenes
CN104484647B (en) A kind of high-resolution remote sensing image cloud height detection method
CN109101874B (en) Library robot obstacle identification method based on depth image
Niu et al. Dynamically removing false features in pyramidal Lucas-Kanade registration
TW202230201A (en) Target image tracking system and method
CN118609071A (en) A multi-camera SLAM method and device in dynamic scenes
CN117456371A (en) Group string hot spot detection method, device, equipment and medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130522

Termination date: 20211201