[OT] master/slave debate in Python

2018-09-23 Thread Albert-Jan Roskam
*sigh*. I'm with Hettinger on this.

https://www.theregister.co.uk/2018/09/11/python_purges_master_and_slave_in_political_pogrom/
-- 
https://mail.python.org/mailman/listinfo/python-list


P = (2^N) - Q

2018-09-23 Thread Musatov
If P is the set of primes, how do I write a program outputting the values of Q 
as an integer sequence with 1 integer of Q for each N?

Let the first prime be P1

P1=2
so if
N=0, Q=-1
as
2=(2^0) - (-1)

Let the second prime be P2

P2=3
so if
N=1, Q=-1
as
3=(2^1) - (-1)

Let the third prime be P3

P3=5
so if
N=2, Q=-1
as
5=(2^2) - (-1)

Let the fourth prime be P4

P4=7
so
N=3, Q=1
as
7=(2^3) - (1)

etc.

I want an integer sequence of Q beginning...

-1,-1,-1,1...

Does this make sense?
-- 
https://mail.python.org/mailman/listinfo/python-list


Need to find the centroid of a circular camera image

2018-09-23 Thread Gene Heskett
Greetings from a very poor python programmer, begging hat in hand;

I have an old lathe that has some bed wear, an linuxcnc has the 
facilities to correct that.  But it takes me surveying the machine for 
errors as the carriage is moved up and down the bed. Obviously I have to 
know what the error is, before I can correct it.

The best way is to mount a gunsighting laser in a 38 special caseing in a 
suitable adapter, and spin it in the lathes chuck, with a considerable 
neutral density filter in front of it, take a time exposure long enough 
to let the camera integrate the non-circular beam into a good circular 
pattern as the spindle turns at 500 to 1000 revs, then close 
the "shutter" save the image and locate the centroid of that saved 
image.

Is there code to do that centroid math in somebodies "bottom desk 
drawer"? Something I could download and control with a bash script which 
I'm fair at?

Thanks everybody.

-- 
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 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: P = (2^N) - Q

2018-09-23 Thread MRAB

On 2018-09-23 19:59, Musatov wrote:

If P is the set of primes, how do I write a program outputting the values of Q 
as an integer sequence with 1 integer of Q for each N?

Let the first prime be P1

P1=2
so if
N=0, Q=-1
as
2=(2^0) - (-1)

Let the second prime be P2

P2=3
so if
N=1, Q=-1
as
3=(2^1) - (-1)

Let the third prime be P3

P3=5
so if
N=2, Q=-1
as
5=(2^2) - (-1)

Let the fourth prime be P4

P4=7
so
N=3, Q=1
as
7=(2^3) - (1)

etc.

I want an integer sequence of Q beginning...

-1,-1,-1,1...

Does this make sense?

Re-arrange the equation to get Q = (2^N) - P. You should be able to work 
from that.

--
https://mail.python.org/mailman/listinfo/python-list


Re: Need to find the centroid of a circular camera image

2018-09-23 Thread Oscar Benjamin
On Sun, 23 Sep 2018 at 20:45, Gene Heskett  wrote:
>
> save the image and locate the centroid of that saved image.
>
> Is there code to do that centroid math in somebodies "bottom desk
> drawer"? Something I could download and control with a bash script which
> I'm fair at?

This is easy enough to in OpenCV. The code at the top of this page
does what you want:

https://docs.opencv.org/3.4.2/dd/d49/tutorial_py_contour_features.html

--
Oscar
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Need to find the centroid of a circular camera image

2018-09-23 Thread Gene Heskett
On Sunday 23 September 2018 16:24:23 Oscar Benjamin wrote:

> On Sun, 23 Sep 2018 at 20:45, Gene Heskett  
wrote:
> > save the image and locate the centroid of that saved image.
> >
> > Is there code to do that centroid math in somebodies "bottom desk
> > drawer"? Something I could download and control with a bash script
> > which I'm fair at?
>
> This is easy enough to in OpenCV. The code at the top of this page
> does what you want:
>
> https://docs.opencv.org/3.4.2/dd/d49/tutorial_py_contour_features.html
>
That looks like about what I'm looking for. Playing around this afternoon 
I find the laser isn't terribly well aligned, but neither is the chuck 
I've got it mounted in, so the beam path of the pattern 30" away ranges 
in the 10-12 mm diameter area.  Way too big to just shine it straight 
onto the imaging chip. So I'll have to interpose a frosted surface, and 
focus the camera on that frosted surface in order to get that image path 
on the cameras imaging chip. Problems, but not insurmountable.

Thank you very much, Oscar.

-- 
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 
-- 
https://mail.python.org/mailman/listinfo/python-list