Page 2 of 3
Re: some camera advice/findings
Posted: Wed Apr 20, 2016 11:19 am
by WayOutWest
vonnieda wrote:I've been having very good luck with this by using the HSV color space.
Actually I don't think HSV had anything to do with it... you covered up the curves with a flat disc to hide the curves!
I'd like to see the before/after shots of your HSV manipulations without the green disc in place.
I tried HSV initially too; I would convert to HSV then multiply the V (intensity) by the H-distance from the color point to pure green. So the closer to green, the more blackened the post-transform image would be. The problem was that shades of gray, like you get from curvature and shadows, have have ill-defined/degenerate hue in the HSV colorspace. So if you have a field of black/white/gray and you look at the H component after HSV you'll see some pretty wild noise.
Here's what the curvy part of the nozzle looks like:
- upcam.jpg (65.17 KiB) Viewed 6466 times
I subtract pretty much everything between yellow and blue which gets the vast majority of the nozzle
Okay, with you so far...
and then the threshold gets everything that was too dark to discern a color from.
What about gray? For example a 50% gray has a very unstable hue; changing one of its RGB components by even the tiniest bit can change its hue from perfect-green to perfect-yellow. And it isn't dark at all (50% gray has 50% intensity/V).
If I do this, here's what I get:
- upcam2.jpg (84.29 KiB) Viewed 6466 times
Did you mean that you did something to pixels which had too little saturation? But if so, what?
Thanks,
Re: some camera advice/findings
Posted: Wed Apr 20, 2016 4:22 pm
by vonnieda
WayOutWest wrote:vonnieda wrote:I've been having very good luck with this by using the HSV color space.
Actually I don't think HSV had anything to do with it... you covered up the curves with a flat disc to hide the curves!
I'd like to see the before/after shots of your HSV manipulations without the green disc in place.
I tried HSV initially too; I would convert to HSV then multiply the V (intensity) by the H-distance from the color point to pure green. So the closer to green, the more blackened the post-transform image would be. The problem was that shades of gray, like you get from curvature and shadows, have have ill-defined/degenerate hue in the HSV colorspace. So if you have a field of black/white/gray and you look at the H component after HSV you'll see some pretty wild noise.
Here's what the curvy part of the nozzle looks like:
I subtract pretty much everything between yellow and blue which gets the vast majority of the nozzle
Okay, with you so far...
and then the threshold gets everything that was too dark to discern a color from.
What about gray? For example a 50% gray has a very unstable hue; changing one of its RGB components by even the tiniest bit can change its hue from perfect-green to perfect-yellow. And it isn't dark at all (50% gray has 50% intensity/V).
If I do this, here's what I get:
Did you mean that you did something to pixels which had too little saturation? But if so, what?
Thanks,
The green disk is above the entire nozzle assembly from the perspective of the camera. It doesn't cover anything with regards to the nozzle. It only covers visual clutter on my head. Here it is in place so you can see what I mean:
- IMG_3010.JPG (225.8 KiB) Viewed 6460 times
The reason you didn't see any of the curves in the video I posted is that the chip was larger than the nozzle's diameter from the camera's perspective, so it was fully covered. Here are some examples with smaller parts:
- Screen Shot 2016-04-20 at 8.07.37 AM.png (373.7 KiB) Viewed 6460 times
- Screen Shot 2016-04-20 at 8.07.59 AM.png (150.54 KiB) Viewed 6460 times
- Screen Shot 2016-04-20 at 8.08.15 AM.png (369.63 KiB) Viewed 6460 times
- Screen Shot 2016-04-20 at 8.08.28 AM.png (148.56 KiB) Viewed 6460 times
The pipeline I am using roughly does the following:
Gaussian blur 9x9: Reduce noise in the image
Mask circle to center 525 pixels: Chop out everything outside the vision disk, primarily to remove visible head objects
Convert color from BGR to HSV_Full
Mask HSV subtracting all pixels with hue 60-130 at any V or S
Convert color from HSV_Full to BGR_Full
Convert color from BGR to gray
Threshold 100: primarily removes any visible bits of the black nozzle tip
Find contours
Filter any contours smaller than 50 pixels: Removes contours created by dust, noise
Draw the contours in white on a completely black background
Get min area rect of all the white pixels in the frame (basically finding the bounding box of all the previous contours)
So far this is working well for my entire test image data set, which is 24 different parts imaged at 3 different angles each. You can see those images at
https://www.dropbox.com/s/troh0pgt5jt4l ... 7.zip?dl=0
The only issue I have currently is that I need to adjust the MaskCircle stage based on the height of the part since the vision disk "shrinks" as the nozzle is raised to accommodate taller parts. You can see the problem in the "05_" series of images.
Jason
Re: some camera advice/findings
Posted: Wed Jun 08, 2016 10:37 am
by dampfboot
Because of this posts I installed two logiteh C270 on my machine. It's running nice with it.
Unfortunately I get random camera errors while using the machine and/or placing parts. A red cross shows up instead of the camera view and I get an error message. After quitting the error message the machine keeps up placing but do not show a camera picture anymore.
I am running the latest Liteplacer Software on a Win 8.1 System on a Lenovo Thinkpad with an i5 processor and 4 GB RAM. The cameras are directly connected to one of the 4 different USB connectors of the laptop. I cross changed the cameras to the different connectors randomly already. I also tried the different camera settings in the Liteplacer Software makes no difference. I also tried it with a Windows running on a MAC Book of a friend - same issue.
1) @all
Any idea how to solve this problem - I am even willing to use/buy an other computer or trying out a different OS - but I would like to stay with the C270.
2) @Juha
After quitting the error message the software uses the cameras again correct but don't show the image on the screen - it would be nice if the software could display the image to the screen again also.
Thanks for your suggestions and help
Re: some camera advice/findings
Posted: Sat Jun 11, 2016 5:26 pm
by dampfboot
Me again:
I tried a second computer with win 7 and 8 MB RAM but I still get the red cross on the camera screen by chance.
Next step will be to go to a more modern computer with USB3 ports - even if i am not using USB3 the controller might be more sophisticatd and maybe that helps.
@Juha
Do you have any idea why the visual system stops working that way. I am a mechanical engineer and don'T have the ability to look deeper into the vision code. What do you think.
- is it some sort of memory problem
- some sort of hardware problem
. a connection problem
You must have programed the routine which shows the red cross so you might know when it will appear?
Is there any kind of error file which I could send or publish here. Even if I am not a customer of your hardware this problem might appear with your customers alos!
Rainer
Re: some camera advice/findings
Posted: Mon Jun 13, 2016 1:37 pm
by JuKu
> You must have programed the routine which shows the red cross so you might know when it will appear?
No, that's the standard Windows "broken image link" function. I don't know why that happens. I'm still looking. One thing I do know (and will fix asap) is that the software doesn't handle the situation where a camera is found in the past, but goes away unexpectedly. In other words, it might be a connection issue or USB bandwidth, which might break the connection momentarily.
Re: some camera advice/findings
Posted: Mon Jun 20, 2016 9:31 am
by dampfboot
I tried several core i5 computer with Win8.1 and Win 7 but get the red cross with all of it randomly with this message:
object is used currently elswhere
You can find quite some hints for this problem with this google search
windows camera "object is used currently elswhere"
I don't know anything about that. Does anybody else get such error messages too?
Re: some camera advice/findings
Posted: Tue Jun 21, 2016 8:48 am
by JuKu
Thank you! It has been very frustrating trying to fix an issue that never happens for me. Now when you get an actual error message with the red cross, I have a good idea what is the reason. I built a version for testing. I would appreciate if you would try this install and tell if anything changes, for better or worse:
http://www.liteplacer.com/Downloads/Lit ... 6_2016.exe
No promises (other than this version runs just as good (without errors) on my machine as the previous one) but it might be the fix.
Re: some camera advice/findings
Posted: Tue Jun 21, 2016 9:42 am
by dampfboot
Thanks for this quick try to help!
Will try it out when I am back home tonight.
Rainer
Re: some camera advice/findings
Posted: Wed Jun 22, 2016 9:41 am
by JuKu
I got feedback from the test release already, and the test was successful, but did not completely cure the issue. A more comprehensive (complete?) fix for this issue is in today's release:
http://www.liteplacer.com/Downloads/Lit ... 6_2016.exe
Re: some camera advice/findings
Posted: Thu Jun 22, 2017 8:24 pm
by mike58
Hello
Thanks for sharing this information gentleman!
The conclusion is two C270 cameras or did this development continue ?