|
hdv212 wrote: as u know, it is initialize with 'Throw exception'
Uhhh, I have no ideo what you're really trying to say here, but nothing is initialized with "Throw Exception".
I think the value you're looking for is DBNull.Value, not null.
|
|
|
|
|
Good day
I am writing a video recognition program in VC#. I have done a lot of reading on webcam data acquisition, but the abundance of information isn't guiding me to an answer.
Could you please give me an overview of:
1. What video format is best (or commonly used) for processing real-time video? Must the raw video first be converted to the required format?
2. In what format should I record a clip(few frames) or an image (single frame) from the webcam, when I want to apply my algorithms to it?
3. And what API could be useful to do all of this? I'm currently looking at AForge
I'm asking this because it would obviously be desirable to keep the image, video and real-time video in the same format in order to write less code, and performance is also very important to me (ie don't know if different formats influence algorithm performance)
|
|
|
|
|
All of this is going to be determined by your webcam and the API used to get an image or video stream from it. Whether it's going to work for you or not depends on how you write your processing algorithm.
|
|
|
|
|
But, according to OP's previous post, not allowed to use an API.
I think he/she is stuck.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
You've done a lot of reading ?
1 - All video ends up as raw frames. DirectX is going to let you access those frames, and it's not really going to matter how it was encoded along the way, your code ends up sitting in the sequence that decodes the video. I don't believe C# can do this, not without using a third party library to help you get access to DirectX. http://slimdx.org/download.php[^] is one that I found out about recently, but I've not looked at it.
2 - does not matter
3 - Ultimately, DirectShow is part of DirectX, and is your best bet, but in C# you will need some sort of wrapper, like the one I linked to, to get access to it.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Okay thank you, I've done a lot of reading but it's been very misguided
When you say "raw frame" do you mean basic memory containing two or three bytes of info on each pixel (depending on RGB, greyscale etc.) which is contained in - for example - an array? (Independent of the video format and API used) Which one can then convert to which ever format you wish (or can), eg. jpg, bmp etc..
|
|
|
|
|
Hi,
This is a new one to me but Ill set the scene,
Would appreciate any support from people who currently or have done this.
We have thousands of products that are going to go through a production line,
the prodcut comes to us with a barcode already attached.
I need my users to scan the item at each stage, ie received the item, assebled, test, etc...
We are developing a .net (ideally asp.net but would do win forms if needed)that
will need to record the barcode (unique id) and add several infomation items to that record along the line.
So,
I need to Find a barcode scanner that will read the bardcode, and I can interact with in my .net application (all data will be stored in sql).
thanks
|
|
|
|
|
|
You can use asp.net.
When you scan barcode, it will simple write out barcode and usually give an CR and LF on end.
So, you should give focus to barcode field on form, and once user scans code it will write code in that field. All scaners do it the same way, only that you can make in some cases define what to return on end. Also, be aware that you will not know in asp.net when data actually comes from scanner, and not from user. When scanner returnes data, it's just like keyboard strokes, you cant know when this happens. So, barcode field should have focus when you start scanning.
|
|
|
|
|
Enver Maroshi wrote: You can use asp.net.
How come ASP.Net is going to help?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Did you read his post or mine?
If you would have read what he wrote you would see something like this:
"We are developing a .net (ideally asp.net but would do win forms if needed)"
|
|
|
|
|
Most barcode scanners simply act as an additional keyboard and send keystrokes straight to whatever has focus as if it were typed.
You can normally program the scanner by way of special control codes to operate how you would like. For example, where I work we set them to insert a TAB at the end of each read so focus is automatically moved to the next control in the tab order.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hi...
For about one year, I make the same application also.
We are using scanner from www.cognex.com or www.datalogic.com.
Just find a scanner with RS232 interface. Then use class SerialPort Class.
Use the methode ReadLine(). If the scanner read a barcode, then you get the
ID from the methode ReadLine(). It's so easy. You can also test is using
HyperTerminal.
There are more than 2 manufacturer of scanner, you can find other manufacturer also.
There is also scanner type with USB. If you install the driver, then it will
be converted to RS232 (Virtual Port). You can read it also using class
SerialPort.
Find a sample how to use class SerialPort in MSDN. Just use the sample
to read some barcode from scanner.
|
|
|
|
|
You can get hold of them fairly easily, either in fixed form like you get at a supermarket or the handheld variety. The last time I used one was about 15 years ago and in those days was connected to the serial port. These days they're probably serial over USB or something so it shouldn't be hard to start reading off it.
They simply send a series of characters representing the barcode. Very like someone typing the numbers in on a keyboard.
Regards,
Rob Philpott.
|
|
|
|
|
In addition to the Serial Port scanners, you CAN use "keyboard wedge" scanners. Most scanners will let you prefix and postfix custom character strings to the code so your application can tell a code is being "typed", allowing you to either position the focus in the appropriate control or just skip the control entirely and read the keystrokes, building the code internally, until you see the postfix characters. You can then do whatever you need with the code without worrying about where the input focus is. You'd normally use the forms key___ events, with KeyPreview set to True, instead of a particular controls events.
|
|
|
|
|
You can get what is called a 'keyboard wedge' which is put in series with the keyboard.
This has the advantage you can enter values with the keyboard when testing.
|
|
|
|
|
Hello Experts!!
I got above error when displaying image in crystal report.....
I am assigning root as Blobfield object and assigning to database field.but it gives error.
My code is:
while (dr.Read())
{
CrystalDecisions.CrystalReports.Engine.BlobFieldObject root;
root = (CrystalDecisions.CrystalReports.Engine.BlobFieldObject)objRpt.ReportDefinition.ReportObjects["Picture2"];
object s = dr["Picture"];
Byte s2 = Convert.ToByte(s);
root=(Byte)s2;
}
i dont knw how to bind dr with object.Suggest me method.......
|
|
|
|
|
Are you using a dataset? If you are using a dataset specify the datatype of the picture column to System.Byte[]. Then from the database set the value to that column as below :
DataColumn mycolumn = new DataColumn ("Picture");
mycolumn.DataType = typeof(System.Byte[]);
mysdset.Tables[0].Columns.Add(mycolumn);
mysdset.Tables[0].Rows[0]["Picture"] = GetImageData(Server.MapPath("~/ABC.Jpg"));
byte[] GetImageData(string fileName )
{
//Method to load an image from disk and return it as a bytestream
System.IO.FileStream fs = new System.IO.FileStream(fileName,System.IO.FileMode.Open, System.IO.FileAccess.Read);
System.IO.BinaryReader br = new System.IO.BinaryReader(fs);
return (br.ReadBytes(Convert.ToInt32(br.BaseStream.Length)));
}
Hope this helps you
|
|
|
|
|
Thanx for healthy reply....i used your code but it gives error at following point as " Cannot find table 0"
mysdset.Tables[0].Columns.Add(mycolumn);
|
|
|
|
|
I'm trying to understand security in .NET.
FYI what I try to achieve is, I have the following files: MyApp.exe, MyLib.dll, Plugin.dll
I want to run everything in a low trust environment, so that only trusted source can execute. However I'd like to trust my MyLib.dll though.
As an exercise I have 2 app. App2 just start an AppDomain with lower permission set and execute App1 in it.
In App1, for the sake of the exercise, I am calling SomePermission.Assert().
This fail with a security exception. Fine, I like that. Now I strongly signed my assembly App1 and it still fails on the Assert() call with SecuritException.
mmh... how do I circumvent that?
I know that some DLL are able to do thing that the caller is not allowed to do, how do they escalate their right? why the caller cannot?
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Good day
I'm writing my first video recogntion program (for sign language specifically) from scratch (no API's). Will the performance be good enough in C# or should I consider doing it in C++?
I'm hoping to aim for 10 frames per sec
|
|
|
|
|
Well, any day C++(unmanaged) would give better performance than C#. But both have pros and cons, C# is no doubt is eay to develop and maintain.
Again, it depends how much throughput you want from your app. I don't think 10 frms/Sec would be a problem.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Well naturally your hardware will come into play. But another big part of the performance depend on how well your processing algorithms are optimised. C++ will offer a better performance than C# with the same algorithms but the problem there is that C++ requires a lot more effort and this may result in poor coding and thus slow the algorithms down, but if you do your research and make sure you get it right then go for C++.
It may only be 10 FPS but your going to have to use some pretty meaty algorithms to achieve what your trying to do, in this case I think performance needs to be a major focus.
Thou if I was you I would forget performance for now and use C# to first get my algorithms working as needed. Image recognition is not an easy task, especially for what your trying to do (sign language), so you will have to work hard on getting it to work first. Also forget the video part for now, just work on a single image.
So, In summary...
1) Use C# to get your processing algorithms working properly on a single image
2) Then test it against video, maybe the performance will be ok
3) Move to C++ if you think you need to
If I am honest with you then I think you are going to find step 1 to be a huge undertaking so good luck...
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
|
My idea is to get a framework going where I obtain a image in bitmap format from my webcam (think AForge is able to do this?). Then I will work on this image till I have my algorithm working.
I haven't done this before, so I'd like to ask you:
1. Can I use a saved webcam "video clip", that is actually just made up of bitmapped images, and use it to test my algorithm? (I was thinking of doing it this way so that I am always using the same functions to work on the data, therefore I don't have to change my functions for video, pictures and RT-video)
2. When attempting the real-time recognition from the webcam, will my bitmap-detection be effective enough, or is there a better format to be doing it in? For example, just doing the detection on each frame in whatever format it comes in
|
|
|
|