Permanent Programming#7

Put your programming skills to the test in these challenges.

Permanent Programming#7

Post by s3klyma on Tue Apr 29, 2008 12:00 am
([msg=1684]see Permanent Programming#7[/msg])

Sorry about the other one I posted,
when I typed in my question and pressed submit, it
told me that I couldn't post again so soon.


My question is how could I actually know where to
move each line of the image?


I'm thinking it has to be something along the lines of
lining up the pixels of a certain color on either side of
the text, but I'm not positive.
s3klyma
New User
New User
 
Posts: 16
Joined: Tue Apr 22, 2008 3:19 pm
Blog: View Blog (0)


Re: Permanent Programming#7

Post by TheMindRapist on Wed Apr 30, 2008 6:11 pm
([msg=1764]see Re: Permanent Programming#7[/msg])

Think about different sorting algorithms.
Image
User avatar
TheMindRapist
Contributor
Contributor
 
Posts: 585
Joined: Mon Apr 14, 2008 4:57 pm
Blog: View Blog (0)


Re: Permanent Programming#7

Post by Nines on Thu May 01, 2008 5:37 am
([msg=1829]see Re: Permanent Programming#7[/msg])

There are several ways of solving this. It'd be a bit pointless if you were told how to work out where to move each line, since that's most of the challenge. evinyatar (the person who coded the new version) solved it a completely different way to me. Before you start coding, think "how will I tell if I've unscrambled it" then start thinking up an algorithm.
User avatar
Nines
Poster
Poster
 
Posts: 191
Joined: Sun Apr 13, 2008 5:57 pm
Blog: View Blog (0)


PHP

Post by bluesun on Sun Jun 22, 2008 6:03 am
([msg=5490]see PHP[/msg])

i am getting the image ,but not so clear to make out!
What algo Should i use?I use the first half set of pixels in each row SUM
Here is the source:Removed
EDT:
I Tried using another algo:get the RGB value of each pixels of the row and so the total sum of the R ,G,B values.Now do a % calculation of which one has the most value of R or G, or B,then arrange according to order.It worked fine with a downloaded image of unscrambled image.(i.e an unscrambled image will give back the same output without much working..)but it fails to give the correct output still now! :cry: :?:
bluesun
New User
New User
 
Posts: 1
Joined: Fri Jun 13, 2008 3:00 pm
Blog: View Blog (0)


Re: Permanent Programming#7

Post by kl223 on Sat Sep 20, 2008 6:06 pm
([msg=12121]see Re: Permanent Programming#7[/msg])

Hi,

thank you for this challenge, it was fun. It did take me a few days to figure it out how to solve it.

I think I coded a new solution for this (it kinda' reminds me on how ocr software work), so I'd like to add a hint: it's not even necessary to unscramble the image lines to solve this challenge.

Cheers,
kl223
(p.s. I did it using bash+sed. :P )
kl223
New User
New User
 
Posts: 5
Joined: Sat Sep 06, 2008 6:25 pm
Blog: View Blog (0)


Re: Permanent Programming#7

Post by old_red_boots on Tue Sep 30, 2008 5:57 am
([msg=12845]see Re: Permanent Programming#7[/msg])

it is suposed that i have to get better results than these?
http://img301.imageshack.us/my.php?image=screenshotua7.jpg
because I have tried a lot of diferent algorithms and still i only can read some characters....
old_red_boots
New User
New User
 
Posts: 16
Joined: Tue Sep 23, 2008 4:49 am
Location: spain
Blog: View Blog (0)


Re: Permanent Programming#7

Post by tio on Tue Sep 30, 2008 10:06 am
([msg=12852]see Re: Permanent Programming#7[/msg])

old_red_boots wrote:it is suposed that i have to get better results than these?
http://img301.imageshack.us/my.php?image=screenshotua7.jpg
because I have tried a lot of diferent algorithms and still i only can read some characters....

sure, there is way how to get the solution clear like this (3 random pictures):
Image
Image
Image
tio
New User
New User
 
Posts: 22
Joined: Tue May 13, 2008 11:01 am
Location: Slovakia
Blog: View Blog (0)


Re: Permanent Programming#7

Post by old_red_boots on Wed Oct 01, 2008 6:14 am
([msg=12931]see Re: Permanent Programming#7[/msg])

:shock: :shock: pfff i have to work more on this :mrgreen: :mrgreen: . I supose i'm ordering the wrong data, however, i don't think i will get such good results as yours
old_red_boots
New User
New User
 
Posts: 16
Joined: Tue Sep 23, 2008 4:49 am
Location: spain
Blog: View Blog (0)


Re: Permanent Programming#7

Post by f22 on Thu Oct 09, 2008 8:30 pm
([msg=13470]see Re: Permanent Programming#7[/msg])

I'm really curious how you guys managed to get it that clear like that. At first I tried depending on the background, looping through each line, and for each one, selecting the one below it which had the lowest average difference in R, G, and B values for each pixel compared to the ones directly below it. That didn't work at all, it just seems like the background is far too blurred to be of any use like that.

What I eventually ended up doing was filtering out all the lines for each of the two "words", and processing each individually, looking for the line that kept each of the characters the most continuous. This worked well enough that I could tell what the letters said, except there was know way of knowing which was supposed to be first and which was second, so there was only a 50% chance of getting it right.
f22
New User
New User
 
Posts: 13
Joined: Sun Sep 28, 2008 10:06 pm
Blog: View Blog (0)


Re: Permanent Programming#7

Post by tio on Sat Oct 18, 2008 5:32 am
([msg=13874]see Re: Permanent Programming#7[/msg])

The difficulty rating of this level is "hard" and maybe this is the reason why you are finding complicated patterns and relations between rows in that picture. In fact, it should be like medium because when I compare programming 3 with this one, 3th level is more harder (and prog3 is like medium, not hard. That's bullshit :D ). You need realized, that if you want sort lines of this pictures, you will need find something what is unique for each row. (the background do them unique too, therefore you shouldn't ignore it)
I'm sure there is another way how to solve it too and maybe the algorithm based on sorting which I used is not the best, but it works in 90% of pictures.
tio
New User
New User
 
Posts: 22
Joined: Tue May 13, 2008 11:01 am
Location: Slovakia
Blog: View Blog (0)



Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests