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

  Prompts the user to enter time in 12-hour notation

Write a program that prompts the user to enter time in 12-hour notation. The program then outputs the time in 24-hour notation. Your program must  contain  three  exception  classes

  Parallel numeric arrays

Create and code a program that uses three parallel numeric arrays of size 6. The program searches one of the arrays and then displays the corresponding values from the other two arrays.

  Write the prototype and header for a function

Write the prototype and header for a function called calculate. The function should have three parameters: an int, a reference to a double, and a long (not necessarily in that order). Only the int parameter should have a default argument, which is..

  Create a vector class called vectordouble

Two constructors: a default constructor that creates a dynamic array for 50 elements and a constructor with one int argument for the number of elements in the initial dynamic array.

  Compute the sales tax as five percent of the purchase price

Create a structure named purchase. Each purchase contains an invoice number, amount of sale, and amount of sales tax.

  Write the definition of the constructor in line 1

Write the definition of the constructor in Line 1 so that the private member variables are initialized to 0.

  You are to create a text adventure game that uses pointers

you are to create a text adventure game that uses pointers. you have a rich eccentric uncle billy who is soon to be

  Write a program that stimulates a bouncing ball

Write a program that stimulates a bouncing ball by computing its height in feet at each second as time passes on a simulated clock. At time zero, the ball begins at height zero.

  Function odd_fill() that fills all integers between two poin

write a function odd_fill() that fills all integers between two pointers, first and last, with a sequence of odd integers: 1,3,5,7

  Find the equation of the line tangent to the graph

Find the equation of the line tangent to the graph of f(x) = (x^2 +1)/ sqrt(x)  at (1,2). Use the definition of derivative instead of derivative rules.

  Ansi-c program complete assignment as per written in the

complete assignment as per written in the attached

  Determine an appropriate functional decomposition

Create structure charts for a problem and determine an appropriate functional decomposition or top-down design from a structure chart

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