Powered by glolg
Display Preferences Most Recent Entries Chatterbox Blog Links Site Statistics Category Tags About Me, Myself and Gilbert XML RSS Feed
Sunday, June 10, 2012 - 22:33 SGT
Posted By: Gilbert

AFU

In-Camp Training week is upon me again, whereupon my relish for research will be reignited by days of sitting about interspersed with running around and much rifle-rubbing. I bid farewell to my computer with extra content.

In need of a pick-me-up (ok, ICT isn't intolerable, just... blah), I chanced upon A Student's Guide to Fourier Transforms on Amazon, and decided on some shopping therapy (only about S$5, used!). And then I recalled that Paul Fussell, whom I felt made for enjoyable reading, had just passed on (Bradbury too), so I added a couple of titles (again used) from him. Then I remembered some others on my wishlist, for which pre-owned versions were not yet available, and figured, why the heck not (using local retailers whenever possible), putting the shipping fees in the back of my consciousness.

Something to look forward for when I return.


Two Markets

As it is not good to depart with ill feelings, I shall offer an olive branch to the local broadsheet by giving attention to a couple of pieces that have appeared within; a few days ago, in "Pump prices: More effective options needed, other than Case", a reader contended that the Consumers Association of Singapore (Case) has been unable to get petrol companies to be more transparent in their pricing (a gripe which extends to other spheres here), which I suspect pertains to fuel prices being fast to rise but slow to fall in tandem with bulk rates.

This caused a report published a couple of months ago, "Undercutting, bad contracts depress cleaners' pay", to spring to mind. According to the correspondent, with new cleaning companies being set up at a rate of one a day here, wages have been depressed, and indeed an update confirms that the firms are thus unable to hire locals, with the median gross wage for cleaners and labourers actually falling from S$1227 to S$960 in the past decade.

So, one might ask, is there any link between the two cases?

Well, it may be neither new nor original (like the lion dance lift, supposedly, with the commentator noting that the Australians tried it in the 1970s, also recognizing the similarity with the rugby version), but this is a classic contrast of market power.

I would be extremely surprised if the petrol companies actually bothered to overtly fix the price (like the biggest boys) in shadowy backrooms, as some are muttering - the only action required is to stifle the urge to slash pump prices immediately when oil prices drop, since all that would bring would be immediate retaliation and lower profits all around, given the inelasticity of demand for fuel. Oh, and tacitly follow-the-leader in raising prices, by the same logic.

It's good to be an oligopolist.

The reverse applies for cleaners and other low-wage workers - the barriers of entry to this industry are extremely low, and any old fellow can set up shop by luring simple folk from neighbouring countries and farming them out for a couple of hundred bucks a month. Who needs productivity when you have labour going for that cheap? Having said that, it is true that the companies have little choice in the matter of pay if they want to be competitive, given the environment.

It sucks to be an unskilled worker.


Well, there is appreciation... sometimes
(Source: Somewhere on the Internet)


I have covered the argument for workers possibly (likely) not being properly compensated for their marginal productivity here before, and the obvious remedy is a reasonable living minimum wage, or alternatively stronger unions; however, neither seems likely, with the National Wages Council's recommendation of a S$50 raise - which is not even compulsory - already being hailed as uncommonly generous, which it probably is, given that it is the council's first such suggestion since 1984.

With friends like these, who needs enemies?

One can easily imagine how tripartism works here in practice:

Union "leader": Um, you know, if it's not too much trouble, maybe you could consider, like, increasing wages? I know it's tough and all that, and I would fully understand if it isn't possible, you just have to give the word...

Business leaders: No, no cannot! We are barely making it as it is! We will relocate if forced to pay more than subsistence wages!

Union "leader": *bows* As I suspected, O irreplaceable captains of industry. *turns to workers* You lot hear that, cannot lah! Back to work, back to work! If you get stubborn, even the union supermarket will die die get cut-price hires from overseas before considering raising salaries!

[N.B. In Escape From The Lion's Paw (apparently not banned here), government-controlled unions are (probably honestly) referred to as "management stooges", which led to the Catholic church-supported (they're definitely doing good work in this case) Jurong Industrial Mission filling in the role of an actual functioning workers' welfare body. The movement would end badly - more on this next time]

The pendulum may be swinging, and rightly too.


Some Progress

Me: We haven't worked on the CAPTCHA thing for awhile; it should be time for us to return to it. If the Chinese can get a 30-storey hotel up in a fortnight, I don't see why we can't meet our own rather less-ambitious targets.

*Mr. Ham inches away*

Me: I said us. And oh, have you heard about the guy who turned his cat into a helicopter after it got run over? Hmm...

Mr. Ham: Stop looking at me like that!

Me: *pulls out ruler* Let's see, about eight cm, *lifts Mr. Ham* not sure if there's enough space for an engine, but we can try. How much lift is required? Maybe a dual-rotor system?

Mr. Robo: Er, you aren't really going to do it?

Me: Oh, only if our dear Mr. Ham regrettably turns up dead, as he so often does when he's needed.

Mr. Ham: I get it, I get it! Tell you what, since we need to level Oboham too, let us draw straws for it. Short straws work on the CAPTCHAs, long straw plays Diablo 3. Since I'm proposing this, you two draw first. Fair enough?


Let's play a game!


Mr. Robo: Sounds good to me. *draws* Darn, it's short.

Me: Mine's short too.

Mr. Ham: Heh heh, best of luck, boys! I'll be off then.

Me: Wait a minute... show me the last straw.

Mr. Ham: *stuffs it into cheek pouch* Now, now, you're already a loser, don't be a welcher too!


*Some hours later*


Mr. Robo: Alright, I'll go first. I have implemented the displacement field distortion as described here, noting that some alphas should be sigmas in this version. Scaling coefficients increase to the right, and Gaussian standard deviations increase downwards:



As explained, a larger standard deviation preserves more structure, and for CAPTCHA purposes, a value of 16 coupled with a scaling factor of 1024 - third from right and bottom above - seems reasonable, though I don't think Google created theirs this way - from the looks of it, they constructed theirs with a far smoother map.

Mr. Ham: Not very impressive.

Mr. Robo: Hey, I'm just a hamster, what were you expecting?

Me: My turn then. I figured out that compensating for global distortions in CAPTCHAs - aligning the text along one axis - would be helpful in segmentation, since only horizontal cuts would have to be considered. This is, of course, mainly a matter of discovering the field used, and applying its inverse (which as noted long ago, can be effective even with extremely distorted fields)

But how can we estimate the field? I began by using measures such as Prewitt distance, local mass and column sum to try and extract the baseline and meanline using dynamic programming, but this proved less than satisfying:


Top row: Original CAPTCHA and Prewitt-filtered copy
Middle row: Global estimation of meanline,
and final multiplication of all independent features
Bottom row: Estimation of meanline by DP, superimposed on original


This too often sticks too closely to the desired line, and despite best efforts at parameter tuning, ends up ignoring the top, or bottom, of certain letters incorrectly, like the "d" and "s" above. A more talented researcher may be able to make further inroads with this approach, but that was enough for me, and I wound up reading the entire Vagabond series, a highly romanticised retelling of Miyamoto Musashi's life story by Takehiko Inoue (better known for Slam Dunk - Musashi does resemble Sakuragi), who is frankly an incredible artist all round.

After coming across warnings of not seeing the forest for the trees and the middle path, I realised that this was just taking the column means of a suitable Gaussian-blurred copy:


As is noted in football too, follow the centre of mass,
not the feet or the ball - it cannot lie

(Original source: zimbio.com)


That done, the slant at each interval can be estimated, for a start by skeletonizing the text and averaging the direction of each suitable nearby pixel, which seems to work fairly decently, or at any rate better than the initial approach. An estimation of the displacement field can then be made by fixing the top and bottom extents along each line by mapping to fixed cumulative intensity percentiles along the line.


Skeletonization of the above CAPTCHA;
leftmost keypoint slant estimated using points in cyan,
other valid points used are in red



Five examples of estimated displacement fields;
keypoints are intersections between red and green field lines


The results won't be exact since the distortion for individual letters aren't affine, but I think it might still be of help. I'll get on the actual unwarping when I get back, since I really have to get to sleep soon.

Mr. Ham: Pfft, not very impressive either.

Me: So what have you done?

Mr. Ham: I've got Oboham maxed out at Level 60, so there!


Oboham in all his glory (cue background music)


Mr. Robo: I hate to admit this, but he wins.

Me: I... I concede.

Mr. Ham: Glad to have you two recognize the enormity of my feat. There were some roadblocks, like before I discovered the utter necessity of stacking Dexterity - every point represents a 1% increase in damage, increase in chance-to-dodge and even Armor with Seize the Initiative, which was fixed with a short trip to the Auction House. Tip for aspiring Monks: just search for +Dex +Vit with a ceiling of 10k gold for each item slot - you may be surprised at what can be had.

Unfortunately, being a melee class has its limitations, especially at higher difficulty levels. Using the kid to represent the hero, and the chickens as the monsters, gameplay tends to pan out as follows:


With marginally less wailing
[N.B. See also animation of knockback mechanic]


This is related to the current design failure regarding melee vs ranged classes, which is at least being addressed. In Inferno mode, where monsters are far tougher, melee classes like the Monk still have to get up close and personal and take hits (yes, they do have Dodge, but try getting much over 40%), which makes Armor, Vitality and resistances indispensable - but they also need attack speed and damage and all that if they want to have any impact. Getting it all is not impossible - just extremely expensive.


It's not hard... just a matter of dropping a hundred million gold or so


Contrast this to ranged classes - they may die in a single hit if their protective skills are on cooldown, but since they will possibly fall to a single hit anyway even with good survivability items, the obvious response is to ignore it totally and simply stack damage, and count on mowing everything down before it reaches them. Which happens to work, even with far cheaper items. Sure, there may be some elite mobs where this isn't sufficient, at least without dying a few times in between, but it still beats plunging headlong into desecrator pools and arcane lasers as a Monk.

Another thing on elite mobs - they can be (and in fact often are) tougher than the actual bosses, but they also can be skipped, so don't get hung up on that Vampiric Vortex Molten Frozen pack that seemingly can't be beaten.

The number one tip for Diablo 3 however remains: pick a Demon Hunter or Wizard, or go play an abstraction.

Me: Being a monk in real life doesn't sound too bad, though. The no drinking (though they do brew good beer) or gambling part is no skin off my nose, and from what I know they get allotted hours of blessed silence for contemplation. The doctrines and (at least official) ban on bunga-bunga, uh, compassion are deal breakers, unfortunately, and not even well-advised given the far-reaching economic repercussions.

Mr. Robo: Now I know why I'm not getting those IT contracts, with Ms. Robo gone. Esquire Pants has advised me to sue my college for neglecting to educate me on the basics of how to attract business!

Mr. Ham: And I thought this might interest you - some recognition for Tesla. Utterly technically brilliant, but zero business sense (the two seem to go in hand) or sense of public relations, which is why Edison, who cheated him out of payment for services rendered, is still by far the more famous inventor. Still, the man spent his last days imagining that he could converse with pigeons. Creepy that!

Me: Why are my eyebrows twitching involuntarily?

Mr. Robo: My finely-tuned Internet senses are picking up large quantities of unintended irony in this sector.



comments (0) - email - share - print - direct link
trackbacks (0) - trackback url


Next: Back In A Piece


Related Posts:
Think Thunk
It Was A Honest Mistake
The Huntster Awakens
Pieces From The Past
Finding Words

Back to top




Copyright © 2006-2025 GLYS. All Rights Reserved.