View index.html
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
<html> | |
<head> | |
<title>OpenCV.js Test</title> | |
</head> | |
<body> | |
<table> | |
<tr> | |
<th>source</th> | |
<th>output</th> | |
</tr> |
View fetch_log.js
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
const path = require('path'); | |
const Ssh = require('node-ssh'); | |
const moment = require('moment'); | |
const tar = require('tar'); | |
async function downloadSlowQueryLog(sshInfo, sshPassword, remoteSlowQueryLogDir, slowQueryLogFileName, localSlowQueryLogFilePath) { | |
const ssh = new Ssh(); | |
const remoteSlowQueryLogFilePath = remoteSlowQueryLogDir + '/' + slowQueryLogFileName; |
View remove_exif.js
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
const path = require('path'); | |
const fs = require('fs'); | |
const piexif = require('piexifjs'); | |
function removeExifFromImage(srcImgPath, destImgPath) { | |
const imgData = fs.readFileSync(srcImgPath).toString('binary'); | |
const newImgData = piexif.remove(imgData); | |
fs.writeFileSync(destImgPath, newImgData, 'binary'); | |
} |
View check_exif.js
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
const path = require('path'); | |
const fs = require('fs'); | |
const piexif = require('piexifjs'); | |
function getExifFromImage(imgPath) { | |
const imgData = fs.readFileSync(imgPath).toString('binary'); | |
const exifRawData = piexif.load(imgData); | |
const exifData = {}; | |
for (const exifType in exifRawData) { |
View resize_images.js
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
const path = require('path'); | |
const fs = require('fs'); | |
const cv = require('opencv4nodejs'); | |
function resizeImagesToMax(srcDirPath, destDirPath, maxWidthHeight) { | |
const srcFileList = fs.readdirSync(srcDirPath); | |
for (const srcFileName of srcFileList) { | |
if (!srcFileName.endsWith('.JPG')) { | |
continue; |
View fetch_remote_db_data.js
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
const tunnel = require('tunnel-ssh'); | |
import knexLib = require('knex'); | |
async function main() { | |
const sshUserName = 'SSH_USER_NAME'; | |
const sshPassword = 'SSH_PASSWORD'; | |
let sshConfig = { | |
host: 'SSH_HOST_ADDRESS', | |
port: SSH_PORT, |
View ssh_tunnel_template.js
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
const tunnel = require('tunnel-ssh'); | |
async function main() { | |
const sshUserName = 'SSH_USER_NAME'; | |
const sshPassword = 'SSH_PASSWORD'; | |
let sshConfig = { | |
host: 'SSH_HOST_ADDRESS', | |
port: SSH_PORT, | |
username: sshUserName, |
View print_remote_file_list.js
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
const Ssh = require('node-ssh'); | |
async function main() { | |
const ssh = new Ssh(); | |
const sshPassword = 'SSH_PASSWORD'; | |
// connect | |
await ssh.connect({ | |
host: 'SSH_HOST_ADDRESS', |
View convert_img_to_line_drawing.js
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
const path = require('path'); | |
const fs = require('fs'); | |
const cv = require('opencv4nodejs'); | |
function convertImageToLineDrawing(img) { | |
const kernel = new cv.Mat([ | |
[1, 1, 1, 1, 1], | |
[1, 1, 1, 1, 1], | |
[1, 1, 1, 1, 1], |
View convert_img_to_line_drawing.py
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
# -*- coding: utf-8 -*- | |
import os | |
import cv2 | |
import numpy as np | |
def create_line_drawing_image(img): | |
kernel = np.array([ | |
[1, 1, 1, 1, 1], |
NewerOlder