Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

imgsessioncopybuffer and framee rate

Dear All;
I have a setup/combination of NI PCIe-1427 and princetion instruments 11 MP camera. Measurement and Automation explorer verifies that  it is possible to get a frame rate of 12/13 frame/second. i am trying to verify this rate within visual C++ by calculating time of imgSessionCopyBuffer .
//mark start time here

a sample code is for(i=0;i<60;i++)
err=imgSessionCopyBuffer(m_Session,0,(uInt8*)lpmage,TRUE);

//mark end time

it is giving me a time of about 6 frames per second. infact it should be near to 12/13 frames per second.  as i am not even doing any processing yet.  can you please help me to get a faster image acquisition rate as is being done in MAX.

//note i have check there is no error during copying. it is just some paremeter that is making imgSessionCopyBuffer act slow.

Regards;
Chand

 

0 Kudos
Message 1 of 12
(5,386 Views)
I have a similar problem with NI PCIe-1427 frame grabber.
does any one know about this one?
my camemra supposes to have 400fps , but i only can get 30fps
does any NI application engineer or other people know why?
i'd really appreicate.
thank you very much

Jack


0 Kudos
Message 2 of 12
(5,321 Views)
Hi guy's,
 
Take a look @ this post. I think it can help you !
 
If not, keep me informed! So I can help you.
 
Julien Roland - District Sales Manager
NI Belgium - Technical Support

Don't forget to rate a good answer
0 Kudos
Message 3 of 12
(5,279 Views)
Hi, Julien:

I re-read that thread again very carefully. it made me clearer now.
but  let me state my situation here:

my system: pco.1200hs high speed camera(Camera Link Interface)
PC: Intel. 3.2GHz, 2GB DDRII RAM,
Frame grabber: NI PCIe-1427(PCIe 1x, 250MB/s bandwith)

since my camera can only run at base mode of camera link interace, which is only 200MB/s, that is why I only chose NI PCIe-1427, which only support the base mode.
in this case, I only transfer 1280*50 pixels (10 bith , mono images).
so the total data size/second is : 1280 × 50 pixels/frame × 10 bits/pixel × 2000 frames/second = 1,280,000,000bit/second =160,000,000bytes/second = 160 MB/second

therefore, what do you think my system setup? is it faster enough to process each frame in  real time?

thank you very much,

best,

Jack


0 Kudos
Message 4 of 12
(5,274 Views)

Hey Chand,

First, I am not familiar with your Princeton Instruments camera, but I am assuming that you either created your own camera file, or you got a camera file to work with NI's IMAQ driver software from the camera manufacturer. Either way, it sounds like the NI Framegrabber is working and grabbing images fine in Measurement & Automation Explorer (MAX for short). Therefore, I suspect that since MAX can get the 12 to 13 fps that you want, then any other software (like LabVIEW, C++, C, VB, or VB.NET) can also get those same frame rates. So here are some other suggestions that I think you can try:

First, make sure that you click on the Save button in MAX after you have acquired from your camera. If you change some settings in MAX, like camera attributes or frame size, then you need to click on the Save button (NOT Save Image), so that those settings get saved in the camera file. Then you can try to run your program to see if you get the 12 to 13 frames per second. Second, I would recommend that you try using one of the Shipping Example programs that come with the NI-IMAQ driver software. Check out the Ring examples in a similar directory: C:\Program Files\National Instruments\NI-IMAQ\Sample\MSVC\Ring. Then you can add your "time check" to that to see if you can get the framerates you expect. Last, another thing I can think of is that you might be displaying your images as they come in. Check to see what the "displayed" images rate says in MAX, and then if you are displaying your images in your C program, then you can not display the images, but still check what rate that they are being acquired.

I hope this helps. Please let us know if you have any further questions or concerns. Thanks, and have a great day.

Regards,
DJ L.

Message 5 of 12
(5,261 Views)
Hey Jack,
 
I see that you have and are posting to Two separate threads. I would kindly ask that you keep your posting to one thread on a specific topic. Also, it seems as if your issue is different from the original poster on this thread. It seems you aren't able to acquire at the framerate you want even in MAX, so we should start there before going into LabVIEW or anywhere else.
 
So to clarify, Camera Link Base is 250 MB/sec, not 200 MB/sec.  Second, you are calculating your MegaBytes per Second incorrectly. I see you are using a 10-bit camera, but when the framegrabber receives the images and sends them into system memory, the images need Byte sized chunks. Therefore, if you are getting 10-bits per pixel, you will need 16 total bits (2 Bytes) to store that pixel data in memory. So when you calculate, you can just multiply by 2 Bytes instead of 10 bits and that will give you the result in MB/sec. For example, your total bandwidth will be equal to: (1280 × 50 pixels/frame) × (2 Bytes/pixel) × (2000 frames/second) = 256,000,000 bytes/second = 256 MB/second which is over the 250 MB/sec limit of the Camera Link Base specification, so you will not be able to acquire that much data that fast. Another thing is that a x1 PCIe lane might only get up to 200 MB/sec bandwidth, so if you need more than that, you might want to try a x4 slot, which will get you well above the 250 MB/sec bandwidth limit of the Camera Link Base spec.
 
Last, if you are only getting 30 fps in both MAX and LV, then you will need to check to see if your Camera File for your PCO 1200 HS camera is set up properly. I am assuming that you did not get the Camera File from National Instruments, as NI does not have it listed on their supported Cameras, and the camera file does not come with the NI-IMAQ driver (in the Vision Acquisition software package). Therefore, you either received the Camera File (.icd file) from the camera manufacturer, or you created your own camera file. Therefore, you can use the Camera File Generator (ftp://ftp.ni.com/support/imaq/pc/ni-imaq/cfgenerator/) (version 2.0.2 for the 1427) and see if you can alter it so that you can acquire at the framerate you want. You might have the Tap Configuration wrong in the camera file, or there might be some other setting that is not set up properly.
 
I hope this helps and I hope it clears things up a bit, like on the bandwidth questions. Please let us know if you have any further questions or concerns. Thanks, and have a great day.
 
Regards,
DJ L.
0 Kudos
Message 6 of 12
(5,260 Views)
thanks a lot DJ.
I got it from the example programs. i ran through Grab examples of MSVC shipped with max. i was using session style of LLGrab example. i tried the other example that is High level grabbing and it worked for me. 
 
regards;
Chand
 
0 Kudos
Message 7 of 12
(5,252 Views)
Hi, DJ L.

So clear explantion. : )

As you said, PCIe 1x slot may not be able to deal with this problem.
so in order to fully process the data transffered from camera link, do you think i should necessary to upgrade to PCIe 4x 1430 or 1429 frame grabber?
my camera camera link only support base mode.

thank you very much

Jack
0 Kudos
Message 8 of 12
(5,247 Views)
Hey Jack,
 
So I am a little confused about what you are asking. It seems like you are asking about how fast can you acquire the images, but then you also mention "to fully process the data" and this would be along the lines of processing not acquiring. Also, another thing I am confused about is that you say your camera is Base Camera Link, but then you state some frame rates and frame sizes that make it sound like the camera can go beyond what the Base spec says of 250 MB/sec. So therefore, if you claim that your camera can only do a true Base Camera Link configuration, then you will not need to upgrade to the 1429 or the 1430 (the 1430 can only acquire from Base Cameras anyways... the difference being that it can acquire from two Base cameras into One framegrabber). So if you think your camera can output more than 250 MB/sec, then you should go to the 1429 and a x4 slot. But if you know for sure that it is a Base and can only go up to 250 MB/sec, then stick with the 1427. You can put the 1427 into a x4 slot if you think the data is not making it from the camera. But again, I don't think the bandwidth is your biggest concern if you are only getting 30 fps, unless you are getting really large images, then it might be the bandwidth.
 
The other threads that i have seen you post on are concerning you processing your data while the images come in. You mentioned you will be using a Ring acquisition, which is correct, but make sure that your processing of the images doesn't take longer than 1/framerate time slices. For example if you are acquiring at 30 fps, then you have about 33 ms to process the images so that you can keep up with the acquistion rate. Sometimes it is not practical to process your images fast enough so that you don't catch up to your ring current image.
 
I hope this helps.
 
Regards,
DJ L.
Message 9 of 12
(5,236 Views)
Hi, DJ L.

sorry for bringing in too much confusions at the same time 🙂
but thank you so much for your patience to ask my questions 🙂

really appreciate 🙂

let me state my probelms here clearly,
1) the first thing  is accquire. after reading your concerns, I gradually understand my projects more deaply.
   as you know, my camera link can only work at basic mode, which can only reach 250 MB/s, though my camera can change ROI to increase frame rates. I ever mixed frame rates issue with  camera link transfer rates issue. now  I should say no matter how faster the frame rates, the camera can only output 250MB/s. Thank you for your disccusion to make me completely understand this problems. so the transfering rate limits my real sampling rates. If I'm wrong, please correct me.

2) PCIe x1 slotband width issue
I was wrong about the PCIe x1 bandwidth. I ever  thought PCIe x1 slot can not fully support basic camera link, since I wrongly thought it runs less than 250MB/s. but after your corrections, since no matter how fast the camera samples, the maxium output of camera is 250MB/s, which the PCIe x1 can handle it. Is it correct ? 🙂

3) the data processing time comsuming issue (sorry to bring in this issue to make this thread more complicated )
 I need to to edge dection analysis, but i also want to process sampled image in realtime, that's why I bring in this questions to the "aquire" subject.
as you said, if the PC can finish the image process and analysis before next frame arrives, then I can catch up all the frames. otherwise, I will always late.
so the bottleneck here is the speed of my PC's CPU speed.
Do you think my intel 3.2GHz will perform better than intel core dou 2.1GHz(if I upgrade)?


finally, thank you so much for helping me , now i'm understand my issues better than before 🙂
and sorry once again for making whole thread more confusing and complicated.

best regards,


Jack
Jack
0 Kudos
Message 10 of 12
(5,232 Views)