/*********************************************************** * @fn setparamsCallback(const sensor_msgs::ImageConstPtr& msg) * @brief callback for the reconfigure gui * @pre has to have the setup for the reconfigure gui * @post changes the parameters ***********************************************************/ void setparamsCallback(mst_homography::homography_ParamsConfig &config, uint32_t level) { // set params params = config; _transform = find_perspective(params.theta_x, params.theta_y, params.theta_z, params.center_x, params.center_y); }
bool init_processing(cv::Mat* mat) { auto found_pespective = find_perspective(mat); if (found_pespective) { perspective = *found_pespective; birds_eye_transform(mat, perspective); if (Settings::normalizeLightning) normalizeLightning(mat, blur_i, intensity / 100.f); cv::Mat cannied_mat; cv::Canny(*mat, cannied_mat, thresh1, thresh2, 3); roadFollower = make_unique<roadfollower>(cannied_mat, mat->size().width / 2.f + centerDiff); return true; } else{ cv::putText(*mat, "SEARCHING FOR STRAIGHT LANES...", POINT(50.f, mat->size().height / 3.f), cv::FONT_HERSHEY_PLAIN, 1, cv::Scalar(0, 255, 0), 2); return false; } }