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

2018-09-24 Thread Gene Heskett
On Monday 24 September 2018 18:47:08 Dennis Lee Bieber wrote:

> On Mon, 24 Sep 2018 12:06:19 -0400, Gene Heskett
> 
>
> declaimed the following:
> >On Monday 24 September 2018 10:55:23 Chris Angelico wrote:
> >> On Tue, Sep 25, 2018 at 12:54 AM Gene Heskett
> >> 
> >
> >wrote:
> >> > 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_featur
> >> > >es. html
> >> >
> >> > I take it that this is python-2.7? code?
> >> >
> >> > Searching thru the python3 results in synaptic, on a stretch
> >> > install on the rock64, python3 has not a p3 version of numpy or
> >> > cv2.
> >> >
> >> > And I'd like to try and make it run on 3.5 since that seems to be
> >> > the newest on stretch. That would tend to future-proof this past
> >> > the final fixes and eventual demise of python-2.
> >> >
> >> > Is there hope for things like numpy and cv2 being ported to
> >> > python 3? Or can numpy and cv2 be used against 3.5 as is?
> >>
> >> Dunno about cv2, but numpy is certainly available for Python 3.
> >
> >What do they call it in debian stretch for arm64?
>
>   Well, in Raspbian they show up as...
>
>
> Linux raspberrypi 4.14.69-v7+ #1141 SMP Mon Sep 10 15:26:29 BST 2018
> armv7l
>
Thats a 32 bit kernel, the rt version has been tried and found wanting, 
very high throwaway percentages for keyboard and mouse events.

> The programs included with the Debian GNU/Linux system are free
> software; the exact distribution terms for each program are described
> in the individual files in /usr/share/doc/*/copyright.
>
> Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
> permitted by applicable law.
> Last login: Fri Sep 14 12:36:56 2018 from
> fe80::c932:bd85:577:9922%eth0 pi@raspberrypi:~$ python3 --version
> Python 3.5.3
> pi@raspberrypi:~$ python3
> Python 3.5.3 (default, Jan 19 2017, 14:11:04)
> [GCC 6.3.0 20170124] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import numpy
>
>   I don't remember installing numpy -- it just seems to be there...
>
> pi@raspberrypi:~$ sudo apt search numpy
> Sorting... Done
> Full Text Search... Done
>
>   
>
>
> python3-bottleneck/stable 1.2.0-6 armhf
>   Fast NumPy array functions written in C - Python 3
>
>   
>
> python3-numexpr/stable 2.6.1-4 armhf
>   Fast numerical array expression evaluator for Python 3 and NumPy
>
> python3-numexpr-dbg/stable 2.6.1-4 armhf
>   Fast numerical array expression evaluator for Python 3 and NumPy
> (debug ext)
>
> python3-numpy/stable,now 1:1.12.1-3 armhf [installed]
>   Fast array facility to the Python 3 language
>
> python3-numpy-dbg/stable 1:1.12.1-3 armhf
>   Fast array facility to the Python 3 language (debug extension)
>
> python3-numpydoc/stable 0.6.0+ds1-1 all
>   Sphinx extension to support docstrings in Numpy format -- Python3
>
>   
>
> python3-rasterio/stable 0.36.0-1+b2 armhf
>   Python 3 API for using geospatial raster data with Numpy
>
> python3-scipy/stable 0.18.1-2 armhf
>   scientific tools for Python 3
>
> python3-scipy-dbg/stable 0.18.1-2 armhf
>   scientific tools for Python 3 - debugging symbols
>
> python3-seaborn/stable 0.7.1-4 all
>   statistical visualization library
>
> python3-snuggs/stable 1.4.1-1 all
>   S-expressions for numpy - Python 3 version
>
>   
>
>
>   Only hits for cv2 are Java
>
> pi@raspberrypi:~$ sudo apt search cv2
> Sorting... Done
> Full Text Search... Done
> libcv2.4/stable 2.4.9.1+dfsg1-2 all
>   computer vision library - libcv* translation package
>
> libopencv2.4-java/stable 2.4.9.1+dfsg1-2 all
>   Java bindings for the computer vision library
>
> libopencv2.4-jni/stable 2.4.9.1+dfsg1-2 armhf
>   Java jni library for the computer vision library
>
> pi@raspberrypi:~$
>
>   However, Raspbian is 32-bit Debian-based. I don't know what would be
> needed to configure/install a pure 64-bit Debian on the RPi-3.
>
In all likelyhood, it won't be running on the pi-3b, but on a rock64, 
which is arm64.  So its called armbian.
>
>
> --
>   Wulfraed Dennis Lee Bieber AF6VN
>   wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/

On the rock64, python has numpy but not cv2, python3 has neither.

And doesn't have pip or pip3 in the repo's.

But on a swag, it did install python-cv2*, so maybe it will run this 
stuff after all. But despite a "sudo apt install cv2" pulling in 30 some 
packages, cv2 is not available to import, at least not by that name..

I might have 

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

2018-09-24 Thread Thomas Jollans
On 2018-09-24 16:52, Gene Heskett wrote:
> 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
> 
> I take it that this is python-2.7? code? 
> 
> Searching thru the python3 results in synaptic, on a stretch install on 
> the rock64, python3 has not a p3 version of numpy or cv2.
> 
> And I'd like to try and make it run on 3.5 since that seems to be the 
> newest on stretch. That would tend to future-proof this past the final 
> fixes and eventual demise of python-2.
> 
> Is there hope for things like numpy and cv2 being ported to python 3? Or 
> can numpy and cv2 be used against 3.5 as is?

Sure it can. Just use pip. There are even binary manylinux wheels!
https://pypi.org/project/opencv-python/


There's a numpy in the stretch repos,
https://packages.debian.org/stretch/python3-numpy - but indeed, the
python3-opencv package doesn't arrive until buster.
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2018-09-24 Thread Gene Heskett
On Monday 24 September 2018 10:55:23 Chris Angelico wrote:

> On Tue, Sep 25, 2018 at 12:54 AM Gene Heskett  
wrote:
> > 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
> >
> > I take it that this is python-2.7? code?
> >
> > Searching thru the python3 results in synaptic, on a stretch install
> > on the rock64, python3 has not a p3 version of numpy or cv2.
> >
> > And I'd like to try and make it run on 3.5 since that seems to be
> > the newest on stretch. That would tend to future-proof this past the
> > final fixes and eventual demise of python-2.
> >
> > Is there hope for things like numpy and cv2 being ported to python
> > 3? Or can numpy and cv2 be used against 3.5 as is?
>
> Dunno about cv2, but numpy is certainly available for Python 3.

What do they call it in debian stretch for arm64?

> ChrisA

Thanks ChrisA

-- 
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: Need to find the centroid of a circular camera image

2018-09-24 Thread Chris Angelico
On Tue, Sep 25, 2018 at 12:54 AM Gene Heskett  wrote:
>
> 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
>
> I take it that this is python-2.7? code?
>
> Searching thru the python3 results in synaptic, on a stretch install on
> the rock64, python3 has not a p3 version of numpy or cv2.
>
> And I'd like to try and make it run on 3.5 since that seems to be the
> newest on stretch. That would tend to future-proof this past the final
> fixes and eventual demise of python-2.
>
> Is there hope for things like numpy and cv2 being ported to python 3? Or
> can numpy and cv2 be used against 3.5 as is?

Dunno about cv2, but numpy is certainly available for Python 3.

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


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

2018-09-24 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

I take it that this is python-2.7? code? 

Searching thru the python3 results in synaptic, on a stretch install on 
the rock64, python3 has not a p3 version of numpy or cv2.

And I'd like to try and make it run on 3.5 since that seems to be the 
newest on stretch. That would tend to future-proof this past the final 
fixes and eventual demise of python-2.

Is there hope for things like numpy and cv2 being ported to python 3? Or 
can numpy and cv2 be used against 3.5 as is?

Thanks 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


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


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


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