Mightex TCE1209-U demo app utility

Greatly appreciate my professor, Andy Davidhazy for loaning his line scan camera for an ‘enrichment’ project.

The challenge:  figure out why (possibly fix) the camera-demo app is producing images with poor tonal quality.

Given: Mightext TCE1209-U camera with demo application as well as sample project source in C++, C#, VB.


After much anticipation, camera arrives with 50mm lens adaptor already assembled.  No power supply needed, USB will do!  Software installation includes a device driver for Windows 7 and demo app (available from website).  The demo application display image result similar to an oscilloscope, one line per time interval.  Output options are Windows bitmap or raw ASCII files.



















With Windows bitmap option known to be a problem, I am diving in to work with the ASCII output option.  Here is one of my ‘better’ result from the first try.  Here, I am swiping the camera view across my kitchen.  You can see a blur version of my daughter in silhouette.













For a better test, I printed the following test page with grayscale (short of buying a Kodak IT-8 target).










The ascii output files each contain 2048 lines (camera pixel width) .  Each pixel has a depth from 0 – 4098 (12 bits per pixel) and is represented in a line delimited by a carriage return.  Since displays and common pictorial file formats are in 8bits per pixel, I am writing the utility to requantize 12bpp ASCII into 8bpp binary image.  With .NET library, System.Drawing.Bitmap class offer all of the features I need to manipulate and save the files into bmp, gif, tif, png, jpg and others.  For better visual result, I am applying histogram equalization to minimize the bit depth compression (12bpp to 8bpp).  Here is my result.









The utility app has three tab pages, Source, Image processing and Storage.  Source code in C#, Visual Studio 2008 solution is available on GitHub.  Included in the solution is a debug executable, test source files and results.

Source (ASCII) – user selects the source directory with ASCII files.  Internally, DirectoryInfo retrieves all the FileSystemInfo and sort them by creation time.

Screen Shot 2015-08-09 at 1.21.24 PM








Image processing – Internally, it loads all the source files to find image black point, white point, mode and number of shades.  It also builds a histogram and look-up-table for 12bpp->8bpp conversion.  User may write the histogram to file (ASCII) for more detail analysis.  Also, user may override the histogram-equalization-look-up-table by changing the white point and black point.

Screen Shot 2015-08-09 at 1.21.15 PM








Storage – Internally, it loads all the source files, apply histogram-equalization (above mentioned) to assemble an 8bit per pixel bitmap which is then saved as bmp, gif, tif, png or jpg.

Screen Shot 2015-08-09 at 1.21.42 PM








Conclusion / Next step:

Probably should invest more time investigating the tone reproduction issue.  Instead, a quick utility is devised and moving onward to the next solution by writing a replacement demo app.  Most of the features in this utility will be ported to the next.

Future enhancements are as follow:

1) an auto-gamma correction

2) a display of the cumulative histogram.

3) FFT filter to remove sine wave if the vertical lines in the image are not artifacts by yours truly.

4) save image into png16.

5) high dynamic range feature to blend the additional 4 bits of data (alternative bit depth conversion 12bpp -> 8bpp).

6) write a demo-app replacement that display live image and output better pictorial binary image files.


1) Peripheral photography article by Andrew Davidhazy.

2) Digital Image Processing by Gonzalez, Woods.  – class text – Digital Image processing I with Dr. Rao at Rochester Institute of Technology.

3) My viewer exercise project in C#, Visual Studio 2005

4) Mightex TCE1209-U camera documentation.

5) Photographics Materials & Processes by Dr. Strobel – class text – M&P with Dr. Strobel, Jack Holm, Russ Kraus at Rochester Institute of Technology.







Leave a Reply