Skip to content

Instantly share code, notes, and snippets.

View mshabunin's full-sized avatar
🌚

Maksim Shabunin mshabunin

🌚
  • Nizhny Novgorod, Russia
  • 13:03 (UTC +03:00)
View GitHub Profile
@mshabunin
mshabunin / legacy_params.hpp
Created February 25, 2015 10:07
legacy_params.hpp
#ifndef __LEGACY_ML_PARAMS_DEFINED__
#define __LEGACY_ML_PARAMS_DEFINED__
#include "opencv2/ml.hpp"
namespace cv { namespace ml {
template <typename T>
class MLParams
{
#define CV_VFP 1
#if defined __GNUC__ && defined __arm__ && (defined __ARM_PCS_VFP || defined __ARM_VFPV3__)
// #define CV_VFP 1
#endif
#if defined __GNUC__ && defined __arm__ && (defined __ARM_PCS_VFP || defined __ARM_VFPV3__ || defined __ARM_NEON__) && !defined __SOFTFP__
// #define CV_VFP 1
#endif
@mshabunin
mshabunin / mailFilter.xml
Created July 21, 2015 08:00
GMail filter to clean OpenCV issues transfer notifications
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>
<title>Mail Filters</title>
<id>tag:mail.google.com,2008:filters:1437465402971</id>
<updated>2015-07-21T07:57:20Z</updated>
<author>
<name>Maksim Shabunin</name>
</author>
<entry>
<category term='filter'></category>
@mshabunin
mshabunin / test.cpp
Last active February 15, 2016 09:07
OpenCV memory leak test (Mac OS X)
#include <opencv2/imgcodecs/imgcodecs.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <mach/mach.h>
#include <iostream>
#include <ctime>
using namespace std;
int main()
@mshabunin
mshabunin / issue_6198.cpp
Created March 2, 2016 16:13
Test code for issue 6198
#include <vector>
#include <stdio.h>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
void createAlphaMat(Mat &mat)
{
for (int i = 0; i < mat.rows; ++i) {
@mshabunin
mshabunin / median_blur_perf_test.cpp
Created September 2, 2016 11:35
medianBlur performance test
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
@mshabunin
mshabunin / build.sh
Created December 22, 2017 11:22
Build script for size investigations
#!/bin/bash
set -e
set -x
export PATH=/usr/lib/ccache:$PATH
build_one() {
BUILDDIR=$1
shift
@mshabunin
mshabunin / fragment.cpp
Created September 18, 2019 16:02
Memory fragmentation with posix_memalign
#include <thread>
#include <utility>
#include <vector>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <malloc.h>
using namespace std;
@mshabunin
mshabunin / posix_memalign_not_reclaiming.cpp
Last active September 19, 2019 12:06
Reproduce issue with posix_memalign
// command: g++ posix_memalign_not_reclaiming.cpp -o test
#include <malloc.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
const size_t ALIGN = 64;
const size_t ITERATIONS = 1000;
const size_t SIZE = 3 * 1000 * 1000;
@mshabunin
mshabunin / pool.cpp
Created December 30, 2019 22:40
Memory pool with two modes: safe and fast
#include <cstddef>
#include <iostream>
#include <list>
// #define SAFE
using namespace std;
class Pool
{