Archive for May, 2018

Remote #ErrorLogging in C#


If you are running a C# Application on a client’s machine, and can’t run the debugger on it, then instead of asking your client to send you log files whenever something goes wrong, you can use a remote logging service to record error events, and view them, and even act on them before the client complains.

This example uses – a logging service designed for Android, but works equally well in C# / .NET. You will need to have an API Key, and store it as a setting as “RemoteLogCat” in your web.config / app.config

public class Logging
public static string key = ConfigurationManager.AppSettings[“RemoteLogCat”];
    public static void Log(string channel, string log)
var strUrl = “{0}&channel={1}&log={2}”;
strUrl = string.Format(strUrl, key, channel, log);
var wc = new WebClient();
This is then called using
Logging.Log(“MyApp”,”Your Error”)
Categories: Uncategorized

#ImageRecognition #API with REST webservice


Image Recognition API

This Image Recognition API allows images to be tagged with a label to describe the content of the image, and a confidence score percentage to indicate the level of trust in the algorithm’s judgement. View our homepage at

Image Recognition Web Service

The API endpoint can be accessed via this url:

It requires an API Key, which can be applied for via this url:


The first API endpoint is

It accepts a url to an image, for example “×680.jpeg

And returns a result as follows;

<RecogntionResult xmlns:xsd=”; xmlns:xsi=”; xmlns=””&gt;

<Label>Egyptian cat</Label>



Urls must be publicly accessible, you cannot use localhost urls, or intranet addresses.


The next API Endpoint is

It accepts a base64 encoded string containing the image, you must also provide the image format, such as “jpg”, “png”, “bmp” etc.

It returns a result as follows;

<RecogntionResult xmlns:xsd=”; xmlns:xsi=”; xmlns=””&gt;

<Label>Egyptian cat</Label>



OCR Web Service

Optical character recognition converts an image containing text to the text itself, a microsite for this service can be reviewed at , here, there are two API endpoints exposed


Extract text from an image that is available on the internet via a Url. It’s endpoint is here

Urls must be publicly accessible, you cannot use localhost urls, or intranet addresses.


Extract text from an image which has been base64 encoded. You also require a file extension (png/jpg/etc) to indicate the format. It’s endpoint is here;

By default, this service will assume a single line of text, rather than a page of text, in order to change this default behavior, or to customise it to your needs, then you can use the “extraArguments” parameter to fine-tune the OCR operation. The full list of these possible parameters are available on


Contact information

This software is designed by Infinite Loop Development Ltd ( and is subject to change. If you would like assistance with custom software development work, please contact us below;


  • +44 28 71226151

  • Twitter: @webtropy

Categories: Uncategorized

#ImageRecognition in C# using #tensorflow #inception

image recognition

Ever been faced with that situation, where you are confronted with fluffy grey animal, with four legs, whiskers, big ears and you just have no idea what it is ?

Never fear, with Artifical intelligence, you can now tell, with 12% confidence, that this is infact a tabby cat!

Ok, in fairness, what this is going to be used for is image tagging, so that a given image can be tagged based on image contents with no other context. So part of a bigger project.

Anyway,  This is based on EMGU, and the Inception TensorFlow model. Which I have packaged into a web service.

You need to install the following nuget packages

Install-Package Emgu.TF
Install-Package EMGU.TF.MODELS

Then, ensuring your application is running in 64 bit mode (x86 doesn’t cut it!)

Run the code;

Inception inceptionGraph = new Inception(null, new string[] { Server.MapPath(@”models\tensorflow_inception_graph.pb”),
Server.MapPath(@”models\imagenet_comp_graph_label_strings.txt”) });
Tensor imageTensor = ImageIO.ReadTensorFromImageFile(fileName, 224, 224, 128.0f, 1.0f / 128.0f);

float[] probability = inceptionGraph.Recognize(imageTensor);

Where filename is a local image file of our trusty moggie, and the output is an array of floats corresponding to the likelyhood of the image matchine one of the labels in inceptionGraph.labels

The 224, 224 bit is still a bit of dark magic to me, and I’d love someone to explain what those are!

Categories: Uncategorized

Improving .NET #performance with Parallel.For


If you ever have a bit of code that does this;

var strSoughtUrl = “”
for each url in urls
var blnFoundIt = MakeWebRequestAndFindSomething(url);
if (blnFoundIt)
strSoughtUrl = url

That is to say, loops through a list of Urls, makes a web request to each one, and then breaks when it finds whatever you were looking for –

Then you can greatly improve the speed of the code using Parellel.for to something like this;

var resultCollection = new ConcurrentBag<string>();
Parallel.For(0, urls.Count, (i,loopstate) =>
var url = urls[(int)i];
var blnFoundIt = MakeWebRequestAndFindSomething(url);
if (blnFoundIt)
var strSoughtUrl = resultCollection.ToArray().First()

I have seen this code speeding up from 22 seconds to 5 seconds when searching through about 100 urls, since most of the time spent requesting a url is waiting for another machine to send all it’s data.

This is yet another performance increase for the Car Registration API service! 🙂

Categories: Uncategorized

#OpenSource KBA & Natcode lookup App for iOS in #Swift


This app allows German and Austrian users search for German KBA (“Kraftfahrt-Bundesamt”) codes, and Austrian NatCode (“Nationaler Code”) by searching by make and model, or by entering the code in the search box.

There is also an API that allows businesses to obtain this data automatically. If you are interested in the API, please visit our German or Austrian website at or

The source code for the app is available (minus the API Keys), at Github: it’s written in Swift, and it’s the first app we’ve published that’s entirely written natively.

The App itself can be downloaded from iTunes here;


Categories: Uncategorized