[ Entries RSS / Comments RSS ]      [ Uni / Z1 ]      [ ENGLISH / MYANMAR ]

Skeleton of Image Region

March 7th, 2012

The structural shape of an image region can be represented by a graph. It is achieved by using a thinning algorithm. The resulting graph is called the skeleton of the region. It can be a useful preprocessing step for some applications such as optical character recognition. The following figures shows an original structural shape and its skeleton.

An image region

An image region


Skeleton

Skeleton


Read the rest of this entry »

Testing fsolve and anonymous function

December 30th, 2011

I have got a need to solve equations repeatedly whose coefficients are changing with each iteration. MatLab function ‘fsolve’ is tested using function handle and anonymous function as follows.

Read the rest of this entry »

Hand, Foot and Mouth Disease (HFMD)

December 16th, 2011

My baby got blister-like rash on her hands and feet last week. Doctor said it may be caused by HFMD or flu. I found out later that it was the flu in my daughter case. I have never heard of HFMD before and that is why I re-share a brochure from KK hospital.

Read the rest of this entry »

Geometric Template Matching in LabVIEW

December 16th, 2011

In NI’s IMAQ Vision Concepts Manual, geometric template matching is described as follows.
Geometric matching locates regions in a grayscale image that match a model, or template, of a reference pattern. Geometric matching is specialized to locate templates that are characterized by distinct geometric or shape information.
When using geometric matching, a template is created that represents the object to be searched. Machine vision application then searches for instances of the template in each inspection image and calculates a score for each match. The score relates how closely the template resembles the located matches.
Geometric matching finds template matches regardless of lighting variation, blur, noise, occlusion, and geometric transformations such as shifting, rotation, or scaling of the template.

The VIs such as IMAQ Find CoordSys (Pattern) 2 are used to locate the model. The template for the model is created as discussed in the following steps.

Read the rest of this entry »

Troubleshooting Daikin Aircon

August 13th, 2011

We have been using Daikin(3MKD58DVM) inverter multi-split (R-22) aircon for a few years. Last month, one of the indoor units (FTKD25DVM) was faulty. There was power and we could turn it on but the operation stops suddenly after a few seconds. Then one the LED indicators kept blinking.
After searching on the Internet, we found a troubleshooting procedure using our ARC433B47 remote controller as follows.

Read the rest of this entry »

Curve Fitting in Matlab

June 3rd, 2011

One of my friends was doing analysis of some sampled data. He wanted to fit them into a curve to derive the equation. He said Excel could fit up to polynomial of order 6 and he wanted a higher order one. So, he asked my help to write a Matlab program. He also wanted the plotted curve besides the calculated coefficients. The program and sample data are shown below. That is good for me because I also need to fit data occasionally and I can reuse it later :)

Read the rest of this entry »

Monte Carlo Integration

June 3rd, 2011

As I am reading about Particle Filter, just for fun, I wrote a Matlab program that performs Monte Carlo integration using uniform distribution. The equation and the program are as follows.

Read the rest of this entry »

Degrees of Freedom of the Human Arm

May 5th, 2011

Have you ever think how many degrees of freedom the human arm has (excluding palm and fingers)? I would like to share a short excerpt from a book by Saeed Benjamin Niku, Introduction to Robotics -Analysis, Control, Applications.
The shoulder, the elbow, and the wrist are three joint clusters in the human arm.
The shoulder has 3 degrees of freedom.
The upper arm can swing up and down in the coronal plane.
It can also swing back and forth in the transverse plane.
And rotation with respective to the axis along humerus can be done also.
The following is the illustration of human anatomy planes from Wikipedia.

Read the rest of this entry »

Byte Stuffing

May 3rd, 2011

I occasionally need to write programs to send and receive data bytes from one device to another. That is why I arbitrarily choose a simple variant of byte stuffing methods to build frames to send and receive data. To delimit the frame, control characters – 0×02 and 0×03- are defined as start of text (STX) and end of text (ETX) respectively. For error detection, exclusive-or of data bytes is appended after the ETX as a checksum. If you need better error detection, CRC as described here can also be used.

Read the rest of this entry »

Simple 6 DOF Translation and Rotation Stages

March 4th, 2011

I had the requirement to control a device in 6 degrees of freedom (DOF). There were 3 motorized translation stages to control the position of the tool in 3D space and 3 rotary motorized stages to control its orientation. Although it could be thought as a robot arm having 3 prismatic joints and 3 revolute joints, I did not want to involve complex forward and inverse kinematics for this simple testing equipment. Here is an example transformation. By arranging rotational axes of rotary motorized stages to intersect at the tool, a simple direct 6 DOF control could be achieved. The following figures show schematic diagram and 3D drawing for the equipment that I designed.

Read the rest of this entry »

Capacitor selection for a Crystal Oscillator

March 3rd, 2011

A typical crystal oscillator circuit and an example layout design are shown in the figures. A crystal manufacturer normally specifies the load capacitance, CL, needed for a crystal in its datasheet. This value is the load seen by the crystal which is in series with C1 and C2, including all parasites. Typically, overall stray capacitance, Cstray, for pin, board, and PCB trace is between 2 pF and 7 pF. The relation between them can be represented by the following formula.
CL=(C1 * C2)/(C1 + C2) + Cstray
C1 and C2 are normally chosen to have equal value. Therefore,
C1 = C2=2 * (CL – Cstray)
For example, assume that Cstray is 4 pF and crystal load capacitance CL is 18 pF, C1 = C2= 28 pF. The normalized value of 30 pF can be used.

Read the rest of this entry »

Denavit-Hartenberg Representation of Robots

February 22nd, 2011

The D-H model of representation is a simple way of modeling robot links and joints that can be used for any robot configuration.
We will have to assign a z-axis and an x-axis for each link. The D-H representation does not use the y-axis at all. Let Lk be the frame associated with link k.

Read the rest of this entry »

Inkscape

December 30th, 2010

Inkscape is a vector graphic editor similar to Illustrator or CorelDraw. Inkscape is better in the sense of cost because it is free. It is also an open source software.
It can be downloaded for free at http://inkscape.org/
The nice feature is that graphics can be saved in pdf format. It allows high quality graphics when you use it with pdflatex to produce pdf files. Since they are Scalable Vector Graphics, unlike bitmap images, there is no problem even when they are magnified.

Read the rest of this entry »

Texmaker: a LaTeX editor

December 29th, 2010

Texmaker is a free and cross-platform LaTeX editor. Editing LaTeX is much more convenient than it used to be.

Read the rest of this entry »

proTeXt and package problem

October 5th, 2010

I like to use proTeXt to write documents. It is freely available at http://tug.org/protext/.
When I used new distribution proTeXt with MiKTeX 2.8, I got a problem if I include \usepackage{mathptmx} in my file and tried to build and view (ctrl+shift+F5).

Read the rest of this entry »

Blind Love: a Myanmar Song

July 19th, 2010

This is another Myanmar song. I liked it very much. Please enjoy the original lyrics in Myanmar.

Read the rest of this entry »

Random Password Generator

July 12th, 2010

I have a few nagging computer user accounts that regularly ask me to change password. Some of them even remember history of about ten old passwords to prevent me from using them again.

Read the rest of this entry »

Common Interrupt Pitfalls

June 18th, 2010

I just want to share some interesting facts that I found in SDCC Compiler User Guide.
From my experience, I think these facts are very important to keep in mind of a firmware programmer. Last time, I got an experience that my program executed wrongly even though I could not find any fault in my program. Suddenly, I remembered stack overflow problem and the program worked correctly after I changed the stack size.

Read the rest of this entry »

Circular Buffered UART Com Module for 8051 Microcontroller

June 10th, 2010

A lot of embedded systems uses UART communication. That is why, I would like to share a circular buffered UART comm module here. I have developed the module for 8051 microcontroller but it can easily be modified for other microcontrollers as well.

Read the rest of this entry »

Soft-Timer Module for 8051 Microcontroller

June 10th, 2010

Almost every embedded system uses timers in their firmware. 8051 microcontroller has only two or three hardware timers, and generally, it is not enough to use hardware for all the timers your system needs to have.
Furthermore, not all timers need to have hard timing requirement. For example, blinking an LED indicator every second is accurate enough if the timing error is less than a few millisecond.
That is why, I normally use software to implement all the timers that have soft timing requirement. Here, I would like to share a soft-timer module that I developed for 8051 microcontroller but it can easily be modified for other microcontrollers as well.

Read the rest of this entry »