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> |
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; |
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'); | |
} |
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) { |
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; |
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, |
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, |
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', |
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], |
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