Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Asked — Edited

Camera Control From My Plugin

Hello ,
I want to control the JD camera from my visual studio plugin ,
I've try the following code but it doesn't work
EZ_B.Camera.GetVideoCaptureDevices();

plz I need ur help as soon as possible .

AI Support Bot
Related Content
Synthiam
#9  
ptp

yup , i still need ur help . I've run ur code but it gave me the following error in the image ,
User-inserted image

for that i asked u to control the camera from my windows form .
for example i try to put ur code in a button in my form but unfortunately , it didn't work
PRO
Synthiam
#11  
Are you sure that you're creating a plugin? Or a standalone application?

Also, do not use ptp's code. Use the tutorial that i posted.

In the tutorial, to draw on a Panel, for example...

Code:


void Camera_OnNewFrame() {

if (_cameraControl == null)
return;

using (Graphics pnlG = panel2.CreateGraphics())
pnlG.DrawImage(_cameraControl.Camera.GetOutputBitmap.ToManagedImage(false), 0, 0, panel2.Width, panel2.Height);
}
#12  
DJ. He is not building an ARC plugin. Needs SDK instructions (I would provide but answering from phone).
PRO
Synthiam
#13  
If you're not building a plugin, then read the README.TXT that is included in the SDK. You're not following the instructions. All files from the SDK package must be copied into your output folder. Read the instructions.

If you are making a plugin, then read the tutorial and use the code i presented.
PRO
USA
#15  
Attention to:

DJ wrote:

Quote:


read the README.TXT that is included in the SDK. You're not following the instructions. All files from the SDK package must be copied into your output folder. Read the instructions.



User-inserted image


Platform target: must be x86 (32 bits)

Some dlls are needed in the application folder you have two options:

1) copy the dlls "packages/EZ_B.dll.2015.05.20.00" to the application folder i.e. (bin/debug or bin/release)

2) add application references to the missing dlls:
e.g.
VS>Project>Add Existing Item>(look for the missing DLL)>ADD
VS>Project>dll properties>"Copy to Output Directory" Change to "Copy if newer"

personally i like the option 2, you are aware of the dlls needed, but the safest option is the 1).
#16  
thanks ptp for your help ,I appreciate you effort ^_^
#17  
hello DJ Sures ,
plz I need ur code that display what robot see as in the picture
User-inserted image






plz send it to me as soon as possible.
PRO
Synthiam
#18  
It's a jpg file... here it is:

User-inserted image
#19  
DJ Sures ,
I need the code that display what robot see not the jpg file *sick* *sick*
I need the visual studio code
PRO
Synthiam
#21  
Or, if it's a plugin as the title says, view any of the examples or the code example that I had already provided to you.

You have more than you need - as there's even code written for you and pasted in this thread. There is literally nothing else anyone can do outside of flying to your city and sitting in front of your keyboard to physically type it. Please use the information provided to you.

You have been very unclear if this is an sdk program or a plugin. The title is misleading to the type of application that you are making. Either way, information for both those has been provided.
PRO
Synthiam
#22  
*warning: this is your final warning or your account will be banned. You have created second accounts and immaturely created numerous threads on the same topic with multiple accounts. If this behavior continues, your account and ip will be banned. You have a history of doing this on ezrobot forum. Including demanding posts and even posts with pages of emojis. You will be banned from any further simular behavior.

I have removed your other threads from duplicate accounts.
#23  
okay DJ Sures
but they aren't two account for the same person we're one team in a graduation project & when I failed to get my needs , my team leader ahmed logged in with his account. u can check my LinkedIn account to see that I'm an IT student.
thanks for being so aggressive.

note :-
we connect our jd robot from this lap & our whole project is on it so, the same IP is normal.
PRO
Synthiam
#24  
You and your team lead need to work on maturity and respect. Absolutely more assistance than is necessary has been provided to you. There is nothing more humanly possible that can be given to you.


1) You still have yet to respond to whether the project is sdk or plugin.

2) sdk code has been presented to you in this thread

3) sdk package contains nearly 50 examples, most of which contain camera

4) plugin code has been provided to you in this thread AND the plugin tutorial has been updated to include an entire new section of how to access the camera

5) plugin and sdk code to draw the camera image to a panel has been provided to you in this thread
PRO
USA
#25  
@shaimaabes,

Most of us have been students too (in my time it was much more difficult) limited internet, and no money to buy IT books, we hang out in public book stores, reading, copying code & information from store's books until a clerk pointed the exit door.

Windows Form Application Example code post #15:
the initial code have everything you need to handle the EZB camera video frames.

i took a small brake to improve the code, please check the github repository.

the code shows video feed in the form application, is not rocket science, but if you have doubts before, i really hope they will be gone.

i had also some extra concurrency code to prevent future issues.

User-inserted image
PRO
Synthiam
#26  
@ptp i should add that the OnNewFrame event will never execute twice. The event is indeed executed on a worker thread (not ui), however it will never execute concurrent or require locks.

If your OnNewFrame event runs for a lengthy time, any new frames that arrive will be skipped. The OnNewFrame event will only be raised when a new frame arrives and there is no current instance of the OnNewFrame event running.
#27  
Eng ,@ptp:)

thanks verrrrrrrrrryyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy muchhhhhhhhhhhhhhhhhhhh for ur kindness & ur smart behavior when u answering me , u are an excellent man , & no words would give u ur value .

yeah nw is mush better for students to learn but u know that sometimes our minds get stopped .

anyway I appreciate ur words , kindness & ur effort:)


User-inserted image
PRO
USA
#28  
yep, i assumed that

this is a good advice (re quote, to enforce the importance):

Quote:


If your OnNewFrame event runs for a lengthy time, any new frames that arrive will be skipped. The OnNewFrame event will only be raised when a new frame arrives and there is no current instance of the OnNewFrame event running.


the concurrency issues are:
OneSecondTimer_Tick (measuring) the fps counter, is a Windows Form Timer so the execution is in the UI thread and changing a counter variable same used for OnFrame event, minor detail to enforce two threads using the same variable.

OnNewFrame, Invoke to the UI/Control/Thread (i assumed it wasn't the ui thread, and you confirmed).

like i said no "rocket science code", but if you follow the good practices (even with simple code) it will save your neck later if you keep adding code:)

@DJ:
One little detail, the camera's close event is being called twice, i double checked the code... not a big deal, i noticed due the output debug.