How do you connect higher resolution cameras??

314 views
Skip to first unread message

Marek T.

unread,
Jun 16, 2017, 1:06:23 PM6/16/17
to OpenPnP
I have bought two ELP cameras, one narrow angle 1Mpx for downlooking camera, second wide angle 2Mpx for uplooking (also one 5Mpx for future solutions).
I have huge problems to run them, the facts as follow:
- both simultaneously connected just to Win7-64 are working excellent set at their full resolution and 25fps. Tested running two copies of vmcap software.
- connected to Openpnp works fatal with opencvcamera drivers (webcams moreless the same). Each camera connected to separated USB-hub.

- Downlooking camera set as 1Mpx resolution doesn't want to recognize fidushales at all. Even when "parked" straight on it. Visualy picture looks perfectly - but not for software. Tried to tune it with every settings of camera including auto and auto-off. Tried with more and less LED light, more from down, more from side... everything for nothing. 95 probes on 100 failed.
- works quite good when resolution set to native (0=640x480) and 15fps. 99 probes on 100 succesful!
- but how to use 1Mpx for some feeders etc...

- Bottom Vision camera set as 2Mpx (dreamed to cover the parts from 0402-40x40mm) doesn't want work same as above. Even if set as 5fps. 95/100 "erors". Pipeline tunned of course not default.
- Resolution set 1080x796 at 5fps started working much better but not ideal yet. Tested on some PLCC44 works good enough 75/25. But sometimes can recognize and draw only 2-3 pads' contours of 44!

So I'm wondering how do you connect 5 or 12Mpx cameras (as PK mentioned that want to do??) Can't imagine how is this possible at all. What may I have wrong with my software/system? Hardware (I mean PC+WIN system) seems to be ok. Thinking to use Paul Jones' USB>IP drivers, has this sense or some other advise maybe?

Maybe important: My Openpnp is not working always the same fast. Sometimes when pick up the part from feeder is standing there some 1-2sec untill goes to bottom camera (nothing wrong in log visible). But sometimes runs at once without any delay. The same about bottom vision, sometimes the process including placement decission takes ~1.5sec but sometimes 3-4. Controllers answer without any suspected delays. Feel totaly confused with this... Some idea?

regards
Marek

Trampas Stern

unread,
Jun 16, 2017, 1:44:22 PM6/16/17
to OpenPnP
First off the delay could be due to saving images if you have logging on. 

One of the things I have noticed with OpenPnP is there are some assumptions with vision. Some vision algorithms require the pixels per mm for the camera to be set correctly, others do not. I think the fiducials are ones which require this.  Also of course changing the resolution of camera can change the aspect ratio and the pixels to mm setting.  So if you change resolution you should re-calibrate camera. 

Additionally of course the vision is highly dependent on the lighting, even if image looks good to eye it does not mean it is good enough for the algorithm to handle. 

Trampas

Marek T.

unread,
Jun 16, 2017, 2:13:13 PM6/16/17
to OpenPnP
Hi Trampas

All my settings are in mm. Re-calibrate is obvious and made in every cases when changed the resolution.
Also your point about the lightning is clear for me and I have tried some different combination. My light is 12 white leds turned on constantly and looking up not 45 deg from side - this option last to try.

Jason von Nieda

unread,
Jun 16, 2017, 2:14:27 PM6/16/17
to ope...@googlegroups.com
https://github.com/openpnp/openpnp/wiki/USB-Camera-Troubleshooting-FAQ explains the camera situation in deep detail. The bottom line is that this is a software limitation and until it's fixed you have to have separate USB host controllers if you want to run full resolution. Other software can do this because it doesn't have the same limitation, and it uses compressed modes for the camera.

If you are having trouble with fiducials, see https://github.com/openpnp/openpnp/wiki/USB-Camera-Troubleshooting-FAQ and if that doesn't help then Submit Diagnostics so we can see the images: https://github.com/openpnp/openpnp/wiki/Getting-Help#submit-diagnostics

Same with bottom vision, use the Submit Diagnostics feature to send example images. This allows us to see what is actually happening.

Jason


--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/06512b87-8434-4722-97ec-eeed01bbd836%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marek T.

unread,
Jun 16, 2017, 2:49:14 PM6/16/17
to OpenPnP
Hi again Jason,

I know this explanation but I have both cameras on separated USB host controllers! Without this Openpnp didn't want to work with them at all (when added second camera the previously connected was dyeng), now can at least connect two cameras and see anything...
Fiducials work for me with 640x480 but not when higher resolution. More diagnostics when come back from vacation after June.27.

Jason von Nieda

unread,
Jun 16, 2017, 2:52:38 PM6/16/17
to ope...@googlegroups.com
Okay, if they are on two separate host controllers (not just hubs, but host controllers) and you can't get full resolution, please explain what is happening. You said "connected to Openpnp works fatal with opencvcamera drivers" but this doesn't tell me anything about what you are experiencing. Is there a crash, or a lockup, or just no image? Anything you can describe will be helpful.

And yes, when you have time, please use the submit diagnostics function to show some images.

Also, as someone else mentioned, if you are changing the resolution of the camera you have to, at least, also change the units per pixel and lens calibration (if enabled) as both of these are tied to the resolution. Having the wrong units per pixel will definitely caused fiducials to fail.

Jason


Message has been deleted

Jason von Nieda

unread,
Jun 16, 2017, 3:27:21 PM6/16/17
to OpenPnP
Okay, so if I understand correctly, you are able to use both cameras at their full resolution (2MP and 1MP) but you have to turn down the frame rate for performance. Is that correct?

In this case, you should have no problem recognizing fiducials at 1MP. I'll wait to see the pictures you send. This will tell us what is really happening. Until we see the pictures it's just guessing.

Jason



On Fri, Jun 16, 2017 at 2:20 PM Marek T. <marek.tw...@gmail.com> wrote:
Sorry for being not precise about hub/host.
I have already answered for Trampas: performed re-calibration each time when change the resolution.

Effect for an eye:
If I set full resolution for both cameras (2Mpx and 1Mpx) then have both visions. But can set this 1Mpx max 15fps and this 2Mpx no more than 5-10fps then moreless ok (otherwise the vision stacks). It's enough.

For the machine:
When set 1Mpx resolution  for Fiducials can't recognize them at 90% probes (remember to try paly with longer settle time). Fiducials at VGA@15fps recognized perfectly.
When set 2Mpx resolution for Bottom - can't allign parts at some 90% allignments (tuned pipeline of course, maybe still not good enough). Bottom vision at 1Mpx@5fps 95/100 ok (still not 100/100, maybe it must be so).

Ok, I know may live with fiducials VGA@15fps, but it seems be to poor when using it for some feeders service.
Ok, I know may live with bottom 1Mpx@5fps, but when processing PLCC which is not small and not large. Haven't tried with 0402 yet but 1Mpx seems be to low resolution for it, and if I must use wide angle to cover parts sizes up to 40x40mm.

Still would like to know how people connects 5-12Mpx cameras to get it working?

Marek T.

unread,
Jun 16, 2017, 3:32:01 PM6/16/17
to OpenPnP
Sorry for being not precise about hub/host.
I have already answered for Trampas: performed re-calibration each time when change the resolution.

Effect for an eye:
If I set full resolution for both cameras (2Mpx and 1Mpx) then have both visions. When set this 1Mpx max 15fps and this 2Mpx no more than 5-10fps then moreless ok (when set more fps for this 2Mpx the vision is jamming). It's enough.


For the machine:
When set 1Mpx resolution  for Fiducials can't recognize them at 90% probes (remember to try paly with longer settle time). Fiducials at VGA@15fps recognized perfectly.
When set 2Mpx resolution for Bottom - can't allign parts at some 90% allignments (tuned pipeline of course, maybe still not good enough). Bottom vision at 1Mpx@5fps 95/100 ok (still not 100/100, maybe it must be so).

Ok, I know may live with fiducials VGA@15fps, but it seems be to poor when using it for some feeders service.
Ok, I know may live with bottom 1Mpx@5fps, but when processing PLCC which is not small and not large. Haven't tried with 0402 yet but 1Mpx seems be to low resolution for it, and if I must use wide angle to cover parts sizes up to 40x40mm.

Still would like to know how people connects 5-12Mpx cameras to get it working?

Marek T.

unread,
Jun 16, 2017, 3:44:26 PM6/16/17
to OpenPnP
Moreless correct. I can use 2MP+1MP with not full resolution, and the picture from them looks lovely for an eye.
But with these parameters both visions don't work correctly to recognize fidu or allign properly. Begin to work quite good when turn down their resolution to VGA and 1MP.

PK

unread,
Jun 16, 2017, 5:08:47 PM6/16/17
to OpenPnP
We struggled with fiducials for a long time. Like you, the captured images looked good, but it turns out that this is misleading, you don't want the captured image to look good.

Machine vision isn't something we have much experience with, but I do have a photography background. Sticking with what I knew, we just kept trying different lighting setups.
In the beginning we were using the ring light that came with the machine. This, along with the HASL finish on the boards, just didn't work.  If we tinned the fiducials and screbbed the solder mask with steel wool it got better though. Comparing the debug pictures from the ones that worked and the ones that didn't provided the answer. In every case, the capture image from the correctly identified fiducial featured the exposed pad/dot, over exposed or 'burnt out'.  So we locked the exposure on the camera, and soldered LEDs with long leads to the ring light board, then we bent the LED's so that their bodies were right up against the lens of the camera and pointing straight down. This provided more light reflected back from the fiducial mark.
The raw captures looked worse, but the pipeline worked..

I'm going in today, and will try to get a picture of the lighting setup.

PK
Message has been deleted

Marek T.

unread,
Jun 16, 2017, 5:22:13 PM6/16/17
to OpenPnP
Jason, maybe it was discussed but I haven't found.
My bottom vision light is constantly turned on (not controlled from gcodes like my downlooking light). On many movies the nozzle comes to camera and then the lightning is turned on for the time of the pictures taking only. Is there some verified information which solution is better working for the parts aligning?

Thx for info Paul. I see moreless the same effect, good looking picture doesn't mean best recognizing effects. Good to see your cameras (both) with their lightnings. Btw: what the resolutions/fps you use for both cameras?

PK

unread,
Jun 16, 2017, 7:21:25 PM6/16/17
to OpenPnP


On Saturday, June 17, 2017 at 5:22:13 AM UTC+8, Marek T. wrote:
Jason, maybe it was discussed but I haven't found.
My bottom vision light is constantly turned on (not controlled from gcodes like my downlooking light). On many movies the nozzle comes to camera and then the lightning is turned on for the time of the pictures taking only. Is there some verified information which solution is better working for the parts aligning?

Take a look at the scripts examples (iirc) there is one for turning the light on and of before the imaging, be careful of autoexposure settings on the cameras though. We have it turned off for the top camera, the bottom camera just has a long delay programmed in.  We'll change that soon. 

Thx for info Paul. I see moreless the same effect, good looking picture doesn't mean best recognizing effects. Good to see your cameras (both) with their lightnings. Btw: what the resolutions/fps you use for both cameras?t
We haven't set them, so they will be running at the default.  I'll check the resolution of the debug images in a few hours..

PK

PK

unread,
Jun 16, 2017, 10:22:56 PM6/16/17
to OpenPnP
OK, here;s the worlds worst pic of the hacked ring light..  Getting a camera in there is like trying to take a photo of your own arse!

Both top and bottom cameras are capturing at 640x480.
PK
top_camera_leds.JPG

Marek T.

unread,
Jun 17, 2017, 3:21:11 AM6/17/17
to OpenPnP
I know and use these scripts, but to turn on/off lightening of downlooking camera not bottom vision (to don't make bottom camera blind from upper light). Bottom vision has lightening nonstop on. Maybe it's some mistake but I thought it can't be only better.
If you didn't set resolution but left native (0 settings) then probably you run at some low resolution. I.e. my 1MP ELP use VGA at this settings set by Openpnp.

Marek T.

unread,
Jun 17, 2017, 3:38:23 AM6/17/17
to OpenPnP
Interesting lightening you made.
So at 640x480 it must work very smoothly. But no big reason to buy high-res camera and use at VGA... How about recognizing 0402 at this resolution?

PK

unread,
Jun 17, 2017, 5:55:42 AM6/17/17
to OpenPnP


On Saturday, June 17, 2017 at 3:38:23 PM UTC+8, Marek T. wrote:
Interesting lightening you made.
It was VERY interesting after we spent a whole day trying to make fiducials work!  :-)
 
So at 640x480 it must work very smoothly. But no big reason to buy high-res camera and use at VGA... How about recognizing 0402 at this resolution?
Yes, it does seem to work well for 0805, TQFP64, SOT 23 size packages.  We haven't tested with 0402's yet, I tried to make a nozzle and snapped two 0.35mm drill bits!  So I've ordered some body piercing needles that I'll press/loctite into the nozzle body.
I too have a 5MP camera sitting there spare, just in case...
PK 

Marek T.

unread,
Jun 17, 2017, 10:35:04 AM6/17/17
to OpenPnP
I have used 12 DIP leds with light diffusors (haven't seen smd leds with that lens) and at VGA resolution the fiducials worked for me at once, just luck. But defeat at 1MP yet, maybe it's problem of light, need more tests.
Also have 5MP but haven't tried to connect it yet when found so many problems with 2MP. I will try to search solution to convert these USB to IP on Windows level and connect these cameras to Openpnp using it's IP driver, just for test and comparison of efficiency to opencvcamera driver. Easy with Linux but more complicated with Windows. Maybe someone has tested it already?

PK

unread,
Jun 17, 2017, 6:20:05 PM6/17/17
to OpenPnP
Yeah, we had stability problems with the cameras. I'm sure it was 80% electrical noise and 20% windows USB drivers. Try running with the usb cable hanging in the air , not in the cable chain?  We ended up with a few ferrites on motor leads....
Since we found a setup that worked, it's been nearly 100% reliable
PK

Marek T.

unread,
Jun 28, 2017, 11:13:24 AM6/28/17
to OpenPnP
Today I have changed PC from "2core AMD, 2.6GHz, 3GB-ram" into "AMD A8 3.3GHz, 16GB-ram" and with both cameras set to 25fps everything is shown in Openpnp perfectly now! Very smoothly, without any video stucks - just like should be.
But have strange effect. Both computers (both with WIN7 Enterprise and Ultimate) crashes with bluescreen while turning the system off, after prior longer Openpnp using. Never got this efect when Openpnp is not used before. @Cri-s advises to me to try run Java with more memory assigned using x-arguments what I will test tomorrow, it sounds very sensual. But I'm curious if it is some common problem or occurs at my computers only??

regards
Marek

btw. My problems with fiducial recognition have moved to more accurate thread about this:
https://groups.google.com/forum/#!msg/openpnp/N72k_zPgByQ/occCebJ3CQAJ

PK

unread,
Jun 28, 2017, 8:05:18 PM6/28/17
to OpenPnP
That does sound odd..

Marek T.

unread,
Jun 29, 2017, 10:31:26 AM6/29/17
to OpenPnP
Tried today with 4096M of memory assigned for Java. The same effect, crash of the Windows while shuting down the PC. Next I have turned PC on again, run Openpnp for some 1 minute (drivers, homing only, nothin more) and close Windows again - and everything normaly. So bluescreen only when few hours of play with Openpnp. Understand nothing, maybe debug/trace??? which have turned on non-stop, will try tomorrow without this. No idea what the reason of this, specialy that two computers the same effect.

Jason von Nieda

unread,
Jun 29, 2017, 10:36:54 AM6/29/17
to OpenPnP
Are you closing OpenPnP before you exit windows? Check task manager to make sure it has fully closed before you shutdown.

User mode programs usually can't cause the OS to crash, so this is likely a driver issue, probably with the video capture drivers.

Jason

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Marek T.

unread,
Jun 29, 2017, 12:22:49 PM6/29/17
to OpenPnP
Hi Jason,

Of course I close anything I can before closing the Windows. Haven't checked Openpnp in task manager as have not expected the crash... tomorrow I will make sure of it.
About the video capture drivers - do you mean they can be a problem in case when Openpnp has stucked in processes, or also in case when OpenPnp closed properly? If you mean the second case - some advise how to solute it?

Jason von Nieda

unread,
Jun 29, 2017, 12:26:13 PM6/29/17
to OpenPnP
This is just a "hunch". Based on a lot of experience with video capture I've found that the OS drivers for these devices tend to be fragile and can easily crash the OS. I've found this to happen when the device is not closed properly. OpenPnP closes the device when it shuts down, so as long as it's shutting down properly this shouldn't be an issue. But if you are finding that it is sticking in task manager than it might not be shutting down, which might leave the capture device open, which might cause a crash.

Unfortunately there isn't a lot you can do aside from try to make sure you have all your OS updates in place. I would also check to see if you have any other software installed that accesses the cameras as there could potentially be a conflict. 

Jason


Matt Brocklehurst

unread,
Jun 29, 2017, 12:44:34 PM6/29/17
to ope...@googlegroups.com
Have you run a 12 hour burn in on the machine? Ie tax the hardware for a while make sure it's nothing like the psu can't cope with the extra 6 power hungry cores? Might not be OpenPNP just the fact it's putting the machine under load?

Sent from my iPhone

Eagle Media

unread,
Jun 29, 2017, 1:19:42 PM6/29/17
to OpenPnP
I'm sorry, what are You talking about?
This is a very low end application.


Am Donnerstag, 29. Juni 2017 18:44:34 UTC+2 schrieb Matt Brocklehurst:
Have you run a 12 hour burn in on the machine?
Sent from my iPhone

Marek T.

unread,
Jun 29, 2017, 4:27:15 PM6/29/17
to OpenPnP
Clear Jason. I will check manager every time when close WIN and tell you what was the OpenPNP status in it if system crashes.

Matt Brocklehurst

unread,
Jun 29, 2017, 5:47:27 PM6/29/17
to ope...@googlegroups.com
My point being the pc was stable but slow then it's had a new cpu and it becomes unstable ? 

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Eagle Media

unread,
Jun 29, 2017, 7:36:19 PM6/29/17
to OpenPnP
Ah, OK, I understand You. Well I thought if somebody building a PnP machine he knows to build a stable PC system.

Eagle Media

unread,
Jun 29, 2017, 7:55:21 PM6/29/17
to OpenPnP
It sounds very strange to me, never heared such problems in video applications on industrial pc systems.
I would say it's driver on system level.

1) Can You check the Memory?
2) Can You try a regular Intel based PC without integrated video?
3) Try with 8 MBytes-and again swapping the modules.

What is the resolution You are running?
Reply all
Reply to author
Forward
0 new messages