Category Archives: Programming

Algorithms, Snippets, Bugs, etc.

OpenCV is pretty darn excellent.

It’s a heck of a lot faster than my code, the canny/sobel operators especially. Also it works. See photos for more. The first is the original with 5×5 blur to reduce the noise, the second is adaptive threshold and the … Continue reading

Posted in Programming | Tagged , , | 2 Comments

Fear my skeleton.

Still haven’t quite got the hang of the MagickWand/MagickCore stuff so I’ve been fiddling on the command line so I can get the best sequence of operators together. I’ve found one. A few actually. If I smooth the image (morphology … Continue reading

Posted in Programming | Tagged , | Comments Off on Fear my skeleton.

There’s always a gotcha.

It turns out these features must be new because they’re not in the ubuntu binaries or source. So here comes a quick guide to compiling image magick under ubuntu.

Posted in Programming | Tagged , , , , | Comments Off on There’s always a gotcha.

Nothing to see here….

I’ve hit somewhat of a brick wall. I managed to get some morphological hit&miss code that thinned the images down to 1px wide and it worked fine on the previously posted test. However after that I started getting horrible loops … Continue reading

Posted in Programming | Tagged , , | Comments Off on Nothing to see here….

A sample of a ‘scanned’ puzzle.

So this is a section of a sudoku puzzle as the code sees it: <img src="http://www.thelostsouls.org.uk/wp-content/uploads/2010/06/binarysample.jpg" alt="" title="Binary Sample" width="800" height="399" class="size-full wp-image-65" srcset="https://www.thelostsouls.org.uk/wp-content/uploads/2010/06/binarysample Continued.jpg 800w, https://www.thelostsouls.org.uk/wp-content/uploads/2010/06/binarysample-300×149.jpg 300w” sizes=”(max-width: 800px) 100vw, 800px” /> A small section of a Sudoku converting … Continue reading

Posted in Programming | Tagged , , , , | Comments Off on A sample of a ‘scanned’ puzzle.

An address of a pointer as opposed to a pointer to a pointer?

EDIT@22:14 I take it back. The data was getting borked on exit from the function. Turns out that the code in use had RETURN() as a macro which freed the pointer I was using when I called RETURN(TRUE). Haha…. still … Continue reading

Posted in Programming | Tagged , | Comments Off on An address of a pointer as opposed to a pointer to a pointer?

Well that was sodding hard work….

OK so I’ve praised MagicWand now I feel I can curse it. I want a 1bit BMP out of the thing. A bitmap is easy, it’s smart. I write something ending in jpg it writes a jpg, I want a … Continue reading

Posted in Programming | Tagged , , , , , | 4 Comments

MagickWand and OCR

The problem with photographs and OCR is they contain lots of noise and colour that is really not helpful.  Levels and Posterise alongside other tools in the GIMP or Photoshop help but they’re hardly automatic and can’t be compiled into … Continue reading

Posted in Programming | Tagged , , , , , , | Comments Off on MagickWand and OCR

A strange bug moving from 64bit to 32bit.

So I installed an SSH client on my iPhone today, TouchTerm (which so far I think is excellent, especially how it handles ctrl keys etc.), and the first thing I do? SSH to my server and compile the previously mentioned … Continue reading

Posted in Programming | Tagged , , , , , | 2 Comments

It lives!

Finally. Stripped out loads of code having realised that keeping a list of possible answers to each square is all well and good but the computational time spent maintaining it outweighs the benefits of just err.. well figuring it out … Continue reading

Posted in Programming | Tagged , , | Comments Off on It lives!