Browse Source

Removed the example integration with RaspiCam to keep the SDK simple.

David Piuva 5 years ago
parent
commit
08a61b1f96

+ 2 - 1
Doc/GettingStarted.txt

@@ -16,9 +16,10 @@ If using a Raspberry Pi, you can use Raspbian (Buster or newer for X11 support)
 
 Build and run an example program:
 	* Select an SDK example and open its folder in a terminal.
+	* Give permission to execute the build script.
 		chmod +x build.sh
+	* Run the build script.
 		./build.sh
-	Some examples might have additional dependencies.
 
 Run regression tests:
 	* Open the source folder in a terminal and run the test script:

+ 0 - 46
Source/SDK/raspiCam/RaspiCam.txt

@@ -1,46 +0,0 @@
-RASPICAM EXAMPLE FOR RASPBERRY PI
-Tested on Ubuntu Mate using a Raspberry Pi 3B.
-
-INSTALLING THE RASBICAM LIBRARY
-* Update your system if you haven't for a while:
-    sudo apt-get update
-    sudo apt-get upgrade
-* Install cmake:
-	sudo apt-get install cmake
-* Download and extract the latest version of Raspicam:
-	https://sourceforge.net/projects/raspicam/files/latest/download
-* Enter the raspicam-x.x.x folder and create a build folder:
-	mkdir build
-* Enter the build folder:
-	cd build
-* Generate a Makefile from the parent directory's CMakeLists.txt:
-	cmake ..
-* Compile using the Makefile:
-	make
-* Install the compiled result:
-	sudo make install
-
-CAMERA INSTALLATION
-Mount the camera onto the camera connector.
-* Connect the cable to your Raspberry Pi camera if it's not already connected.
-* Remove the tape from the camera port.
-* Pull up the plastic edges holding the back against the connectors.
-* Put in the cable all the way.
-* Hold the cable in place by pressing down the plastic edges. This is important!
-* Open the Raspberry configuration from a terminal using:
-	sudo raspi-config
-* Activate the camera interface.
-	This will be located in the top menu or the interface sub-menu.
-* Reboot after enabling the camera interface.
-* Remove any lens protection to avoid getting a black or foggy image.
-
-CAMERA TESTING WITH RASPISTILL
-* Open a terminal anywhere and try the camera.
-	raspistill -t 1000000
-
-CAMERA TESTING WITH SDK EXAMPLE 
-* Open SDK/Raspicam in a terminal and run the build script.
-	chmod +x build.sh
-	./build.sh
-* You should see a grayscale camera feed in a window.
-

+ 0 - 27
Source/SDK/raspiCam/build.sh

@@ -1,27 +0,0 @@
-#!/bin/bash
-
-# Assuming that you called build.sh from its own folder, you should already be in the project folder.
-PROJECT_FOLDER=.
-# Placing your executable in the project folder allow using the same relative paths in the final release.
-TARGET_FILE=./camera
-# The root folder is where DFPSR, SDK and tools are located.
-ROOT_PATH=../..
-# Select where to place temporary files and the generated executable
-TEMP_DIR=${ROOT_PATH}/../../temporary
-# Select a window manager
-WINDOW_MANAGER=X11
-# Select safe debug mode or fast release mode
-#MODE=-DDEBUG #Debug mode
-MODE=-DNDEBUG #Release mode
-# Select the version of C++
-CPP_VERSION=-std=c++14
-# Select optimization level
-O_LEVEL=-O2
-# Select external libraries
-LINKER_FLAGS="-lraspicam"
-
-# Give execution permission
-chmod +x ${ROOT_PATH}/tools/buildAndRun.sh;
-# Compile everything
-${ROOT_PATH}/tools/buildAndRun.sh "${PROJECT_FOLDER}" "${TARGET_FILE}" "${ROOT_PATH}" "${TEMP_DIR}" "${WINDOW_MANAGER}" "${MODE}" "${CPP_VERSION}" "${O_LEVEL}" "${LINKER_FLAGS}";
-

+ 0 - 62
Source/SDK/raspiCam/main.cpp

@@ -1,62 +0,0 @@
-#include "../../DFPSR/includeFramework.h"
-#include <raspicam/raspicam.h>
-
-using namespace dsr;
-
-// Global
-const String mediaPath = string_combine(U"media", file_separator());
-bool running = true;
-
-// The window handle
-Window window;
-
-int main(int argn, char **argv) {
-	// Create a window
-	int cameraWidth = 320 * 2;
-	int cameraHeight = 240 * 2;
-	window = window_create(U"Raspberry Pi camera application", cameraWidth, cameraHeight);
-	// Load an interface to the window
-	//window_loadInterfaceFromFile(window, mediaPath + U"?.lof");
-
-	// Bind methods to events
-	window_setCloseEvent(window, []() {
-		running = false;
-	});
-
-	// Start the camera
-	raspicam::RaspiCam piCamera;
-	piCamera.setWidth(cameraWidth); piCamera.setHeight(cameraHeight);
-	piCamera.setFormat(raspicam::RASPICAM_FORMAT_GRAY);
-	if (!piCamera.open()) {
-		throwErrorMessage("Couldn't find any Raspberry Pi camera!\n");
-		return -1;
-	}
-	time_sleepSeconds(0.1);
-
-	// Create an image for the camera input
-	AlignedImageU8 cameraImage = image_create_U8(piCamera.getWidth(), piCamera.getHeight());
-
-	// Execute
-	while(running) {
-		window_executeEvents(window);
-		//window_drawComponents(window);
-
-		// Set shutter time in microseconds
-		piCamera.setShutterSpeed(10000); // 10000 fast, 20000 normal
-		piCamera.setISO(800); // 100 darkest, 800 brightest
-		// Get an image from the camera
-		piCamera.grab();
-		// Uncomment for a 10 ms cooldown time after each frame
-		//time_sleepSeconds(0.1);
-
-		piCamera.retrieve(image_dangerous_getData(cameraImage));
-
-		// Display the image
-		auto canvas = window_getCanvas(window);
-		draw_copy(canvas, cameraImage);
-
-		// Show the final state of the canvas without flickering
-		window_showCanvas(window);
-	}
-}
-