Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You cannot used double quotes for colours code. Just removed double quotes. You can change fontscale and thickness to suit your needed. Change this:

putText(frame, "Press 'C' to start calibration", Point(10, 20), FONT_HERSHEY_SIMPLEX, 0.6, **(0, 0, 255)**, 2);
putText(frame, "Press 'Q' to quit", Point(10, 40), FONT_HERSHEY_SIMPLEX, 0.6, **(0, 255, 0)**, 2);
putText(frame, to_string(num_img) + " Chessboards are detected ", Point(10, 60), FONT_HERSHEY_SIMPLEX, 0.5, **(255, 0, 0)**, 2);

to:

putText(frame, "Press 'C' to start calibration", Point(10, 20), FONT_HERSHEY_SIMPLEX, 0.6, (0, 0, 255), 2);

putText(frame, "Press 'Q' to quit", Point(10, 40), FONT_HERSHEY_SIMPLEX, 0.6, (0, 255, 0), 2);

putText(frame, to_string(num_img) + " Chessboards are detected ", Point(10, 60), FONT_HERSHEY_SIMPLEX, 0.5, (255, 0, 0), 2);

You cannot used double quotes for colours code. Just removed remove double quotes. You can change fontscale and thickness to suit your needed. Change this:

putText(frame, "Press 'C' to start calibration", Point(10, 20), FONT_HERSHEY_SIMPLEX, 0.6, **(0, 0, 255)**, 2);
putText(frame, "Press 'Q' to quit", Point(10, 40), FONT_HERSHEY_SIMPLEX, 0.6, **(0, 255, 0)**, 2);
putText(frame, to_string(num_img) + " Chessboards are detected ", Point(10, 60), FONT_HERSHEY_SIMPLEX, 0.5, **(255, 0, 0)**, 2);

to:

putText(frame, "Press 'C' to start calibration", Point(10, 20), FONT_HERSHEY_SIMPLEX, 0.6, (0, 0, 255), 2);

putText(frame, "Press 'Q' to quit", Point(10, 40), FONT_HERSHEY_SIMPLEX, 0.6, (0, 255, 0), 2);

putText(frame, to_string(num_img) + " Chessboards are detected ", Point(10, 60), FONT_HERSHEY_SIMPLEX, 0.5, (255, 0, 0), 2);

You cannot used double quotes for colours code. Just remove double quotes. You can change fontscale and thickness to suit your needed. Change this:

putText(frame, "Press 'C' to start calibration", Point(10, 20), FONT_HERSHEY_SIMPLEX, 0.6, **(0, 0, 255)**, 2);
putText(frame, "Press 'Q' to quit", Point(10, 40), FONT_HERSHEY_SIMPLEX, 0.6, **(0, 255, 0)**, 2);
putText(frame, to_string(num_img) + " Chessboards are detected ", Point(10, 60), FONT_HERSHEY_SIMPLEX, 0.5, **(255, 0, 0)**, 2);

to:

putText(frame, "Press 'C' to start calibration", Point(10, 20), FONT_HERSHEY_SIMPLEX, 0.6, (0, 0, 255), (255,0,0), 2);

putText(frame, "Press 'Q' to quit", Point(10, 40), FONT_HERSHEY_SIMPLEX, 0.6, (0, 255, 0), 2);

putText(frame, to_string(num_img) + " Chessboards are detected ", Point(10, 60), FONT_HERSHEY_SIMPLEX, 0.5, (255, 0, 0), (0,0,255), 2);

You get an order Red, Green and Blue.