Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

lp6m

🌴
On vacation
Block or report user

Report or block lp6m

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lp6m
lp6m / generate_sample.R
Created Nov 7, 2019
Generate bayesian network sample data from learned network structure on R
View generate_sample.R
#sudo apt install r-base-core #the latest version will not be installed by this command
#install.packages("bnlearn", dependencies = TRUE)
library(bnlearn)
data(alarm)
res = read.bif("./alarm.bif") #http://www.bnlearn.com/bnrepository/discrete-medium.html#alarm
sim = rbn(res, 500, alarm)
write.csv(sim, "./alarm.csv")
View bdeu_score.cpp
/*example dataset
4 3
A B C D
A B
B C
D C
10
1 1 0 1
0 2 1 1
2 1 0 0
View build-ubuntu18.04-rootfs.sh
#This shell script refers this tip : https://qiita.com/ikwzm/items/be06b07e26cbf05fec2b
#rootfs which this script generates is compatible for v2019.1 of https://github.com/ikwzm/ZynqMP-FPGA-Linux
#### Setup APT
distro=bionic
export LANG=C
/debootstrap/debootstrap --second-stage
View dma.h
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <sys/types.h>
#include <sys/mman.h>
#define DMA_INTAKE_DMACR (0x0000)
View hog.cpp
void hog(cv::Mat img, double *dst){
const int s_row = 32;//img.rows;
const int s_col = 64;//img.cols;
const int c_row = 12;
const int c_col = 12;
const int b_row = 2;
const int b_col = 2;
int n_cells_row = s_row / c_row; // number of cells along row-axis //2
int n_cells_col = s_col / c_col; // number of cells along col-axis //5
const int orientations = 8;
View gist:9a492fbae3a288716d3ed6dd64567772
void hog(cv::Mat img, double *dst){
const int s_row = 32;//img.rows;
const int s_col = 64;//img.cols;
const int c_row = 12;
const int c_col = 12;
const int b_row = 2;
const int b_col = 2;
int n_cells_row = s_row / c_row; // number of cells along row-axis //2
int n_cells_col = s_col / c_col; // number of cells along col-axis //5
const int orientations = 8;
@lp6m
lp6m / pcam.cpp
Created Dec 6, 2018
永久財産
View pcam.cpp
/*
before run this code, you should run the following commands.
media-ctl -d /dev/media0 -V '"ov5640 2-003c":0 [fmt:UYVY/'1920x1080'@1/'15' field:none]'
media-ctl -d /dev/media0 -V '"43c60000.mipi_csi2_rx_subsystem":0 [fmt:UYVY/'1920x1080' field:none]'
*/
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
@lp6m
lp6m / get_pcam_image2.cpp
Created Oct 22, 2018
Get Pcam 5C image through HLS core via V4L2 API
View get_pcam_image2.cpp
/*
Target board: ZYBO Z7-20
Kernel&Circuit:https://github.com/Digilent/Petalinux-Zybo-Z7-20
Distribution: Ubuntu 16.04
https://rcn-ee.com/rootfs/eewiki/minfs/ubuntu-16.04.3-minimal-armhf-2017-10-07.tar.xz
Thanks to @hokim.
Xilinx Form: https://forums.xilinx.com/t5/Embedded-Linux/can-t-get-image-from-PCam-5C-on-Ubuntu-running-on-ZYBO-Z7-20/m-p/882879#M28057
Before run this code, you must run the following commands.
@lp6m
lp6m / system_user.dtsi
Created Oct 22, 2018
Modified Device Tree
View system_user.dtsi
/include/ "system-conf.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/media/xilinx-vip.h>
/ {
model = "Zynq Zybo Z7 Development Board";
compatible = "digilent,zynq-zyboz7", "xlnx,zynq-7000";
chosen {
bootargs = "console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio";
@lp6m
lp6m / system_user.dtsi
Created Oct 22, 2018
Cutom Device Tree
View system_user.dtsi
/include/ "system-conf.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/media/xilinx-vip.h>
/ {
model = "Zynq Zybo Z7 Development Board";
compatible = "digilent,zynq-zyboz7", "xlnx,zynq-7000";
chosen {
bootargs = "console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio";
You can’t perform that action at this time.