Sunspot identification method and system compatible with PNG image format

By encapsulating the PNG image into fits file and configuring metadata, combining the spherical graft conversion algorithm and custom sensitivity interface, the compatibility and accuracy of sunspot recognition in PNG format is solved, and a sunspot recognition method that simplifies operation and improves visualization effects is realized.

CN120339925APending Publication Date: 2025-07-18SHANDONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510400910.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-01
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The existing technology is difficult to compatible with PNG format sunspot recognition, resulting in equipment limitations, inaccurate identification effects and complex operation in experimental teaching, and the distribution of sunspots cannot be visually displayed.

Method used

Encapsulate the PNG sun image into a fits file, configure the necessary metadata, and obtain the latitude and longitude coordinates of sunspots through the spherical longitude and graft conversion algorithm, and adjust the recognition threshold in combination with a custom sensitivity interface to realize sunspot visualization.

Benefits of technology

It realizes compatibility with PNG format images, lowers the equipment threshold, improves recognition accuracy and visualization effects, simplifies the operation process, and facilitates students to understand the distribution of sunspots.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120339925A_ABST
    Figure CN120339925A_ABST
Patent Text Reader

Abstract

The invention discloses a sunspot identification method and system compatible with a PNG image format, and relates to the technical field of sunspot observation, and the method comprises the steps: packaging a PNG sun image into a fit file, and configuring the shooting time, the sun surface coordinate, the image depth, the pixel point corresponding angle and the zoom factor in a file header of the fit file; recognizing the two-dimensional coordinates of the sunspots based on the configured fit file, and obtaining the longitude and latitude coordinates of the sunspots in the full-solar spherical graticule according to the geometric projection relation from the hemispherical surface to the circular plane; and converting the latitude and longitude coordinates into pixel coordinates, and marking the pixel coordinates at corresponding positions of a graticule drawn on the PNG sun image, thereby obtaining a visual sunspot image. The compatibility of the sun image in the PNG format is improved, and a good recognition effect is achieved; and a spherical graticule conversion algorithm is provided, and the longitude and latitude degrees of key positions are clearly displayed on the image, so that the distribution condition of the sunspots on the surface of the sun can be intuitively understood.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of sunspot observation, and particularly to a sunspot recognition method and system compatible with the PNG image format. Background Art

[0002] The statements in this section merely provide background technical information related to the present invention and do not necessarily constitute prior art.

[0003] In experimental teaching, students usually need to observe sunspots through a telescope to understand the relevant knowledge of solar physics. However, due to the high cost and limited quantity of large professional telescope equipment, it is difficult for students to directly use it in experimental teaching. In terms of data processing, although there are currently many image processing algorithms based on deep learning that can be used for sunspot recognition, their application fields are mainly for the scientific research-level data processing of large observatory professional astronomical telescopes. For undergraduate students who are beginners, the deployment and implementation of these algorithms have high thresholds, poor usability, and limited usage scenarios.

[0004] Moreover, the existing method can only receive fits format files from specific observatory data sources as input, requiring detailed metadata in the header file of the fits file, with strong limitations; in experimental teaching, the display and processing of fits files are not convenient, and the original algorithm is not compatible with fits files taken by a laboratory CCD camera with corresponding software.

[0005] In addition, the threshold or sensitivity BSCALE for identifying sunspots is given by the fits header file, which is a fixed value to ensure correct exposure according to the shooting conditions. However, the file in PNG format does not contain this parameter, so a preset value needs to be given to BSCALE; but the design of fixed parameters results in uneven recognition effects when facing images under different lighting conditions; for over-bright or over-dark images, the fixed threshold may lead to misrecognition or missed recognition, affecting the accuracy of the results. The existing method cannot adjust the threshold or sensitivity of image recognition, resulting in uneven recognition effects for images with different brightness levels.

[0006] Finally, after identifying the sunspots, the visualized image output in the existing method only marks the positions and serial numbers of the sunspots, lacking the full-disk spherical longitude and latitude grid corresponding to the longitude and latitude coordinates, resulting in insufficiently intuitive image information and making it difficult to help students or users understand the specific distribution of sunspots on the solar surface. Summary of the Invention

[0007] To solve the above problems, the present invention proposes a sunspot recognition method and system compatible with the PNG image format. Based on the captured PNG solar image, it is encapsulated into a fits file, and necessary metadata is configured in the fits file, improving the compatibility with the PNG format solar image and having a good recognition effect; a spherical latitude and longitude grid conversion algorithm is proposed to obtain the heliospheric latitude and longitude coordinates of the sunspot center point, and the latitude and longitude degrees at key positions are clearly displayed on the image, facilitating an intuitive understanding of the distribution of sunspots on the solar surface.

[0008] To achieve the above object, the present invention adopts the following technical solutions:

[0009] In the first aspect, the present invention provides a sunspot recognition method compatible with the PNG image format, including:

[0010] Obtain the captured PNG solar image;

[0011] Encapsulate the PNG solar image into a fits file, and configure the shooting time, heliospheric coordinates, image depth, angle corresponding to each pixel point, and scaling factor extracted based on the PNG solar image in the file header of the fits file;

[0012] Based on the configured fits file, recognize the two-dimensional coordinates of the sunspots, and obtain the heliospheric latitude and longitude coordinates of the sunspots in the heliospheric spherical latitude and longitude grid according to the geometric projection relationship from the hemisphere to the circular plane;

[0013] Convert the heliospheric latitude and longitude coordinates to pixel coordinates and mark them at the corresponding positions of the latitude and longitude grid drawn on the PNG solar image, thereby obtaining the sunspot visualization image.

[0014] As an alternative implementation, the configuration process of the file header of the fits file includes: determining the heliospheric coordinates based on the shooting time; modifying the image depth of the PNG solar image to the image depth of the fits format; determining the angle corresponding to each pixel point in the horizontal and vertical directions of the PNG solar image; setting the scaling factor, which is used to offset and scale the pixel points so that they are within the set range.

[0015] As an alternative implementation, modify the 8-bit image depth of the PNG solar image to the 16-bit image depth of the fits format;

[0016] Obtain the angle corresponding to each pixel point by dividing the average apparent diameter of the solar disk by the pixel diameter of the solar disk in the PNG solar image;

[0017] Set the scaling factor to 250;

[0018] The heliospheric coordinates include the heliocentric latitude, heliospheric longitude, and solar P angle of the center of the solar disk.

[0019] As an alternative implementation, the process of obtaining the latitude and longitude coordinates of sunspots in the spherical latitude and longitude grid of the full solar disk includes:

[0020] Determine the x value and y value according to the two-dimensional coordinates of the sunspot, and use the solar radius as the distance from the sunspot to the coordinate origin, thereby determining the z value of the sunspot in the three-dimensional rectangular coordinate system;

[0021] Determine the equatorial plane, that is, the plane where the 0-degree latitude line is located. Determine the plane equation of the 0-degree latitude line in the three-dimensional rectangular coordinate system according to the heliographic latitude of the solar disk center, and determine the plane equation of the 0-degree longitude line in the three-dimensional rectangular coordinate system according to the heliographic longitude of the solar disk center. Thus, obtain the latitude and longitude coordinates of the sunspot according to the x value, y value and z value of the sunspot.

[0022] As an alternative implementation, the plane equation of the 0-degree latitude line in the three-dimensional rectangular coordinate system is: -sinB0·X + cosB0·Z = 0, where B0 is the heliographic latitude of the solar disk center;

[0023] The plane equation of the 0-degree longitude line in the three-dimensional rectangular coordinate system is: sinL0·X - cosL0·Y = 0, where L0 is the heliographic longitude of the solar disk center;

[0024] For the sunspot (X, Y, Z), the latitude is θ = arcsin[(-sinB0·X + cosB0·Z) / R], and the longitude is φ = arctan2(Y, XcosB0 + ZsinB0) - L0, where R is the solar radius.

[0025] As an alternative implementation, the visualization process includes:

[0026] Draw the latitude and longitude grid on the PNG solar image, set the grid interval to 10 degrees, and mark the latitude and longitude on the PNG solar image; for latitude marking, add markings at the intersections of the 0° longitude line and each latitude line; for longitude marking, add markings at the intersections of the 0° latitude line and each longitude line;

[0027] Convert the latitude and longitude coordinates to image pixel coordinates, and draw the marked text on the PNG solar image to ensure that the marked positions are accurate and do not overlap with the grid lines, thereby displaying the latitude and longitude degrees of key positions on the PNG solar image.

[0028] In a second aspect, the present invention provides a sunspot recognition system compatible with the PNG image format, including:

[0029] An acquisition module configured to acquire the captured PNG solar image;

[0030] An encapsulation module, configured to encapsulate a PNG solar image into a FITS file, and configure the shooting time, heliographic coordinates, image depth, pixel corresponding angle, and scaling factor extracted from the PNG solar image in the header of the FITS file;

[0031] A conversion module, configured to identify the two-dimensional coordinates of sunspots based on the configured FITS file, and obtain the longitude and latitude coordinates of the sunspots in the heliospheric spherical grid according to the geometric projection relationship from the hemispherical surface to the circular plane;

[0032] A visualization module, configured to convert the longitude and latitude coordinates into pixel coordinates and mark them at the corresponding positions of the grid drawn on the PNG solar image, thereby obtaining a sunspot visualization image.

[0033] In a third aspect, the present invention provides an electronic device, including a memory and a processor, as well as computer instructions stored on the memory and running on the processor. When the computer instructions are run by the processor, the method described in the first aspect is completed.

[0034] In a fourth aspect, the present invention provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by the processor, the method described in the first aspect is completed.

[0035] In a fifth aspect, the present invention provides a computer program product, including a computer program. When the computer program is executed by the processor, the method described in the first aspect is implemented.

[0036] Compared with the prior art, the beneficial effects of the present invention are:

[0037] The present invention proposes a sunspot recognition method and system compatible with the PNG image format, aiming to solve problems such as the limitations of large-scale equipment for sunspot observation in undergraduate experimental teaching, the low efficiency and inaccurate results of existing manual drawing analysis, and the high threshold for the deployment of existing recognition algorithms. It improves the compatibility with PNG-format solar images. Based on the captured PNG solar images, they are encapsulated into fits files, and necessary metadata is configured in the fits files to make them compatible with the sunspot recognition algorithm and have good recognition effects. A custom sensitivity interface is introduced, allowing the sensitivity of image processing to be dynamically controlled by adjusting the BSCALE parameter to ensure the recognition quality of images under different shooting conditions. A spherical longitude and latitude grid conversion algorithm is proposed. Taking planar two-dimensional coordinates as input, the conversion is achieved through the geometric projection relationship from the hemispherical surface to the circular plane, and the solar spherical longitude and latitude coordinates of the center point of each sunspot are output, and the longitude and latitude degrees of key positions are clearly displayed on the solar image, enabling the position of the sunspot to directly correspond to the spherical coordinates of the sun, making the image more visualized, facilitating users to intuitively understand the distribution of sunspots on the solar surface, significantly improving the visualization effects of teaching and scientific research, and enabling the observation of sunspots without relying on expensive large-scale professional equipment, thus solving the equipment limitation problem.

[0038] The present invention captures images through a small telescope, has strong compatibility, is easy to operate, and can be used without the need to have complex image processing knowledge, reducing the equipment threshold; it provides image annotation and tabular visualization display, facilitating students to understand and analyze, solving the efficiency problem while improving the accuracy of recognition results.

[0039] Advantages of additional aspects of the present invention will be partly given in the following description, partly will become obvious from the following description, or will be understood through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained according to the provided drawings.

[0041] Figure 1 It is a flowchart of the sunspot recognition method compatible with the PNG image format provided in Embodiment 1 of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0042] The following will further illustrate the present invention in conjunction with the drawings and embodiments.

[0043] It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.

[0044] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular forms are also intended to include the plural forms. In addition, it should be understood that the terms "comprising" and "including" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0045] In the case of no conflict, the embodiments in the present invention and the features in the embodiments may be combined with each other.

[0046] Embodiment 1

[0047] As Figure 1 shown, this embodiment provides a sunspot recognition method compatible with the PNG image format, including:

[0048] Obtain the captured PNG solar image;

[0049] Encapsulate the PNG solar image into a fits file, and configure the shooting time, heliographic coordinates, image depth, pixel point corresponding angle, and scaling factor extracted from the PNG solar image in the file header of the fits file;

[0050] Based on the configured fits file, identify the two-dimensional coordinates of the sunspots, and according to the geometric projection relationship from the hemispherical surface to the circular plane, obtain the longitude and latitude coordinates of the sunspots in the heliographic spherical grid of the whole solar disk;

[0051] Convert the longitude and latitude coordinates into pixel coordinates and mark them at the corresponding positions of the grid drawn on the PNG solar image, thereby obtaining the sunspot visualization image.

[0052] In this embodiment, the PNG solar image can be captured by a small telescope, and the PNG solar image can be preprocessed, including cropping and centering. The original PNG solar image is cropped into a square with an aspect ratio of 1:1, while ensuring that the solar disk is located at the center of the image, and the size of the solar disk is resampled and scaled so that it occupies a set size in the image to ensure the recognition accuracy of the subsequent algorithm.

[0053] Since the existing algorithms for sunspot recognition can only receive fits format files from specific observatory data sources as input, and require detailed metadata in the header files of the fits files, their limitations are very strong. In experimental teaching, the display and processing of fits files are not convenient, and the original algorithm is not compatible with the fits files taken by using a laboratory CCD camera with corresponding software.

[0054] Therefore, the method of this embodiment improves the compatibility with PNG format solar images. Based on the PNG solar images directly captured by a CCD camera, they are encapsulated into fits files, and necessary metadata is configured in the fits files so that they can be compatible with the sunspot recognition algorithm and have good recognition effects.

[0055] Specifically: First, the 1:1 square images obtained after preprocessing are resampled to unify their resolutions, and the resampled images are encapsulated in fits files; then, the metadata in the file headers of the corresponding fits files are matched. The metadata includes the shooting time, heliographic coordinates, image depth, the angle corresponding to each pixel point, and the scaling factor.

[0056] Specifically, it includes:

[0057] (1) Extract the shooting time DATE-OBS from the file name string of the PNG solar image, and determine the heliographic coordinates according to the shooting time.

[0058] The heliographic coordinates include the heliographic latitude B0 at the center of the solar disk, that is, the inclination angle of the solar center relative to the solar equator from the perspective of the earth; the heliographic longitude L0 where the center of the solar disk is located, that is, the value of the solar central meridian in the standard longitude system; the P angle of the sun, that is, the angle of the solar north pole relative to the celestial north direction. The values of B0, L0, and P at zero o'clock in the world time every day of the year are listed in the astronomical almanac, and the values at the observation moment can be obtained by using the interpolation method. This process can be directly calculated based on the observation time using the corresponding functions of the sunpy library in python. This embodiment does not make specific limitations.

[0059] (2) Modify the image depth of the PNG solar image to the image depth BITPIX of the fits format, that is, change the 8-bit image depth of the PNG solar image to 16-bit image depth.

[0060] (3) Determine the angles cdelt1 and cdelt2 corresponding to each pixel point in the horizontal and vertical directions in the PNG solar image; for example, 1 arcsecond / pixel, which is obtained by dividing the average apparent diameter of the solar disk (in angular seconds) by the pixel diameter of the solar disk in the solar image (in pixels), to ensure that the apparent diameter of the sun in the output result conforms to the actual physical meaning.

[0061] (4) Set the scaling factor BSCALE; in the recognition algorithm, use the two parameters BZORE and BSCALE in the fits header file to offset and scale the original data to a specific range. Since the image depth of the PNG format is 8 bits, that is, the data range that each pixel can represent is 0-255, while the image depth of the fits file is 16 bits, that is, the data range that each pixel can represent is 0-65535. Although the BITPIX parameter has been used to describe the image depth of the PNG solar image as 16 bits, it only changes the data range it can represent, but does not change its absolute size. Therefore, it is necessary to use the BSCALE parameter to expand it to a suitable range, that is, to scale the original 8-bit data range to 16 bits, that is, from 0-255 to 0-65535, to reach the set recognition threshold. For example, if the original value of a pixel is x and it becomes x' after offset and scaling, then x' = BZORE + x * BSCALE. After repeated tests, when the BSCALE value is set to the default 250, it has the best recognition effect on normally exposed PNG images.

[0062] In addition, the threshold or sensitivity BSCALE for identifying sunspots is given by the fits header file and is a fixed value that ensures correct exposure according to the shooting conditions. However, the PNG format file does not contain this parameter, so a preset value needs to be given to BSCALE. After multiple tests, it is found that when the BSCALE value is set to 250, it has the best recognition effect on normally exposed PNG images. However, the design of fixed parameters results in uneven recognition effects when dealing with images under different lighting conditions; for over-bright or over-dark images, fixed thresholds may lead to misrecognition or missed recognition, affecting the accuracy of the results. And the existing methods cannot adjust the threshold or sensitivity of image recognition, resulting in uneven recognition effects for images of different brightness.

[0063] To solve this problem, this embodiment introduces a custom sensitivity interface, which allows users to dynamically control the sensitivity of image processing by adjusting the BSCALE parameter to ensure the recognition quality of images under different shooting conditions. For darker images, using the default parameter 250 may not be able to identify all sunspots, so increase the sensitivity to capture more details; for brighter images, using the default parameter 250 may misidentify other features that are not sunspots, so decrease the sensitivity to reduce noise.

[0064] Specifically, first use the default parameter 250 for the BSCALE value for recognition, and then visually judge the approximate recognition rate of sunspots. If there are many unrecognized sunspots, it is considered that the brightness is low, and increase the BSCALE value to observe the recognition effect; if other features that are not sunspots appear, it is considered that the brightness is high, and decrease the BSCALE value to observe the recognition effect.

[0065] In image processing, the BSCALE parameter is used to adjust the set binarization threshold. Binarization is the process of converting a grayscale image into a black-and-white image, and the threshold determines which pixels are classified as "black" (sunspots) or "white" (background). The larger the BSCALE value, the lower the threshold, and more pixels are classified as "black", improving the recognition sensitivity; the smaller the BSCALE value, the higher the threshold, and the recognition becomes more stringent, reducing noise. This personalized adjustment mechanism ensures high-quality sunspot recognition results under different shooting conditions, enhancing the adaptability of the software and the user experience.

[0066] In this embodiment, based on the configured fits file, the two-dimensional coordinates of sunspots can be recognized. Sunspots can be recognized based on deep learning, machine learning, etc., and the positions of sunspots can be recognized based on genetic algorithms, convolutional neural networks, etc. This process can use conventional image processing algorithms or models without specific limitations.

[0067] In this embodiment, after the positions of sunspots are recognized, the two-dimensional coordinates of the sunspots in the plane rectangular coordinate system with the center of the solar disk as the origin and the due east and due north of the sun as the horizontal and vertical positive directions are output. However, the two-dimensional coordinates are not conducive to intuitively and accurately depicting the actual position coordinates of the sunspots.

[0068] The current solution in teaching practice is as follows: Based on the full-disk solar image obtained by using a small astronomical telescope combined with a CCD and a computer, first, students derive and calculate the necessary solar parameters according to the shooting date and time, including the heliographic latitude B0 of the center of the solar disk, that is, the inclination angle of the center of the sun relative to the solar equator from the perspective of the earth; the heliographic longitude L0 where the center of the solar disk is located, which is the value of the solar central meridian in the standard longitude system; the P angle of the sun, that is, the angle of the north pole of the sun relative to the north direction of the celestial sphere; rotate the solar image according to the P angle, draw the correct latitude and longitude grid, and on this basis, manually mark and draw the positions of sunspots, read the center point coordinates, and estimate the area of the sunspots. The manual image processing process is very cumbersome and contains a large amount of unnecessary repetitive work, which is time-consuming and laborious, and the efficiency is very low.

[0069] Therefore, this embodiment proposes a spherical latitude and longitude grid conversion algorithm, which takes the plane two-dimensional coordinates as the input, realizes the conversion through the geometric projection relationship from the hemisphere to the circular plane, and outputs the solar spherical longitude and latitude coordinates of the center point of each sunspot.

[0070] Specifically:

[0071] Regarding the sun as a sphere with a known constant radius, the original two-dimensional rectangular coordinate system is extended to a three-dimensional rectangular coordinate system. To determine the coordinates of a sunspot on the solar sphere, three coordinate components are required. Given the two-dimensional coordinates of the sunspot, that is, the xy components are known, and the distance from each sunspot to the coordinate origin is a fixed value, namely the solar radius. Then, the value of the third component can be calculated according to the distance formula between two points in three-dimensional space;

[0072] Specifically, in three-dimensional space, the coordinates of a sunspot are (x, y, z), where x and y are known, and the distance from it to the origin is the solar radius R. According to the distance formula between two points in space, we have: R 2 = x 2 + y 2 + z 2 , and the solution is: So far, the three coordinate components of each sunspot in the three-dimensional rectangular coordinate system have been obtained. The next step is to convert them into longitude and latitude.

[0073] According to the definition rules of longitude and latitude, first, the equatorial plane, that is, the plane where the 0-degree latitude circle is located, needs to be determined, and its plane equation in the rectangular coordinate system is written. Here, due to the different relative positions with the Earth observer according to different observation times, it needs to be determined according to the B0 parameter; similarly, the position of the 0-degree meridian is also related to the observation time and needs to be determined by the L0 parameter. After determining the starting reference for calculating longitude and latitude, the longitude and latitude coordinates of each known point in space can be calculated.

[0074] Specifically:

[0075] The equatorial plane is perpendicular to the solar axis of rotation, and its normal vector is determined by the direction of the solar north pole. In the three-dimensional rectangular coordinate system (X, Y, Z), the plane equation of the equatorial plane is: Z = 0; but in actual observations, due to the inclination between the solar axis of rotation and the Earth's observation direction (determined by the parameter B0), coordinate rotation is required. The plane equation of the rotated equatorial plane is: -sinB0·X + cosB0·Z = 0, where B0 takes the observation time as input and is obtained through the built-in algorithm of the source program; the plane of the prime meridian passes through the solar axis of rotation, and its position is determined by the parameter L0. The plane equation is: sinL0·X - cosL0·Y = 0. Similarly, L0 takes the observation time as input and is obtained through the built-in algorithm of the source program.

[0076] For any point (X, Y, Z) on the solar surface, its latitude θ = arcsin[(-sinB0·X + cosB0·Z) / R, which reflects the angle between this point and the equatorial plane, where R is the solar radius in pixels; the longitude φ = arctan2(Y, XcosB0 + ZsinB0) - L0, which represents the azimuth angle relative to the prime meridian.

[0077] After identifying sunspots, the visual images output by existing methods only mark the positions and serial numbers of sunspots, lacking the full-disk spherical latitude and longitude grid corresponding to the latitude and longitude coordinates, resulting in insufficiently intuitive image information and making it difficult for students or users to understand the specific distribution of sunspots on the solar surface.

[0078] To solve this problem, in this embodiment, a latitude and longitude grid overlay and key degree markings are added to the visual image.

[0079] First, use the draw_grid function of the sunpy library to draw the latitude and longitude grid on the PNG solar image, set the grid interval to 10 degrees, and mark the latitude and longitude on the PNG solar image. For latitude markings, add markings at the intersections of the 0° meridian and each latitude line (such as from -80° to 80°); for longitude markings, add markings at the intersections of the 0° latitude line and each meridian line (such as from -80° to 80°).

[0080] Then, convert the latitude and longitude coordinates to image pixel coordinates through SkyCoord, and draw the marked text on the image to ensure that the marked positions are accurate and do not overlap with the grid lines.

[0081] Finally, the latitude and longitude degrees of key positions are clearly shown on the image, helping users intuitively understand the distribution of sunspots. This enables the positions of sunspots to directly correspond to the spherical coordinates of the sun, making the image more vivid and facilitating users to intuitively understand the distribution of sunspots on the solar surface, significantly enhancing the visualization effect of teaching and research.

[0082] The method proposed in this embodiment takes images through a small telescope, has strong compatibility, and the software system can process images taken by a small telescope, reducing the equipment threshold; it provides image annotation and tabular visualization display, facilitating students' understanding and analysis.

[0083] Embodiment 2

[0084] This embodiment provides a sunspot recognition system compatible with the PNG image format, including:

[0085] An acquisition module configured to acquire the captured PNG solar image;

[0086] An encapsulation module configured to encapsulate the PNG solar image into a fits file and configure the shooting time, heliographic coordinates, image depth, pixel point corresponding angle, and scaling factor extracted based on the PNG solar image in the file header of the fits file;

[0087] A conversion module configured to identify the two-dimensional coordinates of sunspots based on the configured fits file and obtain the latitude and longitude coordinates of sunspots in the full-disk spherical latitude and longitude grid according to the geometric projection relationship from the hemisphere to the circular plane;

[0088] A visualization module, configured to convert longitude and latitude coordinates into pixel coordinates and mark them at corresponding positions of the longitude and latitude grid drawn on the PNG solar image, thereby obtaining a sunspot visualization image.

[0089] It should be noted here that the above-mentioned module corresponds to the steps described in Embodiment 1. The examples and application scenarios implemented by the above-mentioned module and the corresponding steps are the same, but are not limited to the content disclosed in the above-mentioned Embodiment 1. It should be noted that the above-mentioned module, as a part of the system, can be executed in a computer system such as a set of computer-executable instructions.

[0090] In more embodiments, there is also provided:

[0091] An electronic device, including a memory and a processor, and computer instructions stored on the memory and running on the processor. When the computer instructions are run by the processor, the method described in Embodiment 1 is completed. For the sake of brevity, it will not be elaborated here.

[0092] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0093] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A part of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0094] A computer-readable storage medium for storing computer instructions. When the computer instructions are executed by the processor, the method described in Embodiment 1 is completed.

[0095] The method in Embodiment 1 can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in the processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.

[0096] A computer program product, including a computer program, which when executed by a processor implements the method described in Embodiment 1.

[0097] The present invention also provides at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. The computer program product includes computer-executable instructions, such as instructions included in program modules, which are executed in a device on a target real or virtual processor to perform the processes / methods as described above. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform specific tasks or implement specific abstract data types. In various embodiments, the functions of program modules can be combined or divided as needed among program modules. The machine-executable instructions for program modules can be executed within a local or distributed device. In a distributed device, program modules can be located in local and remote storage media.

[0098] The computer program code for implementing the method of the present invention can be written in one or more programming languages. This computer program code can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program code is executed by the computer or other programmable data processing device, it causes the functions / operations specified in the flowchart and / or block diagram to be implemented. The program code can be executed entirely on the computer, partially on the computer, as a stand-alone software package, partially on the computer and partially on a remote computer, or entirely on a remote computer or server.

[0099] In the context of the present invention, the computer program code or related data can be carried by any suitable carrier so that a device, apparatus, or processor can perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, and the like. Examples of signals can include electrical, optical, radio, acoustic, or other forms of propagated signals, such as carrier waves, infrared signals, etc.

[0100] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in conjunction with this embodiment can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0101] Although the specific implementation manners of the present invention have been described above in conjunction with the accompanying drawings, it is not a limitation on the protection scope of the present invention. Those skilled in the art should understand that, based on the technical solution of the present invention, various modifications or deformations that can be made by those skilled in the art without creative efforts are still within the protection scope of the present invention.

Claims

1. A sunspot recognition method compatible with the PNG image format, characterized in that, Including: Obtaining the captured PNG solar image; Encapsulating the PNG solar image into a fits file, and configuring the shooting time, heliographic coordinates, image depth, corresponding angle of pixel points, and scaling factor extracted based on the PNG solar image in the header of the fits file; Identifying the two-dimensional coordinates of sunspots based on the configured fits file, and obtaining the longitude and latitude coordinates of sunspots in the heliographic spherical grid of the full solar disk according to the geometric projection relationship from the hemispherical surface to the circular plane; Converting the longitude and latitude coordinates into pixel coordinates and marking them at the corresponding positions of the grid drawn on the PNG solar image, thereby obtaining the visualized image of sunspots.

2. The sunspot recognition method compatible with the PNG image format according to claim 1, characterized in that, The configuration process of the header of the fits file includes: determining the heliographic coordinates based on the shooting time; modifying the image depth of the PNG solar image to the image depth of the fits format; determining the corresponding angles of each pixel point in the horizontal and vertical directions of the PNG solar image; setting the scaling factor, which is used to offset and scale the pixel points so that they are within the set range.

3. A method for identifying sunspots compatible with the PNG image format according to claim 2, characterized in that Modifying the 8-bit image depth of the PNG solar image to the 16-bit image depth of the fits format; Obtaining the corresponding angle of pixel points according to the average apparent diameter of the solar disk divided by the pixel diameter of the solar disk in the PNG solar image; The scaling factor is set to 250; The heliographic coordinates include the heliocentric latitude, heliographic longitude, and solar P angle of the center of the solar disk.

4. A sunspot recognition method compatible with the PNG image format according to claim 1, characterized in that, The process of obtaining the longitude and latitude coordinates of sunspots in the heliographic spherical grid of the full solar disk includes: Determining the x value and y value according to the two-dimensional coordinates of the sunspot, and taking the solar radius as the distance from the sunspot to the coordinate origin, thereby determining the z value of the sunspot in the three-dimensional rectangular coordinate system; Determining the equatorial plane, that is, the plane where the 0-degree latitude line is located, determining the plane equation of the 0-degree latitude line in the three-dimensional rectangular coordinate system according to the heliocentric latitude of the center of the solar disk, and determining the plane equation of the 0-degree longitude line in the three-dimensional rectangular coordinate system according to the heliographic longitude of the center of the solar disk, and thus obtaining the longitude and latitude coordinates of the sunspot according to the x value, y value, and z value of the sunspot.

5. A method for identifying sunspots compatible with the PNG image format according to claim 4, characterized in that The plane equation of the 0-degree latitude line in the three-dimensional rectangular coordinate system is: -sinB0·X + cosB0·Z = 0, where B0 is the heliocentric latitude of the center of the solar disk; The plane equation of the 0-degree longitude line in the three-dimensional rectangular coordinate system is: sinL0·X - cosL0·Y = 0, where L0 is the heliographic longitude of the center of the solar disk; For the sunspot (X, Y, Z), the latitude is θ = arcsin[(-sinβ0·X + cosB0·Z) / R], and the longitude is φ = arctan2(Y, XcosB0 + ZsinB0) - L0, where R is the solar radius.

6. The sunspot recognition method compatible with the PNG image format according to claim 1, characterized in that, The visualization process includes: Draw a latitude and longitude grid on the PNG solar image, set the grid interval to 10 degrees, and mark the latitude and longitude on the PNG solar image; for latitude marking, add markings at the intersections of the 0° meridian and each parallel; for longitude marking, add markings at the intersections of the 0° parallel and each meridian; Convert the latitude and longitude coordinates to image pixel coordinates, and draw the marked text on the PNG solar image, ensuring that the marked positions are accurate and do not overlap with the grid lines, thereby displaying the latitude and longitude degrees of key positions on the PNG solar image.

7. A sunspot recognition system compatible with the PNG image format, characterized in that, Comprising: An acquisition module configured to acquire the captured PNG solar image; An encapsulation module configured to encapsulate the PNG solar image into a fits file, and configure the shooting time, heliographic coordinates, image depth, pixel point corresponding angle, and scaling factor extracted based on the PNG solar image in the file header of the fits file; A conversion module configured to identify the two-dimensional coordinates of sunspots based on the configured fits file, and obtain the latitude and longitude coordinates of sunspots in the heliographic spherical latitude and longitude grid according to the geometric projection relationship from the hemispherical surface to the circular plane; A visualization module configured to convert the latitude and longitude coordinates to pixel coordinates and mark them at the corresponding positions of the latitude and longitude grid drawn on the PNG solar image, thereby obtaining a sunspot visualization image.

8. An electronic device, characterized in that, Comprising a memory, a processor, and computer instructions stored on the memory and running on the processor, when the computer instructions are run by the processor, the method described in any one of claims 1-6 is completed.

9. A computer-readable storage medium, characterized in that, For storing computer instructions, when the computer instructions are executed by the processor, the method described in any one of claims 1-6 is completed.

10. A computer program product, characterized in that, Comprising a computer program, when the computer program is executed by the processor, the method described in any one of claims 1-6 is implemented.