|
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
|
|
|
|
|
you can use any source of input as long as you are able to obtain each frame as an image.
In regards to you concern about dealing with different image formats then you could go for converting the images so each one is the same, that will of course add cost to processing but I think it will be very little compared to what you image processing algorithms are going to require.
If I needed to deal with multiple image formats then I would write a class that deals with that and you algorithm simply asks this class for the pixel data it wants to use.
For example I would have a class with the following functions...
public ImageFormat formatForImage;
public Pixel GetPixel(int xPos, int yPos)
{
if(formatForImage == type1)
else if(formatForImage == type2)
}
...Hope that helps explain my meaning. You can choose for this class to work in different ways, you could pass it each frame from the video or you could have it load the next frame itself with the use of a NextFrame function etc.
In my opinion it does not matter what format you work with as all your algorithms will need to be concerned with is the values of each pixel.
I think the best way is have a class like above that can load a bitmap from a given file, then have a function that returns the pixel you want to use.
Then when you need to make it do video you just add that functionailty to the class, then a pixel will always be returned the way your algorithms wants them to be.
Hope that makes sense
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
tvbarnard wrote: from scratch (no API's)
Sorry, this isn't really an answer to your question, but why aren't you using any APIs?
If it's purely because you want to learn that's fair enough, but if this is a real product you should definitely consider using some frameworks to reduce your workload. One of the benefits of OO design is re-usability. Don't waste your time reinventing the wheel.
I mean, you must be using some APIs or are you going to code the user interface from scratch direct bit injections to video memory? And what about capturing the video stream, surely you'll use a library for that, like DirectShow, WIA or Avicap32.
Simon
|
|
|
|
|
No problem
I'm an engineering student completing my bachelor's and I was given this as my year-end project. I am using VS.NET to do my interface and I am allowed to use API's for obtaining the data from the webcam. I have started my implementation using AForge.NET for that (let me know if you suggest anything better).
Other than that, my specs given to me say I am not allowed to use any API's.
I welcome any form of help at this stage (as you can imagine) so you are welcome to give me any feedback from your own experiences
|
|
|
|
|
Well, if it's part of the requirements because they want you to learn about something, that is all right I suppose.
tvbarnard wrote: Other than that, my specs given to me say I am not allowed to use any API's.
I'd clarify that with your supervisor then. Aforge seems like a pretty major framework. It helps with image processing and all sorts. Exactly the kind of thing I would be looking for in a project like this, but if your not allowed to use frameworks you should check this is allowed.
I can't help much I'm afraid, I just wanted to make the point that you shouldn't artificially restrict your self to not using the available libraries and tools without a good reason.
Good luck. It sounds like an interesting project.
Simon
|
|
|
|