Running OpenCV code in a real time thread would be an entirely different
matter, I suspect.  I do not know if the cv2 library would be compatible
with real time requirements, or what level of processing could be accomplished
in a reasonable fraction of a servo period.  You would also need to think
carefully about what camera you use.  I used a USB2 microscope camera, and
I suspect USB2 would be entirely incompatible with the realtime requirements.
Perhaps some PCI bus board with internal frame buffer could work, if OpenCV
could talk to it.  I normally just get UVC compatible cameras, but those are all
USB2.

If you wanted to really get into it, you could work with the machinekit fork, 
and use the Parallella board as your platform. That has a 16 core (or 64 core) 
processor that has had OpenCV ported already. There is also a Xilinx fpga 
(which contains two Arm cores that run Linux) that could be used for CNC 
tasks.  I have one sitting on my desk, but don't know when I'm going to have 
time to play with it.  There would still be the matter of camera communications.

-- Ralph
________________________________________
From: Javier Ros [j...@unavarra.es]
Sent: Wednesday, October 08, 2014 1:00 AM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] opencv for shape recognition

Very interesting Ralph.

I always wandered if it would be possible to do head position tracking for
robot calibration based on OpenCV. Do you think that this would be possible
using a real time HAL module, written in C, using the a PREEMPT RT PATH
real time based kernel?. If it is possible, I suppose that GPU power could
theoretically be made available to OpenCV operations.

What is you opinion?.

Thanks,

Javier


On Tue, Oct 7, 2014 at 9:20 PM, Ralph Stirling <
ralph.stirl...@wallawalla.edu> wrote:

> This is what I used to do machine vision homing a couple of years ago:
> FitElipse is a function that finds the best fit circle in the frame.  I
> can supply
> that function too if you like. It is adapted from examples I found online.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> # homecart.py
> import sys
> import urllib2
> import random
> import cv2.cv as cv
> import time
> import hal
>
> if __name__ == '__main__':
>
>     h = hal.component("homecart")
>     h.newpin("offset", hal.HAL_FLOAT, hal.HAL_OUT)
>     h.newpin("located", hal.HAL_BIT, hal.HAL_OUT)
>     h.ready()
>
>     capture = cv.CaptureFromCAM(0)
>
>     while True:
>         img = cv.QueryFrame(capture)
>
>         gimg = cv.CreateImage((640,480), cv.IPL_DEPTH_8U, 1)
>
>         cv.CvtColor(img, gimg, cv.CV_RGB2GRAY)
>
>         fe = FitEllipse(gimg, 116)
>         h['offset'] = fe.offset
>         h['located'] = fe.located
>
> In the hal file, I have:
>
> loadusr ./homecart              # Can't have .py on the end of the filename
>
> then I can use homecart.located and homecard.offset pins.  I can't find
> an example where I actually used it to do the homing though.  I must have
> gotten distracted by something else before I got that step completed.
>
> Hope this is useful.
>
> -- Ralph
>
>
>
> -- Ralph
> ________________________________________
> From: sam sokolik [sa...@empirescreen.com]
> Sent: Tuesday, October 07, 2014 11:59 AM
> To: Enhanced Machine Controller (EMC)
> Subject: Re: [Emc-users] opencv for shape recognition
>
> You make it sound /so/ easy...  :)
>
> sam
> On 10/7/2014 1:09 PM, andy pugh wrote:
> > On 7 October 2014 19:06, sam sokolik <sa...@empirescreen.com> wrote:
> >> this is my first real exposure to python. the next step is to see how I
> >> can fidldle hal stuff with it..
> > import hal
> >
> > make hal pins, job done :-)
> >
> >
>
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to