Automatic posting and Verification Code Recognition Using DELPHI

Source: Internet
Author: User

This is a small Delphi program compiled last year. At that time, a friend from Ningbo asked me to write a software for him. The requirements are as follows: Automatic posting can be implemented in various transaction zones on the XXXX website.
XXXX is a game card transaction site. They divide transaction regions by province. Information publishers can only publish information in one province at a time. Of course, they may also for some purpose, such as preventing information flooding. The publisher's publishing information page has a graphic verification code. The entire process can be completed only by entering the correct verification code.
At that time, he was using it all the time. It is unknown whether or not he is still using it. It is purely a matter of communicating and learning with everyone and not doing anything evil.

Log on to the website, automatically fill in the webpage data, and submit the data. This is a simple function. I would like to give you an example at will:
First, embed a standard webbrowser control in Form (another webbrowser control is used in the program, but can be exchanged), navigate a URL, and then access it through the OLE object.
For example, if there is a button with the ID btnok on the page, you can access it as follows:
Try
O: = embeddedwb1.oleobject.doc ument. All. Item ('btnok', 0 );
O. Click;
Except
Txterror. Caption: = 'no <confirm submission> input location found on the current page. Please check it! ';
End;

The most complicated part is the verification code recognition part:
Thanks to the simple verification code image of this website, it consists of 4 characters. Although there are interference colors, noise, and character sticking, it has a certain degree of rotation, but only a number, there are no letters or Chinese characters. Otherwise, you have to build a complete OCR system.
The image processing process is as follows:

 

The recognition simulation process is as follows:

 

Comparison similarity is difficult to identify. I am here to save effort because the image is relatively simple. For more complex image recognition, you can create a mathematical model, make images and templates into a matrix, and compare the similarity based on matrix transformation and rotation. Interested friends can gain a deeper understanding.

I put the source code in the resource. You can download it without splitting. Everyone laughed and wrote dephi7. At that time, the recognition rate was about 80%.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.