Thursday, November 23, 2017

OpenCV with wxWidgets

  1. Introduction
  2. Linux
  3. Windows
  4. References

Introduction

In this article, using OpenCV with wxWidgets is discussed with examples. For that, OpenCV and wxWidgets need to be installed in your system. Installing and using them on Linux and Windows platforms can be found at the following links.

Linux

Building an application using OpenCV and wxWidgets in Linux terminal is simple. As an example, a simple program called wxcvsimple.cpp (online) is discussed below. At the start of the program, in OnInit() method of the Application,
wxInitAllImageHandlers();
is called. Then, wxStaticBitmap variables are declared in MyFrame class, a derived class of wxFrame, to display images. The following code can be used to initialize wxStaticBitmap in the constructor of MyFrame class.

Monday, November 20, 2017

OpenCV on Linux using g++, CMake, Qt, Code::Blocks

  1. Introduction
  2. Using GCC ၊ CMake
  3. Using Qt
  4. Using Code::Blocks
  5. References

Introduction

To install OpenCV on your Linux machine, you need to have the following packages as prerequisites [Ope17g].
  • GCC 4.4.x or later
  • CMake 2.6 or higher
  • Git
  • GTK+2.x or higher, including headers (libgtk2.0-dev)
  • pkg-config
  • Python 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy)
  • ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev
  • [optional] libtbb2 libtbb-dev
  • [optional] libdc1394 2.x
  • [optional] libjpeg-dev, libpng-dev, libtiff-dev, libjasper-dev, libdc1394-22-dev
To install the required packages, you can enter the following commands in terminal.

Monday, October 30, 2017

Cross-platform C++ programming with wxWidgets

  1. Introduction
  2. Windows Setup
  3. Linux Setup
  4. Mac Setup
  5. References

Introduction

wxWidgets is a C++ library for creating cross-platform applications. It enables developers to create GUI code to compile and run on several computer platforms such as Windows, OS X, Linux and UNIX with minimal or no code changes.

wxWidgets is free and open source software which satisfies those who wish to produce for GPL and proprietary software without license costs [wxW98]. On the other hand, Qt is available for free under LGPLv3 license but has some limitations for commercial use unless you pay the license fee [Qt17].

wxWidgets uses Native platform , therefore GUI has more native look and feel [wxW12]. Qt extends the C++ language but wxWidgets does not extend the C++ language which is less surprising to developers expecting standard C++.

wxWidgets produces small and efficient binary applications. Therefore, it is suitable for embedded systems. In term of library size, Qt library is \(\approx 200\) MB where wxWidgets library is \(\approx 30\) MB.

wxWidgets not only works for C++, but also has bindings for python, perl, php, java, lua, lisp, erlang, eiffel, C# (.NET), BASIC, ruby and even javascript [wxW15a]. wxWidgets is one of the most complete and mature GUI toolkits. There are a lot of utility classes also.

wxWidgets is used by a huge range of organisations and individuals all over the world. Some of the better-known organisations who have used wxWidgets include NASA, AMD, Xerox, and Open Source Applications Foundation (OSAF). wxWidgets applications that you may be familiar with include AVG AntiVirus, Audacity, Filezilla, Code::Blocks, CodeLite.

Wednesday, September 13, 2017

Pixy

Pixy (http://cmucam.org/projects/cmucam5) is a vision system that can be used to add computer vision to your Arduino, Raspberry Pi, or BeagleBone project. Once you have taught it the color to detect, it can send you the position and size of the detected objects.

Thursday, August 3, 2017

KiCad Getting Started Guide in Myanmar Language

KiCad is a suite of free software to design PCBs.[KiCad on Wikipedia]. I have been using it to make PCBs and it is OK so far. It is also easy to use. It comes with tools to check design rules and to produce Gerber files for manufacturing. I have written a getting started guide for KiCad in Myanmar language to take note about my experience and methods. And I combined them with English version guide which can be found on its website [Getting Started in KiCad, March 5, 2017]. My Myanmar version getting started guide for KiCad book can be found at

https://yan9a.github.io/KiCad/kicadmm.pdf



Tuesday, June 6, 2017

Flash content protection for LPC824

In this article, I would like to discuss about evaluation of LPC824 low cost 32-bit ARM Cortex-M0 microcontroller using OM13071 LPCXpresso824-MAX Development board. LPC824M201JHI33 is used in the board. Its size is only 5 x 5 x 0.85 mm in HVQFN package.

In order to evaluate it, MCUXpresso Integrated Development Environment (IDE) is downloaded and installed. Other tools for it can be found at this link . After launching MCUXpresso and assigning a workspace folder, example projects can be imported by clicking Quick Start Panel (near bottom left corner) -> Import projects from file system ... -> Browse LPC open resources as shown in the following figure.



Wednesday, May 31, 2017

Programming serial port in C++ with wxWidgets for Windows and Linux

I have developed a class library 'Serial.h' to use serial port (com port) on both Windows and Linux. This cross-platform 'Serial' class is written in C++. A simple example for C++ console program using the class is demonstrated. As an another example, using it with wxWidgets for GUI application is also presented. The source code can be found at

https://github.com/yan9a/serial


Figure. A wxWidgets GUI application using 'Serial' class with Visual Studio 2017

Friday, February 24, 2017

OpenCV 3.2 / 3.3 on Windows 10 - 64 bit Using Visual Studio 2015 / 2017

Using the latest version OpenCV (currently opencv-3.2.0) pre-built for 64 bit Windows with Visual Studio 2015 is discussed. The procedure is also applicable for OpenCV 3.3 and Visual Studio 2017. OpenCV is available to download at
https://sourceforge.net/projects/opencvlibrary/files/opencv-win/.
Then, the downloaded file, opencv-3.2.0-vc14.exe is extracted at C:\opencv as a folder called opencv320. Visual Studio 2015 IDE is downloaded from https://www.visualstudio.com/downloads/ and install. The following steps are tested on Windows 10 64 bit using Visual Studio 2015 and OpenCV-3.2.0. For other versions, the precedures are similar.

At first OPENCV_DIR is declared as an enviroment variable. Run 'Command window' in administrator mode by right clicking start menu and choosing command prompt (admin). Enter

setx -m OPENCV_DIR C:\opencv\opencv320\build\x64\vc14


Wednesday, February 22, 2017

A LaTeX Report Template for Myanmar Language Using XeTeX

This is a template for LaTeX report in Myanmar language using XeLaTeX. It is available at

https://github.com/yan9a/LaTeX_Myanmar_Language.

To properly render Myanmar fonts using LaTeX, it is necessary to use TeX typesetting engines that support Unicode such as XeTeX. Simple examples for testing XeTex can be found in an older post Myanmar (Burmese) Language with XeTeX and LuaTeX.

Tuesday, February 21, 2017

Integration of Accelerometers

We have several 3-axis accelerometers attached to a rigid body at arbitrary positions. The rigid body is moving at arbitrary linear and angular movements, but the accelerometers can only sense linear accelerations. Consequently, the information about angular movements of the rigid body is not available.

A question is whether it is possible to integrate them to get an equivalent accelerometer without using angular movement information.
After consideration, I think the answer for that question is 'YES'.

Monday, January 9, 2017

Creating Dynamic Link Library (DLL) in C++ and Using it in Visual Basic .NET

I need to create a DLL (Dynamic Link Library) to be used in Visual Basic .NET 2012 (vs11). And I want to write the DLL in C++. Two different ways to accomplish the task are discussed below.

  • CLR Class Library
  • Win32 DLL