Quoth Russell Brown..... (yes it's bad form following up my own post. Sorry)
>
>But quite what you do with convert_crop.so once it's copied to
>/usr/lib/camunits I don't know.

Aha!  You stick it in the chain directly after the V4l2 bit and in
camview (the standalone utility) you can move the slider to crop the
image (or edit the ratio in camviewcfg) and everything after that in the
chain seems to operate on the cropped image.  Works for me anyway.

Playing with the cropping looks very hopeful.

Here's a couple of screen-scrapes.  Both with the USB Microscope ~300mm
from the rule, hanging in mid-air from it's cable and very rough
focusing.

The first is with no-cropping and it's just about useless for edge
finding on a mill.

http://ruffle.me.uk/cnc-pics/snapshot1.png

Cropping the image centre down to 110x82 pixels produces this:

http://ruffle.me.uk/cnc-pics/snapshot2.png

Which should get me to within a gnats of 'close enough' :-) and I
thought I was going to have to get all complex with lenses and
arithmetic and science!


Now I just have to make a tweakable mount and try to figure out how I
can persuade camview-emc to include the cropping slider in it's controls
section within Axis so I can twiddle when it's being used for real.

FWIW, the camera used above is a Supereyes TE24S 1-400X 5Mp selected on
the highly selective and technical basis of being a random pre-loved
cheapy on EBay that wasn't too bulky (it's a ~15mm diameter tube).  I
think that I'll have to hot-gloop the focus slider once it's bolted down
and jog Z for fine adjustments.


PS:  For the record, here's my camviewcfg file (using little 640x480
endoscope camera) showing util.crop's position in the chain:


<?xml version="1.0" encoding="utf-8" ?>
<chain>
    <unit id="input.v4l2:0" width="640" height="480"
pixelformat="CAM_PIXEL_FORMAT_RGB" format_name="640x480 RGB 24bpp">
        <control id="input">0</control>
        <control id="standard">0</control>
        <control id="brightness">111</control>
        <control id="contrast">42</control>
        <control id="saturation">33</control>
        <control id="hue">-1</control>
        <control id="auto-white-balance">1</control>
        <control id="gamma">220</control>
        <control id="gain">3</control>
        <control id="control-9963800">1</control>
        <control id="control-9963802">4650</control>
        <control id="control-9963803">2</control>
        <control id="control-9963804">0</control>
        <control id="control-10094849">3</control>
        <control id="control-10094850">166</control>
    </unit>
    <unit id="util.crop" width="234" height="175"
pixelformat="CAM_PIXEL_FORMAT_RGB" format_name="234x175 RGB 24bpp">
        <control id="ratio">0.366534</control>
    </unit>
    <unit id="convert.to_rgb8" width="234" height="175"
pixelformat="CAM_PIXEL_FORMAT_RGB" format_name="234x175 RGB 24bpp">
    </unit>
    <unit id="output.opengl" width="234" height="175"
pixelformat="CAM_PIXEL_FORMAT_RGB" format_name="234x175 RGB 24bpp">
    </unit>
    <unit id="emc.halio" width="234" height="175"
pixelformat="CAM_PIXEL_FORMAT_RGB" format_name="234x175 RGB 24bpp">
        <control id="limit">3</control>
        <control id="reload">0</control>
        <control id="circle">video.circle</control>
        <control id="axis-pins">halui.axis.%d.pos-feedback</control>
        <control id="axis-letters">012345678</control>
        <control id="axis-format">%.3f</control>
        <control id="spacing">44</control>
        <control id="color-r">1</control>
        <control id="color-g">1</control>
        <control id="color-b">1</control>
        <control id="gl-xor">1</control>
    </unit>
    <unit id="emc.crosshair" width="234" height="175"
pixelformat="CAM_PIXEL_FORMAT_RGB" format_name="234x175 RGB 24bpp">
        <control id="enable">1</control>
        <control id="color-r">1</control>
        <control id="color-g">1</control>
        <control id="color-b">1</control>
        <control id="gl-xor">1</control>
        <control id="circle-radius">104</control>
        <control id="circle-angle">0</control>
        <control id="shape">1</control>
    </unit>
</chain>



-- 
 Regards,
     Russell
 --------------------------------------------------------------------
| Russell Brown          | MAIL: russ...@lls.com PHONE: 01780 471800 |
| Lady Lodge Systems     | WWW Work: http://www.lls.com              |
| Peterborough, England  | WWW Play: http://www.ruffle.me.uk         |
 --------------------------------------------------------------------

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&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