Evaluate a project on number plates

Assignment Help C/C++ Programming
Reference no: EM13938654

'A project on Number plates; I have successfully implemented a method for character localisation, character segmentation and character recognition.

Main problem at the moment is to find a method capable of reading raster data and print it to file. Have segmented characters into a 10x10 pixels, 8-bit(Bitmap) black and white.

It has been suggested that i should use a code developed by Bill Green (www.pages.drexel.edu/~weg22/colorBMP.html ) click on tutorial and raster data tutorial (8-bit). Have downloaded the code, made a few changes but could not unfortunately get the right answer.

Have actually got some answers but when a compare for example the values for letter E from the program and the values of letter E with Photo shop, the result is not the same.

If you could help, please let me know. Below is the code with little modification made.

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

/*-------STRUCTURES---------*/
typedef struct {int rows; int cols; unsigned char* data;} sImage;

/*-------PROTOTYPES---------*/
long getImageInfo(FILE*, long, int);
long copyImageInfo(FILE*, FILE*, int);
long copyColorTable(FILE*, FILE*);

int main(int argc, char* argvUnknown Variable:)
{
FILE *bmpInput, *rasterOutput;
sImage originalImage;
unsigned char someChar;
unsigned char* pChar;
int nColors;
long fileSize;
int vectorSize, r, c;

/* initialize pointer */
someChar = '0';
pChar = &someChar;

// if(argc < 2)
// {
// printf("Usage: %s bmpInput.bmpn", argvUnknown Variable:0);
// exit(0);
//}

argvUnknown Variable:1="LetterE.bmp";
printf("Reading filename %sn", argvUnknown Variable:1);

/*--------READ INPUT FILE------------*/
bmpInput = fopen(argvUnknown Variable:1, "rb");
fseek(bmpInput, 0L, SEEK_END);
rasterOutput = fopen("LetterE.txt", "w");

/*--------GET BMP DATA---------------*/
originalImage.cols = (int)getImageInfo(bmpInput, 18, 4);
originalImage.rows = (int)getImageInfo(bmpInput, 22, 4);
fileSize = getImageInfo(bmpInput, 2, 4);
nColors = getImageInfo(bmpInput, 46, 4);
vectorSize = fileSize - (14 + 40 + 4*256);

/*-------PRINT TO SCREEN-------------*/
printf("Width: %dn", originalImage.cols);
printf("Height: %dn", originalImage.rows);
printf("File size: %ldn", fileSize);
printf("# Colors: %dn", nColors);
printf("Vector size: %dn", vectorSize);

/*----------READ RASTER DATA---------*/
fseek(bmpInput, (54 + 4*nColors), SEEK_SET);

for(r=0; r<=originalImage.rows - 1; r++)
{
for(c=0; c<=originalImage.cols - 1; c++)
{
fread(pChar, sizeof(char), 1, bmpInput);
fprintf(rasterOutput, "(%d, %d) = %dn", r, c, *pChar);
}
}

fclose(bmpInput);
fclose(rasterOutput);

}

/*----------GET IMAGE INFO SUBPROGRAM--------------*/
long getImageInfo(FILE* inputFile, long offset, int numberOfChars)
{
unsigned char *ptrC;
long value = 0L;
unsigned char dummy;
int i;

dummy = '0';
ptrC = &dummy;

fseek(inputFile, offset, SEEK_SET);

for(i=1; i<=numberOfChars; i++)
{
fread(ptrC, sizeof(char), 1, inputFile);
/* calculate value based on adding bytes */
value = (long)(value + (*ptrC)*(pow(256, (i-1))));
}
return(value);

} /* end of getImageInfo */

Attachment:- Raster Data Tutorial.doc

Reference no: EM13938654

Questions Cloud

Survey and the other research proposal : Hi, This subject has two assessments , one literature survey and the other research proposal. I have already submitted the literature survey and he gave 17 out of 35. This research proposal is based on that literature survey ,and this proposal is ..
Calculate the fixed overhead spending and volume variances : Calculate the fixed overhead spending and volume variances for the Little Rock and Athens plants. What is the most likely cause of the spending variance? Why are the volume variances different for the two plants?
Declared the dividend on the preferred stock : Organize the transaction data in accounts under an accounting equation. Prepare the stockholders equity section of the balance sheet at December 31, 2012.
Classification of health care technologies : "Classification of Health Care Technologies and Its Impact on Health Care" Please respond to the following: Analyze the major past to present transformations of technology in health care
Evaluate a project on number plates : 'A project on Number plates; I have successfully implemented a method for character localisation, character segmentation and character recognition.
What is the effect size value : If the salary and compa mean tests in questions 2 and 3 provide different results about male and female salary equality, which would be more appropriate to use in answering the question about salary equity - how do you interpret the results and what ..
Impact project planning and execution : What known challenges will impact project planning and execution? By implementing the project, what specific opportunities become available?
How it affects the different organ systems : The subject of obesity has been in the news a lot in the past months. A lot of the discussion has centered on the politics of the issue, but it is needed to consider the biological effects of obesity. Explain what obesity is and how it affects the..
Detailed study of bi application : A detailed study of BI application in a particular industry domain, e.g., telecommunications, finances, banking, education, airline, sport, etc.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program manipulating a 2-dimensional array

Write a program manipulating a 2-dimensional array. Create constants to represent your number of students and number of assignments.

  Assign passed value to function to return value

Assign passed value to this member and another function to return value. Your main should read the integer from an input data file, and write the output to the output data file.

  Problem on c++ tools

When working in teams (at most two students per team), send one solution file per team.

  Summarizing your predicted and actual output

Write a statement summarizing your predicted and actual output, and identify and explain any differences. For your conclusions, write at least one nontrivial paragraph that explains, in detail, either a significant problem you had and how you solv..

  Include the iostream, fstream, string, and cctype libraries

1. Include the iostream, fstream, string, and cctype libraries in your program.

  Write the select query

Assume the table "books" contains books that the company stocks. Assume the table order_lines only contains books that have actually been ordered.

  Implement a matrix class for two-by-two matrices

Implement a Matrix class for 2-by-2 matrices. Include a default constructor, a copy constructor, an inverse() function that returns the inverse of the matrix.

  Explain shortestpath() and printshortestdistance()

Explain the following code line by line, and submit your answer: shortestPath() & printShortestDistance() in weightedGraph.h

  Developing a database to manage academic issues

What's A Matter University (good old Whatsamatter U) is developing a database to manage academic issues. You are asked to assist in the design of the database. Sketch the Entity-Relationship diagram for each of the following business needs. Your a..

  Design and implement a class called statistician in c++

Design and implement a class called statistician in C++. After a statistician is initialized, it can be given a sequence of double numbers. Each number in the sequence is given to the statistician by activating a member function called next_number..

  Show what is output by the following segment of code

Show what is output by the following segment of code. Consider the following statements.

  What information do you need to find the selling price

To make a profit, the prices of the items sold in a furniture store are marked up by 60%. Design an algorithm to find the selling price of an item sold at the furniture store. What information do you need to find the selling price?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd