Skip to content

Instantly share code, notes, and snippets.

View ollewelin's full-sized avatar

Olle Welin ollewelin

View GitHub Profile
@ollewelin
ollewelin / gist:1d2f2b114d2e078924b94b0f5747bedd
Created October 11, 2016 17:57
NN18.cpp Convolution Neural Network
//File: NN18.cpp
//Ask of loading any reruned training turn
//Rerun fully connected weights (10 times) and lock kernel layer 0 after (2) rerun lock kernel layer 1 after (4) reruns
//Show all kernels in 3 windows
//In this example 6 output nodes and explaned training images set in start of program.
float pre_debug_diff = 0.0;
float debug_diff = 0.0;
int load_kernels;
//2017-05-07 find bugg Mat pol_c_m1_unpad(C2M_H,C2M_W,CV_32F); was before bug fix ..C2M_H,C2M_H..
//File: NN18.cpp
//2017-01-17 fix bugg in make_SumChangeFeature0Weights replace c_m1 with m1_conv0
//Ask of loading any reruned training turn
//Rerun fully connected weights (10 times) and lock kernel layer 0 after (2) rerun lock kernel layer 1 after (4) reruns
//Show all kernels in 3 windows
//In this example 6 output nodes and explaned training images set in start of program.
float pre_debug_diff = 0.0;
float debug_diff = 0.0;
int load_kernels;
//File: NN20.cpp
//New on NN20 is:
//Sum nr0 with nr1 kernel's also on second layer here also with backprop
//New function make_SumChangeFeature_1B_Weights()
//2017- fix bugg in make_SumChangeFeature0Weights replace c_m1 with m1_conv0
//2017- fix bugg in make_SumChangeFeature_0B_Weights replace c_m1 with m1_conv0
//In this example 6 output nodes and explaned training images set in start of program.
float pre_debug_diff = 0.0;
# ----------------------------------------------------------------------------
# Basic Configuration
# ----------------------------------------------------------------------------
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(raspicam)
set(PROJECT_VERSION "0.1.2")
string(REGEX MATCHALL "[0-9]" PROJECT_VERSION_PARTS "${PROJECT_VERSION}")
list(GET PROJECT_VERSION_PARTS 0 PROJECT_VERSION_MAJOR)
list(GET PROJECT_VERSION_PARTS 1 PROJECT_VERSION_MINOR)
@ollewelin
ollewelin / gist:b39466c0797cb00455eacd03607c6fe9
Last active January 29, 2017 16:05
CMakeLists.txt for NN18
#####################################
cmake_minimum_required (VERSION 2.8)
project (raspicam_test)
SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /home/pi/OpenCV/opencv-3.2.0/release)
set(CMAKE_MODULE_PATH "/usr/local/lib/cmake/${CMAKE_MODULE_PATH}")
find_package(raspicam REQUIRED)
find_package(OpenCV)
IF ( OpenCV_FOUND AND raspicam_CV_FOUND)
MESSAGE(STATUS "COMPILING OPENCV TESTS")
@ollewelin
ollewelin / test_prog
Created March 1, 2017 18:08
Make posXXX.jpg files 64x48 pixels (fit NN18 program)
//Generate Positive samples
//File: test_prog.cpp
//You must make a director /positive_data/ where this program could put the pictures in
#include <stdio.h>
#include <unistd.h>
#include <ctime>
#include <iostream>
#include <raspicam/raspicam_cv.h>
using namespace std;
@ollewelin
ollewelin / test_prog
Created March 1, 2017 18:17
Generate verXXX.jpg files
//Generate Verify samples
//File: test_prog.cpp
//You must make a director /positive_data/ where this program could put the pictures in
#include <stdio.h>
#include <unistd.h>
#include <ctime>
#include <iostream>
#include <raspicam/raspicam_cv.h>
using namespace std;
@ollewelin
ollewelin / CMakeFiles.txt
Created March 1, 2017 18:20
Cmake file for test_prog verXXX.jpg
#File: CMakeLists.txt
#be in /home/pi/olle/pi/verify directory and type:
#sudo cmake ./CMakeLists.txt
#sudo make
#sudo ./test_prog
#####################################
cmake_minimum_required (VERSION 2.8)
project (raspicam_test)
set(CMAKE_MODULE_PATH "/usr/local/lib/cmake/${CMAKE_MODULE_PATH}")
@ollewelin
ollewelin / CMakeFiles.txt
Created March 1, 2017 18:22
Cmake files for posXXX.jpg tool
#File: CMakeLists.txt
#be in /home/pi/olle/pi/pos_neg directory and type:
#sudo cmake ./CMakeLists.txt
#sudo make
#sudo ./test_prog
#####################################
cmake_minimum_required (VERSION 2.8)
project (raspicam_test)
set(CMAKE_MODULE_PATH "/usr/local/lib/cmake/${CMAKE_MODULE_PATH}")
@ollewelin
ollewelin / installation log
Created March 3, 2017 16:55
My Raspberry pi 3 installation jessie, I/O pins bcm2835, OpenCV, Raspicam, Codeblocks, wxSmith, wxWidgets
Step by step installation I made on my Rasperry pi 3
This will install:
I/O pins bcm2835, OpenCV, Raspicam, Codeblocks, wxSmith, wxWidgets
Here we go..
Install Windisk32 on your ordernary computer
download RASPBIAN JESSIE WITH PIXEL disk image from
https://www.raspberrypi.org/downloads/raspbian/
to a 16Gb micro SD card use Windisk32