Skip to content

Commit

Permalink
Merge pull request #172 from CPFL/mod_tlr
Browse files Browse the repository at this point in the history
Mod tlr
  • Loading branch information
manato committed Dec 18, 2015
2 parents 2ac5eae + 0978915 commit d2f4016
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ struct thresholdSet {
hsvSet Green;
};

//#define SHOW_DEBUG_INFO

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,10 @@ static cv::Mat signalDetect_inROI(const cv::Mat& roi,
break;
}

// imshow("bright_mask", bright_mask);
// waitKey(10);
#ifdef SHOW_DEBUG_INFO
imshow("bright_mask", bright_mask);
cv::waitKey(10);
#endif

unsigned int candidates_num = candidates.size();

Expand Down Expand Up @@ -391,9 +393,11 @@ void TrafficLightDetector::brightnessDetect(const cv::Mat &input) {
cv::Mat extracted_HSV;
roi.copyTo(extracted_HSV, signalMask);

// extracted_HSV.copyTo(roi);
// imshow("tmpImage", tmpImage);
// waitKey(5);
#ifdef SHOW_DEBUG_INFO
extracted_HSV.copyTo(roi);
imshow("tmpImage", tmpImage);
cv::waitKey(5);
#endif

cvtColor(extracted_HSV, extracted_HSV, CV_BGR2HSV);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,11 @@ static void superimpose_cb(const std_msgs::Bool::ConstPtr& config_msg)
int main(int argc, char* argv[]) {

// printf("***** Traffic lights app *****\n");
#ifdef SHOW_DEBUG_INFO
cv::namedWindow("tmpImage", cv::WINDOW_NORMAL);
cv::namedWindow("bright_mask", cv::WINDOW_NORMAL);
cv::startWindowThread();
#endif

thSet.Red.Hue.upper = (double)DAYTIME_RED_UPPER;
thSet.Red.Hue.lower = (double)DAYTIME_RED_LOWER;
Expand Down Expand Up @@ -495,6 +500,8 @@ void setContexts(TrafficLightDetector &detector,
ctx.yellowCenter3d = cv::Point3d( map_x, map_y, map_z );
ctx.signalID = sig_iterator->signalId; // use yellow light signalID as this context's representative
break;
default: /* this signal is not for cars (for pedestrian or something) */
continue;
}
min_radius = (min_radius > radius) ? radius : min_radius;
most_left = (most_left > img_x - radius - 1.5 * min_radius) ? img_x - radius - 1.5 * min_radius : most_left;
Expand Down

0 comments on commit d2f4016

Please sign in to comment.