Posts tagged ‘C++’

A Library for LTC1665/LTC1660

ATmega328p does not provide any Digital/Analog conversion channels (although the D/A conversion can be simulated by means of measuring the PWM output). We can easily add up to eight D/A channels using either a LTC1665 (8 bit) or LTC1660 (10 bit) from Linear Technology. Continue reading ‘A Library for LTC1665/LTC1660’ »

Interfacing LIS3LV02DL Using SPI — II

In my last post, I described in detail how to hand solder LIS3LV02DL, an LGA packaged accelerometer chip. And here I will show you how the communication with Arduino is done using SPI. Continue reading ‘Interfacing LIS3LV02DL Using SPI — II’ »

4 Digit 7 Segment Display Using Arduino

I was inspired by Paul’s 7 segment display and decided to build one myself. He used 4 common cathode 7 segment displays. In his original schematics, all the segments within a display shared one current limiting resistor which unfortunately affect the display brightness when different numbers of segments are lit. I happened to have two common anode dual 7 segment displays (QDSP-G545) so I decided to use them and four 74HC595 shift registers to build a four 7-seg display. Realizing that other people might be using either common anode or common cathode displays, I also built a library that can be used for either case. Continue reading ‘4 Digit 7 Segment Display Using Arduino’ »

A Parallel Port Stepper Motor Driver With Discrete Components

Using PC’s parallel port is a convenient way to control a stepper motor. For unipolar stepper motors, up to two motors can be controlled with the 8bit data line. Continue reading ‘A Parallel Port Stepper Motor Driver With Discrete Components’ »

A Simple Program for Finding Palindromic Prime Numbers

A palindromic prime (palprime) is a prime number that is also palindromic. So out of curiosity I wrote a simple program a few days ago that can find the palindromic numbers within a given range. Here is the code in C++: Continue reading ‘A Simple Program for Finding Palindromic Prime Numbers’ »

Image Blur Detection via Hough Transform — IV

In my previous three articles (1,2,3) I discussed how to use Canny edge detection and Hough transform to identify blur images. Here I will show some results from the algorithm discussed before. Continue reading ‘Image Blur Detection via Hough Transform — IV’ »

Image Blur Detection via Hough Transform — III

I will continue where I left off in my previous post. After performing Hough transform, and extracted the longest sections of lines for each corresponding Hough line detected, we will need to calculate the gradients of the image pixels luminance around the line sections. Continue reading ‘Image Blur Detection via Hough Transform — III’ »

Image Blur Detection via Hough Transform — II

In my previous post, I briefly discussed the rationale behind automated blur detection in digital imagery and did an overview of an algorithm that could be used to detect blur images. Here I will show some implementation details along with some C++ code snippets. Continue reading ‘Image Blur Detection via Hough Transform — II’ »

Image Blur Detection via Hough Transform — I

It is often necessary to identify and classify images based on their clarities. For instance, it is desirable for an automated process to locate blurred images within a large digitized image library and then automatically sharpen the blurred images via inverse filtering or blind deconvolution. In the following series of articles, I will discuss a practical method in detecting blur images using Hough Transform. Continue reading ‘Image Blur Detection via Hough Transform — I’ »

C++ Recursive Directory Search Under Linux

I was trying to search for some code examples on how to do a recursive directory search under Linux using C++ the other day. But to my surprise, I could not find any place that offers a complete example. So I decided to post my code here after I created my own and hopefully you will find it helpful. Continue reading ‘C++ Recursive Directory Search Under Linux’ »

Timing Methods in C++ Under Linux

Measuring the execution time for code sections can be done in multiple ways in C++. Except for the time resolution issue, different timing methods worked relatively the same in single processor environment. As multi-core processors become more prevalent however, we need to be careful at choosing the correct timing mechanism as not all such routines measure the wall time elapsed. Continue reading ‘Timing Methods in C++ Under Linux’ »

Magick++ Missing Delegate Error

As I wrote last time, I did a clean Ubuntu 9.04 install on my main PC. Continue reading ‘Magick++ Missing Delegate Error’ »

Canny Edge Detection Auto Thresholding

In the example I gave in “Interfacing IPP with Magick++“, I illustrated how to use Intel’s Integrated Performance Primitives (IPP) to perform edge detection. One issue with Canny edge detection algorithm is that we need to specify a high threshold and a low threshold. How to select those threshold values affect the quality of the detected edge greatly. And in my previous example, the threshold values were chosen manually. In this blog post, I will examine a couple of simple methods that can be used to automatically determine the threshold values. Continue reading ‘Canny Edge Detection Auto Thresholding’ »

C++ IDEs Under Linux

So far I have been mainly using KDevelop and Code::Blocks as my C++ development IDEs. Recently, I started using NetBeans IDE for C++ and I started to like it quite a bit. Continue reading ‘C++ IDEs Under Linux’ »

An Image Class Based On IPP

A couple of weeks ago, I wrote about how to interface Integrated Performance Primitives (IPP) with Magick++. While IPP offers excellent performance advantages, it does not come with the easiest programming model. Fortunately, it is easy enough to create a C++ wrapper on top of IPP and provide an easier to use programming interface. Continue reading ‘An Image Class Based On IPP’ »