0

RPI robot - Camera

Camera

Camera is started in mrm-robot.cpp file, which contains Robot class constructor, using this command:

camera = new Camera();
Skipping details, you can use the camera this way:
void RobotLine::loop() {         
	camera->imageGet(); 						// Capture image from camera
	if (camera->newFrameAvailable && !camera->frame->empty()) { // If a new picture
		cv::imshow("Camera", *camera->frame); 	// Display in a window
		camera->newFrameAvailable = false;		// Reset flag
		if (cv::waitKey(1) == 27)  				// Esc pressed?
			end();								// Stop the program
	}
}
Enter this program, use "loo" command and watch video capture and display in a window.