Skip to content

Instantly share code, notes, and snippets.

Avatar
👀
I may be slow to respond.

Fangjun Kuang csukuangfj

👀
I may be slow to respond.
View GitHub Profile
View c-programming-array-and-structure-initialization-special
#include <stdio.h>
enum header_type
{
TYPE1 = 15,
TYPE2 = 16,
TYPE3 = 17,
TYPE_END = 22,
};
@csukuangfj
csukuangfj / Eigen2CV.h
Created Jul 2, 2016 — forked from BloodAxe/Eigen2CV.h
This header file contains code snippet for easy mapping Eigen types to OpenCV and back with minimal overhead.
View Eigen2CV.h
/**
* @brief Mapping functions from Eigen data types to OpenCV
* @author Eugene Khvedchenya <ekhvedchenya@gmail.com>
* @details This header file contains code snippet for easy mapping Eigen types to OpenCV and back with minimal overhead.
* @more computer-vision.talks.com/articles/mapping-eigen-to-opencv/
* Features:
* - Mapping plain data types with no overhead (read/write access)
* - Mapping expressions via evaluation (read only acess)
*
* Known issues:
@csukuangfj
csukuangfj / opencl-opencv-first-example.cpp
Last active Mar 12, 2017
First example of using OpenCL in OpenCV 3.x
View opencl-opencv-first-example.cpp
// This example shows how to create
// a context from a specified device type
// using OpenCL wrappers provided by OpenCV 3.x
//
// The default platform is the zero-th platform
// returned by clGetPlatformIDs.
//
// To compile it on Mac OS X, add `-framework opencl`
// to CXX_FLAGS
View KernelArgs.cpp
enum { LOCAL=1, READ_ONLY=2, WRITE_ONLY=4, READ_WRITE=6, CONSTANT=8, PTR_ONLY = 16, NO_SIZE=256 };
View OpenCV-OpenCL-kernel-arguments.cpp
// a 2-d mat
cv::Mat mat1(2,2,CV_8UC1);
int sz[] = {2,3,4};
// a 3-d mat
cv::Mat mat2(3, sz, CV_8UC1);
cv::UMat m1 = mat1.getUMat(cv::ACCESS_RW);
View doxygen-header.h
//File comment
/**
* @file headerfile.h
* @author my name
* @date 31 Mar 2017
* @brief A bried description of headfile.h
*
* A more detailed descriptions goes here.
* Bla bla
* bla bla
@csukuangfj
csukuangfj / aux.c
Created Apr 6, 2017 — forked from mina86/aux.c
Code reading auxiliary vector present in executable binary.
View aux.c
#include <stdio.h>
#include <stdlib.h>
#include <linux/auxvec.h>
static unsigned long *getauxv(char **env) {
while (*env++ != NULL) {
/* nop */
}
return (void*)env;
@csukuangfj
csukuangfj / no-bug-comment.cpp
Last active Apr 25, 2017
no bug comment in the header
View no-bug-comment.cpp
// _ooOoo_
// o8888888o
// 88" . "88
// (| -_- |)
// O\ = /O
// ____/`---'\____
// . ' \\| |// `.
// / \\||| : |||// \
// / _||||| -:- |||||- \
// | | \\\ - /// | |
@csukuangfj
csukuangfj / idea-reset-evaluation.sh
Created May 12, 2017
reset intellij idea 14 evaluation
View idea-reset-evaluation.sh
#!/bin/bash
echo "removeing evaluation key"
rm ~/.IntelliJIdea15/config/eval/idea15.evaluation.key
echo "resetting evalsprt in options.xml"
sed -i '/evlsprt/d' ~/.IntelliJIdea15/config/options/options.xml
echo "resetting evalsprt in prefs.xml"
sed -i '/evlsprt/d' ~/.java/.userPrefs/prefs.xml
@csukuangfj
csukuangfj / build.log
Created Aug 19, 2017 — forked from iley/build.log
OpenCV build log
View build.log
macserver:build_device iley$ SDK_VERSION=4.3 ../opencv_cmake.sh device ../OpenCV-2.1.0
Starting cmake...
Target SDK = iPhoneOS
iOS SDK Version = 4.3
iOS Deployment Target = 3.0
OpenCV Root = ../OpenCV-2.1.0
OpenCV Install Prefix = /Users/iley/Sources/iphone_opencv_test/build_device/../opencv_device
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
You can’t perform that action at this time.