Skip to content

Commit

Permalink
fix: remove unused process
Browse files Browse the repository at this point in the history
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
  • Loading branch information
satoshi-ota committed Sep 20, 2024
1 parent 281e23d commit f215966
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,7 @@ void AutowareScreenCapturePanel::on_timer()
size, CV_8UC3, const_cast<uchar *>(q_image.bits()),
static_cast<size_t>(q_image.bytesPerLine()));

const auto q_size = screen->grabWindow(main_window_->winId())
.toImage()
.convertToFormat(QImage::Format_RGB888)
.rgbSwapped()
.size();

current_movie_size_ = cv::Size(q_size.width(), q_size.height());
size_ = size;

if (is_buffering_) {
buffer_.push_back(image.clone());
Expand Down Expand Up @@ -267,7 +261,6 @@ bool AutowareScreenCapturePanel::save_movie(const std::string & file_name)

save(movie_, file_name);

// writer_.release();
capture_to_mp4_button_ptr_->setText("waiting for capture");
capture_to_mp4_button_ptr_->setStyleSheet("background-color: #00FF00;");

Expand Down Expand Up @@ -298,11 +291,11 @@ void AutowareScreenCapturePanel::save(

writer.open(
"capture/" + file_name + ros_time_label_->text().toStdString() + ".mp4", fourcc, rate_->value(),
current_movie_size_);
size_);

for (const auto & frame : images) {
cv::Mat resized_frame;
cv::resize(frame, resized_frame, current_movie_size_);
cv::resize(frame, resized_frame, size_);
writer.write(resized_frame);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,12 @@ public Q_SLOTS:
QSpinBox * rate_;
QMainWindow * main_window_{nullptr};

cv::Size current_movie_size_;
cv::Size size_;

std::deque<cv::Mat> movie_;

std::deque<cv::Mat> buffer_;

// std::deque<std::pair<cv::Mat, rclcpp::Time>> frame_buffer_;
// Size of the frame buffer (number of frames to keep in memory)
// At 10 Hz capture rate, 100 frames correspond to approximately 10 seconds of video
const size_t buffer_size_ = 100;
Expand Down

0 comments on commit f215966

Please sign in to comment.