Skip to content

Instantly share code, notes, and snippets.

View ollewelin's full-sized avatar

Olle Welin ollewelin

View GitHub Profile
//2017-05-11 fix bugg index was wrong before m32_conv0 = convolute_mat2(&Feature0Kernel[31][0], FE0KSIZESQR, FE0KSIZESQR, m1_0_padded, int (m1_0_padded.cols));// Make a convolution of the image
//2017-05-07 find bugg Mat pol_c_m1_unpad(C2M_H,C2M_W,CV_32F); was before bug fix ..C2M_H,C2M_H..
//2017-05-05 32x32x32 feature stright connection
//2017-05-05 FIX so kernel update weight direct after each pixel step (before there was a sum up all steps togheter dont work prorper). So now the kerenle patches traingin much much faster and better
//the kernels feature now adapt and look's much more like it correspond to the traingin images.
//Add dropout on fully connected HiddenNodes prevent overtraning
//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
@ollewelin
ollewelin / gist:a8a94a7c485c557ba5c84c19682728fc
Last active May 10, 2017 18:39
NN18.cpp update feature learning much better and faster
//Fix bugg 2017-05-10 (....C2M_W....) before (C2M_H,C2M_H...
//Mat pol_c_m1_unpad(C2M_H,C2M_W,CV_32F);//After second pooling befor padding
//2017-05-05 FIX so kernel update weight direct after each pixel step (before there was a sum up all steps togheter dont work prorper). So now the kerenle patches traingin much much faster and better
//the kernels feature now adapt and look's much more like it correspond to the traingin images.
//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.
@ollewelin
ollewelin / CMakeFiles.txt
Created March 3, 2017 19:24
CMakeFiles.txt for NN18.cpp program
#####################################
cmake_minimum_required (VERSION 2.8)
project (raspicam_test)
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")
#SET_SOURCE_FILES_PROPERTIES( gpio_test.c PROPERTIES LANGUAGE CXX )
@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
@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 / 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 / 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 / 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 / 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")
# ----------------------------------------------------------------------------
# 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)