Camera integration into SW application

Camera integration into SW application

Hi,

When user press the camera button on c5,it will open a preview window.Now,I want to embed the preview window in my application.I don't konw which control can be used for container and what i should to do concretely in c#.

Thank you for your help.Wish everyone happy.

22 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

In the current version of the MCA SDK button handler, we always pop up a preview screen when the camera button is pressed. To do what you are asking for we would have to create a new or custom button handler to replace the default button handler. At this time we do not support replacing the default button handler with a custom version.

Another way you could accomplish what your looking for is to write to the Camera and Button API directly rather than relying on the button handler.

do you have sample?

and how do you save the video. do you have smaple of saving vidoe?

may I use directX way?

thanks!

Hi bobyang,

How to save a pictue and where the picture is saved is covered in the MCA SDK Developers Guide. Here is an example of the info in the guide:

The parameterbelow specifies a default path for saving pictures as part of the default action.

/Intel/HealthcareSDK/ToolTray/DefaultHandler/ButtonHandler.dll/CA-DefaultPath

The parameterbelow specifies a prefix for the default file name used for pictures that are saved.

/Intel/HealthcareSDK/ToolTray/DefaultHandler/ButtonHandler.dll/CA-DefaultFilebase = pic_

You can download the MCA SDK Developers Guide from here:

http://downloadcenter.intel.com/Filter_Results.aspx?strOSs=All&strTypes=All&ProductID=2854&lang=eng&OSFullName=All%20Operating%20Systems

-Steve

Steve,

Thanks for the information! it seems very easy for pictures!

However, afterreading the developer guide and I haven't found informationabout saving videos. could you point me which page I should look at. thanks.

sorry one more question,we need to connect the filename with the records in the database. how canwe name our own video filesinstead of auto-generated or prefix.

thanks!

Hi bobyang,

The MCA applicationonly permitsyou to assign a prefix. However, once the file is saved your application can rename or move it however you would like.

Thanks,

Steve

Steve,

thanks.

1. about C5, we find something was off by default. the problem is not solved yet even it is onbut I will post once the problem is solved. it sounds more windows setting issue. I test with netmeeting and it doesn't come up anything either.

2. we will need to save the video, could you point me a direction of saving video. thanks!

3. thanks for the information about filename. if that's the case. is there any method I can get the filename which I just saved? this will help me to write the filename back to the database field.

thanks

Hi bobyang

The default button press dialog only allows you to control the picture file name prefix. If you are using the MCA API you can save the file to any name you want. The API doesnt even work with images as files it returns a block of memory containing the image data at which point your application can do whatever it needs to with the image.

Assuming you are using the default button handler to capture pictures, the file name the MCA softwarechooses is really only a suggestion and the user is free to change it in the Save As dialog. If your application uses the MCA API then this again is not an issue as the application has complete control of what is done with the image. The only way I can think of to get the behavior you are asking for today is for you to write a WMI script or application to monitor a folder for files then pass the file or file name off to the other application.

There is currently no way to save video with the MCA software - only pictures. This is something that we have discussed but have yet to implement.

-Steve

May I know where to configure those parameters?

Thanks,

WendyK

Hello WendyK,

the parameters can be configered in the configuration file called IntelHealthcare.cfg
It is located in the IntelMCABin folder.
You can configure the IntelHealthcare.cfg on your PC or your MCA with the Notepad.
If you have a Motion Computing C5 running with the Platform Driver v1.11 you can also use the MCA Configuration Editor.

Greetings Markster

Markster, found it! Thanks!
Anyways, I am using C# to create a small program to capture images and video.
I follow the examples provided with the MCA SDK.
So this is how I instantiate the Camera object:

private Camera oCam = new Camera();

However, when I click on the Capture button, it will display a MessageBox saying:
Camera device named " was not found. (unable to get last error)

Should I put anything inside the bracket of the Camera? --> new Camera( ? );

Hope to hear from anybody soon.

Thanks,
WendyK

Hello WendyK,

The initiation of a Camera object Camera oCam = new Camera() is correct. (Nothing in brackets)
Where do you run your application? On a development PC with the SDK or on a Motion Computing with the Platform Driver? Steve always points out on two things:
1. On an MCA install the Platform Driver (PD) (not the SDK) and on your development PC install the SDK
2. Watch out for coreect versions, if you use the SDK v1.11 also use the PD v1.11.
Now please let us know where you run your application!

Greetings
Markster

Hi Markster,

I'm running my application on a development PC and I have already installed the SDK.
I tried to search for the version of the SDK. I opened IntelMCAand there is a pdf file called "Intel MCA SDK 1.11 Errata". I assume its version is 1.11?

Thanks,
Wendy

Hello WendyK,

you're right. The SDK version v1.11 seems to be installed on your development PC.
What kind of USB camera do you use? Maybe it is not supported. When exactly does the error occur?
When you call new Camera() or
when it goes through oCam.ReserveDevice() ?

Greetings

Markster

Hi Markster,

I use an IP camera, which is Panasonic BL-C131.
There aresome problems withthe camerasetup. Therefore I can't test my code with the camera.

Anyways, thanks for your help. I'll come back again when the camera setup is fine and I can start testing.

Thanks,
WendyK

Hi Markster,

The camera setup is now alright.
I am using a network camera, not a USB camera.
So, it is not connected to the PC, but to the same router where my PC is connected to.
(The camera and the PC have to be in the same network)

When I tested my code, an error occurred - Camera device named " was not found. (Unable to get last error).
I'm not sure where the error occurred, but it happened when I clicked the Capture button.
The Capture button is to capture image.
In the code of my Capture button, there is a method CaptureFrame().
So, did the error occur when I called that method?
Do I have to configure the camera name in the configuration file in Bin folder of the MCA SDK?

Also, do you know where in the code can I put the IP address of the cam? So that I can connect to the cam through the code.

Thanks,
WendyK

Helllo WendyK,

the Developer Guide 1.11 says:
"You can configure this camera plug-in to work with most USB camera devices.
To write a camera application, you need to install a USB camera device on your developer workstation" (page 27).

I don't know wether a network camera is supported.

The SDK does not provide a way to configure an IP adress through the code.
Does the Preview method start in the correct way. Do you see on your Preview Window what the camera sees?
I only recieve the error
Camera device named " was not found. (Unable to get last error)
when no camera is connected to my development PC.
Camera oCam = new Camera() will work without a connected Camera.
The first time I use the camera this error will occur.
As soon as you call a method oCam.reeserveDevice()
this error will occur when no camera is connected.

So I think the error is due to the fact, that the network camera can not be seen from your application.
I suggest to try an USB camera.

If it is not the camera always follow theese steps:
1. Instance Camera oCam = new Camera()
2. Reserve Device oCam.ReserveDevice()
3. Set image and video resolution oCam.setVideoSize(size)
4. Start Preview oCam.startPreview(picture)
When you see the Preview the Camera is connected in a correct way. After this try
5. Set optional camera settings oCam.setOptionValue(Option, Value)
6. Capture Frame oCam.captureFrame()
6. Release Device oCam.ReleaseDevice()
Now before you capture a frame start the Preview and let us know wether you were able to start the Preview

Greetings
Markster

Hi Markster!

I can preview and capture the image now.
I would like to save the picture captured and I have to configure the default path in the configuration file, yes?

/Intel/HealthcareSDK/ToolTray/DefaultHandler/ButtonHandler.dll/CA-DefaultPath =

There is nothing initially so I suppose I have to type in the directory by myself.
Anyways, I'm not sure of how I should put the directory.

Thanks,
WendyK

Hi WendyK,

The standard camera button application will save the captured image in the default path. It can be configured in the IntelHealthcare.cfg file that can be found in the folder C:Program filesIntelMCABin
If you want to change the default path you only need to write the path at
/Intel/HealthcareSDK/ToolTray/DefaultHandler/ButtonHandler.dll/CA-DefaultPath =
The path does not need any brackest () or quotation marks ". An example looks like:
/Intel/HealthcareSDK/ToolTray/DefaultHandler/ButtonHandler.dll/CA-DefaultPath = C:My DocumentsMy Pictures
This path only works for the camera button standard application.

Greetings

Markster

Hi Markster,

Thanks for your reply.
When you said that it will only work for the camera button standard application, do you mean the camera button on the C5?
So, it will not work with my C# application?

I tried but it didn't work.

Thanks,
WendyK

Hi,

Ihave written my program using C# language. My program is quite similar to the example provided by the MCA SDK. I want to save the image captured. Therefore I tried to edit the content in IntelHealthcare.cfg regarding the path and the filename. But when i capture an image, the captured image was notfound in the path that I specify. I tried to use the search engine of Windows but nothing was found. So I'm wondering if anyone knows what went wrong?

I also noticed that inside the IntelHealthcare.cfg, there is a portion called "Camera Default handler configuration.
// These settings affect the DEFAULT ACTION for the Camera button", may I know the Camera button that it stated,is it referring to the real camera button on the C5 or something else?

Thanks

madxm

Hello madxm,

1.
when writing a program using C# you need to implement a workaround to really save the image. When running the example programs, the image that is captured will not be saved.
You can not configure the IntelHealthcare.cfg file to save an image when using the SDK to create applications.
You have to implement a method, that saves the image to a file.
You can't find the saved image when using your C# program because the image has not been saved.

2.
These settings affect the Default Action for the Camera button:
The Camera button is the real camera button on the right hand side of your Motion C5.
On your development PC the Cameara Button can be "pressed" by pressing Shift + F3.
When pressing the Camera Button on your Motion C5 or on your Development PC the Standard Camera Button Application will start.
These settings only affect this standard application, nothing else!

Greetings

Markster

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi