Tag Archives: C

A coding dilemma.

This happens quite a lot in programming I find. There’s the ideal way of doing something and the way you actually end up doing it, be it due to buggy libraries, quirks of code, time or inexperience. I found one … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

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

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 , , | Leave a comment

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 , , , , | Leave a comment

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 , | Leave a comment

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 , , , , , , | Leave a comment

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 , , | Leave a comment

A short note on arrays and ncurses with a bit of a git.

So ncurses operates on a y,x co-ordinate system.  All of it’s functions expect y first, for example: getyx(y,x); which gets the location of the cursor putting the values into y and x.  This sounds a bit counter intuitive to us, … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment