[python]Affine Transform

2023-11-3 写技术

import cv2 import numpy as np img = cv2.imread("book.png",1) img_org = img.copy() h,w = img.shape[:2] p1 = np.float32([[81,30],[378,80],[13,425]]) p2 = np.float32([[0,0],[300,0],[0,400]]) M = cv2.getAffineTransform(p1,p2) img = cv2.warpAffine(img,M,(w, h)) cv2.imshow("org",img_org) cv2.i...

阅读全文>>

标签: linux python

评论(0) 浏览(393)

[linux]Running sftp automatically by expect tools

2023-8-27 写技术

#!/usr/bin/expect -f send "mv ./models/weights/FCRNet.weights.h5 ./models/weights/FCRNet.weights.h5.back\r" expect "*python39*" spawn sftp -P 3222 root@log.anycle.com expect "*assword" send "dppppppppppasdas\r" expect "sftp>" set timeout -1 send "get /hy-tmp/FCRN/models/weights/FCRNet.wei...

阅读全文>>

标签: linux

评论(0) 浏览(275)

[linux] 文件分包压缩

2023-8-19 写技术

tar zvf data.tar.gz data #使用split命令 #-b 3G 表示设置每个分割包的大小,单位还是可以M、k #-d 参数指定生成的分割包后缀为数字的形式 #-a x来设定序列的长度(默认值是2),这里设定序列的长度为1 split -b 3G -d -a 1 data.tar.gz data.tar.gz.  #拆分文件执行命令后,生成压缩包如下,通过ll命令查看: -rw-r--r--  1 root     root      4194304000 May 20 1...

阅读全文>>

标签: linux

评论(0) 浏览(261)

ubifs异步文件系统挂载注意

2023-6-5 写技术

ubifs 是一个异步的文件系统, 所以为了掉电的时候数据能保存完整, 最好使用-o sync 挂载文件系统

阅读全文>>

标签: linux

评论(0) 浏览(391)

[DL]Efficient Graph-Based Image Segmentation

2022-6-29 写技术

import os import math import torch import matplotlib.pyplot as plt from PIL import Image from torchvision import transforms from torchvision.transforms import ToPILImage MAX_VAL = 65535 means = [0.485, 0.456, 0.406] stds = [ 0.229, 0.224, 0.225] def cost_edge(a, b): ret = 0 ...

阅读全文>>

标签: neural network linux python machine_learning DL

评论(0) 浏览(950)

[linux] Install gcc

2020-10-15 写技术

wget http://ftp.gnu.org/gnu/gcc/gcc-6.1.0/gcc-6.1.0.tar.gz tar -zvxf gcc-6.1.0.tar.gz --directory=/usr/local/ cd /usr/local/gcc-6.1.0 sudo ./contrib/download_prerequisites sudo mkdir build cd build sudo ../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib...

阅读全文>>

标签: linux C++

评论(0) 浏览(1133)

[embeded] A sample of searial port communication

2019-7-10 写技术

#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> #include <termios.h> void main() { struct termios opt; int tty; int len; int i; unsigned...

阅读全文>>

标签: embedded C linux

评论(0) 浏览(1132)

[linux]How to build ethtool by crosstool

2019-6-18 写技术

cd ethtool-5.0/ ./configure --host=arm-xilinx-linux-gnueabi-gcc LDFLAGS=-static make

阅读全文>>

标签: embedded linux

评论(0) 浏览(1065)

[linux]How to build tcpdump by crosstool

2019-6-18 写技术

cd libpcap-1.9.0/ ./configure --prefix=$PWD/install --host=arm-xilinx-linux-gnueabi --with-pcap=linux make make install cd tcpdump-4.9.2/ ./configure --host=arm-xilinx-linux-gnueabi make

阅读全文>>

标签: embedded linux

评论(0) 浏览(1187)

[linux]How to access ini file by shell

2018-10-16 写技术

readIni() { file=$1; section=$2; item=$3; val=$(awk -F '=' '/\['${section}'\]/{a=1} (a==1 && "'${item}'"==$1){a=0;print $2}' ${file}) echo ${val} } writeIni() { file=$1; section=$2; item=$3; val=$4; awk -F '=' '/\['${section}'\]/{a=1} (a==1 && "'${i...

阅读全文>>

标签: linux

评论(0) 浏览(1253)

Powered by anycle 湘ICP备15001973号-1