Created Date : 2009.10.
Language : C++
Tool : Visual Studio C++ 2008
Library & Utilized : Point Grey-FlyCapture, Triclops, OpenCV 2.1
Reference : PointGrey Bumblebee Reference, www.cylod.com, www.ptgrey.com/
Etc. : STL
BumBleBee Stereo Camera Data Acquisition Source code.
This is Stereo Camera. The name is BumBleBee. This is product of PointGrey Company.
This camera is IEEE 1394 capble type.
This camera can obtain 3D cloud data rapidly and continously.
I need 2 library for using this camera(Triclops SDK, FlyCapture).
You can download these libs on the www.ptgrey.com site(support).
You have to use my source after install libs. and you have to set path(To include directory, lib directory). and you also need opencv 2.1 lib.
I made the acquisition code as class. The class name is CSensorStereo2.
You can use this class like below source code.
The sequence is 'Open->GetData->Close'.
I did that 2D data save Iplimage in opencv and 3D depth data save as Txt file.
The source code is very easy to use ^^.
If you have any question, Plz give your comments to me.
Thank you.
source code is shared on Github
https://github.com/MareArts/Bumblebee_GetDataClass
#include <stdio.h> #include "SensorStereo2.h" #include <time.h> void main() { int Width = 320; int Height = 240; CSensorStereo2 CSS2; CSS2.Initial(Width,Height); CSS2.Open(); cvNamedWindow("Reference"); char str[1000]; while(1) { //get 1 frame data(Image, Depth information) CSS2.GetData(); //Show Image cvShowImage("Reference",CSS2.ImgReference); //Save Depth sprintf(str,"./DepthData/%d_Depth.txt",time(0)); printf("%s\n", str); FILE * fp; fp = fopen(str,"w"); for(int i=0; i<Width; ++i) { for(int j=0; j<Height; ++j) { fprintf(fp,"%lf %lf %lf\n", CSS2.pDepth[i][j].x, CSS2.pDepth[i][j].y, CSS2.pDepth[i][j].z ); } } fclose(fp); if(cvWaitKey(1) >= 0 ) break; } cvDestroyWindow("Reference"); CSS2.Close(); }
Hi Mare,
ReplyDeleteI'm looking for your CSensorStereo2 header and C++ files. Could you share them with me?
I'm very intersting in using BumbleBee with Triclops and OpenCV ...
Thank you!
Greg
Hi Gregouze.
ReplyDeleteI have uploaded the source code on the Google-Doc.
However, somehow the link is not working propertly.
So I am going to send the file to your email.
Regards.
hello,
ReplyDeleteI would be intrested in using the opencv libraries with bumblebee and I think this code could be a good starting point. Can I please ask you to share the files with me. Thank you
Dear Valentin
ReplyDeleteI have sent the example source code to your email.
Please check the your email.
Thank you for visit my blog.
Hello
ReplyDeleteI am interested in using the disparities of bumblebee stereo camera in the real time .Can you please hep me in doing this
Thanx
Ok. What is your problem?
ReplyDeleteIf you want the source code, I can help you easily.
Please give me your email address to my email(feelmare@gmail.com) or left comment on this post again.
I will send the source code by email.
Thank you for visit my blog.
Hi Mare,
ReplyDeleteI'm looking for your CSensorStereo2 header and C++ files too. Could you share them with me (kke0217@gmail.com)?
I'm very intersting in using BumbleBee with Triclops and OpenCV ...
Thank you!
KwangEun Ko.
Dear Kwang-Eun Ko
DeleteI have sent the source file to your email.
I sorry to reply too lately.
Please check your email.
Thank you for visiting my blog.
Hi Mare, thanks for sharing your code first.
ReplyDeleteI would like to show frames acquired from both cameras but i didn't manage it. You wrote:
cvShowImage("Reference",CSS2.ImgReference);
and can actually see just one image.
Which camera is this image coming from?
I think.. The reference image in the bumblebee is right camera.
ReplyDeleteBut I cann't be sure. I don't remember.
But you can check. Cover the lense by your hand one by one.
And
If you want to get other camera, move to the "GetData" function in the CSensorStereo2 Class.
And find "triclopsGetImage16" function.
and change TriCam_REFERENCE to LEFT_IMAGE.
Now I cann't check source code. because there is not bumblebee in here.
Anyway, you can get wanted camera data by changing option "TriCam_REFERENCE", "LEFT_IMAGE", "RIGHT_IMAGE"
Thank you.
Unfortunately setting the option to TriCam_LEFT doesn't work, it returns a windows with generic red, blue and green pixel bands. I think it is caused by the imageType TriImg16_DISPARITY in the function triclopsGetImage16. I've tried also using the triclopsGetImage:
ReplyDeleteif ( triclopsGetImage( triclops, TriImg_RAW, TriCam_LEFT, &refImage ) != TriclopsErrorOk )
return false;
cvShowImage("Reference1",refImage.data); <-------..but this gives runtime error
Sorry.
ReplyDeleteI don't have bumblebee camera now.
To get bumblebee, I should visit to my university
Or I can ask to my junior in university.
Please wait..
Thank you.
I've solved by contacting the PTG Support
ReplyDeleteThank you
Hi Anonymous,
DeleteI have same problem like your problem. I would like to show COLOR LEFT RAW IMAGE and COLOR LEFT RECTIFIED IMAGE from BumbleBee2 camera. But i didn't get COLOR LEFT IMAGEs. Please can you say me how to solve this problem?
I am looking forward your answer.
Thank you.
Hello Mare,
ReplyDeleteI'm very intersting in using BumbleBee with Triclops and OpenCV. Please, could you please share your source code with me? Please, can you help me for my Ph.D. thesis?
Thank you!
This is link address.
Deletehttps://docs.google.com/file/d/0B7Z5A9fd6h29OTcwNzExNTktN2QxNS00OWRkLThjOTEtNTU0ZWNhOTdjZDYz/edit?hl=ko
and You also download source code on the page.
Hi,
DeleteThank you for your interested.
I downloaded and run it. But i created new empty project at VC++ 2012. And i copied your codes into my new empty project but i didn't run it. I have error that is "0xc0150002". I didn't understand. But When i compiled my new project, there is no compiler error and warning and it create an EXE file.
I hope, i have explained my problem.
i am looking forward your answers.
Thank you.
This comment has been removed by the author.
ReplyDeleteHi I am a beginner in with Bumble bee, I was following your code. The code was very much helpful.
ReplyDeleteHowever I have the following doubt.
How to take the left and right images? I understand that the raw data comes as a 16 bit image. So after you have created 'ReferanceImgae', I tried to right bit shift the colorImage.blue, colorImage.red and colorImage.green by 8 bits and create the second Image. [SensorStereo2.cpp lines 296-298]
I tried this:
Left:
ImgReference->imageData[ i*ImgReference->widthStep+j*3+0] = (unsigned char) colorImage.blue[k];
ImgReference->imageData[ i*ImgReference->widthStep+j*3+1] = (unsigned char) colorImage.green[k];
ImgReference->imageData[ i*ImgReference->widthStep+j*3+2] = (unsigned char) colorImage.red[k];
Right:
ImgReference2->imageData[ i*ImgReference2->widthStep+j*3+0] = (unsigned char) (colorImage.blue[k]>>8);
ImgReference2->imageData[ i*ImgReference2->widthStep+j*3+1] = (unsigned char) (colorImage.green[k]>>8);
ImgReference2->imageData[ i*ImgReference2->widthStep+j*3+2] = (unsigned char) (colorImage.red[k]>>8);
But I was not able to see that. What I get is a black window.
What could have went wrong? Could you please help me?
Hi.Mike~~
DeleteI just doing the vision serving in using BumbleBee2 .
Do you have the CSensorStereo2 header and C++ files mentioned above?
I am just looking for that file~~
Can you send it to me?
My email is yunong7379@gamil.com
Thanks a lot!
Hi mike, now I don't have bumblebee camera, so I cannot test your code.
ReplyDeleteBut if you wait about 1 month, I will buy bumblebee by 3 lens type,
Then I will update the source code more useful.
Thank you for visiting my blog.
Hello Mare..
ReplyDeletenice work...
i'm also interested in using bumblebee cam and opencv..,
i try to run your code, but I get this: How to solve this error LNK2019?
thanks.. you can email me : rostam.ftk@gmail.com....
1>SensorStereo2.obj : error LNK2019: unresolved external symbol _triclopsSetSubpixelInterpolation referenced in function "public: bool __thiscall CSensorStereo2::Open(void)" (?Open@CSensorStereo2@@QAE_NXZ)
1>SensorStereo2.obj : error LNK2019: unresolved external symbol _triclopsSetUniquenessValidation referenced in function "public: bool __thiscall CSensorStereo2::Open(void)" (?Open@CSensorStereo2@@QAE_NXZ)
1>SensorStereo2.obj : error LNK2019: unresolved external symbol _triclopsSetTextureValidation referenced in function "public: bool __thiscall CSensorStereo2::Open(void)" (?Open@CSensorStereo2@@QAE_NXZ)
1>SensorStereo2.obj : error LNK2019: unresolved external symbol _triclopsSetDisparity referenced in function "public: bool __thiscall CSensorStereo2::Open(void)" (?Open@CSensorStereo2@@QAE_NXZ)
Hi Mare,
ReplyDeleteI'm looking for your CSensorStereo2 header and C++ files. Could you share them with me?
I'm doing the vision serving in using BumbleBee2 with Triclops and OpenCV ...
Thank you!
Here is entire source code.
Deletehttps://github.com/MareArts/Bumblebee_GetDataClass
Thank you.