+ All Categories
Home > Documents > CS 101 – Introduction to Computing Lab 3suraj.lums.edu.pk/~cs101a05/lab03.pdf · IrfanView is a...

CS 101 – Introduction to Computing Lab 3suraj.lums.edu.pk/~cs101a05/lab03.pdf · IrfanView is a...

Date post: 18-Oct-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
11
CS 101 – Introduction to Computing Lab 3 Instructors: Dr. Arif Zaman, Dr. Sohaib Khan and Dr. Tariq Jadoon Time: 100 mins Environment: Windows Note: - This lab aims at introducing you to some of the most common image editing tools. - Section 1 below deals with a famous image editing software known as IrfanView while section 2 teaches you how to process a scanned text-based document. - You are advised not just to read this handout thoroughly but also to practice as you read. - This is a closed book/notes lab. You CANNOT ask for help from anybody except the TAs. Good Luck Section 1 - IrfanView: What is IrfanView? IrfanView is a compact, easy to use image viewer/editor. It can be used to produce a variety of effects on your (scanned) digital images. IrfanView was created by Irfan Skiljan, a graduate of Vienna University of Technology. How do I start IrfanView? Go to Start Programs IrfanView IrfanView 3.97 to run the program. Once you do this, something similar to the following should come up:
Transcript
Page 1: CS 101 – Introduction to Computing Lab 3suraj.lums.edu.pk/~cs101a05/lab03.pdf · IrfanView is a compact, easy to use image viewer/editor. It can be used to produce a variety of

CS 101 – Introduction to Computing Lab 3

Instructors: Dr. Arif Zaman, Dr. Sohaib Khan and Dr. Tariq Jadoon

Time: 100 mins Environment: Windows Note:

- This lab aims at introducing you to some of the most common image editing tools.

- Section 1 below deals with a famous image editing software known as IrfanView while section 2 teaches you how to process a scanned text-based document.

- You are advised not just to read this handout thoroughly but also to practice as you read.

- This is a closed book/notes lab. You CANNOT ask for help from anybody except the TAs.

Good Luck Section 1 - IrfanView: What is IrfanView?

IrfanView is a compact, easy to use image viewer/editor. It can be used to produce a variety of effects on your (scanned) digital images. IrfanView was created by Irfan Skiljan, a graduate of Vienna University of Technology.

How do I start IrfanView?

Go to Start Programs IrfanView IrfanView 3.97 to run the program. Once you do this, something similar to the following should come up:

Page 2: CS 101 – Introduction to Computing Lab 3suraj.lums.edu.pk/~cs101a05/lab03.pdf · IrfanView is a compact, easy to use image viewer/editor. It can be used to produce a variety of

How to open an image file for editing? Click on the File menu, then the Open option to get a file for use in the viewer. A dialog box will allow you to select the file you want. Click the “Preview Active” box in the Open dialog to see small versions of images before opening them. Select the file that you want to open. As an example we have opened up an image containing two parrots (have you seen this image before?). This picture is also available on the website (named as “test_image1.jpg”) for you to experiment on. The screen should look like this:

What do I do now? Once you have opened the image file, there are loads of things you could do to the image. We will show you how to perform some basic tasks with the expectation that you will experiment and learn more about this software whenever you have time. Task 1: Color/Contrast Adjustment From your week 2 theory lecture, you should have a clear idea as to what we mean by color and contrast for a particular image. Using IrfanView, you can easily adjust the colors, brightness, saturation and contrast for an image. For this purpose, you need to do the following: Go to: Image Enhance colors

Page 3: CS 101 – Introduction to Computing Lab 3suraj.lums.edu.pk/~cs101a05/lab03.pdf · IrfanView is a compact, easy to use image viewer/editor. It can be used to produce a variety of

The following dialog box should pop up:

Here you can experiment with the slide-bars to change different attributes and select the combination that you think is perfect. For example, we did the following to this image (not even close to perfect):

Page 4: CS 101 – Introduction to Computing Lab 3suraj.lums.edu.pk/~cs101a05/lab03.pdf · IrfanView is a compact, easy to use image viewer/editor. It can be used to produce a variety of

Click on “OK” when you are done. You should be back to the original screen with the enhanced image in place. Task 2: Rotate the Image When you scan an image or capture it using your digital camera, the image may not be perfectly straight – it may be tilted or slightly rotated. In such a case you need to rotate it till its straight. For this purpose do the following: Go to: Image Custom/Fine rotation… The following dialog box appears:

Page 5: CS 101 – Introduction to Computing Lab 3suraj.lums.edu.pk/~cs101a05/lab03.pdf · IrfanView is a compact, easy to use image viewer/editor. It can be used to produce a variety of

Here you can select the angle by which the image is to be rotated. For example, an eight degrees counter-clockwise rotation should look like above. Click on “OK” to return to the normal screen with the image rotated as desired. Task 3: Select and Crop: There are times when you need to pick out a certain part of the image and save separately. For example, you may want to retrieve the parrot on the left of the above picture. To do this, you will have to select it (click and hold the left mouse button as you drag the mouse pointer).

Page 6: CS 101 – Introduction to Computing Lab 3suraj.lums.edu.pk/~cs101a05/lab03.pdf · IrfanView is a compact, easy to use image viewer/editor. It can be used to produce a variety of

Once you have selected the parrot, do the following: Go to: Edit Crop selection And you will get something like this: Task 4: Save your work: This is the most important bit. Once you are done with the image enhancement, you will have to save it for all the enhancements to be permanent. Go to: File Save as In the dialog box that appears, select the location of saving (from the “Save in” drop down list) as well as the format (from the “Save as type” drop down list). For the purpose of this lab you will choose the type to be “JPG-JPEG Files” always. Now save the enhanced image and close IrfanView. You might want to open the saved file again to see if the changes have taken place.

Page 7: CS 101 – Introduction to Computing Lab 3suraj.lums.edu.pk/~cs101a05/lab03.pdf · IrfanView is a compact, easy to use image viewer/editor. It can be used to produce a variety of

Lab Assignment Yes we do have one (in fact another one later on as well). Armed with this knowledge, all you need to do is apply it. We have provided you with an image named as “Assignment_Image.jpg”. It is downloadable from the course website (under the labs section). The image is to be enhanced to your own best judgment and is to be submitted in the folder on “Indus”. After enhancing the image please save it by your roll-number before you submit. Also note that the image may need a lot of adjustments example; color, contrast, brightness, tilt, etc.

Section 2 – OCR: OCR stands for Optical Character Recognition. When you scan a document (which may contain both text and images), it is always scanned as a picture (or more technically as a bitmap). This means that the text in the scanned image cannot be processed using a text editor (example MS Word). So for example if you scan a page from your book and want to edit it without needing to type the whole page; it would not be possible without an OCR software. The OCR software takes in scanned images as input and tries to recognize the text (as well as other non-textual objects). The output is a text file along with images which you can edit using any off-the-shelf text editor. Note that the recognition is not always perfect since the fonts vary so much. Not all fonts can be recognized and even those that can be recognized may not be identified accurately. Sadly, therefore, you may need to make some changes manually after the OCR processing. Also note that OCR works for standard fonts and not human handwriting. This is obvious because the human handwriting is almost always unique to a person (doctors specially are a challenge for even humans).

For the purpose of this lab, we will be using a famous (and expensive) OCR software known as “ABBY FineReader 7.0” (known as AFR from now on). You can run this software as follows:

Go to:

Start All Programs ABBY FineReader 7.0 ABBY FineReader 7.0 Professional Edition

Page 8: CS 101 – Introduction to Computing Lab 3suraj.lums.edu.pk/~cs101a05/lab03.pdf · IrfanView is a compact, easy to use image viewer/editor. It can be used to produce a variety of

The following screen should come up:

Close the “Welcome” dialog box if it appears (do not worry if it does not appear at all).

The top left hand corner of the screen appears as follows:

Click on the “Scan&Read” button – i.e. the left most button. The following dialog box should appear:

Page 9: CS 101 – Introduction to Computing Lab 3suraj.lums.edu.pk/~cs101a05/lab03.pdf · IrfanView is a compact, easy to use image viewer/editor. It can be used to produce a variety of

Select the “From file” option and click on “next”. You will be asked to input the file containing the scanned image. For experimentation purposes, we have provided you with one sample file. It is available on the course website under the labs section and is named as “test_image2.jpg”. Please download this image and give it as input to the OCR software. Once you do that, the following should appear:

Click on “Leave original” and click “OK”. The following dialog box comes up:

Just make sure that the recognition language is “English” and click on “Next”.

This would start the character recognition. Please wait while the processing is being done. Once it is all done, you will see the following:

Page 10: CS 101 – Introduction to Computing Lab 3suraj.lums.edu.pk/~cs101a05/lab03.pdf · IrfanView is a compact, easy to use image viewer/editor. It can be used to produce a variety of

Here you can see and check if the OCR has produced any mistakes. It is highly likely that there are too many errors. Depending on the scanned original image and the scanning quality, the OCR may or may not produce a lot of errors. In case there are too many errors, you may have to rescan the image to get a better result. For the purpose of this lab, click on “Few errors” and click “Next”.

The following would come up:

Page 11: CS 101 – Introduction to Computing Lab 3suraj.lums.edu.pk/~cs101a05/lab03.pdf · IrfanView is a compact, easy to use image viewer/editor. It can be used to produce a variety of

Select the “No” option and click “Next” to move onto the following:

Select “Microsoft Word” and click “Next”. This would open up Microsoft Word with all the text (and images if any). Here you can edit the text and save the document appropriately. Lab Assignment

This is the last one and there is not much to do. So relax. We have provided you with a scanned image named as “Assignment_OCR.jpg”. It is downloadable from the course website (under the labs section). Your task is to run the OCR software and convert this image into an editable text file which should resemble the image as much as possible. You need to compare the processed document with the original scanned file. In case of any discrepancies, make appropriate changes and save the final document using the “Save As” option. By now you should know the name by which you have to save it – save it by your roll-number. Make sure that the word document and the scanned file resemble each other as much as possible.


Recommended