add 相机旋转
This commit is contained in:
parent
425be3f373
commit
c046635bb9
@ -52,6 +52,7 @@ second_tolerance: 100 # 远距离射击容差,degree
|
||||
judge_distance: 2 #距离判断阈值
|
||||
auto_fire: true # 是否由自瞄控制射击
|
||||
|
||||
rotate_180: false
|
||||
camera_name: "hikrobot"
|
||||
exposure_ms: 2
|
||||
gain: 16
|
||||
|
||||
@ -5,6 +5,7 @@ pattern_type: chessboard # circles_grid | chessboard
|
||||
|
||||
R_gimbal2imubody: [1, 0, 0, 0, 1, 0, 0, 0, 1]
|
||||
|
||||
rotate_180: false
|
||||
camera_name: "hikrobot"
|
||||
exposure_ms: 3
|
||||
gain: 10.0
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
# gamma: 0.5
|
||||
# vid_pid: "f622:d13a"
|
||||
|
||||
rotate_180: false
|
||||
camera_name: "hikrobot"
|
||||
exposure_ms: 3
|
||||
gain: 10.0
|
||||
|
||||
@ -52,6 +52,7 @@ second_tolerance: 2 # 远距离射击容差,degree
|
||||
judge_distance: 2 #距离判断阈值
|
||||
auto_fire: true # 是否由自瞄控制射击
|
||||
|
||||
rotate_180: false
|
||||
camera_name: "hikrobot"
|
||||
exposure_ms: 2
|
||||
gain: 16
|
||||
|
||||
@ -30,6 +30,7 @@ usb_gamma: 160
|
||||
usb_gain: 10 #0-96
|
||||
|
||||
#####-----工业相机参数-----#####
|
||||
rotate_180: false
|
||||
camera_name: "mindvision"
|
||||
exposure_ms: 2
|
||||
gamma: 0.5
|
||||
|
||||
@ -37,6 +37,7 @@ usb_gamma: 160
|
||||
usb_gain: 10 #0-96
|
||||
|
||||
#####-----工业相机参数-----#####
|
||||
rotate_180: false
|
||||
camera_name: "hikrobot"
|
||||
exposure_ms: 2
|
||||
gain: 16
|
||||
|
||||
@ -51,6 +51,7 @@ second_tolerance: 2 # 远距离射击容差,degree
|
||||
judge_distance: 2 #距离判断阈值
|
||||
auto_fire: true # 是否由自瞄控制射击
|
||||
|
||||
rotate_180: false
|
||||
camera_name: "hikrobot"
|
||||
exposure_ms: 2.5
|
||||
gain: 16.9
|
||||
|
||||
@ -51,6 +51,7 @@ second_tolerance: 2 # 远距离射击容差,degree
|
||||
judge_distance: 2 #距离判断阈值
|
||||
auto_fire: true # 是否由自瞄控制射击
|
||||
|
||||
rotate_180: false
|
||||
camera_name: "hikrobot"
|
||||
exposure_ms: 2.5
|
||||
gain: 16.9
|
||||
|
||||
@ -52,6 +52,7 @@ second_tolerance: 2 # 远距离射击容差,degree
|
||||
judge_distance: 2 #距离判断阈值
|
||||
auto_fire: true # 是否由自瞄控制射击
|
||||
|
||||
rotate_180: false
|
||||
camera_name: "hikrobot"
|
||||
exposure_ms: 2
|
||||
gain: 16
|
||||
|
||||
@ -22,6 +22,7 @@ roi:
|
||||
use_roi: false
|
||||
|
||||
#####-----工业相机参数-----#####
|
||||
rotate_180: false
|
||||
camera_name: "mindvision"
|
||||
exposure_ms: 8
|
||||
gamma: 0.6
|
||||
|
||||
@ -29,11 +29,16 @@ Camera::Camera(const std::string & config_path)
|
||||
else {
|
||||
throw std::runtime_error("Unknow camera_name: " + camera_name + "!");
|
||||
}
|
||||
|
||||
rotate_180_ = yaml["rotate_180"] ? yaml["rotate_180"].as<bool>() : false;
|
||||
}
|
||||
|
||||
void Camera::read(cv::Mat & img, std::chrono::steady_clock::time_point & timestamp)
|
||||
{
|
||||
camera_->read(img, timestamp);
|
||||
if (rotate_180_) {
|
||||
cv::rotate(img, img, cv::ROTATE_180);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace device
|
||||
@ -23,6 +23,7 @@ public:
|
||||
|
||||
private:
|
||||
std::unique_ptr<CameraBase> camera_;
|
||||
bool rotate_180_ = false;
|
||||
};
|
||||
|
||||
} // namespace device
|
||||
|
||||
Loading…
Reference in New Issue
Block a user