Skip to content

Instantly share code, notes, and snippets.

View MareArts's full-sized avatar

MareArts MareArts

View GitHub Profile
import os
def splitPathFileExt(fullName):
base=os.path.basename(fullName)
split_name = os.path.splitext(base)
#print(split_name)
FilePath = str[:str.rfind('/')]
FileName = split_name[0]
//////////lambda side /////////////////////////////////////////
//node.js
// function to encode file data to base64 encoded string
function base64_encode(file) {
// read binary data
var bitmap = fs.readFileSync(file);
// convert binary data to base64 encoded string
return new Buffer(bitmap).toString('base64');
}
#https://www.cvlecture.marearts.com/forum/computer-vision-forum/upload-file-to-google-drive-using-python-writing
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
try :
import argparse
flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
except ImportError:
flags = None
#include <vector>
#include <opencv2/opencv.hpp>
#ifdef _DEBUG
#pragma comment(lib, "opencv_world401d.lib")
#else
#pragma comment(lib, "opencv_world401.lib")
#endif
#include <vector>
#include <opencv2/opencv.hpp>
#ifdef _DEBUG
#pragma comment(lib, "opencv_world401d.lib")
#else
#pragma comment(lib, "opencv_world401.lib")
#endif
#include <opencv2/opencv.hpp>
#ifdef _DEBUG
#pragma comment(lib, "opencv_world401d.lib")
#else
#pragma comment(lib, "opencv_world401.lib")
#endif
//http://study.marearts.com/2019/04/opencv-simple-background-subtraction.html
//https://youtu.be/s32FB0OxnuI
#include <opencv2/opencv.hpp>
#ifdef _DEBUG
#pragma comment(lib, "opencv_world401d.lib")
#else
#pragma comment(lib, "opencv_world401.lib")
#endif
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
ret, frame = cap.read()
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
@MareArts
MareArts / test.py
Last active June 27, 2018 14:19
test
import cv2
import numpy as np
img = cv2.imread('Suzy.jpg', 1)
@MareArts
MareArts / Extract the value of interest rows and copy that to new Mat using concate.cpp
Last active March 22, 2018 18:05
Extract the value of interest rows and copy that to new Mat using concate.cpp
//using concate
cout << "\ncopy interest rows to new Mat using concate\n";
Mat c;
for (auto it : row_index_interest)
{
if (c.empty())
{
c = a.row(it);
continue;
}else{