Skip to content

Instantly share code, notes, and snippets.

View mesutpiskin's full-sized avatar
👀
I may be slow to respond.

Mesut Pişkin mesutpiskin

👀
I may be slow to respond.
View GitHub Profile
#!/usr/bin/env python
# import the necessary packages
from __future__ import division
from scipy.spatial import distance as dist
import numpy as np
import time
import dlib
import cv2
from collections import OrderedDict
#!/usr/bin/env python
# import the necessary packages
from __future__ import division
from scipy.spatial import distance as dist
import numpy as np
import time
import dlib
import cv2
from collections import OrderedDict
@mesutpiskin
mesutpiskin / calibration.py
Last active April 25, 2024 11:36
Fisheye Camera Calibration with OpenCV
import numpy as np
import cv2
import glob
# Define the chess board rows and columns
CHECKERBOARD = (6,9)
subpix_criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.1)
calibration_flags = cv2.fisheye.CALIB_RECOMPUTE_EXTRINSIC + cv2.fisheye.CALIB_CHECK_COND + cv2.fisheye.CALIB_FIX_SKEW
objp = np.zeros((1, CHECKERBOARD[0]*CHECKERBOARD[1], 3), np.float32)
objp[0,:,:2] = np.mgrid[0:CHECKERBOARD[0], 0:CHECKERBOARD[1]].T.reshape(-1, 2)
@mesutpiskin
mesutpiskin / calibration_fisheye2.py
Created June 23, 2018 10:24
OpenCV fisheye calibration and undistortion
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 17 19:59:33 2018
@author: mesut
"""
import yaml
import cv2
assert cv2.__version__[0] == '3', 'The fisheye module requires opencv version >= 3.0.0'
import numpy as np
@mesutpiskin
mesutpiskin / MeanShift.py
Last active May 13, 2020 10:00
Ağırlıklı Ortalama Öteleme Algoritması (Mean Shift) ile Hareketli Nesne Takibi #OpenCV #Python
# http://mesutpiskin.com/blog/agirlikli-ortalama-oteleme-algoritmasi-mean-shift-ile-hareketli-nesne-takibi.html
# https://youtu.be/9qzaBzmmL7s
import cv2
import numpy as np
videoCapture = cv2.VideoCapture("video.mp4")
@mesutpiskin
mesutpiskin / image_data_generator.py
Last active April 11, 2019 13:24
Image data generator with Keras
import os
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
from PIL import Image
import glob
image_count = 5
current_dataset_folder = "train/*.*"
export_folder_name = "newdataset"
@mesutpiskin
mesutpiskin / FakeAsyncCursor.cs
Last active October 21, 2019 08:29
fake/dummy implementation of mongodb IAsyncCursor used for testing
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MongoDB.Driver;
namespace MyProject.Test
{
public class DummyAsyncCursor<TEntity> : IAsyncCursor<TEntity>
{
apiVersion: v1
kind: Pod
metadata:
name: bulkhead-myapp
spec:
containers:
- name: bulkhead-myapp-container
image: bulkhead-myapp
resources:
requests:
@mesutpiskin
mesutpiskin / redis-search-and-delete.go
Last active December 2, 2022 07:09
Redis Delete Keys Matching a Search Pattern with Go Lang. Redis client https://github.com/go-redis/redis
package main
import (
"context"
"fmt"
"os"
"github.com/go-redis/redis/v8"
)
Feature: Kullanıcılar e-tiracret platformu üzerinden seçtikleri ürünü satın alabilir.
Scenario: (Success) Satın alınan ürününün stok miktarı, satın alınan adet kadar azalalır.
Given "USER1" kodlu kullanıcı oturum açmalıdır
And "PRODUCT1" kodlu ürünün stok miktarı 100 olarak güncellenir
And "USER1" kodlu kullanıcının sepeti temizlenir
And "PRODUCT1" kodlu üründen sepete 1 adet eklenir
When "USER1" kodlu kullanıcı ödeme işlemi gerçekleştirildiğinde