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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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