The application is based on Japanese Patent Application No. 2021-134934 filed on Aug. 20, 2021, the content of which incorporated herein by reference.
The present invention relates to a ship assistance device, a ship assistance method, and a storage medium.
The technology for alleviating the sway of a small ship is known. For example, Japanese Patent Application Laid-open No. 2004-291688 discloses a technology of controlling pitching of a ship body by using an angular velocity sensor.
The technology disclosed in Japanese Patent Application Laid-open No. 2004-291688 controls the speed of the ship body when a pitching angular velocity output by the angular velocity sensor exceeds a predetermined threshold value. However, the technology disclosed in Japanese Patent Application Laid-open No. 2004-291688 does not predict pitching of the ship body in advance, and is not preferable for assisting an occupant of the ship in driving the ship in some cases.
The present invention has been made in view of the above-mentioned circumstances, and has an object to provide a ship assistance device, a ship assistance method, and a storage medium, which can provide driving assistance to the occupant of the ship more preferably.
A ship assistance device, a ship assistance method, and a storage medium according to embodiments of the present invention adopt the following configurations.
(1): According to an embodiment of the present invention, there is provided is a ship assistance device including a storage medium storing a computer-readable command and a processor connected to the storage medium, the processor executing the computer-readable command to: calculate a pitching amount of a ship body based on a plurality of images photographed by a camera mounted on the ship body; estimate a pitching cycle of the ship body at least based on the calculated pitching amount; predict pitching of the ship body based on the estimated pitching cycle; and control a throttle of the ship body so as to reduce the predicted pitching of the ship body.
(2): According to another aspect of the present invention, there is provided a ship assistance device comprising a storage medium storing a computer-readable command and a processor connected to the storage medium, the processor executing the computer-readable command to: calculate a pitching amount of a ship body based on a plurality of images photographed by a camera mounted on the ship body; estimate a pitching cycle of the ship body at least based on the calculated pitching amount; predict pitching of the ship body based on the estimated pitching cycle; and display such a throttle operation of the ship body as to reduce the predicted pitching of the ship body.
(3): In the aspect (1), the processor cuts out a plurality of square regions from an image photographed at a predetermined time by shifting predetermined pixels among the plurality of images, and calculates the pitching amount based on a plurality of shift amounts corresponding to the plurality of cut out square regions and a plurality of characteristic values of difference images between the plurality of cut out square regions and a reference region of an image photographed at a time subsequent to the predetermined time.
(4): In the aspect (3), the processor derives an approximation function that approximates a relationship between the plurality of shift amounts and the plurality of characteristic values, identifies a shift amount corresponding to the minimum value of the approximation function as a pitching variation amount, and integrates the pitching variation amount to calculate the pitching amount.
(5): In the aspect (1), the pitching cycle estimation unit estimates the pitching cycle by minimizing an evaluation function for evaluating an error between the pitching amount calculated by the pitching amount calculation unit and a pitching amount estimation model constructed based on a variable obtained by adding a vibrating reference signal to each of an angular velocity and phase of the pitching.
(6): In the aspect (1), the pitching prediction unit predicts the pitching of the ship body by advancing a phase of the pitching by a predetermined period from the estimated pitching cycle.
(7): According to another aspect of the present invention, there is provided a ship assistance method to be executed by a computer, including: calculating a pitching amount of a ship body based on a plurality of images photographed by a camera mounted on the ship body; estimating a pitching cycle of the ship body at least based on the calculated pitching amount; predicting pitching of the ship body based on the estimated pitching cycle; and controlling a throttle of the ship body so as to reduce the predicted pitching of the ship body.
(8): According to another aspect of the present invention, there is provided a computer-readable non-transitory storage medium storing a program for causing a computer to: calculate a pitching amount of a ship body based on a plurality of images photographed by a camera mounted on the ship body; estimate a pitching cycle of the ship body at least based on the calculated pitching amount; predict pitching of the ship body based on the estimated pitching cycle; and control a throttle of the ship body so as to reduce the predicted pitching of the ship body.
According to the aspects (1) to (8), it is possible to execute driving assistance for the occupant of the ship more preferably.
According to the aspect (4), it is possible to reduce the image processing load by utilizing the approximation function.
According to the aspect (5), it is possible to smoothly predict the pitching behavior by utilizing the pitching model having periodic behavior.
According to the aspect (6), it is possible to predict pitching in consideration of responsiveness the engine or occupant by advancing the phase of the estimated pitching cycle.
[Configuration of Vehicle]
Now, description is given of a ship assistance device, a ship assistance method, and a storage medium according to an embodiment of the present invention with reference to the drawings.
To address this issue, the ship assistance device 100 according to an embodiment decreases the throttle opening degree of the ship 1 when the pitching amount of the ship 1 increases (bow faces upward) and increases the throttle opening degree of the ship 1 when the pitching amount of the ship 1 decreases (bow faces downward), to thereby reduce the pitching of the ship 1.
The pitching amount calculation unit 110 calculates the pitching amount of the ship 1 on the basis of a plurality of photographed images PI photographed by the camera 10 mounted in the ship 1. More specifically, the pitching amount calculation unit 110 first extracts a pitching determination image DI from each of the plurality of photographed images PI, and calculates the pitching amount on the basis of the extracted pitching determination images DI. Now, description is given of an operation to be executed by the pitching amount calculation unit 110 with reference to
Next, the pitching amount calculation unit 110 compares the moving average of pixels with a threshold value to obtain a binary value. The pitching amount calculation unit 110 identifies, as the ship body, a region having non-zero pixel values as a result of binarization. In this manner, as illustrated in the lower left part of
Next, the pitching amount calculation unit 110 cuts out a plurality of square regions SR from an image photographed at a predetermined time (for example, time k−i) by shifting predetermined pixels thereof among the plurality of pitching determination images DI, and calculates difference images between the plurality of cut out square regions SR and a reference region RR of an image photographed at a time (for example, time k) after the predetermined time.
Next, the pitching amount calculation unit 110 obtains, as the reference region RR, a square region obtained by cutting out the center part of the pitching determination image DI at the current time point k. The pitching amount calculation unit 110 takes differences between the plurality of cut out square regions SR and the reference region RR, and binarizes the differences to obtain a plurality of difference images. At this time, a difference image having a higher degree of match with the reference region RR tends to exhibit a white color.
Next, the pitching amount calculation unit 110 calculates a total sum of absolute values of pixel values for each difference image. This total sum of absolute values of pixel values is an example of “characteristic value”. The square region SR having the total sum of absolute values of pixel values means a square region having a difference with the reference region RR at the time point k. For example, when the total sum of absolute values of pixel values of the square region SR obtained by shifting the center part of the pitching determination image DI at the time point k-i in the upper (or lower) direction by (n×1) pixels is minimum, this means that pitching behavior has occurred in the upper (or lower) direction by a distance corresponding to one pixel in a period between the time point k−i and the time point k. Thus, the pitching amount calculation unit 110 can identify, as the pitching variation amount dp, a length corresponding to the shift amount of the square region SR having the minimum total sum of absolute values of pixel values (technique 1).
However, when the pitching variation amount dp is obtained by the above-mentioned technique 1, it is necessary to set the shift amount of the square region SR finely in order to identify the square region SR having the minimum total sum of absolute values of pixel values. As a result, the number of square regions SR to be cut out from the pitching determination image DI and subject to the processing of taking a difference with the reference region RR increases, which may increase the load of image processing excessively. Thus, in this embodiment, the pitching amount calculation unit 110 derives an approximation function that approximates a relationship between a plurality of shift amounts and a plurality of the total sums of absolute values of pixel values, and identifies a shift amount corresponding to the minimum value of the approximation function as the pitching variation amount dp.
More specifically, the pitching amount calculation unit 110 first approximates an estimated value S{circumflex over ( )} ({circumflex over ( )} (hat) to be originally assigned above S is denoted by S{circumflex over ( )}) of the total sum of absolute values of pixel values in accordance with the following expression (1) by using an approximation function F being a quadratic function for the shift amount xp(j).
S{circumflex over ( )}(j)=F(xp(j))=a(j)xp2(j)+b(j)xp(j)+c(j)=ΦT(j) Expression (1)
In expression (1), a(j), b(j), c(j) represent approximation function parameters of the approximation function F, and Φ(j) and ζ(j) are vectors defined by the following expressions (2) and (3), respectively. j represents an approximation function calculation counter, and increases by the number of parameter IDs of the square regions SR shifted in
ζT(j)=[xp2(j), xp(j), 1] Expression (2)
ΦT(j)=[a(j), b(j), 1] Expression (3)
That is, when the approximation function parameters a(j), b(j), c(j) of the approximation function F are obtained, the shift amount corresponding to the minimum value of the approximation function F can be identified as the pitching variation amount dp. In this embodiment, the pitching amount calculation unit 110 uses data of the plurality of shift amounts and the plurality of the total sums of absolute values of pixel values obtained in
e(j)=S(j)−S{circumflex over ( )}(j)=S(j)−ΦT(j)ζ(j) Expression (4)
Φ(j)=Φ(j−1)+KG(j)e(j) Expression (5)
KG(j)=Gζ(j)/{1+ζT(j)Gζ(j)} Expression (6)
In expression (4), e(j) represents an error between the total sum S(j) of pixel values and the estimated value S{circumflex over ( )}(j) of the total sum of pixel values, and in expressions (5) and (6), KG(j) represents an update gain of the error e(j). KG(j) corresponds to the gradient of an error curved surface, and is obtained by taking a partial derivative of the error curved surface by a(j), b(j), c(j).
The pitching amount calculation unit 110 substitutes the shift amount of the square region SR of each parameter ID into xp(j) in order at each control time point k, substitutes the total sum of pixel values corresponding to the shift amount into S(j), and minimizes a square error between the total sum S(j) of pixel values and the estimated value S{circumflex over ( )}(j) of the total sum of pixel values in accordance with the expressions (4), (5), (6), to thereby obtain the approximation function parameters a(j), b(j), c(j). In this manner, it is possible to derive the approximation function F.
dp(j)=−b(j)/2a(j) Expression (7)
Calculation of dp(j) is performed in shorter cycles at the control time k. Thus, the pitching amount calculation unit 110 identifies the final value of dp(j) calculated at the control time k as the pitching variation amount (pitching variation amount parameter) dp(k) at the control time k. In this manner, contrary to the technique 1 in which the shift amount of the square region SR is required to be set finely, in this embodiment, the approximation function F is calculated by the iterative least square technique on the basis of data of the plurality of shift amounts and the plurality of the total sums of absolute values of pixel values obtained in
After the pitching amount calculation unit 110 calculates the pitching variation amount dp(k), the pitching amount calculation unit 110 integrates the pitching variation amount dp(k) in accordance with the following expression (8) or (9) to calculate a pitching amount parameter p(k).
p(k)=p(k−1)+dp(k) Expression (8)
p(k)=λpp(k−1)+dp(k) Expression (9)
In expression (9), λp represents a forgetting coefficient of the pitching variation amount p(k), and is, for example, a value smaller than 1 such as 0.99. By using expression (9) instead of expression (8), it is possible to prevent drift of the central value of the pitching variation amount dp(k) and divergence of the absolute value due to the influence of an error.
After the pitching amount calculation unit 110 calculates the pitching variation amount p(k), the pitching cycle estimation unit 120 estimates the pitching cycle of the ship body of the ship 1 on the basis of the calculated pitching amount parameter p(k). More specifically, the pitching cycle estimation unit 120 assumes that the pitching behavior of the ship body follows a sine wave, and estimates an amplitude ψ, an angular velocity parameter ω, and a phase η for defining the sine wave.
In expressions (10) and (11), p_ave(k) represents a moving average value of the pitching amount parameter p(k), and ma represents a moving average number for calculating p_ave(k). The pitching cycle estimation unit 120 defines the estimated amplitude value ψ(k) in accordance with the following expressions (12) and (13) on the basis of the calculated offset pitching amount parameter q(k).
In expressions (12) and (13), σ(k) represents a standard deviation of q(k), ms represents a moving average number for calculating σ(k) (ms<ma), and Kamp represents an adaptive parameter of the estimated amplitude value ψ(k). The pitching cycle estimation unit 120 defines the estimated value q{circumflex over ( )} of a pitching amount estimation model for estimating the offset pitching amount parameter q(k) in accordance with expression (14).
q{circumflex over ( )}(k)=ψ(k)sin(Ω(k)+η(k)) Expression (14)
In expression (14), Ω(k) represents an angular velocity parameter of the pitching amount estimation model, and η(k) represents the phase of the pitching amount estimation model. Further, Ω(k) is defined by the following expression (15).
In expression (15), ω(k) represents a gain of the angular velocity parameter, and ΔT represents the period of the control time k. The pitching cycle estimation unit 120 calculates the amplitude ψ(k) of the estimated value q{circumflex over ( )} of the pitching amount estimation model in accordance with expression (13), and calculates the phase η(k) and the angular velocity Ω(k) of the estimated value q{circumflex over ( )} of the pitching amount estimation model by minimizing an evaluation function J defined by the following expressions (16) and (17).
e_m(k)=q(k)−q{circumflex over ( )}(k) Expression (16)
J(k)=λmJ(k)+e_m(k)2 Expression (17)
In expressions (16) and (17), e_m represents a model error of the pitching amount estimation model, and λm represents a forgetting coefficient of the evaluation function J(k) (0≤λm≤1).
In order to optimize the evaluation function J by the extremum seeking controller, the pitching cycle estimation unit 120 defines the following variables, which are obtained by adding reference inputs r1 and r2 to the phase η and angular velocity parameter gain ω of the pitching amount estimation model, in accordance with the following expressions (18), (19), (20), and (21).
ηr(k)=η(k)+r1(k) Expression (18)
r1(k)=Ar1 sin(ωr1ΔTk) Expression (19)
ωr(k)=ω(k)+r2(k) Expression (20)
r2(k)=Ar2 sin(ωr2ΔTk) Expression (21)
In expressions (18), (19), (20), and (21), ηr represents a reference input applied phase, r1 represents a reference input to the phase η, ωr represents a reference input applied angular velocity parameter, Ar1 represents the amplitude of the reference input to the phase η, ωr1 represents an angular velocity frequency of the reference input to the phase η, r2 represents the reference input to the angular velocity parameter gain ω, ωr2 represents the amplitude of the reference input to the angular velocity parameter gain ω, and ωr2 represents the angular velocity frequency of the reference input to the angular velocity parameter gain ω. In the above expressions, ωr1 and ωr2 are relatively prime.
The reference input applied phase ηr represented by expression (18) and the reference input applied angular velocity parameter tor represented by expression (20) are used to redefine the evaluation function J as the evaluation function Jr in accordance with expressions (22), (23), (24), and (25). The reference input is a periodic function having an average value of zero, and thus minimization of the evaluation function J and minimization of the evaluation function Jr are equivalent to each other.
q{circumflex over ( )}r(k)=ψ(k)sin(Ωr(k)+ηr(k)) Expression (22)
Ωr(k)=Ω(k−1)+ωr(k)ΔT Expression (23)
e_mr(k)=q(k)−q{circumflex over ( )}_r(k) Expression (24)
Jr(k)=λmJ(k)+e_mr(k)2 Expression (25)
In expressions (22), (23), (24), and (25), q{circumflex over ( )}r represents the estimated value of the reference input applied pitching amount estimation model, Ωr represents the angular velocity parameter of the reference input applied pitching estimation model, e_mr represents the error of the reference input applied pitching estimation model, and Jr represents the reference input applied evaluation function.
The pitching cycle estimation unit 120 uses the reference input applied evaluation function Jr defined above to optimize the reference input applied phase ηr and the reference input applied angular velocity parameter ωr by the extremum seeking controller.
As illustrated in
h1(k)=Fbp1(Jr(k)) Expression (26)
Next, the pitching cycle estimation unit 120 multiplies the output value h1(k) of the bandpass filter Fbp1 by the reference signal r1 to obtain an intermediate variable Phr1. This intermediate variable Phr1 represents the period or increase/decrease sensitivity of the vibrational component h1(k) with respect to the period of the reference signal r1. The intermediate variable Phr1 is represented by the following expression (27).
Phr1(k)=h1(k)r1(k−1) Expression (27)
The intermediate variable Phr1 obtained by multiplication processing includes a vibrational component due to the reference signal r1. Thus, the pitching cycle estimation unit 120 removes the vibrational component by inputting the intermediate variable Phr1 into a moving average filter Fave in accordance with the following expression (28).
In expression (28), mc represents the number of moving average taps, and is set to a value Ts/ΔT1 obtained by dividing Ts, which is a multiple of the period T1 of ω1, by a control period ΔT. The pitching cycle estimation unit 120 obtains an intermediate variable Pc1(k) by the processing of expression (28).
Next, the pitching cycle estimation unit 120 multiplies the intermediate variable Pc1(k) by a search gain Ksk1, and adds the multiplied value to the previously estimated phase η(k) to calculate the current phase η(k). That is, the current phase η(k) is represented by the following expression (29).
η(k)=η(k)+Kadp1Pc1(k) Expression (29)
The pitching cycle estimation unit 120 repeats the above-mentioned processing until the phase η(k) converges. The pitching cycle estimation unit 120 obtains the phase η(k) that has converged as the phase η(k) of the estimated value q{circumflex over ( )} of the pitching amount estimation model.
Similarly to the angular velocity parameter ω, the pitching cycle estimation unit 120 inputs the reference input applied evaluation function Jr into a bandpass filter Fbp2 to extract a vibrational component of the reference input applied evaluation function Jr. The extracted vibrational component h2(k) is represented by the following expression (30), for example.
h2(k)=Fbp2(Jr(k)) Expression (30)
Next, the pitching cycle estimation unit 120 multiplies the output value h2(k) of the bandpass filter Fbp2 by a reference signal r2 to obtain an intermediate variable Phr2. This intermediate variable Phr2 represents the period or increase/decrease sensitivity of the vibrational component h2(k) with respect to the period of the reference signal r2. The intermediate variable Phr2 is represented by the following expression (31).
Phr2(k)=h2(k)r2(k−1) Expression (31)
The intermediate variable Phr2 obtained by the multiplication processing includes a vibrational component due to the reference signal r2. Thus, the pitching cycle estimation unit 120 inputs the intermediate variable Phr2 into the moving average filter Fave to remove the vibrational component in accordance with the following expression (32).
In Expression (32), mc is set to a value Ts/ΔT2 obtained by dividing Ts, which is a multiple of the period T2 of ω2, by the control period ΔT. The pitching cycle estimation unit 120 obtains the intermediate variable Pc2(k) by the processing of expression (32).
Next, the pitching cycle estimation unit 120 multiplies the intermediate variable Pc2(k) by the search gain Ksk2, and adds the multiplied value to the previously estimated angular velocity parameter ω(k) to calculate the current angular velocity parameter ω(k). That is, the current angular velocity parameter ω(k) is represented by the following expression (33).
ω(k)=ω(k)+Kadp2Pc2(k) Expression (33)
The pitching cycle estimation unit 120 repeats the above-mentioned processing until the angular velocity parameter ω(k) converges. The pitching cycle estimation unit 120 obtains the angular velocity parameter ω(k) that has converged as the angular velocity parameter ω(k) of the estimated value q{circumflex over ( )} of the pitching amount estimation model. In this manner, the pitching cycle estimation unit 120 obtains the amplitude ψ(k), the phase η(k), and the angular velocity Ω(k) of the estimated value q{circumflex over ( )} of the pitching amount estimation model.
The pitching prediction unit 130 predicts the pitching behavior of the ship body of the ship 1 on the basis of the estimated pitching cycle. More specifically, the pitching prediction unit 130 sets a prediction period Tpre in consideration of the responsiveness or the like of an engine based on the ship speed Vs, and advances the estimated value q{circumflex over ( )} of the pitching amount estimation model by the prediction period Tpre, to thereby predict the pitching behavior. That is, the predicted value q_pre of the pitching behavior is represented by the following expressions (34), (35), and (36).
ηpre(k)=Tpreω(k)/2π Expression (34)
Ωpre(j)=Ω(k)+η(k)+ηpre(k) Expression (35)
q_pre(j)=ψ(k)sin(Ωpre(k)) Expression (36)
In the expressions (34), (35), and (36), ηpre represents a pitching prediction phase, Tpre represents the pitching prediction period, and Ωpre represents the predicted phase parameter. Ω(k) is defined by expression (15).
The throttle operation control unit 140 controls the throttle of the ship body so as to reduce the pitching behavior of the ship body on the basis of the predicted value q_pre of the pitching behavior predicted by the pitching prediction unit 130. More specifically, the throttle operation control unit 140 determines a throttle opening degree TH(k) in accordance with the following expression (37).
TH(k)=TH_base(k)+DTH_FB(k)+K_DTH_Comp(k)DTH_Comp_bs(k) Expression (37)
In expression (37), TH_base(k) represents a reference throttle opening degree based on the target ship speed Vs_trgt(k), DTH_FB(k) represents a correction amount calculated to cause a feedback controller to control the ship speed Vs(k) to reach the target ship speed Vs_trgt(k), K_DTH_Comp(k) represents a compensation gain based on the estimated amplitude value ψ, and DTH_Comp_bs(k) represents a reference compensation pattern based on the predicted phase parameter Ωpre.
The throttle operation assistance unit 150 assists in performing such a throttle operation as to reduce the pitching behavior of the ship body on the basis of the predicted value q_pre of the pitching behavior predicted by the pitching prediction unit 130. The throttle operation control unit 140 operates when the ship 1 is in an automatic operation mode, whereas the throttle operation assistance unit 150 operates when the ship 1 is in a manual operation mode.
The throttle operation assistance unit 150 may assist in performing a throttle operation by adding a compensation throttle opening degree to a throttle opening degree TH_user(k) indicated by the occupant in accordance with the following expression (38), for example.
TH(k)=TH_user(k)+K_DTH_Comp(k)DTH_Comp_bs(k) Expression (38)
Similarly to expression (37), in expression (38), DTH_Comp_bs(k) represents a reference compensation pattern, and K_DTH_Comp(k) represents a compensation gain. As a result, the throttle operation assistance unit 150 can reduce the pitching behavior depending on the throttle opening degree TH_user(k) indicated by the occupant.
Further, the throttle operation assistance unit 150 may display indication information on such a throttle operation as to reduce the pitching behavior on a display unit (not shown) provide in the ship assistance device 100 without adding a compensation throttle opening degree.
Next, description is given of a flow of processing to be executed by the ship assistance device 100 with reference to
First, the pitching amount calculation unit 110 identifies the ship body of the ship 1 on the basis of the plurality of photographed images PI photographed by the camera 10 mounted in the ship 1 in time series, and acquires a pitching determination image DI excluding the ship body from the photographed images PI (Step S101). Next, the pitching amount calculation unit 110 calculates a pitching amount on the basis of the plurality of pitching determination images DI (Step S102).
Next, the pitching cycle estimation unit 120 estimates the pitching cycle, namely, the amplitude, angular velocity, and phase of pitching on the basis of the pitching amount calculated by the pitching amount calculation unit 110 (Step S103). Next, the pitching prediction unit 130 predicts pitching behavior on the basis of the pitching cycle estimated by the pitching cycle estimation unit 120 (Step S104).
Next, the throttle operation control unit 140 controls the throttle of the ship body so as to reduce the pitching behavior on the basis of the pitching behavior predicted by the pitching prediction unit 130 (Step S105). Alternatively, when the occupant is manually operating the throttle, the throttle operation assistance unit 150 adds such a compensation throttle opening degree as to reduce the pitching behavior, or displays, on the display unit, indication information on such a throttle operation as to reduce the pitching behavior (Step S105). Then, the processing of this flowchart is finished.
According to the embodiment described above, the pitching of the ship body is predicted on the basis of a plurality of images photographed by the camera mounted in the ship body, and the throttle of the ship body is controlled or the throttle operation performed by the occupant is assisted in accordance with the predicted pitching of the ship body. As a result, it is possible to execute driving assistance for the occupant of the ship more preferably.
The embodiment described above can be represented by the following expressions.
A ship assistance device including a storage medium storing a computer-readable command and a processor connected to the storage medium, the processor executing the computer-readable command to: calculate a pitching amount of a ship body based on a plurality of images photographed by a camera mounted on the ship body; estimate a pitching cycle of the ship body at least based on the calculated pitching amount; predict pitching of the ship body based on the estimated pitching cycle; and control a throttle of the ship body so as to reduce the predicted pitching of the ship body.
This concludes the description of the embodiment for carrying out the present invention. The present invention is not limited to the embodiment in any manner, and various kinds of modifications and replacements can be made within a range that does not depart from the gist of the present invention. For example, the present invention can be applied to power conversion equipment and grids, which can be connected to commercial power systems.
Number | Date | Country | Kind |
---|---|---|---|
2021-134934 | Aug 2021 | JP | national |