Method for determining camera attitude and electronic device
A method for determining camera attitude includes: in response to a first input image satisfying a first condition, adjusting a camera from a first attitude to a second attitude, the first input image being an image obtained by the camera in the first attitude; obtaining a second input image, the second input image being an image obtained by the camera in the second attitude; determining second attitude data corresponding to the second attitude based on the second input image; and determining first attitude data corresponding to the first attitude according to a transformation relationship between the first attitude and the second attitude, and the second attitude data.
1 . A method for determining camera attitude, comprising:
in response to a first input image satisfying a first condition, adjusting a camera from a first attitude to a second attitude, the first input image being an image obtained by the camera in the first attitude, and the first input image satisfying the first condition including a pedestrian area interference value appearing in a portion of the first input image;
obtaining a second input image, the second input image being an image obtained by the camera in the second attitude;
determining second attitude data corresponding to the second attitude based on the second input image; and
determining first attitude data corresponding to the first attitude according to a transformation relationship between the first attitude and the second attitude, and the second attitude data.
2 . The method according to claim 1 , wherein the first input image satisfying the first condition further includes:
a texture intensity of the first input image not reaching a preset value; or
failing to calculate the first attitude data through the first input image.
3 . The method according to claim 1 , wherein adjusting the camera from the first attitude to the second attitude comprises:
recognizing another portion of the first input image with a texture intensity satisfying a second condition;
determining a first adjustment parameter according to a position of the another portion in the first input image; and
adjusting the camera from the first attitude to the second attitude according to the first adjustment parameter.
4 . The method according to claim 1 , wherein adjusting the camera from the first attitude to the second attitude comprises:
rotating the camera to a preset angle, the transformation relationship being a preset transformation relationship corresponding to the preset angle.
5 . The method according to claim 1 , wherein adjusting the camera from the first attitude to the second attitude comprises:
receiving a control instruction sent from a control terminal, and rotating the camera according to the control instruction until receiving a confirmation instruction sent from the control terminal.
6 . The method according to claim 1 , wherein determining the first attitude data corresponding to the first attitude according to the transformation relationship between the first attitude and the second attitude, and the second attitude data comprises:
determining the first attitude data corresponding to the first attitude according to the transformation relationship between the first attitude and the second attitude, the second attitude data, and third attitude data, the third attitude data being attitude data determined according to a third input image obtained by the camera in a third attitude.
7 . The method according to claim 6 , further comprising:
determining to-be-verified attitude data corresponding to the first attitude according to the transformation relationship between the first attitude and the second attitude, and the second attitude data;
determining fourth attitude data corresponding to the first attitude according to a transformation relationship between the first attitude and the third attitude, and the third attitude data; and
in response to accuracy of verifying the to-be-verified attitude data based on the fourth attitude data reaching a preset accuracy, determining the to-be-verified attitude data to be the first attitude data.
8 . The method according to claim 6 , wherein determining the first attitude data corresponding to the first attitude according to the transformation relationship between the first attitude and the second attitude, the second attitude data, and the third attitude data comprises:
determining the first attitude data corresponding to the first attitude according to the transformation relationship between the first attitude and the second attitude, the second attitude data, the transformation relationship between the first attitude and the third attitude, and the third attitude data.
9 . The method according to claim 1 , further comprising:
sending a display instruction to a control terminal, the display instruction being used to instruct the control terminal to display a direction prompt icon, and a direction indicated by the direction prompt icon being consistent with a direction in which the camera is adjusted from the first attitude to the second attitude.
10 . An electronic device, comprising a memory storing a computer program; and one or more processors coupled to the memory, wherein when being executed by the one or more processors, the computer program causes the processors to:
in response to a first input image satisfying a first condition, adjust a camera from a first attitude to a second attitude, the first input image being an image obtained by the camera in the first attitude, and the first input image satisfying the first condition including a pedestrian area interference value appearing in a portion of the first input image;
obtain a second input image, the second input image being an image obtained by the camera in the second attitude;
determine second attitude data corresponding to the second attitude based on the second input image; and
determine first attitude data corresponding to the first attitude according to a transformation relationship between the first attitude and the second attitude, and the second attitude data.
11 . The electronic device according to claim 10 , wherein the first input image satisfying the first condition further includes:
a texture intensity of the first input image not reaching a preset value; or
failing to calculate the first attitude data through the first input image.
12 . The electronic device according to claim 10 , wherein when adjusting the camera from the first attitude to the second attitude, the processor is further configured to:
recognize another portion of the first input image with a texture intensity satisfying a second condition;
determine a first adjustment parameter according to a position of the portion in the first input image; and
adjust the camera from the first attitude to the second attitude according to the first adjustment parameter.
13 . The electronic device according to claim 10 , wherein when adjusting the camera from the first attitude to the second attitude, the processor is further configured to:
rotate the camera to a preset angle, the transformation relationship being a preset transformation relationship corresponding to the preset angle.
14 . The electronic device according to claim 10 , wherein when adjusting the camera from the first attitude to the second attitude, the processor is further configured to:
receive a control instruction sent from a control terminal, and rotate the camera according to the control instruction until receiving a confirmation instruction sent from the control terminal.
15 . The electronic device according to claim 10 , wherein when determining the first attitude data corresponding to the first attitude according to the transformation relationship between the first attitude and the second attitude, and the second attitude data, the processor is further configured to:
determine the first attitude data corresponding to the first attitude according to the transformation relationship between the first attitude and the second attitude, the second attitude data, and third attitude data, the third attitude data being attitude data determined according to a third input image obtained by the camera in a third attitude.
16 . The electronic device according to claim 15 , wherein the processor is further configured to:
determine to-be-verified attitude data corresponding to the first attitude according to the transformation relationship between the first attitude and the second attitude, and the second attitude data;
determine fourth attitude data corresponding to the first attitude according to a transformation relationship between the first attitude and the third attitude, and the third attitude data; and
in response to accuracy of verifying the to-be-verified attitude data based on the fourth attitude data reaching a preset accuracy, determine the to-be-verified attitude data to be the first attitude data.
17 . The electronic device according to claim 15 , wherein when determining the first attitude data corresponding to the first attitude according to the transformation relationship between the first attitude and the second attitude, the second attitude data, and the third attitude data, the processor is further configured to:
determine the first attitude data corresponding to the first attitude according to the transformation relationship between the first attitude and the second attitude, the second attitude data, the transformation relationship between the first attitude and the third attitude, and the third attitude data.
18 . The electronic device according to claim 10 , wherein the processor is further configured to:
send a display instruction to a control terminal, the display instruction being used to instruct the control terminal to display a direction prompt icon, and a direction indicated by the direction prompt icon being consistent with a direction in which the camera is adjusted from the first attitude to the second attitude.
19 . The method according to claim 3 , wherein the second condition includes that the another portion of the first input image does not have the pedestrian area interference value.
20 . A method for determining camera attitude, comprising:
in response to a first input image satisfying a first condition, adjusting a camera from a first attitude to a second attitude, the first input image being an image obtained by the camera in the first attitude;
obtaining a second input image, the second input image being an image obtained by the camera in the second attitude;
determining second attitude data corresponding to the second attitude based on the second input image; and
determining first attitude data corresponding to the first attitude according to a transformation relationship between the first attitude and the second attitude, and the second attitude data, including:
determining to-be-verified attitude data corresponding to the first attitude according to the transformation relationship between the first attitude and the second attitude, and the second attitude data;
determining fourth attitude data corresponding to the first attitude according to a transformation relationship between the first attitude and a third attitude, and third attitude data, the third attitude data being attitude data determined according to a third input image obtained by the camera in the third attitude; and
in response to accuracy of verifying the to-be-verified attitude data based on the fourth attitude data reaching a preset accuracy, determining the to-be-verified attitude data to be the first attitude data.