Skip to content

Instantly share code, notes, and snippets.

atinfinity

Block or report user

Report or block atinfinity

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@atinfinity
atinfinity / fluid_kernel_sample.cpp
Last active Sep 29, 2019
G-API fluid kernel sample
View fluid_kernel_sample.cpp
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/gapi.hpp>
#include <opencv2/gapi/core.hpp>
#include <opencv2/gapi/imgproc.hpp>
#include <opencv2/gapi/fluid/gfluidkernel.hpp>
G_TYPED_KERNEL(TBitwiseNot, <cv::GMat(cv::GMat)>, "sample.fluid.bitwise_not")
{
@atinfinity
atinfinity / CMakeLists.txt
Last active Apr 21, 2019
librealsense2 sample
View CMakeLists.txt
cmake_minimum_required(VERSION 3.1.0)
project(sample_librealsense2)
# Find librealsense2 installed package
find_package(realsense2 REQUIRED)
find_package(OpenCV REQUIRED)
# Enable C++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
View knnMatch.py
import numpy as np
import cv2
#import random
if __name__ == '__main__':
img1 = cv2.imread('Univ4.jpg')
gray1 = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY)
img2 = cv2.imread('Univ3.jpg')
gray2 = cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY)
dst = gray1
@atinfinity
atinfinity / use_gpumat.py
Created Sep 24, 2018
Python bindingからGpuMatを使うサンプルコード(OpenCV 4.0以上)
View use_gpumat.py
import cv2
img = cv2.imread('lena.jpg', cv2.IMREAD_COLOR)
d_img = cv2.cuda_GpuMat()
d_img.upload(img)
d_gray = cv2.cuda.cvtColor(d_img, cv2.COLOR_BGR2GRAY)
gray = d_gray.download()
cv2.imshow('img', img)
cv2.imshow('gray', gray)
View pcl_boost_issue.cpp
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <iostream>
int main(int argc, const char* argv[])
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
return 0;
}
@atinfinity
atinfinity / gpumat_memory_performance.cpp
Last active Feb 18, 2018
GpuMatのcudaMallocPitchが遅くなる再現コード
View gpumat_memory_performance.cpp
#include <opencv2/core.hpp>
#include <opencv2/core/cuda.hpp>
#include <cuda_runtime.h>
#include <device_launch_parameters.h>
#include <iostream>
int main(int argc, const char * argv[])
{
cudaFree(0); // dummy call
@atinfinity
atinfinity / selectrois_sample.cpp
Last active Feb 3, 2018
cv::selectROIsのサンプルコード
View selectrois_sample.cpp
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <vector>
int main(int argc, char *argv[])
{
cv::Mat src = cv::imread("lena.jpg", cv::IMREAD_UNCHANGED);
@atinfinity
atinfinity / gpumat_issue.cpp
Last active Dec 11, 2017
GpuMatのバグ(?)再現のための最小コード
View gpumat_issue.cpp
#include <opencv2/core/cuda.hpp>
int main(int argc, char *argv[])
{
cv::cuda::GpuMat img1(cv::Size(320, 240), CV_32FC1, cv::Scalar(0.0f)); // NG(cuda-memcheck)
//cv::cuda::GpuMat img2(cv::Size(320, 240), CV_32FC1); // OK(cuda-memcheck)
return 0;
}
View opencvcontrib_build_vs2015_x64.txt
General configuration for OpenCV 3.1.0-dev =====================================
Version control: unknown
Extra modules:
Location (extra): C:/Users/bishnois.VITECNET/Downloads/opencv_contrib-master/modules
Version control (extra): unknown
Platform:
Timestamp: 2016-02-16T18:22:12Z
View opencvdefault_build_vs2015_x64.txt
General configuration for OpenCV 3.1.0 =====================================
Version control: 3.1.0
Platform:
Host: Windows 6.1 AMD64
CMake: 3.3.1
CMake generator: Visual Studio 14 2015 Win64
CMake build tool: C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
MSVC: 1900
You can’t perform that action at this time.