This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/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"; |