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
import cv2 | |
import numpy as np | |
img = cv2.imread('star.jpg',0) | |
ret,thresh = cv2.threshold(img,127,255,0) | |
contours,hierarchy = cv2.findContours(thresh, 1, 2) | |
cnt = contours[0] | |
M = cv2.moments(cnt) | |
print(M) |
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
import cv2 | |
i = cv2.imread('img6.jpg') | |
img_g = cv2.cvtColor(i, cv2.COLOR_BGR2GRAY) | |
ret,img = cv2.threshold(img_g,127,255,0) | |
M = cv2.moments(img) | |
X = int(M["m10"] / M["m00"]) | |
Y = int(M["m01"] / M["m00"]) |
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
unset LD_PRELOAD | |
command="proot" | |
command+=" --link2symlink" | |
command+=" -0" | |
#archurl="arm64" | |
#wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Rootfs/Ubuntu/${archurl}/ubuntu-rootfs-${archurl}.tar.xz | |
#mkdir ubuntu-fs && proot --link2symlink tar -xJf ubuntu-rootfs-${archurl}.tar.xz -C ubuntu-fs | |
command+=" -r ubuntu-fs" | |
command+=" -b /dev" | |
command+=" -b /proc" |
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
#!/usr/bin/env bash | |
#Bootstrap the system, Ex: ./bootstrap.sh arm64 ubuntu-rootfs | |
rm -rf $2 | |
mkdir $2 | |
if [ "$1" = "i386" ] || [ "$1" = "amd64" ] ; then | |
debootstrap --arch=$1 --variant=minbase --include=systemd,libsystemd0,wget,ca-certificates,busybox-static jammy $1 http://archive.ubuntu.com/ubuntu | |
else | |
qemu-debootstrap --arch=$1 --variant=minbase --include=systemd,libsystemd0,wget,ca-certificates,busybox-static jammy $1 http://ports.ubuntu.com/ubuntu-ports | |
fi |
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
maven { url 'https://maven.aliyun.com/repository/public' } | |
maven { url 'https://maven.aliyun.com/repository/central' } | |
maven { url 'https://maven.aliyun.com/repository/google' } | |
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } | |
maven { url 'https://maven.aliyun.com/repository/apache-snapshots' } | |
compileSdk 33 | |
buildToolsVersion "33.0.3" | |
minSdk 21 |
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
task getDeps(type: Copy) { | |
from new File(gradle.gradleUserHomeDir, "caches/modules-2/files-2.1") | |
into "build/libs" | |
includeEmptyDirs false | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
pkg install -forge symbolic | |
pkg load symbolic |
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
% Define farfield radiation electric field (E) and magnetic field (H) functions | |
E = @(r, theta, phi) your_electric_field_function(r, theta, phi); | |
H = @(r, theta, phi) your_magnetic_field_function(r, theta, phi); | |
% Define spherical region of integration | |
rmin = your_min_r_value; | |
rmax = your_max_r_value; | |
thetamin = your_min_theta_value; | |
thetamax = your_max_theta_value; | |
phimin = your_min_phi_value; |
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
% Define the function to be integrated | |
fun = @(x) x.^2; | |
% Define the integration limits | |
lower_limit = 0; | |
upper_limit = 1; | |
% Calculate the definite integral | |
result = integral(fun, lower_limit, upper_limit); |
OlderNewer