|
Well, most car plates are done in a standard font
If you could create an array of images / vectors showing the framework for each possible character
(ie the skeleton of an F would be just the basic lines), and then had it search for this shape within each letter in the license plate.
What you have to allow for are lighting, the angle at which the photo was taken, possible different sizes, speeds of car etc.
Looking for a framework will allow you a pretty accurate measurement, and you can make countermeasures against specific problems (ie images on license plates etc)
Regards
James
|
|
|
|
|
|
thats great guyys...thx a lot
for the character recognition, i got think about neural network...i know its the best solution but its hard to write for me knowing that my programming level is not that good..
any suggestion of other ways to do it??
|
|
|
|
|
I've programmed a simple neural network in some hardware before and I've simulated it in C++ too. You only need to first demystify the neural network by realizing it's just standard matrix algebra then figure out how to apply the neural network to the problem.
I figure you'd have to create an image for each character on a place, feed each into the network so the network "learns" all the images, then scan the plate and pick out each letter. It's best to convert your pictures to black and white because the neural network works best when there's ample contrast. If you can't convert the pictures, then you'll have to increase the qualify of the network by adding new nodes.
If you demystify and understand a neural network, the short paragraph above makes much more sense. Good luck. I know two groups of people that used a neural network to correctly identify someone by their voice and by their faces over 99% of the time.
|
|
|
|
|
In response to the latest reply:
Im not too familiar with neural networks, but from what ive heard, am I right in thinking its similar to reverse-engineering matrices in DirectX to find what object a mouse clicked in a 3D world?
if you are trying to simulate a speed camera (i.e. a stationary object) then you may not need this as you can use the same algorithm as the cars will always be taken in the same position (roughly), and you can search the whole scene for a license plate (look for yellow etc) and then scan that area for something which has the skeleton of an "A" and so on.
ie, if you get any font on MS word, (well most sensible ones) you can always fit a skeleton into each letter - they should be one pixel thick, and fit into them.
If you understand that, well done, if not its my explanatory skills lol - jamespraveen@aol.com MSN - that way I can explain in real time which may not be as bad.
James
(dont tell ANYONE im on AOL)
|
|
|
|
|
I don't know about DirectX but I figure in DirectX that it simply converts a click and extends a vector basically perpendicular into the screen and the first surface it touches is the selected entity. If that's so, then I'm pretty sure it's not a neural network.
You can use Windows fonts I guess but if you're reading license plate letters, you really should teach the network using license plate letters, otherwise your network might think 5's are S's and vice versa if a license plate S or 5 looks like Ariel's 5 or S, respectively. You want to "teach" the network with the best materials to minimize error when it goes to work. That's why I said objects that yield the highest contrast give the best weights to the network and do really well. Weights by the way are individual numbers on how likely any particular node is "on".
For instance, if you fed in all the license plate letters and every character occupies a particular pixel, the node that corresponds to that pixel will probably have a weight of 1, meaning that pixel will always be used. When you to go set the network to operate and you give it a picture where that pixel is not used, then the progression of the network will rule out all of it's learned possiblities and result in telling the user that it doesn't know what that image is which is what is supposed to happen.
|
|
|
|
|
ermm...LighthouseJ..is it possible to do this character recognition without using neural network?..bcos i really dont have any base about neural network
and for the starting...i might start with edge detecting to detect the edge bcos car plate normally comes in standard size..rite?
do you have any example about character recognition??
it might help me a lot...and anyone out there if you all have anything to share with me just send to my e-mail
jian_loong520@yahoo.com
or just add me in my MSN...., mave_loong@hotmail.com
thx a lot...
|
|
|
|
|
I can't think of any other mechanism that would do the trick. I don't have any of my old programs but there are several articles on here that feature neural networks in different ways and a google search for neural network yielded many pages on it. I'm sorry I can't help you further but I haven't used a neural network in a long time.
|
|
|
|
|
|
Who knows, how to logoff an USB-Stick from WindowsXP by C#?
My application detects putting USB-Stick by comparsion of the logical drives (Directory.GetLogicalDrives();). It would be nice, to forbid the windows pluggin-process to install special stick-software. Only the stick should be installed. But this is not my problem. My problem beginns, when the stick has to be pulled. My application closes all the files, which should be written on the stick, but at some USB-sticks these files seem to be after that still in memory. Pulling these special sticks causes dataloss. How can I throw out usb-stick by my application?
When my application is running, the monitor is completely filled by my application. So it is not possible, to use the "disconnect hardware surely" button in the taskbar.
Thanks in advance!
|
|
|
|
|
Make use of CM_Request_Device_Eject API ... I do NOT have the code in C#, so I am posting what I do have in C++ ...
Hopefully you can gain enough information from this to create your C# code.
//// this sample demostrates how to safely remove a hardware using
// CM_Request_Device_Eject API.
//
// You need install Windows DDK to build this sample.
//
// http://www.microsoft.com/whdc/ddk/
//
// Specifically the following two header files are needed:
//
// \WINDDK\inc\ddk\wxp\cfg.h
// \WINDDK\inc\ddk\wxp\cfgmgr32.h
//
// Copy the two files to the currently directory and then
//
// cl remove.cpp /I. /link setupapi.lib
//
#include <windows.h>
#include <stdio.h>
#include <setupapi.h>
#include <cfgmgr32.h>
void EjectDevice(DEVINST devinst)
{
CM_Request_Device_Eject(devinst, NULL, NULL, 0, 0);
}
void main()
{
HDEVINFO hdevinfo;
hdevinfo = SetupDiGetClassDevs(NULL, NULL, NULL,
DIGCF_PRESENT | DIGCF_ALLCLASSES | DIGCF_PROFILE);
SP_DEVINFO_DATA devinfo_data;
devinfo_data.cbSize = sizeof(SP_DEVINFO_DATA);
for(int i = 0; SetupDiEnumDeviceInfo(hdevinfo, i, &devinfo_data); i++)
{
DWORD Capabilities;
SetupDiGetDeviceRegistryProperty(hdevinfo, &devinfo_data,
SPDRP_CAPABILITIES,
NULL, (PBYTE)&Capabilities, sizeof(Capabilities), NULL);
if( !(Capabilities & CM_DEVCAP_REMOVABLE) ||
(Capabilities & CM_DEVCAP_SURPRISEREMOVALOK) )
{
continue;
}
DEVINST devinst = devinfo_data.DevInst;
const int size = 300;
BYTE buffer[size];
DWORD requiredSize;
SetupDiGetDeviceRegistryProperty(hdevinfo, &devinfo_data,
SPDRP_DEVICEDESC,
NULL, buffer, size, NULL);
printf("%8d %s\n", devinst, buffer);
// Add code to display UI for user to select a device to remove,
and then:
//
// EjectDevice(devinst);
}
SetupDiDestroyDeviceInfoList(hdevinfo);
}
:..::. Douglas H. Troy ::..
Bad Astronomy |Development Blogging|Viksoe.dk's Site
|
|
|
|
|
Hi All,
I am a AutoCAD user and newly joined this world of programming by learning C# to some extent. (no prior knowledge of any other programming languages i.e, C++/java/cobal nothing)
I want to learn ARX which is supported by Autodesk Applications could some one help me in getting some tutorials for the same. Pleae note that I do not have any knowledge of C++ I want to learn straight from .NET environment.
Any help in this regard is greatly appreciated.
Thanks in advance.
Rukmaj Chandavar
|
|
|
|
|
autocad .net tutorials is free download
www.autodesk.com
jjjjjjj
|
|
|
|
|
Could someone give me a tip or help me make some code wich list all the ip addresses betwen to givel values. I need this for a host scaner and I spent a whole nigth working on it but I wrote only useless code. Thanks
|
|
|
|
|
What is the problem you are having?
|
|
|
|
|
For an example if I have 2 Ip address 127.0.0.1 and 127.0.2.1 I want to generate 127.0.0.1,127.0.0.2,127.0.0.3.......127.0.0.255....127.0.2.1
Do you understand now.
Or if there is a link about this subject that woulb be helpful
|
|
|
|
|
Since an IP address is a 32 bit unsigned integer, you can convert the IPs into "flat" numbers, then generate all the addresses you want, then convert them into a "classic" IP address.
For example:
string[] startAddr = "127.0.0.1".Split('.');
string[] endAddr = "127.2.0.1".Split('.');
uint start = uint.Parse(startAddr[0]) +
uint.Parse(startAddr[1]) * 256 +
uint.Parse(startAddr[2]) * 256 * 256 +
uint.Parse(startAddr[3]) * 256 * 256 * 256;
uint end = ...
uint[] addr = new uint[end - start];
for(int i = 0; i < addr.Length; i++) {
addr[i] = start + i;
}
string[] result = new string[addr.Lenght];
string tmp = "";
for(int i = 0; i < result.Lenght; i++) {
result[i] = "";
result[i] += ((uint)(addr[i] % (256 * 256 * 256 * 256))).ToString() + ".";
result[i] += ((uint)(addr[i] % (256 * 256 * 256))).ToString() + ".";
result[i] += ((uint)(addr[i] % (256 * 256))).ToString() + ".";
result[i] += ((uint)(addr[i] % (256))).ToString();
}
I don't know if this works (I didn't try it), but this is my idea.
EDIT: IT DOESN'T WORK AT ALL!
___________________________________
Tozzi is right: Gaia is getting rid of us.
My Blog [ITA]
-- modified at 4:59 Wednesday 15th February, 2006
|
|
|
|
|
I had a go at this for you, and got it to work, but there were plenty of weirdnesses!
IPAddress has a constructor that looks like:
IPAddress(byte[] address)
Which kept throwing an exception when passed the return from IPAddress.GetAddressBytes - this is weird as all the docs say it should work. There is a weird limitation that requires the byte array to have a length og 16 but II ensured this....
So anyway, IPAddress.Parse was working so a quick method such as the following gets round the issue.
private IPAddress IPFromBytes(byte[] bytes)
{
return IPAddress.Parse( String.Format("{0}.{1}.{2}.{3}",bytes[0],bytes[1],bytes[2],bytes[3]) );
}
Now, to solve this problem I started by thinking about how to incremement an IPAddress, and I came up with this:
Loop from the last digit to the first
if the current number is 255 set it to 0
otherwise incremement the number and break out the loop
this should cause the sequence to go
127.0.0.1
127.0.0.2
......
127.0.0.254
127.0.0.255
127.0.1.0
127.0.1.1
Here is the incremement code:
private byte[] Incremement(byte[] current)
{
for(int i=3;i>-1;i--)
{
if(current[i] == 255)
{
current[i] = 0;
}
else
{
current[i]++;
break;
}
}
return current;
}
Finally, the get range method must do the following
capture start and end IP's
loop while not at end
capture current IP into a list
incremement IP
The only hard part there is "loop while not at end", as weve already written the incremement and capturing to a list is childs play.
private System.Net.IPAddress [] GetRange(IPAddress start, IPAddress end)
{
byte[] startBytes = start.GetAddressBytes();
byte[] endBytes = end.GetAddressBytes();
byte[] currentBytes = startBytes;
ArrayList list = new ArrayList();
while(
currentBytes[0] < endBytes[0]
|| currentBytes[1] < endBytes[1]
|| currentBytes[2] < endBytes[2]
|| currentBytes[3] < endBytes[3])
{
list.Add( IPFromBytes(currentBytes) );
currentBytes = this.Incremement(currentBytes);
}
return (IPAddress[])list.ToArray(typeof(IPAddress));
}
Hope it helps, and please rememeber not to be doing anything malicious with port scanners!
|
|
|
|
|
Thx, i will see if I manage to solve my problem. And don`t be afraid I don`t want to make port scanners. I try to make an utility that detects all PC from a Lan by pinging them
|
|
|
|
|
How do I load an Assembly dynamically in a NEW appdomain?
The assembly is in bytes[] array.
Gurpreet
|
|
|
|
|
You should look for articles that deals with reflection and plugins.
YOu should be able to get the code you need from there.
I have a little plugin system on my page too (oldow it does not load an assembly into a new appdomain): http://cwizo.slogamedev.net/index.php?i=showcase&s=programs
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
_________________________________________________________
The Assembly that I need to load:
_________________________________________________________
namespace WindowsApplication4
{
public class TestDll : MarshalByRefObject,interfaces.Test
{
public string HelloWorld()
{
return "Hello World";
}
}
}
_________________________________________________________
interfaces.Test is in a seprate dll. code is as below:
_________________________________________________________
namespace interfaces
{
public interface Test
{
string HelloWorld();
}
}
_________________________________________________________
The code that I am using to load:
_________________________________________________________
AppDomain currentDomain = AppDomain.CreateDomain("mydomain1");
currentDomain.AssemblyResolve += new ResolveEventHandler(MyResolver);
domain.CreateInstance("TestAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "WindowsApplication4.TestDll");
static Assembly MyResolver(object sender, ResolveEventArgs args)
{
Assembly assembly;
AppDomain domain = (AppDomain)sender;
// Actually the assembly in bytes will come from database so temporarily loading it as below:
byte[] rawAssembly = loadFile("d:\\TestAssembly.dll");
assembly = domain.Load(rawAssembly);
return assembly;
}
I DO NOT FACE ANY PROBLEM IN LOADING THE ASSEMBLY WHEN IT IS NOT IMPLEMENTING THE INTERFACE. IT WORKS FINE IN THAT CASE.
Gurpreet
-- modified at 3:12 Wednesday 15th February, 2006
|
|
|
|
|
I am guessing but I think that you should add refrence to the Interface dll in your TestDLL
but you should really post some error or something.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I get the following error:
{"Could not load file or assembly 'TestAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.":"TestAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"}
reference of interface.dll is added in Testdll. Testdll can not be compiled without the reference
Gurpreet
|
|
|
|
|
KaurGurpreet wrote: How do I load an Assembly dynamically in a NEW appdomain?
Just you would normally, but you need to call it from within that AppDomain.
|
|
|
|
|