Archives mensuelles : juin 2022

Template matching with Python Opencv

opencv import import cv2 opencv template matching Useful opencv functions Note:Many functions of opencv rely on the ndarray type: in input as parameter and in output as returned result. imread(filename: Any, flags: Any = None)->ndarray: It loads an image from … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

numpy basic

Install numpy pip install numpy Import numpy in code import numpy as np What a ndarray is? It is a central data structure of the NumPy library. It represents a homogeneous n-dimensional array object. it has methods to describe it … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Debug python applications

Print all attributes of an object by reflection from pprint import pprint pprint(vars(my_object))

Publié dans Non classé | Laisser un commentaire

Slicing in python

Slicing in python Goal A slicing selects a range of items in a sequence object (e.g., a string, tuple or list). General syntax a[start:stop] : from start through stop-1 a[start:] : from start through the end of the array a[:stop] … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Windows dos script tips

Script tips To get the command used to call the batch file (could be foo, ..\foo, c:\bats\foo.bat, etc.) %0 To get the nth argument passed to the current script %1: first parameter %2: second parameter and so for… To get … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Concurrent futures with python 3.8

Purpose and overview The concurrent.futures module provides a high-level interface for asynchronously executing callables. The asynchronous execution can be performed with 2 flavors: – threads, using ThreadPoolExecutor – separate processes, using ProcessPoolExecutor. Both implement the same interface, which is defined … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

threads in python

Purpose and overview This module constructs higher-level threading interfaces on top of the lower level _thread module. We have other alternatives to the threading module, but the module is still an appropriate model if you want to run multiple I/O-bound … Continuer la lecture

Publié dans Non classé | Laisser un commentaire