CN109668629B - Sunshine measuring method based on mobile phone sensor - Google Patents

Sunshine measuring method based on mobile phone sensor Download PDF

Info

Publication number
CN109668629B
CN109668629B CN201910055769.6A CN201910055769A CN109668629B CN 109668629 B CN109668629 B CN 109668629B CN 201910055769 A CN201910055769 A CN 201910055769A CN 109668629 B CN109668629 B CN 109668629B
Authority
CN
China
Prior art keywords
mobile phone
angle
sun
cos
sunshine
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.)
Active
Application number
CN201910055769.6A
Other languages
Chinese (zh)
Other versions
CN109668629A (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.)
Nanjing Fanzai Geographic Information Industry Research Institute Co ltd
Nanjing Normal University
Original Assignee
Nanjing Fanzai Geographic Information Industry Research Institute Co ltd
Nanjing Normal 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 Nanjing Fanzai Geographic Information Industry Research Institute Co ltd, Nanjing Normal University filed Critical Nanjing Fanzai Geographic Information Industry Research Institute Co ltd
Priority to CN201910055769.6A priority Critical patent/CN109668629B/en
Publication of CN109668629A publication Critical patent/CN109668629A/en
Application granted granted Critical
Publication of CN109668629B publication Critical patent/CN109668629B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J1/00Photometry, e.g. photographic exposure meter
    • G01J1/42Photometry, e.g. photographic exposure meter using electric radiation detectors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/011Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72457User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to geographic location
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J1/00Photometry, e.g. photographic exposure meter
    • G01J1/42Photometry, e.g. photographic exposure meter using electric radiation detectors
    • G01J2001/4266Photometry, e.g. photographic exposure meter using electric radiation detectors for measuring solar light
    • G01J2001/4285Pyranometer, i.e. integrating over space

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Environmental & Geological Engineering (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • Photometry And Measurement Of Optical Pulse Characteristics (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a sunshine measuring method based on a mobile phone sensor, which comprises the steps of shooting a picture through a smart mobile phone, then obtaining information such as the size of the picture and the size of a CCD (charge coupled device) of a camera, obtaining an azimuth angle, a pitch angle and a roll angle of the mobile phone when the picture is shot by using an electronic compass of the mobile phone, obtaining longitude and latitude of the position of the mobile phone when the picture is shot by using a positioning device of the mobile phone, transmitting the obtained parameters to a server side, solving the positions of the sun in the picture at different moments by using a collineation equation principle by the server side, transmitting the positions to a mobile phone client side by using the position, drawing a running track of the sun in the original picture by using the position by the mobile phone client side, and judging the time of the position which is directly irradiated by the sun in one. The invention can utilize the smart phone to quickly measure the sunshine condition of a certain place, and brings great convenience for people to buy rooms, park, go out and the like.

Description

Sunshine measuring method based on mobile phone sensor
Technical Field
The invention belongs to the field of computers, and particularly relates to a sunshine measuring method based on a mobile phone sensor.
Background
Sunlight is closely related to the production life of people, the current sunlight measuring method is complex and cumbersome, common sunlight measuring equipment such as a heliograph is expensive and heavy, and the sunlight condition of a place cannot be measured quickly, so that a better sunlight measuring method is urgently needed to help people to quickly judge whether the place can be directly irradiated by the sun or not and the approximate time of the place being directly irradiated by the sun.
The smart phone is the most common communication equipment, has the characteristics of easy obtaining and easy operation, and basically all the smart phones carry a camera, a positioning device and an electronic compass at present, so that the smart phone is very convenient for people if the mobile phone is used for measuring sunshine.
The augmented reality technology is a new technology for seamlessly integrating real world information and virtual world information, and is characterized in that entity information which is difficult to experience in a certain time space range of the real world originally is overlapped after simulation through scientific technologies such as computers and the like, virtual information is applied to the real world and is perceived by human senses, and therefore the sensory experience beyond reality is achieved. If the augmented reality technology is used for carrying out simulation display on the sun running track, people can very intuitively and quickly acquire the sunshine condition of a certain place.
Disclosure of Invention
The purpose of the invention is as follows: the invention aims to solve the limitations that the current sunshine measuring instrument is expensive and heavy, the measuring method is complex and the sunshine condition cannot be quickly obtained, and provides a sunshine measuring method based on a mobile phone sensor.
The technical scheme is as follows: in order to achieve the purpose, a picture is taken by the mobile phone facing the sky, the position of the sun is simulated in the picture, and a user can quickly judge the sun shielding condition and the time when the sun shines directly in a certain place according to the picture. The technical scheme of the invention is as follows:
the sunshine measuring method based on the mobile phone sensor comprises the following steps:
(1) acquiring a sunshine photo and parameters shot by a mobile phone camera, wherein the parameters comprise internal parameters and external parameters, the internal parameters are mobile phone camera parameters, and the external parameters are photo parameters and shooting action parameters;
(2) calculating the azimuth angle and the elevation angle of the sun based on the longitude and latitude of the sun when the sun is photographed and the photographing time, wherein the calculation method comprises an SPA algorithm, a Spencer algorithm, a Bourges algorithm, a Duffie algorithm and a Stine algorithm;
(3) calculating the position of the sun in the photo through an algorithm based on the parameters, the solar azimuth angle and the altitude angle;
(4) and (4) drawing a sun running track on the sunshine photo according to the position of the sun in the photo obtained in the step (3), and judging the sunshine condition of the shooting place by the user according to the photo.
Further, the internal parameters in the step (1) include the size and the focal length of a CCD of a camera of the mobile phone, the external parameters include the shooting time, the size, the shooting location and the shooting angle of the picture, and the shooting angle includes a mobile phone azimuth angle, a pitch angle and a roll angle.
The step (1) comprises the following specific steps:
shooting a sunshine photo by a mobile phone camera, and simultaneously acquiring parameters of the mobile phone camera and parameters of the sunshine photo; the electronic compass based on the mobile phone obtains the azimuth angle, the pitch angle and the roll angle of the mobile phone during photographing, and the positioning device of the mobile phone is used for obtaining the longitude and latitude of the position of the mobile phone during photographing; and finally, sending the sunshine photos and the parameters to a background server.
Further, the step (2) specifically comprises the following calculation steps:
the background server calculates the sun altitude and the sun azimuth of a photo shooting place based on the longitude and latitude and the time parameters transmitted by the mobile phone client;
the solar declination angle calculation expression is as follows:
δ(deg)=0.006918-0.399912cos(b)+0.070257sin(b)-0.006758cos(2b)+0.000907sin(2b)-0.002697cos(3b)+0.00148sin(3b)
wherein δ is solar declination angle, b is 2 PI (N-1)/365, and N is the number of days from 1 month and 1 day per year from the calculation day; PI represents a circumference ratio, and deg represents an angle degree;
the calculation expression of the solar time angle is as follows:
t=(tr-12)*15°
tr=tb+4*(120-lon)/60
wherein t represents the solar time angle, trIndicating true solar time angle, tbRepresenting the beijing time when the photograph was taken, lon representing the longitude of the location of the photograph;
the calculation expressions for calculating the solar altitude and the solar azimuth are as follows:
sinH=sinφ*sinδ+cosφ*cosδ*cost
cosA=(sinH*sinφ-sinδ)/(cosH*cosφ)
wherein H represents the solar altitude, A represents the solar azimuth, phi represents the latitude of the position where the photo is taken, delta represents the solar declination angle, and t represents the solar hour angle.
Further, the step (3) specifically includes the following calculation process:
the direction cosine is calculated as follows:
phi=azimuth*PI/180;
omega=pitch*PI/180;
kapa=roll*PI/180;
a1=cos(phi)*cos(kapa)-sin(phi)*sin(omega)*sin(kapa);
a2=-cos(phi)*sin(kapa)-sin(phi)*sin(omega)*cos(kapa);
a3=-sin(phi)*cos(omega);
b1=cos(omega)*sin(kapa);
b2=cos(omega)*cos(kapa);
b3=-sin(omega);
c1=sin(phi)*cos(kapa)+cos(phi)*sin(omega)*sin(kapa);
c2=-sin(phi)*sin(kapa)+cos(phi)*sin(omega)*cos(kapa);
c3=cos(phi)*cos(omega);
wherein a isi,bi,ci(i ═ 1,2,3) are 9 direction cosines consisting of 3 external orientation angle elements of the sunshine photographs; azimuth is the azimuth angle of the mobile phone, pitch is the pitch angle of the mobile phone, roll is the roll angle of the mobile phone, PI is the circumferential rate, phi is the camber value of the azimuth angle, omega is the camber value of the pitch angle, and kapa is the camber value of the roll angle;
the spatial coordinate difference between the sun position and the mobile phone position is calculated as follows:
dXY0=100000*cos(H);
dZ0=100000*sin(H);
dZ=dZ0-height;
d=sqrt(pow(dZ,2)+pow(dXY0,2));
beita=asin(dZ/d);
dX=d*cos(beita)*(-sin(A));
dY=d*cos(beita)*(-cos(A));
wherein d isX、dY、dZThe space coordinate difference is shown, H is the solar altitude, A is the solar azimuth, height is the mobile phone camera height, and the rest variables are intermediate variables;
the expression for calculating the position of the physical coordinate of the sun in the photograph is as follows:
F1=a1*dX+b1*dZ-c1*dY
F2=a2*dX+b2*dZ-c2*dY
F3=a3*dX+b3*dZ-c3*dY
x=-f*F1/F3;
y=-f*F2/F3;
wherein x and y are the physical coordinate positions of the sun in the photo, the coordinate system takes the vertex at the upper left corner of the sunshine photo as the origin of coordinates, the photo is in the direction of the x axis transversely, the photo is in the direction of the y axis longitudinally, and dX、dY、dZIs a difference of space coordinates, F is a focal length of the camera, F1、F2、F3Is an intermediate variable;
the position calculation expression of the sun in the photograph for the pixel coordinates is as follows:
ccdLenth=16/ccdSize;
tmp=sqrt(ccdLenth*ccdLenth/25);
ccdHeight=4*tmp;
ccdWidth=3*tmp;
pixSizeOfRow=ccdHeight/imgRows;
pixSizeOfCol=ccdWidth/imgCols;
col=(imgCols-1)/2+x/pixSizeOfCols;
row=(imgRows-1)/2-y/pixSizeOfRows;
wherein col is the column coordinate of the pixel coordinate of the sun in the sunshine photo, row is the row coordinate, ccdSize is the size of the camera ccd, and the rest variables are intermediate variables.
Further, the step (4) includes processing corresponding calculation processes at the mobile phone client and the background server respectively, specifically, the mobile phone client draws a sun movement track in the photo by using the sun position information calculated by the background server; then, the user judges the sunshine condition of the place according to the photos superposed with the sun position.
Furthermore, the method calculates the position information of the sun as pixel coordinates according to the parameters, calculates the position of the sun in the sunshine photo according to different time points under the same parameters, and forms the movement track of the sun sunshine by using the position points.
Has the advantages that: compared with the prior art, the invention uses the equipment of the smart phone to obtain the internal and external parameters of the camera, utilizes the collinearity equation principle and combines the augmented reality technology to simulate the sun running track, and is convenient for the user to quickly check the sunshine condition. Compared with the traditional sunshine measuring method, the method used by the scheme is simpler and quicker, and can quickly acquire the sunshine condition of a place without any professional knowledge.
Drawings
FIG. 1 is a flow chart of the present invention;
fig. 2 is a result diagram of embodiment 1 with sun trajectory information superimposed.
Detailed description of the invention
For the purpose of explaining the technical solution disclosed in the present invention in detail, the following detailed description is made with reference to the accompanying drawings and examples. In the embodiment, the mobile phone is used for photographing, the corresponding calculation process is processed through the mobile phone client and the background server, and the implementation of the method is carried out based on the mobile phone sensor and the existing hardware configuration.
Example 1
As shown in fig. 1, the sunshine measuring method based on the mobile phone sensor includes the following four steps:
step 1, acquiring internal and external parameters and time of a mobile phone camera, and sending the parameters to a background server;
step 2, calculating the solar altitude angle and the solar azimuth angle by using the parameters acquired in the step 1 in a background server;
step 3, calculating the position of the sun in the sunshine photo, and then returning the position information to the mobile phone client;
and 4, drawing a sun running track on the photo by the mobile phone client by using the position information, and judging the sunshine condition of the shooting place by the user according to the photo.
In the step 1, internal and external parameters of the mobile phone camera are obtained and sent to the background server, wherein the internal and external parameters refer to the parameters related to the internal parameters of the mobile phone camera, including the size of a camera CCD and the focal length of the camera, and the parameters related to the external parameters of the mobile phone camera, including the longitude and latitude, the north direction of the mobile phone, the pitch angle and the roll angle. A meter is arranged in the sunshine measuring software, and the meter comprises the main mobile phone model on the market and the corresponding CCD size, so that the mobile phone model is firstly obtained when the CCD size of the camera is obtained, and then the corresponding CCD size is found according to the mobile phone model. And sending the parameters from the mobile phone client to the background server by using a network communication protocol.
The background server in the step 2 calculates the position information of the sun according to the parameters, wherein the position information of the sun is the solar altitude angle and the solar azimuth angle, and common solar position calculation methods comprise an SPA algorithm, a Spencer algorithm, a Bourges algorithm, a Duffee algorithm and a Stine algorithm, and the principle of the method is that the solar altitude angle and the solar azimuth angle of a photo shooting place can be calculated by utilizing longitude and latitude and time.
And 3, calculating the position of the sun in the sunshine photo, wherein the position of the mobile phone camera, the position (image point) of the sun in the photo and the actual position (object point) of the sun are on the same straight line and meet a collinear equation, so that the position of the sun in the photo can be calculated by substituting the position of the sun and internal and external parameters of the camera into the collinear equation in the second step.
In the step 4, the mobile phone client draws a sun moving track on the photo by using the position information returned by the server, and the user judges the sunshine condition of the place according to the photo, wherein the position information of the sun is the pixel coordinate of the sun in the photo, the pixel coordinates falling in the photo are screened out, the pixel coordinates are connected into a line to be the moving track of the sun in the day, as shown in fig. 2, the direct sun irradiation condition of the place shot in the day can be judged according to the sun moving track and the real scene in the photo.
Example 2
In the example, Android is used as an APP running system, a mobile phone client APP uses Android Studio as a development environment, Java as a development language, a background server uses Pycharm as a development environment and python as a development language, and dll developed by C + + language is called in the server.
Installing the sunshine measurement APP on hand, starting a server program on a computer, and then carrying out sunshine measurement according to the following steps:
step 1, acquiring internal and external parameters and time of a mobile phone camera, and sending the parameters to a background server;
step 2, calculating the position of the sun in the photo by using the parameters acquired in the step 1 at a background server, and then returning the position information to the mobile phone client;
and 3, drawing a sun running track on the photo by the mobile phone client by using the position information, and judging the sunshine condition of the place by the user according to the photo.
The specific implementation steps are as follows:
step 1, internal and external parameters and time of a mobile phone camera are obtained, and the parameters are sent to a background server.
The mobile terminal APP of the mobile phone runs on an Android system, and the Android provides the following codes for application developers to obtain data.
(1) Obtaining mobile phone operation authority
Figure GDA0002751692290000061
Figure GDA0002751692290000071
In view of safety, when obtaining the mobile phone position information and reading the photo information in the android mobile phone, the user needs to manually give the app runtime permission, so before obtaining the data, the runtime permission of the mobile phone is obtained through the above steps.
(2) Obtaining electronic compass data
Figure GDA0002751692290000072
When the value of the sensor changes, an onSensorChanged function is triggered, and the values of the azimuth angle, the pitch angle and the roll angle of the mobile phone are obtained through the event variable.
(3) Obtaining latitude and longitude data
Figure GDA0002751692290000073
The longitude and latitude and the elevation of the position where the mobile phone is located are obtained by using a network positioning method.
(4) Obtaining time data
Calendar calendar=Calendar.getInstance();
picker, get (calendar.year); v/year
pickmonth ═ lens. // month
Dockedday ═ calander. The// day Calendar is the Calendar through which the year, month and day currently selected by the user can be retrieved.
(5) Obtaining camera focal length
StringstrfocalLen=
exif.getAttribute(ExifInterface.TAG_FOCAL_LENGTH);
String[]strFocalLens=strfocalLen.split("/");
float tmpA=Float.parseFloat(strFocalLens[0]);
float tmpB=Float.parseFloat(strFocalLens[1]);
focusLen ═ tmpA/tmpB; v/Camera focal Length
(6) Width and height of photo
Figure GDA0002751692290000081
(7) Obtaining CCD size
Figure GDA0002751692290000082
The ccdMap variable holds the model number of most smartphones on the market and their corresponding CCD size,
and traversing the variable to find the ccd size corresponding to the current mobile phone model.
After the mobile terminal of the mobile phone acquires data, the data needs to be transmitted to a background server, and an HTTP protocol is used for transmission.
Figure GDA0002751692290000091
Step 2, calculating the position of the sun in the photo by using the parameters acquired in the step 1 in a background server, and then returning the position information to the mobile phone client;
(1) computing solar altitude and solar azimuth by calling external functions
SunAnalysis(cameraParam.lat,cameraParam.lng,dateTime,&sunHAngle,&sunPosAngle);
The common sun position calculation method, namely the SPA algorithm, is used in this part, and the sun azimuth angle and the sun altitude angle of the place can be obtained by inputting the longitude and latitude and the time, which are not described herein again.
(2) The position of the sun in the photograph is calculated according to the following collinearity equation
Figure GDA0002751692290000092
Figure GDA0002751692290000093
In the equation:
x and y are image plane coordinates of the image point, namely the position of the sun in the picture;
x0,y0f is the internal orientation element of the image;
XS,YS,ZSis a space coordinate of the mobile phone;
XA,YA,ZAis the solar space coordinate;
ai,bi,ci(i ═ 1,2,3) is the 9 direction cosines consisting of the 3 external orientation angle elements of the image.
a. Data structure defining camera parameters
Figure GDA0002751692290000101
b. Calculating the direction cosine
float a1,a2,a3,b1,b2,b3,c1,c2,c3;
cameraParam.azimuth*=(PI/180);
cameraParam.pitch*=(PI/180);
cameraParam.roll*=(PI/180);
double phi=cameraParam.azimuth;
double omega=cameraParam.pitch;
double kapa=cameraParam.roll;
a1=cos(phi)*cos(kapa)-sin(phi)*sin(omega)*sin(kapa);
a2=-cos(phi)*sin(kapa)-sin(phi)*sin(omega)*cos(kapa);
a3=-sin(phi)*cos(omega);
b1=cos(omega)*sin(kapa);
b2=cos(omega)*cos(kapa);
b3=-sin(omega);
c1=sin(phi)*cos(kapa)+cos(phi)*sin(omega)*sin(kapa);
c2=-sin(phi)*sin(kapa)+cos(phi)*sin(omega)*cos(kapa);
c3=cos(phi)*cos(omega);
c. Calculating a space coordinate difference value of the sun and the mobile phone;
double XA,XS,YA,YS,ZA,ZS
double detXYd0=100000*cos(H);
double detZd0=100000*sin(H);
double detZ=detZd0-cameraParam.height;
double d=sqrt(pow(detZ,2)+pow(detXYd0,2));
double beita=asin(detZ/d);
double detX=d*cos(beita)*(-sin(A));
double detY=d*cos(beita)*(-cos(A));
XA-XS=detX;
YA-YS=detZ;
ZA-ZS=-detY;
d. calculating the position of the sun in the photograph
double F1=a1*(detX)+b1*(detZ)+c1*(-detY);
double F2=a2*(detX)+b2*(detZ)+c2*(-detY);
double F3=a3*(detX)+b3*(detZ)+c3*(-detY);
double x=-cameraParam.f*F1/F3;
double y=-cameraParam.f*F2/F3;
e. Converting position to pixel coordinates
const int lengthPerInch=16;
float ccdLenth=lengthPerInch/ccdSize;
float tmp=sqrt(ccdLenth*ccdLenth/25);
float ccdfight ═ 4 × tmp; // height mm of sensor
float ccdWidth ═ 3 × tmp; // width of sensor mm
floatpixSizeOfRow=ccdHeight/imgRows;
floatpixSizeOfCol=ccdWidth/imgCols;
float c=(imgCols-1)/2+x/pixSizeOfCols;
float r=(imgRows-1)/2-y/pixSizeOfRows;
intcol ═ c; // column coordinate
introw ═ r; v/line coordinate
And 3, drawing a sun running track on the photo by the mobile phone client by utilizing the sun position information, and judging the sunshine condition of the place by the user according to the photo.
The final result is shown in fig. 2, which is a photograph taken in front of a window, the curve in the figure is a simulated sun trajectory, and the circle is a simulated sun, from which it can be seen that the window has direct sunlight at 8:30 to 11: 30.

Claims (6)

1. The sunshine measuring method based on the mobile phone sensor is characterized in that: comprises the following steps:
(1) acquiring a sunshine photo and parameters shot by a mobile phone camera, wherein the parameters comprise internal parameters and external parameters, the internal parameters are mobile phone camera parameters, and the external parameters are photo parameters and shooting action parameters;
(2) calculating the azimuth angle and the elevation angle of the sun based on the longitude and latitude of the sun and the shooting time, wherein the calculation method comprises an SPA algorithm, a Spencer algorithm, a Bourges algorithm, a Duffie algorithm and a Stine algorithm;
(3) calculating the position of the sun in the photo through an algorithm based on the parameters, the solar azimuth angle and the altitude angle;
the direction cosine is calculated as follows:
phi=azimuth*PI/180;
omega=pitch*PI/180;
kapa=roll*PI/180;
a1=cos(phi)*cos(kapa)-sin(phi)*sin(omega)*sin(kapa);
a2=-cos(phi)*sin(kapa)-sin(phi)*sin(omega)*cos(kapa);
a3=-sin(phi)*cos(omega);
b1=cos(omega)*sin(kapa);
b2=cos(omega)*cos(kapa);
b3=-sin(omega);
c1=sin(phi)*cos(kapa)+cos(phi)*sin(omega)*sin(kapa);
c2=-sin(phi)*sin(kapa)+cos(phi)*sin(omega)*cos(kapa);
c3=cos(phi)*cos(omega);
wherein a isi,bi,ci(i ═ 1,2,3) are 9 direction cosines consisting of 3 external orientation angle elements of the sunshine photographs; azimuth is the azimuth angle of the mobile phone, pitch is the pitch angle of the mobile phone, roll is the roll angle of the mobile phone, PI is the circumferential rate, phi is the camber value of the azimuth angle, omega is the camber value of the pitch angle, and kapa is the camber value of the roll angle;
the spatial coordinate difference between the sun position and the mobile phone position is calculated as follows:
dXY0=100000*cos(H);
dZ0=100000*sin(H);
dZ=dZ0-height;
d=sqrt(pow(dZ,2)+pow(dXY0,2));
beita=asin(dZ/d);
dX=d*cos(beita)*(-sin(A));
dY=d*cos(beita)*(-cos(A));
wherein dX, dY and dZ are space coordinate difference values, H is a solar altitude angle, A is a solar azimuth angle, height is the height of the mobile phone camera, and the rest variables are intermediate variables;
the expression for calculating the position of the physical coordinate of the sun in the photograph is as follows:
F1=a1*dX+b1*dZ-c1*dY;
F2=a2*dX+b2*dZ-c2*dY;
F3=a3*dX+b3*dZ-c3*dY;
x=-f*F1/F3;
y=-f*F2/F3;
wherein x and y are physical coordinate positions of the sun in the photo, the coordinate system takes the vertex at the upper left corner of the sunshine photo as a coordinate origin, the transverse direction of the photo is the direction of an x axis, the longitudinal direction of the photo is the direction of a y axis, dX, dY and dZ are space coordinate difference values, F is the focal length of the camera, and F1, F2 and F3 are intermediate variables;
the position calculation expression of the sun in the photograph for the pixel coordinates is as follows:
ccdLenth=16/ccdSize;
tmp=sqrt(ccdLenth*ccdLenth/25);
ccdHeight=4*tmp;
ccdWidth=3*tmp;
pixSizeOfRow=ccdHeight/imgRows;
pixSizeOfCol=ccdWidth/imgCols;
col=(imgCols-1)/2+x/pixSizeOfCols;
row=(imgRows-1)/2-y/pixSizeOfRows;
wherein col is a column coordinate of a pixel coordinate of the sun in the sunshine photo, row is a row coordinate, ccdSize is the size of a camera ccd, and the rest variables are intermediate variables;
(4) and (4) drawing a sun running track on the sunshine photo according to the position of the sun in the photo obtained in the step (3), and judging the sunshine condition of the shooting place by the user according to the photo.
2. The sunshine measuring method based on the mobile phone sensor as claimed in claim 1, wherein: the internal parameters in the step (1) comprise the CCD size and the focal length of a camera of the mobile phone, the external parameters comprise the shooting time, the size, the shooting location and the shooting angle of the picture, and the shooting angle comprises a mobile phone azimuth angle, a pitch angle and a roll angle.
3. The sunshine measuring method based on the mobile phone sensor as claimed in claim 1, wherein: specifically, a sunshine photo is shot by a mobile phone camera, and parameters of the mobile phone camera and parameters of the sunshine photo are obtained simultaneously; acquiring an azimuth angle, a pitch angle and a roll angle of the mobile phone during shooting based on an electronic compass of the mobile phone, and acquiring longitude and latitude of the position of the mobile phone during shooting by using a positioning device of the mobile phone; and finally, sending the sunshine photos and the parameters to a background server.
4. The sunshine measuring method based on the mobile phone sensor as claimed in claim 1, wherein: the step (2) specifically comprises the following calculation steps:
the background server calculates the sun altitude and the sun azimuth of a photo shooting place based on the longitude and latitude and the shooting time transmitted by the mobile phone client;
the solar declination angle calculation expression is as follows:
Figure 5
wherein δ is solar declination angle, b is 2 PI (N-1)/365, and N is the number of days from 1 month and 1 day per year from the calculation day; PI represents a circumference ratio, and deg represents an angle degree;
the calculation expression of the solar time angle is as follows:
t=(tr-12)*15°
tr=tb+4*(120-lon)/60
wherein t represents a solar time angle, tr represents a true solar time angle, tb represents Beijing time at the time of shooting, and lon represents longitude of a position at the time of shooting;
the calculation expressions for calculating the solar altitude and the solar azimuth are as follows:
sinH=sinφ*sinδ+cosφ*cosδ*cost
cosA=(sinH*sinφ-sinδ)/(cosH*cosφ)
wherein H represents the solar altitude angle, A represents the solar azimuth angle, phi represents the latitude of the position where the camera is located, delta represents the solar declination angle, and t represents the solar hour angle.
5. The sunshine measuring method based on the mobile phone sensor as claimed in claim 1, wherein: the step (4) comprises the steps of respectively processing corresponding calculation processes at the mobile phone client and the background server, specifically, drawing a sun running track in a photo by the mobile phone client by utilizing sun position information calculated by the background server; then, the user judges the sunshine condition of the place according to the photos superposed with the sun position.
6. The sunshine measuring method based on the mobile phone sensor as claimed in claim 1, wherein: according to the method, the position information of the sun is calculated as pixel coordinates according to parameters, and the position of the sun in the sunshine photo is calculated according to different time points under the same parameters, so that the position points form a sun running track.
CN201910055769.6A 2019-01-21 2019-01-21 Sunshine measuring method based on mobile phone sensor Active CN109668629B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910055769.6A CN109668629B (en) 2019-01-21 2019-01-21 Sunshine measuring method based on mobile phone sensor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910055769.6A CN109668629B (en) 2019-01-21 2019-01-21 Sunshine measuring method based on mobile phone sensor

Publications (2)

Publication Number Publication Date
CN109668629A CN109668629A (en) 2019-04-23
CN109668629B true CN109668629B (en) 2021-07-09

Family

ID=66149637

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910055769.6A Active CN109668629B (en) 2019-01-21 2019-01-21 Sunshine measuring method based on mobile phone sensor

Country Status (1)

Country Link
CN (1) CN109668629B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110531445A (en) * 2019-09-05 2019-12-03 中国科学院长春光学精密机械与物理研究所 A kind of sunshine duration measuring device and equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8878113B2 (en) * 2012-05-29 2014-11-04 Qbotix, Inc. Solar tracking system using periodic scan patterns with a shielding tube
CN102692271B (en) * 2012-06-14 2014-05-07 中国气象科学研究院 Sky visible light images based direct solar radiation intensity measurement method and device
CN103365302B (en) * 2013-06-18 2016-03-09 陕西理工学院 The sunray track algorithm of three-phase limitation sunray sensor and light spot image sensor fusion
CN106447786A (en) * 2016-09-14 2017-02-22 同济大学 Parallel space establishing and sharing system based on virtual reality technologies

Also Published As

Publication number Publication date
CN109668629A (en) 2019-04-23

Similar Documents

Publication Publication Date Title
CN105627991B (en) A kind of unmanned plane image real time panoramic joining method and system
CN110675450B (en) Method and system for generating orthoimage in real time based on SLAM technology
CN109520500B (en) Accurate positioning and street view library acquisition method based on terminal shooting image matching
US11508030B2 (en) Post capture imagery processing and deployment systems
KR100538343B1 (en) Method for constituting gis of river information by updating river area facilities information to digital map via mobile internet
CN110988947B (en) Augmented reality positioning method based on real-time dynamic carrier phase difference technology
CN104833336B (en) A kind of satellite side-sway angle acquisition methods based on characteristics of image
CN112019745B (en) Method for acquiring target image of sky area and astronomical photographing equipment
CN110569797B (en) Method, system and storage medium for detecting mountain fire of geostationary orbit satellite image
CN112288853A (en) Three-dimensional reconstruction method, three-dimensional reconstruction device, and storage medium
US20100061593A1 (en) Extrapolation system for solar access determination
US20090232415A1 (en) Platform for the production of seamless orthographic imagery
WO2018214778A1 (en) Method and device for presenting virtual object
Barreira et al. A context-aware method for authentically simulating outdoors shadows for mobile augmented reality
CN109668629B (en) Sunshine measuring method based on mobile phone sensor
WO2022025283A1 (en) Measurement processing device, method, and program
CN111982147A (en) Vehicle-mounted instrument shadow effect display method and system, storage medium and vehicle-mounted terminal
CN109636850A (en) Visible light localization method in faced chamber under intelligent lamp
CN109377476A (en) The dynamic threshold acquisition methods and device of remote sensing image cloud detection characteristic parameter
Hu et al. Underwater downwelling radiance fields enable three-dimensional attitude and heading determination
CA3142001C (en) Spherical image based registration and self-localization for onsite and offsite viewing
CN112070885B (en) Three-dimensional reconstruction method and system based on photogrammetry photometric stereo model
CN110887475B (en) Static base rough alignment method based on north polarization pole and polarized solar vector
CN106846311A (en) Positioning and AR method and system and application based on image recognition
JP5363256B2 (en) Information terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant