Re: [Emc-users] Real-Time Image procesing in HAL (WAS opencv for shape recognition...)

2014-10-17 Thread Javier Ros
Thanks for your answers.

This looks like an important problem to me, looking at the foreseable
future Artificial Vision is going to have a preeminent role everywhere. I
expect machines including CNC controls making some use of it, anv envision
some CNC paradigm changes, leaded by this "revolution".

As from LinuxCNC manual page, it says:


DESCRIPTION
hal_create_thread establishes a realtime thread that will execute one or
more HAL functions periodically.
All thread periods are rounded to integer multiples of the hardware timer
period, and the timer period is
based on the first thread created. Threads must be created in order, from
the fastest to the slowest. HAL
assigns decreasing priorities to threads that are created later, so
creating them from fastest to slowest results
in rate monotonic priority scheduling.
...

So it is rate monotonic scheduling.

So I think that the slow task, no matter how slow, will get scheduled. The
only requirement, would be to get the period for the slow thread, big
enough recording and, so that it can finish with the image grabbing
processing.

It would be nice to know, if opencv has been written with real time in
mind, so that memory allocation, pagefaults "et al." works in a compatible
way can be taken away from the show time.

A interesting question would be to know, how well multicore procesors are
taken advantage by LinuxCNC HAL. Let say, can we reserve a couple of
processors ans schedule different threads in different cores?. Would HAL
execute different functions in the same thread at different cores?.


Thanks very much for your answers. I apologize for my late reply :),

Javier
--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Real-Time Image procesing in HAL (WAS opencv for shape recognition...)

2014-10-17 Thread andy pugh
On 17 October 2014 20:04, Javier Ros  wrote:
> It would be nice to know, if opencv has been written with real time in
> mind, so that memory allocation, pagefaults "et al." works in a compatible
> way can be taken away from the show time.

For many applications the image processing won't need to be real-time.
Tracking items on a moving conveyor might require real-time machine
vision, but things like spotting marks or choosing stationary targets
can be handled in userspace, with a module that just says "I got one,
here it is"

-- 
atp
If you can't fix it, you don't own it.
http://www.ifixit.com/Manifesto

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Real-Time Image procesing in HAL (WAS opencv for shape recognition...)

2014-10-17 Thread Gene Heskett
On Friday 17 October 2014 15:04:08 Javier Ros did opine
And Gene did reply:
> Thanks for your answers.
> 
> This looks like an important problem to me, looking at the foreseable
> future Artificial Vision is going to have a preeminent role everywhere.
> I expect machines including CNC controls making some use of it, anv
> envision some CNC paradigm changes, leaded by this "revolution".
> 
> As from LinuxCNC manual page, it says:
> 
> 
> DESCRIPTION
> hal_create_thread establishes a realtime thread that will execute one
> or more HAL functions periodically.
> All thread periods are rounded to integer multiples of the hardware
> timer period, and the timer period is
> based on the first thread created. Threads must be created in order,
> from the fastest to the slowest. HAL
> assigns decreasing priorities to threads that are created later, so
> creating them from fastest to slowest results
> in rate monotonic priority scheduling.
> ...
> 
> So it is rate monotonic scheduling.
> 
> So I think that the slow task, no matter how slow, will get scheduled.
> The only requirement, would be to get the period for the slow thread,
> big enough recording and, so that it can finish with the image
> grabbing processing.
> 
> It would be nice to know, if opencv has been written with real time in
> mind, so that memory allocation, pagefaults "et al." works in a
> compatible way can be taken away from the show time.
> 
> A interesting question would be to know, how well multicore procesors
> are taken advantage by LinuxCNC HAL. Let say, can we reserve a couple
> of processors ans schedule different threads in different cores?.
> Would HAL execute different functions in the same thread at different
> cores?.
> 
> 
Data point only.

Box is atom D525MW, using isolcpu's.

Even with a 40 kilohertz base thread, a 4 kilohertz servo-thread works 
well.  But it did not do a thing for the noise from the encoder other than 
make it fast enough I could lowpass filter it a bit without mucking with 
the PID stability.

Now I have a 5i25, no base-thread, still works well at 4 kilohertz.

> Thanks very much for your answers. I apologize for my late reply :),
> 
> Javier
> ---
> --- Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push
> notifications. Take corrective actions from your mobile device.
> http://p.sf.net/sfu/Zoho
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Real-Time Image procesing in HAL (WAS opencv for shape recognition...)

2014-10-17 Thread Gene Heskett
On Friday 17 October 2014 15:30:10 andy pugh did opine
And Gene did reply:
> On 17 October 2014 20:04, Javier Ros  wrote:
> > It would be nice to know, if opencv has been written with real time
> > in mind, so that memory allocation, pagefaults "et al." works in a
> > compatible way can be taken away from the show time.
> 
> For many applications the image processing won't need to be real-time.
> Tracking items on a moving conveyor might require real-time machine
> vision, but things like spotting marks or choosing stationary targets
> can be handled in userspace, with a module that just says "I got one,
> here it is"

Driving the machine to center that mark so you can record it using the 
align package, is however pretty frustrating when its 5 seconds after you 
have taken the finger off the moveit key before the camera shows you where 
its actually at.  In fact, its a right pain in the arse.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Real-Time Image procesing in HAL (WAS opencv for shape recognition...)

2014-10-17 Thread andy pugh
On 17 October 2014 20:57, Gene Heskett  wrote:

> Driving the machine to center that mark so you can record it using the
> align package, is however pretty frustrating when its 5 seconds after you
> have taken the finger off the moveit key before the camera shows you where
> its actually at.

That's not a "realtime" issue, that's a "computer too slow" issue.

If that 5 seconds was servo thread time just think what else would be
going wrong..

-- 
atp
If you can't fix it, you don't own it.
http://www.ifixit.com/Manifesto

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Real-Time Image procesing in HAL (WAS opencv for shape recognition...)

2014-10-17 Thread Gene Heskett
On Friday 17 October 2014 16:59:33 andy pugh did opine
And Gene did reply:
> On 17 October 2014 20:57, Gene Heskett  wrote:
> > Driving the machine to center that mark so you can record it using
> > the align package, is however pretty frustrating when its 5 seconds
> > after you have taken the finger off the moveit key before the camera
> > shows you where its actually at.
> 
> That's not a "realtime" issue, that's a "computer too slow" issue.
> 
> If that 5 seconds was servo thread time just think what else would be
> going wrong..

I don't think so Andy, because theres at least 4 or 5 full processes 
looking at and possibly adding to that image between the camera and the 
display window.  I have tried a much slower base thread and the lag was 
still the same.  Looking at the camera itself with something like cheese, 
it is much faster, but thats right out of the camera, raw. No cropping, 
DRO additions & no crosshairs or target circles added, I suspect a faster 
USB might help some, and a cpu running at 15ghz would help, but thats an 
1.4ghz atom & thats all on one core.  Firefox doesn't lag, and neither 
does konversation, the IRC client.  Typically both are running.

Camunits runs at a low enough priority, but all that buffer copying 
between the various video treatment modules does take time.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Real-Time Image procesing in HAL (WAS opencv for shape recognition...)

2014-10-17 Thread Charles Buckley
Not sure if the following link will be helpful for anyone, but I did
stumble across it.

http://derekmolloy.ie/beaglebone/beaglebone-video-capture-and-image-processing-on-embedded-linux-using-opencv/


On Fri, Oct 17, 2014 at 5:16 PM, Gene Heskett  wrote:

> On Friday 17 October 2014 16:59:33 andy pugh did opine
> And Gene did reply:
> > On 17 October 2014 20:57, Gene Heskett  wrote:
> > > Driving the machine to center that mark so you can record it using
> > > the align package, is however pretty frustrating when its 5 seconds
> > > after you have taken the finger off the moveit key before the camera
> > > shows you where its actually at.
> >
> > That's not a "realtime" issue, that's a "computer too slow" issue.
> >
> > If that 5 seconds was servo thread time just think what else would be
> > going wrong..
>
> I don't think so Andy, because theres at least 4 or 5 full processes
> looking at and possibly adding to that image between the camera and the
> display window.  I have tried a much slower base thread and the lag was
> still the same.  Looking at the camera itself with something like cheese,
> it is much faster, but thats right out of the camera, raw. No cropping,
> DRO additions & no crosshairs or target circles added, I suspect a faster
> USB might help some, and a cpu running at 15ghz would help, but thats an
> 1.4ghz atom & thats all on one core.  Firefox doesn't lag, and neither
> does konversation, the IRC client.  Typically both are running.
>
> Camunits runs at a low enough priority, but all that buffer copying
> between the various video treatment modules does take time.
>
> Cheers, Gene Heskett
> --
> "There are four boxes to be used in defense of liberty:
>  soap, ballot, jury, and ammo. Please use in that order."
> -Ed Howdershelt (Author)
> Genes Web page 
> US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS
>
>
> --
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://p.sf.net/sfu/Zoho
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>
--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users