Skip to content

Instantly share code, notes, and snippets.

View webstorage119's full-sized avatar
:accessibility:

Chang-Ho Hwang webstorage119

:accessibility:
View GitHub Profile
@webstorage119
webstorage119 / index.html
Created March 18, 2025 06:51 — forked from ajaymdesai/index.html
OpenCV.js Face Detection (WebAssembly)
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<body>
<div id="container">
<canvas class="center-block" id="canvasOutput" width=320 height=240></canvas>
</div>
<div class="text-center">
<input type="checkbox" id="face" name="classifier" value="face" checked>
<label for="face">face</label>
<input type="checkbox" id="eye" name="cascade" value="eye">
<label for="eye">eye</label>
@webstorage119
webstorage119 / webcam_opencv.cpp
Created March 5, 2025 01:22 — forked from priteshgohil/webcam_opencv.cpp
C++ code to read images from webcam using CV 4.1.1
#include <opencv2/opencv.hpp>
#include <iostream>
int main(int, char**) {
// open the first webcam plugged in the computer
cv::VideoCapture camera(0); // in linux check $ ls /dev/video0
if (!camera.isOpened()) {
std::cerr << "ERROR: Could not open camera" << std::endl;
return 1;
}
@webstorage119
webstorage119 / HelloSDL2.cpp
Created December 18, 2023 07:22 — forked from eabase/HelloSDL2.cpp
A minimal Hello World C++ example for using SDL2 to render text in a native Windows window.
//---------------------------------------------------------------------
// Name: HelloSDL2.cpp
// Author: EAML
// Date: 2021-05-16
//
// Description:
// A minimal PoC for producing a native SDL2 Windows app that can
// be ran from either Windows Explorer or from Powershell console.
// It's designed to use minimal command line, compiler options,
// and dependencies... It will display a gray window for 2 sec's.
@webstorage119
webstorage119 / readmultipageTiff.cpp
Created November 30, 2023 04:20 — forked from discorev/readmultipageTiff.cpp
C++ to use libtif to read a multi-page tiff and convert it to an opencv matrix for manipulation
#include <opencv2/core/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
#include <string>
#include <tiffio.h>
using namespace cv;
using namespace std;
@webstorage119
webstorage119 / oclMat_custom_kernel.cpp
Created September 14, 2023 07:26 — forked from atinfinity/oclMat_custom_kernel.cpp
sample code to execute custom OpenCL kernel on OpenCV 2.4.9
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/ocl/ocl.hpp>
// cl_mem構造体を参照するためにインクルード
#if defined __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif
@webstorage119
webstorage119 / opencl-opencv-first-example.cpp
Created September 14, 2023 05:33 — forked from csukuangfj/opencl-opencv-first-example.cpp
First example of using OpenCL in OpenCV 3.x
// 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

First your OpenCV should be compiled with CUDA (and OpenGL) support to test all this features. Detect your CUDA hardware with OpenCV CUDA by:

#include <iostream>
using namespace std;

#include <opencv2/core.hpp>
using namespace cv;

#include <opencv2/cudaarithm.hpp>
using namespace cv::cuda;
@webstorage119
webstorage119 / cmake-tutorial.md
Created April 21, 2023 06:43 — forked from luncliff/cmake-tutorial.md
CMake 할때 쪼오오금 도움이 되는 문서

CMake를 왜 쓰는거죠?
좋은 툴은 Visual Studio 뿐입니다. 그 이외에는 전부 사도(邪道)입니다 사도! - 작성자

주의

  • 이 문서는 CMake를 주관적으로 서술합니다
  • 이 문서를 통해 CMake를 시작하기엔 적합하지 않습니다
    https://cgold.readthedocs.io/en/latest/ 3.1 챕터까지 따라해본 이후 기본사항들을 속성으로 익히는 것을 돕기위한 보조자료로써 작성되었습니다
@webstorage119
webstorage119 / basic.js
Created June 3, 2022 08:39 — forked from darkwave/basic.js
Webcam as texture in three.js
window.addEventListener( 'resize', onWindowResize );
var scene, camera, renderer;
var geometry, material, mesh, videoTexture, movieMaterial;
var video, video_canvas;
initWebcam();
init();
animate();
function initWebcam() {
# reference: https://itnext.io/build-ffmpeg-webassembly-version-ffmpeg-js-part-2-compile-with-emscripten-4c581e8c9a16
# tested in macos / emscripten 1.38.48
emconfigure ./configure \
--disable-x86asm --disable-inline-asm --disable-doc --disable-stripping \
--nm="$EMSDK/upstream/bin/llvm-nm -g" \
--ar=emar --cc=emcc --cxx=em++ --objcc=emcc --dep-cc=emcc
emmake make -j8