Advanced SubString (Support Unicode)

How to do proper substring for unicode characters


I wrote this article after experiencing a “Broken surrogate pair” issue in Java. After investigation, I found that improper substring is the root cause of this problem.

Unicode Problem

  • JAVA encode characters in 16-bits representation.
  • Unicode chars may be encoded using multiple 16-bit entities.
  • How can we cut it based on character index?
Continue reading “Advanced SubString (Support Unicode)”

[RealSense SDK] Stream Color and Depth Camera Simultaneously

In this post, I will describe how to stream altogether color and depth stream of Intel RealSense 3D camera SR300. This can be done easily by using RealSense SDK. However for new developers who have not familiarized them-self with the SDK, this task might not be easy to do. Continue reading “[RealSense SDK] Stream Color and Depth Camera Simultaneously”

[RealSense SDK] Calibrate Color and Depth Stream

Recently, I play around with RealSense technology using a newly bought SR300 (front-facing 3D camera). I want to stream color and depth stream together, then create an depth stream mask over the color stream. This is similar to what is already been done by 3D Segmentation algorithm of the RS-SDK. Continue reading “[RealSense SDK] Calibrate Color and Depth Stream”

Intersection and Union of Two Rectangles using OpenCV

Getting involved in computer vision project requires me to make myself familiar with OpenCV. And today, I’ve just withnessed one of its powerful functions which is related to two-dimensional rectangle operation. It supports intersection (overlapping) and unification (union) of two different rectangles. Continue reading “Intersection and Union of Two Rectangles using OpenCV”

Multi-camera Capture using OpenCV (Multi-threaded)

Previously, I have managed to create a simple program to capture images from multiple cameras (click here). However, it is not quite good approach to use just a single thread to handle all of the capturing processes. Thus, I need to improve it by using multi-thread approach. Each thread will capture images from a single camera, so the number of threads will be determined by the number of cameras. In addition, to make it even better for further application (e.g.: motion detection), I made it object oriented. Continue reading “Multi-camera Capture using OpenCV (Multi-threaded)”

Multi-camera Capture using OpenCV (Single-threaded)

I have been working on a project which requires me to stream multiple cameras. So, here I provide an example code to show how I can stream multiple usb cameras simultaneously using OpenCV. I assume you have installed it properly on your PC and already have basic knowledge about it. Without further ado, here is the simplest and cleanest code that I have made: Continue reading “Multi-camera Capture using OpenCV (Single-threaded)”