2012-06-18

Digiscoping with the ScopeTronix EZ-Pix Digital Camera Holder

Admittedly this is an old adapter; I bought it in 2004. ScopeTronix mentions the EZ-Pix II on their website, but I can't tell what's new about it because the links on the website don't work.

No matter. This is to discuss a different approach to digital camera adapters than the one I mentioned here: Digiscoping Test

The scope setup and camera are the same. The digital camera adapter is a ScopeTronix EZ-Pix.
Rather than using a cylinder that slips over your eyepiece and another cylinder that slips over the first and attaches to your camera via its filter thread, this system uses a padded clamp that attaches to your eyepiece, which is attached to a slotted bar, which in turn is attached to your camera's tripod mounting hole via a screw and optional spacer.
High compatibility are ensured by:

  • 2" and 1.25" clamps included
  • pivot post
  • slotted bar that slides backward and forward and pivots on the pivot post
  • camera attachment knob that slides up and down on the slotted bar
  • optional spacer
  • optional socket head bolt to use for more permanently fixing the adapter with heavier cameras
  • no looking for an adapter with the right size thread for your camera's filter thread or a camera that even has a filter thread (almost all cameras have a tripod mounting hole)
All these variables, however, make it a bit tricky getting the camera aligned to the eyepiece just right. Once it is, however, you "only" need to loosen the clamp, remove the assembly and replace it again when switching from viewing to digiscoping and back.

A further disadvantage if you're using a zoom eyepiece is that the entire adapter-camera assembly turns when you zoom in and out, making zooming impractical. In addition, the clamp covers the magnification markings on the eyepiece ("25x", "60x", etc.).

This adapter originally costed $49.95. I can't tell what the current model costs because, like I said, the links on the website don't work.

2012-06-02

Digiscoping Test

After getting my spotting scope repaired, I did a digiscoping test.

Here's my equipment:

  • Swarovski AT 80 spotting scope (13 years old)
  • Swarovski 20-60x eyepiece
  • Swarovski tripod
  • Foto Fennica SWA AT camera adapter with 27 mm adapter ring
  • Nikon CoolPix AW100 compact digital camera

The CoolPix AW100 is one of the only compact digital cameras I know of that has a filter adapter (40.5 mm). At first I tried connecting this to the SWA AT camera adapter with 2 filter adapter rings (that added a mm or 2 to the distance from camera to scope). I couldn't find an individual adapter ring that went from 27 to 40.5 mm. However, the vignetting was too pronounced.
In order to reduce vignetting by getting the camera lens as close as possible to the scope's eyepiece, I got my brother-in-law to screw the plastic AW100 filter adapter directly to the SWA AT camera adapter. This was achieved by boring threading for the screws used directly into the metal camera adapter.
In the photo below the Bullfinch was in the shade at a feeder in my yard. I used the 20x magnification of the zoom eyepiece and the maximum optical zoom of the camera (4x). The photo was not cropped. As one can see there is no vignetting when using the camera's optical zoom.
In the following photo the Bullfinch was at a different feeder in full sunlight. I was closer to the subject and couldn't use the full optical zoom because the bird would fill the frame too much. Notice the vignetting.
The following photo is the same as the one above except that much of the vignetting was cropped out. Here one can see individual feathers of this songbird and the black eye against the black background. Even using my scope I would not have noticed this level of detail. In the wild it is almost impossible to distinguish this bird's eye from its background. Click on the photo for a larger version.
With a little more practice I could probably make fairly good photos with this setup. However, if the bird wasn't relatively stationary at my feeder for several minutes, I'm not sure I could get set up quickly enough before the bird flew away. It takes some time to remove the rubber eye cup and affix the first half of the camera adapter to the scope eyepiece with the set screw. The other half of the camera adapter is clipped on quickly to the camera, but this is also its disadvantage: Due to its material (plastic) it sometimes comes off again too easily and might break easily.

Swarovski makes a similar camera adapter called the DCA that would fit my eyepiece. This may be more stable. However, I plan on trying a different setup altogether for the following reasons:

  • My scope isn't particularly suited to digiscoping since it's not HD.
  • My eyepiece isn't particularly suited to digiscoping since it's not wide-angle.
  • I think the digital camera base (DCB) by Swarovski would be more practical than the type of adapter I'm using, since it swings up and away for viewing and swings back quickly into place for taking photos, but the DCB doesn't fit my older model scope.
  • A different compact digital camera that allows one to do more settings manually might be more suitable.

So, except for the tripod, that means exchanging every part of my equipment. I might as well get a new tripod too, since they're lighter these days.

What are your experiences with digiscoping? Please comment below.

Chronology of a Customer Service Case

I bought my Swarovski spotting scope AT 80 and 20-60x eyepiece in 1999 (13 years ago). When birding in a group, I don't notice anyone any more with this older gray-colored model. Almost everyone has a Swarovski, but it's the newer green-colored, ATM/STM model.


I noticed that my scope had play in the focusing ring, that is, when I switch directions when turning it, there was about 1 or 2 mm play before it started turning in the other direction. In addition it seemed to me I couldn't focus sharply at the highest magnification of 60x.

At the Pannonian Bird Experience, I mentioned this to a Swarovski representative who took a look through my scope and suggested I send it in to be repaired. Since I live in Austria, I visited the Austrian Swarovski website and got the e-mail address of the Head of the Customer Service department.


I still have the guarantee card (with dealer's stamp and purchase date) and noticed that they have a 30-year guarantee (!) but any work done after 5 years is to be paid by the customer. It also says that parts subject to natural wear (eye cups, etc.) are not covered. I couldn't readily locate the original invoice.


I e-mailed them on April 30 attaching a scan of my guarantee card and asked what to do. The next day (May 1) I received an e-mail saying to send it in and they would send me a cost estimate.

A week later (May 8) I mailed the scope and eyepiece to Swarovski in Absam, Tirol, Austria. Two days later (May 10) I received an e-mail saying the repair would be free of charge(!), although the attached estimate showed that the cost would normally be about EUR 200 (US 250), mostly for work but also a few parts.

Not quite 2 weeks later (May 23) I received my repaired scope and eyepiece. There is no longer play in the focus ring, the optics were cleaned, and the rubber parts (e.g. eye cup) were replaced. The light intensity is much higher, and I am now able to focus sharply at 60x magnification.

I am extremely satisfied with the handling of this customer service case and can only recommend it to all other companies, most noticeably consumer electronics companies I have dealt with. Swarovski has gone far beyond their already very generous guarantee. The only costs I incurred were the shipping costs to the company. Sure, they're a little more expensive than other optics companies, but the quality of the products and of the customer service more than make up for the price difference in the long run.

[Disclaimer: I am in no way connected to the Swarovski company (besides being their customer), nor are any relatives or close friends of mine employed by them. Only a few of my social media friends work for them. Nor have I received any payment from Swarovski, either monetarily or in products. Nor did they know beforehand that I would do this blog post.]

Does anyone else have notable customer service experiences they would like to share?

Does anyone else have experience with Swarovski or other birding optics companies they would like to share?

Please comment below.

2012-05-27

Handy Bird-book Bookmarks

So, you're tracking down a confusing fall warbler or other difficult bird. You're taking looks through the bins and simultaneously consulting your favorite bird book. As you switch back and forth from book to binoculars, you awkwardly clamp the book, opened to the right page, under your arm or between your legs. You know from experience that traditional bookmarks made from pieces of paper don't work since they inevitably blow away in the wind. Besides, they block the view of text or pictures in the book.

Here's a handy tip: Get a piece of thin ribbon about three times as long as your book is tall. Fold it in half, and glue the folded part into the spine if it's a hardcover book or between the cover and first or last page near the spine if it's a softcover.

Then reap the praise of all your fellow birders as they notice what a great idea you had! If they remark that it looks like a bible, you can remark, "Well, it is my birding bible!"


2011-07-30

How to install and implement Sphinx Search on XAMPP for Windows 7 with MySQL and PHP

If you have a MySQL-based website with lots of records (like hundreds of thousands) and run a full-text search on them, you will probably run into performance problems. The first thing most people probably do is use LIKE with the % wildcard. This quickly becomes too slow, of course, because MySQL has to search through the entire text of every record of the table and can’t use any indexes.

The first solution most people think of is MySQL’s own full-text index capability. However, this doesn’t work very well if you run the query on many text fields per record. In my case, the search was even slower.

Sooner or later, you have to think about creating additional full-text indexes. At a seminar once I heard about how powerful the Apache Lucene project is, so that’s the first thing I looked into. However, I quickly found out that it’s very complicated and requires a larger learning curve than I was willing to invest. In the online documentation for Lucene somewhere it said that if Lucene is too low-level for you then to try Apache Solr, so I looked into that. Solr is based on Lucene and runs on Java, so that means you need to install Apache Tomcat if you haven’t already, which I didn’t. I looked into installing it on my XAMPP installation and realized I would need to either update XAMPP to a version that included it or add it manually. This was turning into a larger project than I wanted it to be even before I could begin to think about the search server itself. So I looked into something else.

Here are some lists of search engine software (search servers):

Sphinx Search caught my eye because it was specifically designed to index MySQL databases, which is what I wanted primarily, although you can index just about anything else too, like XML files and web pages. It was also mentioned as particularly easy to implement.

This is true, although, of course, there are pitfalls, especially since, like most things web server, it is mainly aimed at Linux and not Windows installations. And this is the main reason for this tutorial, to help Windows users install and implement Sphinx Search with as little trouble as possible.

Resources that helped me:

Decide which release you want, generally the latest stable beta release as described here: http://sphinxsearch.com/downloads/

Download “Win32 binaries w/MySQL support” here: http://sphinxsearch.com/downloads/beta/

Unzip the zip file to C:\Sphinx. This directory should now include a few files, such as sphinx.conf.in, and subdirectories, such as api and bin.

Add the subdirectories data and log.

Copy the file C:\Sphinx\sphinx.conf.in to C:\Sphinx\sphinx.conf.

Open C:\Sphinx\sphinx.conf in a text editor.

Change the settings sql_user and sql_pass to match your MySQL installation.

Find and replace all occurrences of @CONFDIR@/ with C:\Sphinx\, at least in the uncommented lines.

Find and replace all occurrences of forward slash (/) with backslash (\) in these same lines. For example @CONFDIR@/data/test1 becomes C:\Sphinx\data\test1.

Leave the source and index settings as they are for now for testing purposes.

If MySQL isn’t running already, start it now.

Start cmd.exe as an administrator (click the Windows Start icon, type cmd in the search box without hitting Enter, right-click "cmd.exe", click “Run as administrator”). On Windows XP this is easier: no need to worry about administrator rights.

Go to your MySQL installation directory, for example enter cd c:\xampp\mysql.

Create the test database and fill it with data by entering:
mysql -u [youruser] -p < c:\sphinx\bin\example.sql (replace [youruser] with your user name).

Enter cd c:\sphinx\bin.

Index the test database by entering indexer.exe --config c:\sphinx\sphinx.conf test1.

Install Sphinx as a service by entering:
searchd.exe --install --config c:\sphinx\bin\sphinx.conf --servicename SphinxSearch

Start the service: Go to Control panel > Administrative tools > Services. Right-click on "SphinxSearch" in the list and click "Start".

Test the search by entering: search.exe --config c:\sphinx\sphinx.conf test. This should result in some matches for the search term “test”.

Copy the Sphinx Search PHP API from C:\Sphinx\api\sphinxapi.php to your site’s HTML directory, for example C:\xampp\htdocs\[yoursite]\sphinxapi.php.

Create a test PHP file with the following contents:



<?php
mysql_connect("localhost", "root", [yourpassword]);
mysql_select_db("test");
require_once('sphinxapi.php');
$s = new SphinxClient;
$s->setServer("127.0.0.1", 9312); // NOT "localhost" under Windows 7!
$s->setMatchMode(SPH_MATCH_EXTENDED2);
$s->SetLimits(0, 25);
$result = $s->Query("test");
if ($result['total'] > 0) {
echo 'Total: ' . $result['total'] . "<br>\n";
echo 'Total Found: ' . $result['total_found'] . "<br>\n";
echo '<table>';
echo '<tr><td>No.</td><td>ID</td><td>Group ID</td><td>Group ID 2</td><td>Date Added</td><td>Title</td><td>Content</td></tr>';
foreach ($result['matches'] as $id => $otherStuff) {
$row = mysql_fetch_array(mysql_query("select * from documents where id = $id"));
extract($row);
++ $no;
echo "<tr><td>$no</td><td>$id</td><td>$group_id</td><td>$group_id2</td><td>$date_added</td><td>$title</td><td>$content</td></tr>";
}
echo '</table>';
} else {
echo 'No results found';
}
?>


Run the PHP file in a browser. You should get a table of results that include the search term “test”.

Now it’s time to RTFM to implement this in your own application. You’ll need to adapt sphinx.conf to index your own MySQL database (http://sphinxsearch.com/docs/2.0.1/conf-reference.html) and adapt the API settings to suit your needs (http://sphinxsearch.com/docs/2.0.1/api-reference.html).

For example, in sphinx.conf you probably want to change the source src1 section to something meaningful. I use [database]_[table], for example source mydb_yourtable, since there can be more than one source section. I figure that avoids confusion, and if I have multiple databases/sources I can simply specify the list of indexes to search in the Query() call, for example:

$cl->Query ("test query", "db1_table1, db2_table3");

Change sql_db to your database.

Change sql_query_info to your table.

You also need to change sql_query to access the MySQL table you want to index. The first field must be a unique, unsigned, positive, integer ID. If your table doesn't have one, you need to add it to the table first. This is how you will later reference the rows found in PHP.

For example:
ALTER TABLE yourtable ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;

Adapt or delete the settings sql_attr_uint and sql_attr_timestamp.

If you changed the name of the source section then you need to change the name or comment out the section source src1throttled : src1.

You probably want to also change the index test1 section to something meaningful. I use [database]_[table] as above, for example index mydb_yourtable.

Change the source setting in the index section to the whatever you named the source above, e.g. mydb_yourtable.

You can also change the path directive to something more sensible than test1.

If you want wildcard support, set enable_star = 1. This means that star (*) can be used at the beginning and/or the end of the keyword. The star will match zero or more characters, similar to % in MySQL. A star in the middle of the keyword doesn’t seem to be supported (but see below). Nor is a question mark or underscore to match exactly one character. You also need to set min_infix_len = 1 for example.

If you changed the name of the index section above then you need to change the name in the sections index test1stemmed : test1 and index dist1 or comment them out.

Be aware that max_matches = 1000 or change this value in the searchd section.

Until and unless you decide to use real-time indexes, you may want to comment out all the lines in the index rt section or delete them.

In the searchd section I set preopen_indexes = 0 because otherwise I had problems with delta index updates (see below).

Index this database as we did above for the test source by entering:
indexer.exe --rotate --config c:\sphinx\sphinx.conf --all

The --rotate option means you don’t have to stop and restart the Windows service running the searchd daemon. However, if you change sphinx.conf, you should manually stop and start searchd. The --rotate option should be used only when reindexing. As of version 0.9.9-rc1 this is no longer absolutely necessary; a --rotate should be sufficient. However, it is usually best to avoid ambiguity.

If you’ve gotten this far and are using real data, then indexing will take a few minutes.

If you ever need to remove the service entirely, start cmd.exe (as an administrator) and enter sc delete SphinxSearch. Somewhere along the line the changes I made to sphinx.conf didn’t work till I did this and reinstalled the service.

Adapt your test PHP file from above to access the database and table you just indexed and load it in a browser.

Now that you’ve gotten Sphinx Search to run in your web application, you need to think about how and when to automatically reindex the data. As of this writing there is no way to automatically do a live index update, at least not with wildcard support. However, you can do an incremental update:

Set up sphinx.conf for delta index updates as described in the manual (adapting to your situation): http://sphinxsearch.com/docs/current.html#live-updates

Use the Windows Task Scheduler to index the main source once daily at slack times. I did this:
c:\sphinx\bin\indexer.exe --rotate --config c:\sphinx\sphinx.conf --all
Once daily at 4:00 am.

Use the Windows Task Scheduler to index the delta source every few minutes at peak times. I did this:
c:\sphinx\bin\indexer.exe --rotate --config c:\sphinx\sphinx.conf mydb_yourtable_delta
Every 5 minutes from 6:00 am to 11:00 pm.

Only new records are indexed every 5 minutes. Modified records only get re-indexed once a day.
You might want to put these commands in batch files.
Re-indexing from the Task Scheduler in Windows 7 didn’t work for me, but it did work in Windows XP. See: http://sphinxsearch.com/bugs/view.php?id=860

In PHP you then need to list both the main index and the delta index in the Query()
function, for example:
$cl->Query ("test query", "db1_table1, db1_table1_delta");


Update: You can simulate for example %one%two% in MySQL with *one* << *two* in Sphinx Search. There's no way to simulate an underscore for exactly one character.


Update: *one* << *two* finds one two but not onetwo.