Skip to content

Instantly share code, notes, and snippets.

View shimat's full-sized avatar
🍀
🍀

shimat shimat

🍀
🍀
View GitHub Profile
@shimat
shimat / OtherDomain.cs
Last active August 29, 2015 13:58
Loading IplImage from other domain.
using System;
using System.IO;
using System.Linq;
using System.Reflection;
namespace ConsoleApplication1
{
class Proxy : MarshalByRefObject
{
private Type type;
@shimat
shimat / BlobEnclosingCircle.cs
Last active August 29, 2015 14:02
Enclosing Circle of Blob
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenCvSharp;
using OpenCvSharp.Blob;
namespace BlobEnclosingCircle
{
class Program
#include <opencv2/opencv.hpp>
#include <cstdio>
#include <algorithm>
using Contour = std::vector<cv::Point>;
void extractBlueRegion(
const cv::Mat &src, cv::Mat &dst, uchar bLow, uchar bHigh)
{
@shimat
shimat / MyDecoder.cs
Last active April 12, 2017 01:23
OpenCvSharp3のMatに、OpenCV2系でデコードした画像データをコピーする
using System;
using System.Runtime.InteropServices;
using OpenCvSharp; // OpenCvSharp3
static class MyDecoder
{
public static unsafe Mat FromImageDataByOpenCV2(
[NotNull] byte[] imageData,
ImreadModes modes = ImreadModes.Color)
{
@shimat
shimat / decolor.cpp
Created February 28, 2018 01:39
cv::decolor 細々した高速化版
// https://github.com/opencv/opencv/blob/master/modules/photo/src/contrast_preserve.cpp
// https://github.com/opencv/opencv/blob/master/modules/photo/src/contrast_preserve.hpp
// この2つを融合した状態
#include <opencv2/opencv.hpp>
#include <array>
using namespace std;
using namespace cv;
@shimat
shimat / AKAZEFeatures.cpp.diff
Last active August 15, 2018 01:24
diff AKAZEFeatures.cpp 3.2.0 <-> 3.3.0
diff --git a/modules/features2d/src/kaze/AKAZEFeatures.cpp b/modules/features2d/src/kaze/AKAZEFeatures.cpp
index 77a68a5..024a5ca 100644
--- a/modules/features2d/src/kaze/AKAZEFeatures.cpp
+++ b/modules/features2d/src/kaze/AKAZEFeatures.cpp
@@ -11,9 +11,14 @@
#include "fed.h"
#include "nldiffusion_functions.h"
#include "utils.h"
+#include "opencl_kernels_features2d.hpp"
@shimat
shimat / KuwaharaFilter.cshtml.cs
Last active November 30, 2020 13:42
KuwaharaFilter with OpenCvSharp
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using OpenCvSharp;
using WebApplication1.Models;
namespace WebApplication1.Pages
{
@shimat
shimat / mat_clone.cpp
Created August 7, 2021 04:05
OpenCV 空のMatに対するMat.cloneではdepthがセットされない
#include <iostream>
#include <opencv2/opencv.hpp>
int main()
{
{
cv::Mat src(0, 0, CV_32SC1);
auto dst = src.clone();
std::cout << "Mat" << std::endl
@shimat
shimat / gist:f0c347dc7f463da8af08d1c2cdf88cc5
Created August 25, 2021 07:39
Cloud BuildでGoogle Container Registryにpush
gcloud builds submit --tag gcr.io/<project-name>/image-name:tag --project <project-name> --timeout 1h --machine-type E2_HIGHCPU_32
@shimat
shimat / buildInformation.txt
Created December 7, 2021 09:01
wasm cv::buildInformation
General configuration for OpenCV 4.5.3 =====================================
Version control: 58cca1b
Extra modules:
Location (extra): /home/runner/work/opencvsharp/opencvsharp/opencv_contrib-4.5.3/modules
Version control (extra): 58cca1b
Platform:
Timestamp: 2021-12-04T04:16:43Z
Host: Linux 5.4.0-1063-azure x86_64