PanoramaScanCam™

On one of my robots, I wanted to place a camera that could observe everything around it. The camera did not have to have a high frame rate. It was not going to be used for motion capture or real-time autonomous driving. It did need to have a 360 degree field of view. Think in terms of the cameras on the Mars Viking landers of the 1970s.

PanoramaScanCam™ is my implementation of a panoramic camera implemented using the components of a flatbed scanner. This is not an original concept. Flatbed scanners have been used as cameras by a number of experimental photgraphers. Performing a websearch reveals several examples of prior art:

The scanning cameras of Davidhazy and Wandel provided the inspiration for developing the PanoramaScanCam™. While both authors provide insights into how they implemented their scanning cameras, neither provide sufficiently detailed instructions to enable others to duplicate their work. In addition, Wandel's scanner camera does not scan 360 degrees.

Blog of Construction

Rather than waiting until completing the PanoramaScanCam™ before posting its design and construction on my website, I've decided to document it with a blog-like page. I say blog-like, as this is an ordinary, hand-edited HTML page. No special blogging tools were used in its construction.

Prelude (2006)

The victim candidate for the scanner conversion into the PanoramaScanCam™ is a UMAX 2100U. It was given to me along with a bunch of other computer stuff back in 2005. It has languished in my garage unused since then. I already had a smaller, more capable scanner. In addition, backend support for the UMAX 2100U scanner by SANE was incomplete. I have wanted to build the PanoramaScanCam™ for some time, but the 2100U was not a suitable candidate.

My original plan was to use a UMAX AstraNET e3420, which I found on a neighbor's curb. It was destined for trash pick-up. SANE support for it has been available for some time through the sane-plustek backend. While I was able to get the scanner working again, I discovered that only half of the sensor was usable. Using an MS Windows driver verified that it was a hardware problem and not a software problem. I decided that the e3420 was not really usable. I was forced to hold off on making the PanoramaScanCam™ until I could obtain a usable scanner with good software support. Fortunately, all of my design concepts and the implementation approach are still usable, regardless of the actual scanner used. Therefore, the time I spent working on the UMAX e3420 was not in vain.

With the introduction of SANE version 1.0.18, support for the UMAX 2100U, via the sane-umax1220u backend, was complete. The time for languishing was over.


UMAX 2100U Flatbed Scanner.

Concept "image" of the PanoramaScanCam™.

January 1, 2007: Dissection

Prior to firming up the design approach for the PanoramaScanCam™, it is necessary to determine the internal layout and construction of the scanner. As dissection of the UMAX 2100U scanner was performed and documented. Understanding these characteristics allows the design of the PanoramaScanCam™ to take advantage of them or compensate for them. Care was taken to ensure that scanner functionality was maintained.

January 2, 2007: Translation to Rotation

The main goal of the PanoramaScanCam™ is to create a camera that can capture a 360-degree image. A secondary goal is to use as much of the original scanner hardware as possible. I believe that doing this aids somewhat in the reliability of the design. The parts of the scanner that are used are meant for that purpose. This means that those parts are rugged enough to provide reliable performance in their new, somewhat modified application. This approach also reduces the cost of development through reuse. Incidentally, the cost of development at this point is $0.00!

In order to convert the translational motion of the flatbed scanner to the rotational motion of the PanoramaScanCam™, it is necessary to connect the belt on the scanner to something that will rotate. For the turntable base, I selected a 4-inch Lazy Susan bearing, model 4C, made by Triangle Manufacturing Company. I got one at the local Woodcraft store for $1.99 (see this page).

The shape of the turntable bearing frame does not lend itself for attachment to the belt and provide smooth rotation. Something cylindrical would be more suitable. The question then is what should be the diameter of the cylinder? To answer this question, lets consider the basic imaging characteristics of a flatbed scanner. We know that a typical flatbed scanner will image a standard letter-size piece of paper. This is 8.5 inches in the cross-scan direction by 11 inches in the in-scan direction. The UMAX 2100U will actually scan up to 11.7 inches in the in-scan direction (A4 paper format), but let's stick with an 11-inch scan.

If we want to convert the translational motion of the 11-inch scan to a rotational motion that covers an equal distance, then the distance around the cylinder would have to equal 11 inches. In geometry, this is known as the circumfrence of the circle. The circumfrence of a circle is defined by the relationship C = D π. C and D are the circumfrence and diameter of the circle, respectively, and π is 3.141592654, approximately. Given a circumfrence of 11 inches, the cylinder would have to have a diameter of 3.5014 inches, approximately. So where can we easily obtain a cylinder with a diameter of about 3.5 inches?

It turns out that a convenient source can be found at the local plumbing supply store in the form of PVC pipe. When PVC pipe is specified by diameter, it is by the inside diameter. U.S.-spec PVC pipe with a 3-inch inside diameter has an outside diameter of 3.5 inches! I was able to obtain a short length of scrap 3-inch PVC from a friend of mine that is a master plumber . Sure enough, the ends of a sheet of 8.5-inch by 11-inch paper wrapped long-ways around the pipe nearly touch each other. That means that the pipe's diameter is slightly more than 3.5 inches. That is okay, though.

January 3, 2007: Belt Drive Layout

The dissection of the UMAX 2100U revealed an interesting mechanical layout on the floor of the scanner. The floor is a pattern of raised and sunken sections with an integral cable tray. The tray helps to guide the ribbon cable connected to the scan head. The raised and sunken sections probably help add rigidity to the scanner case. For the PanoramaScanCam™, this adds a challenge to reusing the case. Modifying the case will tend to weaken the structure of the case. Perhaps the pattern of raised and sunken could be exploited to maintain case integrity.

The raised and sunken sections also create a challenge for the new layout of the scanner belt drive. The placement of the Lazy Susan bearing will have to take these sections into account. The bearing must be placed to allow the ribbon cable to rise up through the hole in the bearing to connect to the scanner board at the top of the pipe. Consequently, these restrictions must be resolved to yield a successful belt drive layout.

The first tasks is to model the floor of the scanner so that accurate placement of the belt drive layout can occur. Using calipers, the essential mechanical elements of the scanner were measured and draughted using OpenOffice Draw. I did the bare minimum amount of drawing to capture the information I needed (see this PDF). The cross-hair in the gray area on the upper left corner of the illustration is the center point for the drive cog on the stepper motor assembly. The line running down the left side is the centerline of the belt drive. Since the idler cog and tensioner assembly are being reused, the center point of the idler cog will have to fall on this centerline. The sunken regions and the cable tray in the scanner floor are marked in blue.

The photo on the right shows the modeling of the belt drive layout. The disks are cut from foam core board and are held in place by push pins. The belt was removed from the scanner and used to verify that the belt path was viable. Details on how the belt layout was determined can be viewed here.

The holes left by the push pins are measured and placed into the drawing. The mark-up of the belt drive layout can be viewed in this PDF. The disks and belt path are indicated. The inner and outer circles of the camera cylinder are indicated as well as the inner opening of the Lazy Susan bearing.


Scanner with lid open showing floor detail.

Idler cog and tensioner assembly.

January 4, 2007: Evisceration and the Mark(up) of the Beast

A couple of days ago, I performed a dissection of the scanner. To me this is a correct term, as the subject is opened up, but all of the internal parts are pretty much left if place. What I did today was more like an evisceration. All of the "guts" are removed, leaving an empty shell.

The application of a screw driver, the spreading of a few clips, the unpluging of a few connectors, and the unwrapping of some wires resulted in an empty case. The screws were placed in the bins of a re-purposed pill holder. Each bin holds screws for different parts of the scanner. The parts went into a box for safe keeping. I placed the scanner controller card in an anti-static bag for good measure.

The most difficult task was separating the window from the scanner's case top. I had to slide an X-acto knife between the case top and the window to break the adhesive seal holding them together. Unfortunately, the white calibration strip was ruined in the course of the separation. I was not really planning on using it in the PanoramaScanCam™, but it would have been nice to keep it intact in case it could be used on another project.

After separating the window from the case top, I discovered that the window was made of glass and not plexiglass, as I had orginally thought. If I had known that ahead of time, I would have been more careful with my prying as I cut the adhesive. A childhood encounter with a window makes me a bit timid around sheet glass!

Its now time to mark the case where the cuts will be made. Studying the belt drive layout, it can be seen that only two rows of the raised sections of the scanner floor are used. The rest can be cut away. A cut straight across the case is not the best solution for a couple of reasons. First, doing so would result in a straight butt joint where the pieces will be brought together. Butt joints tend to be weak unless they are securely glued and strengthened with supporting materials. Second, in order to reuse as much of the existing functionality of the case, the tensioner assembly, a case foot, and a noise filter retainer need to be preserved.

Fortunately, the tensioner assembly, case foot, and noise filter retainer are positioned such that careful routing of the cuts will preserve them all. The photo on the right shows the markings applied to the case and its top. I first did the markings with pencil followed up by a permanent marker. I added arrows to remind myself to cut on this side of the line! Note that the markings for the case top do cut straight across, contrary to my comments above. A complete new deck will be attached to the case top, so the butt joint will be sufficiently strengthened.


Parts removed from the scanner case.

Unneeded glass removed from the case top.

The scanner case marked for cutting.

January 6, 2007: Rough Cut and Clean Cut

Friday and Saturday were spent cutting the case apart according to the mark-up discussed above. This took longer that expected. I had purchased a hobby hot-knife from Harbor Freight, hoping that I'd be able to make clean, quick cuts. I decided to do the case top first, as the cuts would be fairly short and straight. After thirty minutes of struggle, I had made three of the four cuts on the lid and had a broken hot-knife! The general-purpose attachment (sort of like an X-acto knife blade holder) would not stay tightened after the hot-knife heated up. I had to keep tightening it. Well, what actually was happening was that tightening of the screw shank tore it apart. The screw on the attachment was made of very cheap metal. Needless to say, I was very disappointed, but I only spent $5.00 on the tool. I guess you get what you pay for; especially with cheap Chinese tools.

I resorted to using my motor tool and X-acto knife to initially rough-out the sections of the PanoramaScanCam™ case. That took up all the time I had on Friday. On Saturday, I used the motor tool, the X-acto knife and a file to clean up the halves of the case. A lot of cutting, fitting, and filing was done to get a decent mating of the case halves. Once they are glued together, the case top will be cleaned up to make sure that it fits properly.


Rough cutout of the case.

Case halves after clean-up.

January 8, 2007: I'm Stuck on You, Babe!

I spent a couple of hours on Sunday glueing the case halves together. It was a bit of a trick making sure that the halves stayed properly aligned while the epoxy set. Rubber bands can be a help and a headache at the same time. After the epoxy set sufficiently, I trimmed the halves of the case top so they appeared to be pretty well aligned.

I waited until Monday evening to determine the final fit of the case top to the case. I wanted to make sure that the epoxy was fully cured before making the final fit. I epoxied the halves of the case top together while lying flat on the table. After the epoxy set, I used the case to help hold the alignment of the top in place.

The pictures show the final results of my efforts. Notice that I used plastic strips to reinforce the glue joints at strategic locations. The plastic was taken from the scrap portions of the case and case lid. I don't mind that the joints between the case halves are clearly visible. I think it makes it clearly obvious that a hack has taken place. I'm really pleased at how well the case mod turned out. Next, I'll start working on the mounting hardware for the camera cylinder and the belt drive.


Top of the case and case top.

Bottom of the case and case top.

A test fit of the case and case top.

January 12, 2007: Mounting the Camera Cylinder

I've spent a lot more time thinking and designing the mounting for the camera cylinder than actually building it. With vacation over, time is now at a premimum. Between work and other responsibilities, physical work on the PanoramaScanCam™ has not progressed very far. The design details have continued to firm up, though.

As mentioned previously, the camera cylinder is a length of PVC pipe. The outside diameter of the pipe is approximately 3.5 inches, which equates to a circumference of 11 inches. This correspondes to the long dimension of a standard letter-size sheet of paper and the full-page scan of a flat bed scanner. The camera cylinder is attached to a Lazy Susan bearing and rotated by the belt drive of the scanner mechanism. The layout of the belt drive is modified to support the rotation of the camera cylinder.

The scanner board sits on the top of the cylinder and is oriented such that the cross-scan axis of the sensor is in-line with the axis of rotation of the camera cylinder. That is, the scanner sensor is vertical and the motion of the camera cylinder sweeps the sensor 360 degrees to capture the image. The ribbon cable connecting the sensor board to the controller board runs down the inside of the camera cylinder, through the center of the Lazy Susan bearing, and underneath it, in the cable tray, to connect to the controller board.

It is not possible to directly connect the camera cylinder to the Lazy Susan bearing. The mounting holes and mechanics of the bearing prevent this. It is necessary to fabricate a mounting plate that interfaces the camera cylinder to the bearing. Another mounting plate also needs to be fabricated for the top of the camera cylinder where the sensor board and imaging lens will be mounted. I have worked out designs for these two mounting plates. A PDF of the bottom and top plates can be seen here.

The bottom plate shows the positions of the inner and outer walls of the camera cylinder. The central hole, where the ribbon cable passes through, is in the center. Screw holes for the attachments to the camera cylinder and the Lazy Susan bearing are concentric to each other. The screw holes for the attachment of the camera cylinder will be countersunk to allow for the use of flathead screws. This will ensure that the bottom plate will mount flush to the bearing. Markings on the four corners of the plate are provided to indicate where the plate (and the Lazy Susan bearing) will be trimmed to allow free rotation within the confines of the modified scanner case.

The top plate's design is preliminary at this point, as I have to work out the design of the enclosure for the sensor board and imaging lens. The design of this enclosure will, in turn, determine the location of a slot in the top plate. The ribbon cable will pass through the slot in its path down the camera cylinder.

It is anticipated that the fabrication of the plates will take place tomorrow. I have already selected the screws to mount the Lazy Susan bearing to the case and the bottom plate to the bearing and the camera cylinder. With some luck, I may also get the pulley installed as well. That means I can complete the belt drive assembly this weekend!

January 13, 2007: Bottom Plate Fabrication and Attachment

I decided to only fabricate the bottom plate. Fabrication of the top plate can wait until its design is firmed up. While I was fabricating the bottom plate, I decided to go ahead and trim the corners of the top section of the Lazy Susan bearing. The trimming will allow the bearing to freely rotate within the case. I used an abrasive disk attached to my motor tool. Cutting the corners generated a lot of sparks. I wore leather gloves so my hands were protected from both the sparks and the heat generated by the friction. One abrasive disk shattered during the grinding, so my policy of always wearing protective goggles when using the motor tool paid off.

Trimmed corners of the Lazy Susan bearing.
I printed off a copy of the top and bottom plate drawing I described yesterday. I cut out the bottom plate layout and pasted it to the bottom of a plastic serving tray that I scavenged from our recent family Christmas lunch. The layout serves as a pattern for cutting out the bottom plate using the cutting disk on the motor tool.
Bottom plate layout on a plastic serving tray.
It only took a few minutes to rough out the outside boundaries of the bottom plate. Next, the inner boundary was cut out. The circle matches the inner ring of the Lazy Susan bearing, which the ribbon cable passes through. After the rough cuts were made, final trimming was done using files and a sanding drum attached to the motor tool. The screw holes were then drilled using the motor tool. A 1/4-inch drill bit attached to a hand drill was used to countersink the screw holes for the camera cylinder. Flathead screws will be used to attach the bottom plate to the camera cylinder. A quick soaking of the bottom plate in warm water loosened the paste, allowing easy removal of the layout paper.
Finished bottom plate with layout still attached.
A similar paper layout was pasted to the bottom of the camera cylinder, so screw holes could be drilled in matching locations. Self-tapping flathead screws were used to attached the bottom plate to the camera cylinder. I had to widen the screw holes on the bottom plate to allow passage of the screws.
Bottom plate attached to the camera cylinder.
It was a bit more problematic finding proper screws to attach the bottom plate to the Lazy Susan bearing. I settled on using some self-tapping sheet metal screws. Even with these, I really had to work to get the screws to thread properly into the steel of the bearing. Again, I found that I had to widen the screw holes on the bottom plate to allow passage of the screws.

Overall, I am very happy with how the bottom plate worked out. The camera cylinder rotates smoothly on the Lazy Susan bearing. It is now just a matter of using the drive belt layout as a pattern to place the screw holes for the bearing and the pulley mount. It will not take much time to do that. Then I'll be able to assemble the drive belt and check out its operation. Work on the PanoramaScanCam™ is proceeding nicely now!


Bearing attached to the camera cylinder.

January 14, 2007: Assembling the Belt Drive

Yesterday's progress was followed by assembling the belt drive today. The first task was to drill the screw holes into the case for the Lazy Susan bearing and the standoff for the pulley. I used a portion of the belt drive layout drawing to establish the locations for the holes for the bearing. The layout was pasted to the case just long enough to mark the locations for the holes. Drilling was quickly completed with the motor tool.

Layout for the bearing on the case.
The screw hole placement for the standoff for the pulley turned out to be a bit more difficult. The original placement of the screw hole in the layout drawing turned out to be on the edge of a step in the case's floor. To obtain a better footing, I moved the hole slightly closer to the scanner controller board. The hole can be seen in the upper-lefthand corner of the photo on the right. This turned out to be a very good location, as it provided two walls for the standoff to press up against when it is placed under tension by the drive belt.
Holes for mounting the bearing and pulley.
The pulley assembly consists of the pulley, which was freed from its frame, and the standoff. The standoff is hexagonal and made of plastic (BG Micro part number ACS1178). It is cut to the proper length so that the pulley's position is inline with the travel of the drive belt. The pulley is held in place with a self-tapping screw and the pulley rotates freely.
The pulley assembly for the belt drive.
Self-tapping screws are used to hold the pulley standoff and the Lazy Susan bearing to the case. Lock washers are used with the screws on the bearing to ensure that vibration would not back them out.

With the belt drive assembled, some preliminary testing was performed to ensure that the drive performed as designed and the scanner was still functional. The electrical functionality of the scanner was reinstalled into the modified scanner case. The excess length of the wiring harness for the front pannel controls was looped and secured with tie wraps. The drive belt was routed around the camera cylinder, the pulley, and the drive cog on the stepper motor's gear assembly. The tensioner of the idler cog was pushed to compress the spring. This allowed the belt to slip over the idler. Releasing the spring tightens the tensioner, holding the belt snugly in place. The belt turns the camera cylinder through a friction fit.

Preliminary testing of the belt drive was found to be reasonably successful. I found that one improvement could be made in the camera cylinder. If the drive belt is not perfectly aligned on the camera cylinder, it will tend to creep either up or down, causing the belt to pop off the pulley. Installing a flange on the camera cylinder would prevent the creep from occurring. Ideally, it would be nice to also add a cog pattern on the camera cylinder to match the drive belt. It may also be necessary to flatten the inside groove of the pulley. The V shape of the groove tends to cause the drive belt to twist. This could also cause the belt to creep.

With the completion of the belt drive, notwithstanding the improvements mentioned above, work can now proceed with the scanner head and optical assemblies. The top end of the camera cylinder will also have to be cut and leveled so that the top plate can be attached. The scanner head and optical assemblies will set on top of the camera cylinder.


The bearing and pulley mounted.

The belt drive assembled and tested.

January 15, 2007: Exploiting the Scanner Head and a New Lens

When I first looked at the scanner board, which is attached to the scanner head, I wondered how I would mount it into a new case and attach a new lens to it. Last week, I had a flash of insight and realized that it would make sense to exploit the scanner head case itself. It truely made sense, as it already had mounting points for the scanner board and a possible mounting point for the new lens.

This evening, I stripped the scanner head apart. As the picture on the right shows, my deconstruction yielded four front-sided mirrors, four pairs of retaining clip, an electro-luminescent (EL) light, and a boost converter circuit. These parts could certainly be used in other projects. The thin strip of paper-like material is a reflective backing behind the EL light. The small black piece is a protective rubber cover for the lens that is still inside the scanner head.

The bottom of the scanner head reveals an essentially empty shell. The cylindrical shape at the center contains the lens and optical path of the scaner. Most of what is shown here will probably be cut away. Only the part containing the optical path and the controller board mount will be used.


The disassembled scanner head.

The bottom side of the scanner head.
The back side of the scanner head is shown in this photo. The lens of the scanner can be seen in the center. The cavity in front of the lens allows the light cone to project onto the sensor that is on the scanner board.
The back side of the scanner head.
This is the new lens I'll be using with the PanoramaScanCam™. I picked it up from BG Micro. It is called "The Main Lens" (part number LEN1010). The diameter of the main lens is 1-5/8 inches. The focal length appears to be about 35 millimeters. Why did I select this lens? Well, first, it was cheap (99¢) and second, it appears to be optically bright (low f-number). The second reason is actually important. The sensor of the scanner will no longer benefit from the EL light. Consequently, it will need as much illumination as possible from the scene in order to record an image. Surprisingly, it appears that the narrow portion of the new lens will fit into the optical path of the scanner head.
The new lens for the PanoramaScanCam™.

January 16, 2007: Investigating the New Lens

I did a little investigation on the Internet to see how I could mount the lens neatly. According to the photo of "The Main Lens" on the BG Micro website, the lens is attached to a mounting bracket. The lens is held to the bracket by the screw threads on the lens body. Of course, when I purchased the lens, the mounting bracket did not come with the lens. A substitute had to be found.

I googled on the words "lens screw thread" and came across a Wikipedia entry on the M42 lens mount. The diameter of the screw thread on the M42 mount is 42 millimeters, which is close to 1-5/8 inches. The threads are spaced 1 millimeter apart. When I measured "The Main Lens", I found that it was an exact match for an M42 lens mount. The M42 mount is also know as a Pentax mount. I also found a list of lens mounts on Wikipedia, which referenced another website that listed camera mounts & registers. The term "register" is also referred to as the flange focal distance. "The Main Lens" design, though, does not fit the flange focal distance specified for the M42 lens mount. I'll have to make a trip to some local camera stores this week to see if I can find an M42 mount.

January 17, 2007: Reinvestigating the New Lens

I guess I didn't do a very good job of measuring the thread pitch of "The Main Lens" yesterday. Maybe I didn't hold my calipers quite right. Anyway, the thread pitch on the lens is 2 millimeters, not 1 millimeter. An M42 lens mount won't work with the lens. I'm bummed out about this, as finding an appropriate screw mount will probably be much harder now. I sent off an email to a local camera repair shop to see if they could help out in finding a screw mount that will fit.

In the meantime, I spent some time studying the scanner head. I was able to remove the original lens and found that it was actually a bit smaller in diameter than the narrow part of the "The Main Lens". This means it won't just slip into the optical path of the scanner head. Constructing the optical assembly will not be as easy as I was beginning to think it might be.

January 18, 2007: Still Looking for a Mount for the New Lens

I'm now starting to think outside of the box on this lens mount problem. I may go to Home Depot to see if I can find a pipe with an appropriate internal thread. That may be a long shot, though. Another possibility is to buy some casting material, like Alumilite, and make a screw mount based upon the threads of the lens. This may cost more than it is worth, so I may go find a different lens that does have a matching mount.

January 27, 2007: Building the Lens Assembly

(Note: Additional modifications to the lens assembly had to be made to achieve infinity focus. See my entry on May 2, 2007.)

I spent a number of days trying to figure out how to address the problem of mounting the new lens to the scanner head. A very busy week also prevented me from working on the PanoramaScanCam™. A friend of mine suggested that I not use the threads already on the new lens. Instead, I should find something to attached the lens to that has its own matching screw threads.

I made another trip back to the Home Depot to search through the PVC plumbing fixtures. After about an hour, I found the fixture shown in the photo on the right. It is a 1-1/2" Trap Adaptor made by Mueller Industries.


Mueller Industries 1-1/2" Trap Adaptor.
A trap adaptor is used to secure a pipe to a drain trap that has no threads on the pipe. Disassembling the trap adaptor reveals an inner gasket that compresses against the pipe when the nut is tightened. For the new lens, the gasket is discarded. The adaptor body and the nut thread together smoothly and do not bind. The threads are uniform and do not taper, like they do on a number of other PVC fittings.
The trap adaptor disassembled.
In order for the new lens to fit into the PVC nut, the threads on the lens had to be removed. This was done with a sanding drum mounted on the motor tool. It took a while to remove the threads, but it was easy to do. The paint in the grooves of the lens threads showed how much material still had to be removed and how even the sanding was. It was easier to control the amount of material being removed due the toughness of the metal (as compared to the plastic of the nut). In the end, I actually had to remove a bit more metal for the lens to fit. Still, I was rewarded with a nice fit. I also had to ream out some of the plactic from the inside of the adaptor body. This was to allow the lens to fully enter the adaptor body as the nut was screwed down. The lens was attached to the nut with five-minute epoxy.
Test fit of the new lens to the PVC nut.
While the epoxy was drying, I turned my attention to the original lens of the scanner. The lens is contained withing a metal barrel that was sitting in the optical path of the scanner head. The lens was held inside the barrel with a screw ring. In order to remove the screw ring, I had to fashion a metal blade to fit into the two grooves on opposite sides of the screw ring. Once the screw ring was removed, the contents of the barrel could be extracted.

I was hoping to find in the barrel an optically-flat, infrared (IR) light blocking filter disk that I could use with the PanoramaScanCam™. An IR blocking filter is important because the scanner sensor is sensitive to IR light as well as visible light. The IR light will distort and saturate the colors levels that are measured.

Unfortunately, as the photo to the right shows, there wasn't an indentifiable IR filter inside the barrel. Inside the barrel were three lenses and a plastic baffle. In the photo, the lens barrel is in the center top. Moving clockwise from the upper right is the screw ring, the first lens removed, the plastic baffle, the second lens removed, and the last lens removed. Either, one of the lenses also served as a IR blocking filter, or the window on the scanner sensor itself blocks the passage of IR light. It is interesting to note that the baffle would reduce aperture of the lens and the amount of light hitting the sensor. In photographic terms, this would "stop down" the optics of the scanner, increasing the depth of field in exchange for requiring a longer light exposure time.


Components of the original scanner lens.
Last weekend, I had cut apart the scanner head, keeping only the part containing the optical path and the controller board mount. The final cutting had not been completed, though, because I wasn't sure, at the time, how I was going to connect the new lens.

In mounting the lens, it is desirable to obtain a full range of focusing options; from infinity to close up. To obtain infinity focus, the separation between the focal plane of the sensor and the rear of the lens must equal the focal length of the lens (35 millimeters for the new lens). For focus closer than infinity, the lens would be moved farther away from the focal plane. The position of the adaptor body, with the lens screwed all the way in, must be placed so that infinity focus is obtained. It is acceptable to mount the adaptor body so that the lens is a little closer than infinity focus. There is still enough length in the screw to accomplish infinity (and closer) focus (Wrong!).


Reworked scanner head.
I verified that I had to ream out the optical channel to allow the narrow portion of the new lens to slide down inside it. The inside of the optical channel measured 17 millimeters, while the narrow portion of the new lens measured 18 millimeters. I used the sanding drum on the motor tool to remove plastic from the optical channel.

With the new lens screwed into the adapter body, I measured how much of the plastic of the scanner head should be cut to allow the adaptor body to fit properly and allow the lens to focus as desired. Careful measurement, cutting, and sanding were performed to obtain the desired fit.

The adaptor body was epoxied to the reworked scanner head. The fit is quite good. The screw rotates freely except as one point, close to infinity focus, where there is a minor amount of binding. I have not figured out the cause of it yet. Overall, I'm very pleased with the new lens assembly. The design of the top plate can now be finalized and fabricated. The top plate is used to attach the lens assembly to the camera cylinder.


Completed lens assembly.

January 31, 2007: Design of the Top Plate

(Note: An additional modification to the top plate was made to accomodate a rerouting of the wiring harness. See my entry on April 1, 2007.)

I finalized the design of the top plate, which is attached to the top of the camera cylinder. The lens assembly is affixed to the top of the plate with the cross-scan axis of the sensor inline with the axis of rotation of the camera cylinder. This is to say that the scanner head is placed on one of its sides. The question, then, is which side of the scanner head should be used?

The reason for the concern is two-fold. First, one side of the reworked scanner head has an appendage with a guiding slot for the ribbon cable. In order for this side of the scanner head to be mounted to the top plate, a hole would have to be cut into the top plate to allow the appendage to pass through. The size of this hole would significantly weaken the top plate. It would be better to use the other side of the reworked scanner head. It presents a flat surface to attach to the top plate

The second issue is that the construction of the scanner sensor effects the way that images are recorded. The sensor records each pixel of the image using three Charged Coupled Device (CCD) detectors - one each for red, green, and blue. These pixels do not overlap each other. Rather, they are adjacent to each other in the in-scan direction. When the original scanner head moved over the paper, the red pixel would acquire the "red brightness" for one line. At the same time, the green pixel would acquire the "green brightness" for the previous line. At the same time, the blue would acquire the "blue brightness" for the line before that. As the lines are scanned and the data recorded, the scanner software will match up the red, green, and blue pixels to the appropriate lines. To illustrate this, look at the top figure in this PDF. The lines (1, 2, and 3) are imaged by the red, green, and blue detectors of the scanner sensor, respectively, as the scanner head moves across the paper. The colored rays illustrate how the light path reflects off the mirrors, passes through the lens, and then falls onto the detectors (1, 2, 3) of the scanner sensor.

The bottom figure shows how the scanner sensor in the reworked optical assembly should be placed in order for scanned images to be recorded in a similar fashion. Due to the absense of mirrors, the light path is much more straightforward. It also shows that the right side of the reworked scanner head (the side with the appendage) should be facing up. This is a lucky situation. The mechanical problem, described above, of using the right side of the reworked scanner head is avoided.

The final design of the top plate is shown at the bottom of this PDF. The design of the bottom plate has not been changed. The top plate provides screw holes to attach the reworked scanner head. One large slot is provided as a feed-through for the ribbon cable. An adjacent hole is provided to attach a small plastic wedge to hold the ribbon cable in place at the slot. A smaller slot is provided as a feed-through for signal wires for the registration sensor that will be removed from the scanner head circuit board (This will be described in detail later.). I hope to fabricate the top plate tomorrow.

February 1, 2007: Top Plate Fabrication

The fabrication of the top plate went about as smoothly as expected. The photo on the right shows the top plate after the cutting, filing, and drilling were completed. The tap holes for the reworked scanner head were also drilled and the self-tapping screws were set. The top plate pattern and the scanner head drill hole pattern were pasted onto their respective objects, as was done with the bottom plate. The patterns and glue were removed with warm water. The small plastic wedge will be used to hold the ribbon cable in place at the slot.

After performing some test fitting, I found that I had to file off some plastic on the scanner head in order for it to rest flat on and perpendicular to the top plate. I also decided that I needed to add an opposing wedge to grip the ribbon cable. A single wedge might apply a shearing force to the ribbon cable at the point where the cable passes through the slot in the top plate. I also needed to drill a hole in the appendage of the scanner head so I can attach a bracket between it and the top plate. I'll do these tasks on Friday.


Completed top plate (almost).

February 2, 2007: Completion of the Top Plate

I was hoping that I'd get more done today, but it just didn't happen. Still, I completed the work on the top plate and attached the lens assembly to the top plate. The photo on the left shows the results. Note the addition of the second wedge attached to the top plate. As mentioned before, the ribbon cable will be clamped between these two wedges. They will act as a strain relief, so any movement of the cable during the rotation of the camera cylinder will not be transferred beyond the interface at the top plate. This will reduce the possibility of a kink occuring in the ribbon cable where it twists to connect to the sensor electronics board. A small bracket has been made to secure the appendage on the reworked scanner head. This makes the attachement of the lens assembly more rigid.

Lens assembly attached to the top plate.
After attaching the lens assembly to the top plate, I did some measurements and testing preparatory to cutting the camera cylinder and attaching the top plate to it. I attached the sensor electronics board to the scanner head and attached the ribbon cable to it after running the cable up through the slot in the top plate. I tried an couple of approaches to twisting the cable to allow it to attach to the sensor board without putting kinks into it. I also wanted to see if there were any potential kinking problems with the cable as the lens was being rotated.

What I determined was that the resting position of the scanner lens would have to face to the front of the scanner rather than to the rear. My original plan was to have the lens face to the rear. If a scan less than 360 degress was desired, a scan in the forward direction could be done with a single scan. A scan to the rear would have to be done in two segments, which would then be spliced together.

The optimal approach to twisting the cable would suggest that the rest position of the camera cylinder would have the ribbon cable twisted 180 degrees in the counter-clockwise direction. A 360-degree scan would then result in a maximum 180-degree twist of the cable in the clockwise direction. This would minimize the risk of kinks in the cable as the cylinder rotates. Coincidentally, the optimum approach to attaching the cable to the sensor board requires the conductor side of the cable to be facing forward as the cable is passed though the slot in the top plate. This reinforces the need for the rest position of the lens to be facing forward. Although I prefer my original plan, I will accept the change to reduce the risk of damaging the cable.

February 3, 2007: Camera Cylinder Construction, Test Assembly, and First Light!

A lot was accomplished today, or should I say, a lot of work finally paid off today. I had to disassemble the camera cylinder so I could complete its fabrication, as shown in the photo to the right. It was necessary to shorten the length of the camera cylinder to allow the ribbon cable to come out of it and connect to the sensor board. I also had to add tap holes so that self-tapping screws could be used to attach the top plate. A hole was drilled on the side of the camera cylinder to provide another feed-through for signal wires for the registration sensor. The pencil markings indicate where the drive belt touches the camera cylinder.
Camera cylinder cut and marked for belt.
The photo on the right shows a test assembly of the PanoramaScanCam™. As part of the test assembly, I decided to add the enhancements to the camera cylinder and the belt drive (see the January 14 posting). A pair of flanges, made of rubber bands, were attached and fixed in place with hot glue. I also added a fillet of hot glue to the idler pulley. These two enhancements appear to help keep the belt from creeping and popping off the idler pulley.

With the camera cylinder reattached, I was able to complete a test assembly by attaching the top plate. I first had to guide the ribbon cable up through the camera cylinder and through the slot in the top plate. After attaching the top plate to the camera cylinder, I tightened the wedge against the ribbon cable to provide strain relief. Next, I attached the ribbon cable to the sensor board. Then I had to route the drive belt around the camera cylinder, idler pulley, drive cog, and idler cog. Once the belt was in place and the tensioner had tighened the belt, I had to manually turn the camera cylinder to face the lens assembly forward. I also had to make sure that the proper 180-degree counter clockwise twist was placed in the ribbon cable. Upon screwing the lens into the lens assembly, I was ready to conduct my first live test.


Test assembly of the PanoramaScanCam™.
I booted my Linux workstation, powered up the PanoramaScanCam™, and connected it to the workstion with the USB cable. Using xsane, I first did a preview scan and then a full page scan at 75 dpi resolution. I had to manually obscure the registration sensor at the end of each scan. I have not made the modification of the scan head circuit to place the registration sensor on the camera cylinder.

The photo on the right is the first light of the PanoramaScanCam™. The redness of the image indicates that an IR blocking filter must have been an integral part of one of the lenses in the original optical barrel (see the January 27 posting). Consequently, I'll have to obtain an IR blocking filter to replace it. I am pleased to see that the lens is indeed bright enough to produce an image that the sensor can detect. In fact, it may be too bright. The streaking is cause by saturation of the CCD detectors. As I expected, the aspect ratio is wrong. This can be corrected by resampling along the cross-scan (vertical) axis. Note that for normal viewing, the image has to be rotated counterclockwise by ninety degrees from the actual scan.

The second photo is an approximate correction of the color and aspect ratio. I used xv to do this. The gamma for the green and blue bands were set to 2.0, while the red band was left at the default gamma of 1.0. The vertical axis was rescaled by a factor of 1:2.56. Further testing will have to be made to determine the proper adjustments. Of course, an IR blocking filter will be need to be installed before any true color corrections can be attempted. I am very excited that the PanoramaScanCam™ is now working!


"First light" of the PanoramaScanCam™.

First image with color and aspect ratio correction.

February 9, 2007: Registration Sensor Mount

(For a more robust solution to the registration sensor problem, see my entry on March 20, 2007.)

Quite a bit of work has been accomplished since "first light". I just have not had time to write it up and post it. Now, I have some time to bring things up to date.

In my January 31 entry, I mentioned a registration sensor that would be mounted on the camera cylinder. The registration sensor is an optical switch mounted on the sensor circuit board. It was used by the scanner to sense when the scanner head had been moved back to a "home position" after a scan is completed. With the PanoramaScanCam™, this sensor is still needed. It just needs to be used in a different way.

After the camera cylinder rotates to capture a 360-degree image, it must return to its starting point. As the camera cylinder rotates back, a tab must interrupt the optical switch to indicate that the camera cylinder has returned to its "home position". It is critical that successful detection is made, otherwise the cylinder will continue to rotate and twist the ribbon cable to the point of destruction.

I had originally thought that I'd just place a tab on the floor of the case and allow the registration sensor to pass over it to find the "home position". As the cylinder rotated during a 360-degree (or greater) scan, a spring would cause the tab to be pressed down. This would avoid an errant detection of the "home position" as the registration sensor passed back by the tab the first time. Unfortunately, I found it to be impractical to construct such a mechanism. The overall rotation from "home position" for a full scan (a preview) was well over 400 degrees.

It took some advice from another friend to come to a workable solution. He suggested that I place the tab on another wheel, which would be rotated by the camera cylinder. The diameter of the new wheel would be greater than the diameter of the camera cylinder. That way the tab would encounter the registration sensor at only one conjunction point in even the longest scan.

The problem with this solution was that there was insufficient room in the case to place the new wheel. In addition, it would require another belt, gearing, or a very good friction fit to assure that the new wheel would be smoothly rotated by the camera cylinder. It occurred to me though that the wheel holding the tab could be smaller in diameter than the camera cylinder. It would work if only one conjunction occurred between the tab and the optical switch during the scan. Such a wheel was already in place: the idler pulley. This is the design I settled on. The following photos show the construction of the new registration sensor assembly and the placement of the registration tab on the idler pulley.

The clip that holds the registration sensor to the camera cylinder was originally a clip for a toilet tank filler hose. It was cut up to provide a mounting hole for a small perf board. The clip was bent to follow the curvature of the camera cylinder.

A small perf board holds the optical switch that was removed from the scan head circuit board. Removing the optical switch from the circuit board was a daunting task. I didn't want to damage the optical switch or the circuit board itself. Doing either could spell disaster for the project. As it was, a lot of solder sucking and part prying was necessary to remove the optical switch. Even then, it was impossible to clear some of the holes on the circuit board. They were so small that neither a solder sucker nor wire braid would remove the solder.

The connector on the registration sensor board came from a dead 3 1/2 inch floppy drive. A pin was clipped to provide a key. Parts of an old machine pin IC socket were used to provide a socket for the optical switch. This socket and the connector were attached to the perf board with epoxy. The socket and connector were wired together with 30-gauge Kynar wire.


Deconstruction of the toilet tank hose clip.

Completed registration sensor assembly.
The photo on the right shows the mounting of the registration sensor board on the camera cylinder. The registration tab described above has also been mounted on the idler pulley. The registration tab was fabricated from the metal door of a 3 1/2 floppy diskette. The registration sensor and registration tab are shown in the "home position". The position of the registration sensor board can be adjusted by loosening the screw holding board and sliding the clip holding the board. This arrangement works nicely, even though the registration tab does pass close to the registration sensor towards the far extent of the scan.
Registration sensor mounted on the camera cylinder.
Some wiring from a discarded computer was used to form a harness between the scan head circuit board and the registration sensor board. The additional length of the wiring provides a "service loop" that allows removal of the top plate without disconnecting the harness. Clear heat-shrink tubing was used to protect the soldered connections on the harness. Right-angle headers were soldered onto the circuit board where the optical switch originally sat. Doing this was almost as difficult as removing the optical switch!
Wiring harness for the registration sensor.
Here is a photo showing the completion of the primary assembly of the PanoramaScanCam™. All that remains now is finishing up the top cover of the case and fabricating a shroud for the top of the camera cylinder. I also need to address the issue of an IR-blocking filter for the CCD sensor. I have several ideas on how I might address this problem. I'll save that topic for another day, though.
Primary assembly of the PanoramaScanCam™ done!

February 17, 2007: A Cover, A Shroud, and Some Second Thoughts

I had hoped that taking care of the cover and shroud would have been fairly easy and straightforward. As it turns out, neither were the case. In addition, I discovered a problem with the PanoramaScanCam™ that has given me some second thoughts about how I implemented it. I'll discuss this later.
Last weekend started out with a stroke of good luck. I needed a shroud for the to cover the scan electronics at the top of the camera cylinder. I thought that I would first try the local Dollar General store to see if I could find something that might work. I found a three-piece plastic tumbler set that might work. It turned out that the mouth of the tumbler was 3 1/2 inches in diameter. Just what was needed. I left the store $1.08 poorer, but ready to make a shroud. One of the tumblers can be seen in the photo on the right.

I immediately ran into problems with actually making and fitting the shroud. It is desirable to have the shroud fit as closely around the camera lens as possible so that foreign objects cannot get inside the shroud easily. Due to the conical shape of the tumbler, the exact shape of the hole is difficult to determine. In addition, the conical shape makes it difficult, if not impossible to fit the shroud over the lens mount, even with the lens itself removed.


Test fit of case top and a candidate shroud.
Having three tumblers to work with, I decided to use one to experiment with. I figured that even if I ruined all three, I could buy another set cheaply enough. After cutting a lens hole and discovering the fitting problem described above, I cut from the bottom part of the lens hole to the lip of the cup. I found that if I was careful, I could fit the shroud over the scanner board, the lens mount, and mate it to the top of the camera cylinder. I really had to stretch the parts of the tumbler that had been cut in order for the shroud to fit over the lens mount. Unfortunately, the edges of the cut would not fit back together. With the mouth of tumbler being just 3 1/2 inches in diameter, it was a press fit over the top of the camera cylinder. Consequently, the press fit was stretching the mouth of the tumbler.

At this point, I was a bit stumped as to how to proceed. I really want to have a nice, clean fit of the shroud to the camera cylinder. In order to fit the shroud over the lens mount, the bottom of the tumbler must be cut, which leaves an unsightly gap at the bottom. I could look for another shroud (err tumbler) that has straight sides, but I want to make this one work.

This weekend, I turned my attention to making a cover for the PanoramaScanCam™. That is to say, a cover for the big hole in the top of the case. I had been thinking about how to do this for some time without arriving at a satisfactory answer. My original thought was to just glue a sheet of plastic over the opening with a hole for the camera cylinder. Alas, this would not work properly, as the hole would have to be quite large in order for the lens to slip through. I then thought of using two pieces of plastic that were held in place by screws. This seemed okay, but I'd have to locate a large enough sheet of white plastic for the task. Then, I was struck with an idea that makes a very neat solution: reuse the original scanner cover!

Reusing the scanner cover would require resectioning it into two pieces and carving out half a hole in each piece for the camera cylinder. Each half would then be held in place with some form of hidden attachment; perhaps velcro. The neat aspect of this solution is that the overall theme of an obviously hacked scanner would be maintained. The illusion of a chopped scanner with a cylinder rising out of it would look quite clever.

To resection the cover, I first had to find out where the cover needed to be cut. I first fashioned a cutout pattern that would indicate where the mating halves of the cover would meet. The hole for the camera cylinder and the location of the camera cylinder itself were then put into place. The initial cutout pattern is shown in the photo on the right.


Drawing of the cover cutout pattern.
After placing the case top onto the case, the cutout pattern was placed onto it. The pattern was then taped into place with the center line for the two halves of the cover properly oriented. This is shown in the photo on the right. The case to was then removed, carefully lifting the tape and moving part of the pattern to allow the lens to slip through.
Cover cutout pattern fitted.
Next, I attached the scanner cover to the case top, flipped them over, and marked where the back porting of the cover needed to be cut. Then, I carefully marked the cutout pattern to indicate where it should lie on the forward portion of the scanner cover. After moving and taping the pattern to the forward portion of the scanner cover, the cover was marked appropriately. The photo on the right shows the completed markup of the scanner cover. As I have done in the past, I placed arrows to indicate on which sides of the lines I need to cut. I plan on cutting the scanner cover apart tomorrow.
Markup of scanner cover before cutting.
As I mentioned at the beginning of this entry, I encountered a problem with the PanoramaScanCam™ that has caused me to have second thoughts about how I implemented it. The problem is with the registration sensor. Last weekend, after I had stopped working on the shroud, I decided to test the PanoramaScanCam™ to make sure that I had not damaged it during my testing. I was alarmed to find that it would not complete a scan properly.

While doing a scan, the cylinder would turn until it reached the end of the scan, but it would not return back to the home position. After much experimentation, I found the problem. It turned out that there must have been some slippage of the camera cylinder on the belt. Consequently, the registration tab on the idler pulley was not reaching conjunction with the registration sensor at the proper time. A second conjunction was occuring as the scan progressed, which confused the scanner controller. I had thought that the presence of the registration tab was ignored until after the scanning was completed and the scanner was returning to home position. I was wrong. The second conjunction must be detected, resulting in a "freeze" of the scanner at the end of the scan.

I was able to readjust the camera cylinder's postion so that it would work properly again. I think that it is just a matter of time, though, before things get out of alignment again. I need to come up with a better approach to the registration sensor problem. One that isn't affected by belt slippage. I have been working on some ideas, which I'll mention at another time.

February 22, 2007: Cover And Shroud Construction

I finished up the rework of the scanner cover on Sunday and Monday, but I havn't had time to document my progress until now. The photo on the right shows the completed cover along with the PanoramaScanCam™. I decided that I wanted to have quick access to the interior of the scanner, so I didn't use screws to attach the top cover to the case top. Rather, I epoxied plastic magnets (the type used for refridgerator art) on the cover halves. I attached spare ceiling fan balancing weights on corresponding locations on the case top.
Completed rework of the scanner cover.
The photo on the right shows the finished cover in its normal position, attached to the case top. The magnets hold the cover pieces to the case top just fine. To gain access, all that needs to be done is to pull the front half of the cover off of the case and flip the rear half of the cover up on its hinges. For more serious maintenance, the screws on the case top can be removed and the case top can then be lifted off of the case.

I'm quite pleased with the results. I think that the desired affect of a "chopped" scanner has been achieved. Now, on to the shroud.


Cover installed on the PanoramaScanCam™.
I determined that the tumbler that I had selected would not work as a shroud. The taper of the tumbler interfered with the scanner head. I went to a couple of other "dollar" stores and determined that the tumbler I found was pretty much a standard shape. I had to come up with an alternative design for the shroud.

I decided that it was necessary to fabricate a shroud with a straight, cylindrical wall. Looking at what I had on hand, I figured that I could use some of the left-over PVC pipe to make top and bottom hoops. The wall of the shroud would be made of the thin plastic sheet that had been attached to the inside of the scanner cover. It was originally used to press the copy matter to the glass window of the scanner.

A sheet of polyurethane foam was glued between the plastic sheet and the scanner cover. Believe me, it was a real pain to clean that polyurethane foam from the plastic sheet. I had to use a lot of acetone to remove the foam and the glue holding it. I was surprised that the acetone didn't dissolve the plastic sheet.

The top of the shroud is a "blow-out" test plug I picked up from the Home Depot. These are used to provide a pressure release when testing PVC plumbing. The photo on the right shows the present state of the fabrication. I should be able to finish the fabrication this weekend.


Initial shroud fabrication.

February 24, 2007: Shroud Construction Continued

Shroud construction continued with making a paper template that would show the position of the lens hole relative to the upper and lower hoops. Please excuse the messy appearance of the template. The photo was taken after the pattern was transferred to the plastic sheet.
Shroud template.
After the pattern was applied, the hole was cut in the plastic sheet and the height dimension was cut to size. The tricky step was to form the plastic sheet around the hoops and epoxy them in place. The two photos on the right show how this was done.

Prior to arranging the plastic sheet around the hoops, notches were cut on opposite sides of each hoop to allow them to eventually be cut in half after the epoxy had cured. The spare section of PVC pipe was used as a form and to provide rigidity to the shroud's center section. The hoops were inserted and postioned in place. Rubber bands were used to keep everything in place.

Epoxy was applied to the inner surfaces of the hoops. A drinking straw was used to spoon globs of epoxy onto the hoops. The bottom side of the lower hoop was not epoxied so that the shroud would sit flat against the top plate of the camera cylinder. The top side of the upper hoop was not epoxied so that the "blow-out" plug would sit flat on top of the upper hoop.


Side view of the shroud construction.

Bottom view of the shroud construction.
After the epoxied cured, an X-acto mini saw was used to cut the notches that had been previously cut into the opposite sides of each hoop. This allows the shroud to open up at the cut points allowing the form in the center to be removed. The shroud can, likewise, be opened to be inserted over the camera lens, wrapped around the scanner head and scanner electronics board, and then closed. A securing mechanism will be used to keep the shroud closed.
Partially completed shroud.
I decided to try a test fit of the shroud on the camera cylinder. It is almost a perfect fit. A little trimming has to be performed on the lower hoop as the scanner head keeps the shroud from completely closing on one side. The "blow-out" plug also has to be attached to one of the halves of the upper hoop. After that, the securing mechanism has to be made so the shroud will stay closed. I'm using some rubber bands for the test.
Test fit of the shroud.

February 26, 2007: Shroud Construction Completed

To complete the shroud construction, I epoxied the "blow-out" plug to one half of the top hoop. When the shroud is closed, the other half of the top hoop mates to the other side of the plug. The fit is positive, which helps to keep the shroud from opening. As mentioned on February 24, I trimmed some of the lower hoop to allow the shroud to close completely.
The "blow-out" plug attached.
I decided to keep the closure of the shroud simple. There was sufficient extra material in the hood to form a tab/slot arrangement. Selective cuts of the plastic allow for interlocking, as shown in the photo on the right. The fit is reasonably snug. Between the friction fit of the "blow-out" plug to the hoop and the tab/slot arrangement, the shroud stays shut snuggly around the camera cylinder.
The closure of the shroud.
This photo shows the completed shroud mounted on the PanoramaScanCam™. The shroud makes the camera cylinder look quite tall. There is sufficient space in the top of the shroud to allow for future enhancements to the scan head. The flat top of the shroud provides a platform for the addition of supporting hardware, such as a light. I'm very pleased how it worked out!
Finished shroud on the PanoramaScanCam™.

March 11, 2007: Tying Up Loose Ends

I've been quite busy the last two weeks. I had to deal with moving my website from Comcast to Roadrunner, as you have discovered by reading this. While I have had time to work on the PanoramaScanCam™, there hasn't been time to do the work and write up and post the results as well. Below is sort of a teaser of what is to come.

There are still a couple of issues that I want/need to resolved before I can call the PanoramaScanCam™ completed. The first one in the problem with the registration sensor, as I mentioned in the entry on February 17. The second one is the need for an IR blocking filter, as I mentioned in the entry on February 3. The third one is providing the ability to select imaging with IR or visible light. I have been thinking and designing solutions for these three issues pretty much in parallel.

To solve the registration sensor issue, I've developed a circuit that uses a quadrature encoder IC and some simple logic to monitor the position of the camera cylinder as it rotates. An encoder disk would be attached to the camera cylinder to generate the quadrature signal. Depending on the position of the camera cylinder, an IR LED is turned on or off. A new phototransistor is placed on the camera cylinder to detect the light coming from the IR LED. The design is pretty straightforward, but I want to do some addtional testing before implementing it. I plan on posting additional details this week.

I've investigated several avenues in finding an IR blocking filter. Local camera stores were no help whatsoever. I did find "relatively" inexpensive IR blocking filters, but minimum order requirements, significant shipping charges, and the cutting of brittle glass are involved. More details will follow this week, but it is sufficient to say that this will be the most expensive component of the PanoramaScanCam™.

I figured out a fairly nifty design for fitting the mechanics of a filter switching mechanism within the scanner head. It will require a pair of small stepper motors taken from floppy drives to actuate the filter brackets. A PIC chip may be used to control the steppers. I still have to work out how provide power and communicate filter selection to this "parasite" circuit. I call it that because the circuit will be on the camera cylinder, but the scanner circuitry will not provide any control to it, only power. Much more research will have to be done before this design can be implemented.

March 20, 2007: A Low-Tech Solution, After All

In my last entry, I mentioned that I had designed a circuit in an attempt to solve the problems with the shifting of the registration sensor. I have persued the solution all the way to designing a schematic, a printed circuit layout, and a component mask using the gEDA tool suite and collecting the components. While doing all of this work over the last couple of weeks, I kept having nagging doubts in my mind as to whether my design was an optimal and, more importantly, a robust solution.

I kept thinking how some sort of simple mechanical solution might be easier to implement. I doodled on a piece of paper, drawing a overhead view of the camera cylinder. I considered a scheme that would provide a movable, spring-loaded registration tab and an arm attached to the camera cylinder. The arm would move the registration tab out of the way at the appropriate time. It dawned on me that a suitably shaped piece of stiff wire could act as the arm and a folded piece of stiff, but flexible metal could be used as the registration tab. The two photos to the right show the results.

The registration tab is fabricated from part of the sliding cover of a 3-1/2 inch floppy diskette. I used a piece of coat hanger wire to form the arm. It is shaped as a curve that flows smoothly out from the attachment point. It sort of reminds me of an Archimedean spiral, although it really isn't. The shape and positioning of the arm required cutting out part of the front bulkhead of the scanner case. I also had to make sure that the arm did not collide with the support post of the idler pulley.

The first picture shows the registration sensor in the home position. The wire arm is on the outside of the registration tab. During a scanning operation, the camera cylinder rotates and brings the arm back around to contact the registration tab. The gentle curve of the arm pushes the registration tab back without causing it to twist. The second picture shows how the arm has pushed back the registration tab so that the registration sensor does not interact with it. After the scan, the camera cylinder rotates back, causing the arm to release the registration tab. The spring in the metal allows the registration tab to return to its original position. The registration sensor can then interact with the registration tab to stop at the home position.

I'm very pleased with how this solution worked out. It was simple to implement and should be quite robust. Metal fatigue in the registration tab could be a problem. There is a possibility that repeated flexing might cause it to break. From what I can tell, the flexing is not that great, so it will probably not be a problem. I just wish I had thought of this low-tech solution sooner!


The registration sensor in the home position.

Metal arm pushing back the registration tab.
As part of the design, I flipped the orientation of the registration sensor such that the home position placed the sensor on the other side of the camera cylinder. This required a rework of the sensor's wiring harness. New holes were drilled in the top plate and the side of the camera cylinder to allow the harness to drop in a straight line from the sensor electronics board to the registration sensor.
Rework of the sensor wiring harness.

April 1, 2007: Resolving the IR Problem

I mentioned in my entry on March 11 that I needed to find an IR filter. I wanted to be able to make images with either visible light or IR light, not both at the same time. While there are commercially-available filters to block visible light, yet pass IR light, there are also a number of very inexpensive solutions. The solution I chose involves using exposed and developed Kodacolor negative film. It is described here. I happened to have some on hand, so it was an easy decision.

It was a different matter altogether to obtain a filter that blocks IR light, yet passes visible light. There are two of ways that IR light can be blocked: reflection or absorption. A number of IR blocking filters are described here. The means of fabricating an inexpensive IR blocking filter struck me as a bit too dangerous to attempt.

After some searching on the Internet, I found two promissing sources for IR blocking filters. They were Edmund Optics and ESCO Products. I concluded that a Schott BG38 filter would be a suitable filter that shouldn't be too expensive. What I found was that after sales taxes, shipping costs, and minimum order requirements, I would have to spend around $50 for a small piece of glass. At that point I felt a bit stumped. I was beginning to think that PanoramaScanCam™ would have to operate with IR light only, just to obtain an inexpensive filter.

Well, a solution for the problem came from an unexpected source. A reader of this "blog", A. Dominic Fortes, reached me by email and sent me the generous donation of a UQG Optics ICF-2510 IR Cut-off filter. The transmission response of the filter can be found here. This filter has a much sharper cut-off and flatter bandpass region compared to BG38. A photo of the filter can be seen on the right. It is 25mm in diameter and 1.1mm thick. I intentionally photographed the filter at an angle, so it would be more visible. When looking at it straight on, it appears to just be a circular piece of plain glass. But it is, oh, so much more than a circular piece of plain glass. Many thanks, Dom!


IR blocking filter.
When I was considering the addition of light filtering to the scanner head, I thought that it would be possible to install a mechanism to switch between an IR blocking filter and a visible light blocking filter. This would have involved cutting glass, building a mechanical shutter assembly, and programming a PIC microprocessor. After that, I'd still have to find a way to provide power and control signals to the mechanism. Well, one simple problem derailed that concept: focus. Most lens systems are designed to compensate for chromatic aberration in the visible light spectrum, but not for near-IR. Consequently, a scene that is in focus under visible light will be out of focus in near IR light. If I wanted to image scenes in both visible light and IR light, I'd have to change to focus on the lens.
I decided to simplify the design and make a caddy that would hold the filter as is. I came up with a simple design for the caddy, as well as the placement of slots for the caddy in the scanner head. The photo on the right shows the three components of the filter caddy along with the screws and nuts used to hold them together. I used the same plastic tray material that I used for the top and bottom plates of the camera cylinder.
Components of the filter caddy.
This photo shows a test assembly of the filter caddy. A little trimming still needed to be done. I wanted the assembled caddy to slide smoothly into the slots in the scanner head. I also wanted a close fit for the filter in the caddy, so the filter would not move around.
Test assembly of the filter caddy.
Two templates were placed on the scanner head to indicate where the filter caddy slots had to be cut. Making these slots was a tense operation, as I did not want to make the slots too tight or too big. The scanner head is made of glass-filled polycarbonate (PC+GF), so I had to make sure that I didn't crack it while cutting it. Actually, the task involved a few strategic drill holes followed by a lot of filing. PC+GF does not cut easily.
Slot templates on the scanner head.
This photo shows to completed filter caddy and caddy slots in the scanner head. The dull appearance on the frontmost caddy component is intentional. This side of the caddy will be facing the scanner sensor. Dulling the surface will cut down on stray light reflections inside the scanner head.
Finished filter caddy and caddy slots.
Once the filter caddy was completed, the IR cut-off filter was (carefully) placed into the caddy, which was then inserted and secured into the scanner head. The completed caddy installation is shown in the photo on the right.
Filter caddy installed in the scanner head.
It is said that "the proof of the pudding is in the tasting". In this case, I'd guess you would say the proof of the filter is in the seeing. The top image in the photo is the original "first light" image I posted with the "blog" entry of February 3. A noticeable red tinge is present everywhere. This is the affect of the near IR light. The bottom image was generated with the new IR cut-off filter in place. The colors are quite natural looking. No retouching had to be done other than the vertical scaling in both images. Streaking and saturation appear in both images, though to a lesser extent in the second image. This is due to both the absence of near IR light and the reduced transmission of visible light (about 90%) caused by the filter. Some streaking and saturation is unavoidable when a bright light source is present. I'd say that the IR problem has been solved!
(T) Image w/o IR filter, (B) image w/ IR filter.

April 15, 2007: Calibration and Geometry: Part 1

With the resolution of the IR problem, the PanoramaScanCam™ is essentially finished. Still, there are a couple of issues that need to be addressed that make the difference between a "proof of concept" and a truely usable camera. These issues are calibration and geometry. What is meant by "calibration" is the adjustment of the color and intensity of the image data so that it replicates the acutal scene. What is meant by "geometry " is the adjustment of the geometric orientation of the data so that is replicates the geometry of the actual scene. How are these issues manifested in the PanoramaScanCam™? How can they be resolved?
The image on the right is a close-up of the bottom image in the photo posted on April 1. My right arm and shirt sleve in the far right portion of the close-up are shown to provide context to the original photo. The "banding" that is clearly visible on the white wall is not actually there.

When I saw this banding for the first time, I thought that there was something wrong with the wiring of the scanner head or the new optics that project light onto the scanner sensor. In my posting on January 31, I discussed how the replacement of the scanner head's original optical path with a lens could affect how the image was viewed by the sensor. I thought that the banding was caused by a misunderstanding, on my part, of how the original optics worked. I wrote a short program to shift the red, green, and blue colors of each pixel to the left or right by a specified number of pixels. This did not make any improvement in the banding and the images just became more fuzzy.


Image detail showing "banding".
I knew that the scanner produced clear images before I converted it into the PanoramaScanCam™. I also verified that the electronics of the scanner head were properly working. I decided to look at how the sane-umax1220u backend performed calibration for the UMAX 2100U.

As I mentioned in my posting on January 4, there is a calibration strip on the underside of the case top. The calibration strip is shown in the top portion of the photo on the the right (looking rather torn up, thanks to the disassembly of the scanner). Originally, I thought that only the white portion of the calibration strip was used to obtain a white level (red, green, and blue intensities at maximum and equal level) for the calibration. Perusal of the source code of the sane-umax1220u source code revealed that the thin, black stripe (at the bottom of the calibration strip) is also used as part of the calibration procedure.


Calibration strip on the scanner case top.
I have worked on getting an understanding as to how calibration is achieved. The scanner first locates the calibration strip and the start of the scanner window. An area guaranteed to contain the strip is scanned and then the black stripe is located as an absolute reference point. Then, the calibration strip is scanned again to obtain an image for calibration. The pixels corresponding to a given detector of the sensor are summed and then averaged. This average is used to form a gain value for each detector. The gain values, along with default gamma value, are passed back from the host computer to the scanner.

Conversion of the UMAX 2100U scanner into the PanoramaScanCam™ removed the calibration strip from the sensor's view. It appears that the gain values derived are now based on what ever is seen by the sensor. This is probably driving each gain to an unreasonable value (It is also probably forcing the scanner to use a default position for the location of the "start" of the scanner window. In order to see what those gain values are and how they were derived, I'll have to modify the sane-umax1220u source code to output the calibration image and the gain values. Provisions are already made in the code to output the calibration image. I just need to uncomment a C preprocessor macro. I will have to add some code to dump the gain values to a file.

The geometry issues related to the PanoramaScanCam™ are rotation of the image and correction of the aspect ratio. I have not pointed this out in the past, but the scanned images that have been displayed to date have been rotated ninety degrees from their original presentation. What is viewed as the left-hand side of the image was originally the top of the scan. This is due to the way that a page scanner treats the image. On the bed of the scanner, the top of a page is placed at the beginning of the scan. The scan head moves down along the page to capture the image. Therefore, the image can be viewed normally as a rendition of the page. The scan head of the PanoramaScanCam™ has been placed on its side to allow for the 360-degree scan. Consequently, the resulting scan looks like it has been turned on it side in a normal scanner presentation. The ninety-degree rotation corrects for this.

As shown in the PanoramaScanCam™ "first light" (see my posting on February 3) the aspect ratio of the image is not correct. The vertical axis appears to be streched. The effective aspect ratio of the pixels is distorted. This is due to the focal length of the lens used and the rotation rate of the PanoramaScanCam™. This is well explained in Andrew Davidhazy's webpage. The aspect ratio has to be corrected by post-processing after the scan. The question is what is the scaling necessary to correct the aspect ratio?

I will work on resolving these calibration and geometry problems over the next few days.

April 21, 2007: Calibration and Geometry: Part 2

I made modifications to the sane-umax1220u backend source code to dump out the calibration and gain data. In the process, I created a new backend, which I call psc_umax2100u. To make the code easier to follow and maintain, I stripped out all code and data that was not used by the 2100U. With the new SANE backend compiled and installed, I did some test scans to see what was going on.

I discovered that when the alignment and calibration scans are performed, the sensor gain must be set to a very low value. The pixels in the scans are all very dark. When the brightness of the alignment image was adjusted to a very high setting, I could make out objects that were in the scene (I also noticed that the image was gray-scale not color.). I could see now that the backend must be using a default position for the location of the "start" of the scan. No discernable black stripe would be found, as the entire image is virtually black.

The calibration scan was as dark as the alignment scan. As I suspected, this resulted in abnormal gain values being set. The gain for each detector was set to a value of 127. I reasoned that if a bright light was shined into the lens during calibration, the gain values would be set to a lower value. Doing this resulted in gain settings ranging from 0 to 127, depending upon the accuracy of my pointing of the light and where the light fell on the sensor. With lower gain values, the scene is still imaged, but it is much darker. The objectionable banding is still present, but is much darker, also. This causes me to suspect that the banding is caused by detector noise. If the scene were imaged in bright light, then the detector noise would be supressed by the brightness of the scene. In order to test this out, some scans outdoors will have to be performed.

For a first-order approximation, geometry correction can be achieved though simple scaling of the image to the correct aspect ratio. This is done by imaging a target of known size and then adjusting the aspect ratio so that the image of the target has the same relative dimensions as that of the target. I used a sheet of foam-core board as the target. Its demensions are 30 inches by 20 inches. I placed the board on a ladder with the long dimension laying horizontally. The target was positioned so that PanoramaScanCam™ would image the target squarely. I wanted to minimize the perspective distortions caused by line scanning.

I scanned the target at the highest resolution available (600 dpi) so that the greatest level of detail could be captured. The photo on the right shows the image after rotation by ninety degrees but before aspect ratio correction. As can be seen, there are noticeable distortions in the target that aspect ratio correction alone will not resolve. The distortions may be caused by a number of factors, such as target misalignment, camera cylinder shake during rotation, and lens focus.

The dimensions of the target, in pixels, were then measured If the aspect ratio of the target image matched that of the target, then the ratio of the target height to the target width would be the same as the ratio of the image height to the image width

target height
target width
= image height
image width
.

This is not the case, so a correction factor must be used. The correction factor should modify the image height, as there are more pixels than are needed. It is better to scale down and lose detail than it is to scale up to gain detail that isn't there. With the aspect ratio correction factor in place, the relationship now becomes

target height
target width
= (image height) x (correction factor)
image width
.

Solving for the correction factor yields

correction factor = (target height) x (image width)
(target width) x (image height)
.

Image before aspect ratio correction.

Image after aspect ratio correction.
The estimated aspect ratio correction factor for the height, given the distortions mentioned above and the granulatity of the pixels, is 0.3524 or 35.24%. The photo on the right shows the image with the aspect ratio correction in place. The target image now appears similar in shape to the actual target. Note that the doorknob in the lower right of the photo now appears to be round, as it really is.

Resolving the other distortion issues and performing the outdoor calibration test are the next tasks to be performed. I am now working on making the PanoramaScanCam™ a portable (luggable?) platform as part of this effort. Results will be available soon.

April 23, 2007: Going Mobile!

Over the weekend I set up the PanoramaScanCam™ in a plastic vegetable crate (similar to a SmartCrate™ ) with an old Compaq Presario 1610 laptop. The laptop is stock with RAM memory expanded to 80 MB and running Slackware Linux 10.2. Some time back, I installed a Belkin PCMCIA 802.11b Wireless Notebook Network Card (F506020 version 2) so I could use the laptop as part of a robot. The photo on the right shows the completed assembly. Power for the laptop and the PanoramaScanCam™ is obtained through a power strip that cannot be seen in the photo. An outdoor extension cord supplies power from the house. I would call it a "luggable", not a portable.

PanoramaScanCam™ Luggable!
I set up saned remote scanning support in the laptop over the weekend. It took a lot longer than it should have because my modified umax1220u backend had problems. I resorted to using the original umax1220u backend so I could make some progress.

This evening, I lugged the whole assembly out to the back yard to do some test scans. I had problems trying to do full range scans with resolution larger than 150 dpi. I realized, after some thought, that there may have not been sufficient memory to allocate for such a large scan. At a resolution of 300 dpi, a full range scan would require the allocation of over 28 MB of RAM. The scan below is at 150 dpi (Please pardon my scruffy yard!).

While it is hard to see in the JPEG image, there is some horizontal streaking in the image around the trees. I think this is due to the imagined calibration strip being placed around about the location of the shed. Once I figure the problems with my modified umax1220u backend, I can verify my suspicions and resolve that problem.

I decided to register an account with panoguide™ so I could display the image above with their 360-degree viewer. You can see it here. I had to trim the ends a little so the horizontal range covers only 360 degrees.

May 2, 2007: Focusing On Focus

From my outdoor tests, I determined that I needed to address the focus and color calibrations issues. I decided to first work on the focus issue, as this could be done indoors. The weather for the week was decidedly inclement. Color calibration, on the other hand, would be dependent upon the light source.
The shortcoming in the focus was that the lens could not move close enough to the sensor to allow focusing at longer distances, like infinity. The cap of the trap adaptor would not screw all the way down on the barrel. About a four-millimeter gap separated the lip of the cap from the bottom of the thread.

After disassembling the lens mount, I looked to see what would have to be trimmed to allow the lens to screw in closer to the sensor. I first trimmed the optical path. This, by itself, did not enable the lens to get closer. I knew that it would still have to be done because the conical portion of the lens was already butting up against the optical path. The left image in the photo on the right shows the optical path in the center prior to the trimming. The right image shows how it appears after trimming.


Original (L) and shortened (R) optical path.
The next step was to cut away some of the threads on the barrel of the trap adaptor. The image on the left half of the photo on the right shows the untrimmed threads. The right image shows the threads after trimming. I had to carefully file the cut threads to ensure that the cap could still screw on smoothly. It was sufficient to cut away one thread to allow the cap to get four millimeters closer. Still, this wasn't completely sufficient. The cap could only get one millimeter closer.
Original (L) and shortened (R) screw mount.
In the end, I also had to sand the inside of the optical path and the inside of the trap adaptor barrel to provide clearance for the lens to screw all the way down. The image on the left half of the photo on the right shows the original, four-millimeter separation of the cap. The right image shows the reduced separation. It is less than one millimeter. Infinity focus can now be achieved.
Original (L) and new (R) lens minimum distance.
In order to change focus, the cap holding the lens is screwed in and out. The further out the lens is screwed, the closer the object focal point is in front of the lens. I know that focusing will be only approximate due to the relative coarseness of the threads, still I can calibrate the focus settings for close objects by measuring the distance to the object and adjusting the lens to obtain a clear focus in a high-resolution scan.

I set up my test target (foam core board) eight feet from the camera. I made several scans at 600 dpi while adjusting the focus. The photo on the right shows the best focus I could obtain with this trial-and-error approach. With the clearer focus, I found that the vertical scaling factor may be closer to 0.35. I'll still have to do additional testing to determine a final value.


Improved focus after modifications.
I also focused on the target at about 13 feet. The results are similar in appearance. With the light outside fading fast, I decided to try focusing on the wall of the neighbor's house. The photo on the right shows the results. The focus is not perfect, but not that bad either, given the available light. The frame of the door is out of focus, which shows that the depth of field is not that great. I'm not surprised considering the brightness of the lens. There appears, I think, to be some chromatic aberation and detector noise as well.

All this does bring up the point that I could have chosen a better lens. That would be one that has adjustable focus and aperture. A used camera lens would be idea. It would also be designed to compensate for chromatic aberation also. I'll have to do some more outdoor tests, when the weather improves, to see if this will be a significant problem under good lighting conditions.


Focusing on the neighbor's wall.

May 15, 2007: Controlling Brightness and Image Color

With the infinity focus issue resolved, I turned my attention to image color and brightness. The SANE umax1220u backend supports the UMAX 2100U flatbed scanner. As I mentioned in my post on April 21, I made some initial modifications to the backend's source code. These modifications were done to remove the code that wasn't used and to add code to assist in gaining an understanding of how the backend calibrated the scanner. With that understanding in hand, I could now change the code to better control the scanner as a camera.

In the original umax1220u backend, the gain setting for each detector on the scanner sensor is determined by imaging a white calibration strip. This technique is fine when attempting to obtain white balance for the detectors when imaging copy on a flatbed scanner. With the PanoramaScanCam™, this doesn't work too well. With the calibration strip removed, the differing gain settings obtained from the calibration results in horizontal stripes in the image (see the image shown in my posting on Apil 23). In order to prevent this from happening, the gain applied to all detectors must be the same.

The detector gain is now used to adjust the brightness of the image. SANE option descriptors have been added to allow the controlling computer to set the gain to an equal level (from 0 to 127) for all of the blue, green, and red detectors independently. A gray gain level can also be set if the scanner is operated in the gray tone mode. Another SANE option descriptor allows for an "auto gain". When "auto gain" is active, the gain settings from the original detector gain technique are averaged to obtain a single setting for all of the detectors. It acts as sort of a "poor man's" light meter.

It turns out that the UMAX 2100U has internal eight-bit gamma tables for blue, green, and red. In the original umax1220u backend, these internal gamma tables are set to the same fixed gamma curve. I added SANE option descriptors to allow the computer to set the gamma curves independently. As an added touch, a SANE descriptor was modified to allow the computer to turn scanner light on and off, rather than just off. I think that these features should be rolled back into the umax1220u backend.

I've done some initial indoor testing to verify the proper operation of these new functions. Once the weather is good enough, I want to get some testing outdoors to properly calibrate the focus and derive some brightness and color balance settings. Then, I can obtain some good pictures outdoors. Once the PanoramaScanCam™ backend code is fully tested and cleaned up, I will post it on this webpage.

May 17, 2007: Blinded by the Light!

Yesterday, I set up to do some focus and color calibration testing outdoors. This involved setting up some test targets at measured distances from the PanoramaScanCam™. I also attached a plastic focus ring to the lens. I developed estimated focus distance points based on the following equations:
1
Image Distance=
(1/(Focal Length)) - (1/(Object Distance))
360° * ((Image Distance) - (Focal Length))
Angle Offset=
Thread Spacing
The Angle Offset is the angular position of a distance with respect to the infinity focus mark. The thread spacing determines how far the lens travels in one turn of the thread (360°).

The focus rings for English (left) and metric (right) distances are in this PDF. As can be seen, it doesn't take much of a turn to move from infinity to a relatively close distance. For now, the paper ring, with the printed focus scale, is attached to the plastic ring with clips. This is shown on the photo to the right. The black tape marks on the camera shroud indicate the focus test points for (from bottom to top) eight, ten, and thirteen feet. The corresponding marks on the focus ring for eight and ten feet are a close match. Once the proper positioning is achieved, it will be glued to the plastic ring.


Focus ring and paper focus scale.
With everything set up outdoors, I proceed to do some scanning. I was amazed to discover that the images were saturated, even with the lowest gain setting. It turns out that I need to place a neutral density filter in front of the sensor or stop down the aperture of the lens. I am now researching out an appropriate aperture stop, based on the work of Thomas Sharpless on his web page ScanCams -- Some Technical Details I hope to have something worked out soon, but this was a bit unexpected.

May 26, 2007: A New Lens Aperture

It took me quite a while to figure out how to make an sufficiently flexible aperture for the PanoramaScanCam™. I toyed with changing the filter caddy design to replace one of the round openings with a slot. This would work, but the width of the slot would have to be fixed. It would also be difficut to change the slot width at any time. An aperture placed in front of the lens would be more flexible. It could even be removed in low light situations.

The photo on the left shows the items that went into fabricating the lens aperture. These items are: blue felt, a shaving cream cap, sheet aluminium taken from the shield of a dead floppy drive, washers and nuts from the junk drawer, and knurled screws that are the used for toolless securing of a PC case cover.


Parts for the lens aperture.
The lens aperture body is made from the shaving cream cap. Only about the top twelve millimeters of the cap are used. A slot with a width of seven millimeters was cut into the top of the cap. This is the maximum aperture provided for the lens. The PanoramaScanCam™, like all scanning cameras, takes its image from a narrow strip of the lens. All other light that comes in does not contribute to making the image. This light does reduce image contrast due to internal reflections within the lens and the sensor head. Lens flare is also reduced due to the blockage of oblique light rays that could enter the lens.

The holes drilled on opposite sides of the aperture allow the securing screw to pass through the cap and feed into nuts epoxied to the cap. The holes are placed to allow the aperture blades to slide to their maximum separation.


Fabrication of the lens aperture body.
The aperture blades are made from sheet aluminium taken from the shield of a dead floppy drive. The metal is actually quite thin and can be cut with scissors. The holes are oversized and allow the blades to slide around to adjust the spacing and shape of the aperture.

The photo on the right shows the nuts that are epoxied to the cap. I may reattach the screws with JB Weld or some other glue that is compatible with the plastic of the cap. A thin strip of blue felt was cut and glued to the inner rim of the cap. I used a water-soluable glue so that the felt can be easily removed and replaced if it wears out.


Fabrication of the lens aperture blades.
The photo on the right shows the completed lens aperture cap, as it is mounted on the lens. The washers are used to hold the aperture blades in place when the knobs are tightened. A slight loosening of the knobs allow the blades to be adjusted to the desired aperture width and shape. The felt enables the lens aperture cap to remain securely attached to the lens. The cap can be turned easily to place the aperture slot in a vertical orientation. This needs to be done whenever the lens focus is changed.

I am pleased with the design of the lens aperture cap. It provides sufficent flexibility in setting the width and shape of the aperture without forcing any permanent changes to the lens. I think the maximum width of the aperture is sufficient for most applications. Once the weather improves, I will do some testing outdoors to determine if this is the case.


Completed lens aperture mounted on the lens.

May 28, 2007: Tweaks to the Lens Aperture and An Underlying Problem

Yesterday, I decided to do some indoor testing to see if the new lens aperture worked as expected. Well it did and it didn't. The aperture blades did have the desired effect of reducing the amount of light reaching the sensor. Additional testing today showed that the depth of field appears to be improved also. What was unexpected was the appearance of an orange haze at the top and bottom of the new images. This was caused by some of the aperture cap appearing in the lens field of view. Light was also leaking through the cap because it is slightly translucent.

A number of things were done to resolve this problem. First, an additional two millimeters of the cap were removed so that the front of the cap sets closer to the lens face. Next, the aperture opening was extended vertically to remove the curved portions of the cap. That portion of the cap was visible in the lens field of view. Finally, an indellible marker was used to color the inside of the cap black. This significantly reduced the amount of light leaking through the aperture cap. Further testing appears to show that the orange haze has been eliminated. Testing in full sunlight will determine whether a more opaque material is needed.

Through the resolution of one problem after another, I see an underlying problem that I see no possible solution. That problems is a persistent, balky behavior of the scanner hardware. The scanner will not make full scans at 600 dpi resolution. It will also stop working unexpectedly with IO errors for no apparent reason. These problems are mentioned in the "KNOWN BUGS" section of the sane-umax1220u backend man page. The only way to solve these problems is to use a different scanner for the PanoramaScanCam™. I wish that the UMAX AstraNET e3420 that I have would work properly. Well, I'm starting to look into getting another scanner to resolve this unresolveable problem. For now, I'll continue to work out other problems with the PanoramaScanCam™ as it is currently designed.

May 30, 2007: Another Outdoor Test

Yesterday evening, I did another outdoor test to try to get an idea of the performance of the new lens aperture. The image below was acquired at 7:47pm CDT. Sunset was already approaching, so the available light was diminished. The scanner gain for all three colors was set to 64. The gamma for all three colors was set to 1.5. The aperture was set to be approximately 1.5 millimeters wide. Once again, my back yard was the test subject.

The horizontal streaking that was present in the previous outdoor test is no longer present. Focusing can now be controlled. The vertical streaking at the center of the image is caused by the sun. This points out that the PanoramaScanCam™ should be used when the sun is as high in the sky and out of view of the imager. A narrower aperture setting will also be necessary, as more light will be present.

I trimmed the image to 1688 x 450 to obtain a 360° view and uploaded that image to panoguide™, so I could display it with their 360° viewer. You can see it here.

Overall, the results look promising. If better weather holds out, I hope to go to a nearby park to obtain some better panoramas. Before that, I'll get the focus ring calibrated. The problems with the scanner driver are still present. I'll still have to be patient in that regard.

June 5, 2007: Testing and Aperture Modification

Last Friday, I was able to do some testing earlier in the afternoon so I could take advantage of the full sunlight that was available. Well, it was actually partly-cloudy, but the sun was plenty bright. The aperture setting I used previously was still too wide. I had to close the aperture down to about 1/2 millimeter or less to reduce the light to a manageable level. The shape of the aperture was a little narrower at the top to provide more attenuation for the sky. I also adjusted to focus setting to 10 feet, according to my current positioning of the focus ring. The image below, taken at 4:34 pm CDT, was the best of the bunch:

The gain was set to 64 (in the 0 to 127 range) for R, G, and B. The gamma settings for R, G, and B are currently 1.25, 1.5, and 1.5, respectively, to correct for some redness in the imagery. The default gamma settings for the scanner is 1.5.

The results are reasonable, if only the middle two-thirds of the image is considered. The red-orange coloration appears to be due to light leaking through the lens cap. The marker pen ink did not provide enough of a light barrier after all. All of the images also appeared to be a bit flat. This may be due to the light leakage through the aperture cap. To compensate for the flatness, I loaded the image into GIMP and adjusted the contrast by +64 counts. I like the fact that the depth of field is significantly improved. Note that the bluriness in the white storage shed is gone, but the lines of the bricks are still sharp.

I decided to rework the aperture cap in order to resolve the light leakage issue once and for all (I hope). I disassembled the cap, removed the ink, and the felt that was attached around the inside edge of the cap. Two thin strips of one-millimeter thick "fun foam" were cut to fit the inside of the cap. The entire face of cap, minus the aperture slot, was covered. The foam was attached with hot glue.

This "fun foam" is quite opaque, so it should block the light quite well. The foam's textured surface also tends to absorb scattered light rays. A third bonus is that the foam acts to lock the nuts in place when they are tightened. I didn't have to glue the screws after all. Small pieces of foam were glued to the top and bottom ends of the aperture slot to block any reflected light from the exposed edges of the cap.

Once the foam was attached, a new strip of felt was applied around the inside edge of the cap. I made sure that the felt butted up against the foam, so no light could come in from the sides. The photo on the right shows the inside of the reworked aperture cap. The appearance of the outside of the cap was unchanged


Reworked lens aperture.

June 11, 2007: Testing Continues

Over the last few days, I've knocked out a few more kinks in the lens aperture. The reworking of the lens aperture cap with the "fun foam" and new felt line was very effective in blocking almost all of the stray light. I say almost because there was still some faint but noticeable "haze" long the top and bottom of the images I took on Friday. I placed a little extra "fun foam" at the top and bottom of the aperture in the cap. This didn't appear to help much.

After some thought, I realized that the cause of the "haze" was the bare aluminium of the lens aperture blades. They were acting like crude mirrors that reflected the difuse light into the lens. I grabbed up a permanent marker and "painted" about five millimeters of the straight edges of the apertures blades. The "painted" aperture blades can be seen in the photo on the right.


Painted lens aperture blades.
On Saturday, I captured a number of images. I had to adjust the aperture width several times due to varying light levels. The image below, taken at 5:57 pm CDT, was the best of the bunch:

The gain was set to 64 (in the 0 to 127 range) for R, G, and B. The gamma settings for R, G, and B are currently 1.25, 1.5, and 1.5, respectively, to correct for some redness in the imagery. The default gamma settings for the scanner is 1.5. The aperture was very narrow, a fraction of a millimeter. It would have been hard to slip a sheet of paper through it.

The results are much improved over the previous experiments. The painting of the aperture blades solved the haze problem. There is still a bit of a contrast problem, but not like it used to be. To compensate for the flatness, I loaded the image into GIMP and adjusted the contrast by only +32 counts.

I will try removing the little bits of "fun foam" that I added in the process of reducing the haze problem. They didn't really help and they increased the vinetting in the images. I think that development of the PanoramaScanCan™ is nearing an end.

June 18, 2007: One Step Forward, One Step Back

I did some more testing yesterday (Sunday) with a new change of zero. As I mentioned in my last post, I tried removing the little bits of "fun foam" that I had added to the top and bottom of the aperture cap in the process of reducing the haze problem. It turns out that they did indeed make a difference. The two photos below show it all.

The first photo was taken at 6:31 pm CDT with the foam bits removed. The gain and gamma settings are the same as in testing done the previous week. No changes in contrast were made in order to better show the effects of light flare. The change in intenstity on the righthand side of the photo is due to a cloud passing in front of the sun during the scan. The area of interest, though, is where the house is visible. The light flare is very noticeable at the top on the photo.

I took the aperture cap back to the bench and put new foam bits in. This time, though, I was very careful to make sure that they extended out only far enough to keep light from coming in from the extreme top and bottom of the aperture.

The second photo was taken at 6:56 pm CDT. The light flare is no longer present. Unfortunately, the new foam bits also reintroduce the additional vignetting, as was seen in previous photos. I estimate that about thirty to fourty additional vertical pixels are lost, but it is better that having the light flare. After the vertical scaling that must be performed on the raw scanner images, there is only a bit over 400 usable pixels for the image in the vertical dimension. This is at a scaner resolution 150 dpi.

I think that I've taken the UMAX 2100U version of the PanoramaScanCam™ about as far as I can. Playing with the scanner's gain and gamma values may help in the brightness, contrast, and color rendidtion. Anything beyond that would probably require replacing the lens. Improving flexibility in the horizontal and vertical resolution and in the scanner reliability overall would require replacing the UMAX 2100U altogether. This is something that I am seriously contemplating.

June 26, 2007: Good Pictures and Mysterious Lights

The weather held out last Friday and Saturday, so I could do some more outdoor testing in bright sunlight. It turned out that the time I had available for testing on Friday was very limted, but I did obtain a couple of good photos. One of them is shown below.

This photo was taken at 2:36 pm CDT. The red gamma is 1.25 and the green and blue gammas are 1.5. I had to use GIMP to change the contrast by +32 counts. I'm pretty please with the results.

I realized later that day that all of my prevous tests had been either at dusk or when the PanoramaScanCam™ was is shadow. I decided that my first test on Saturday would be to generate some photos while sitting in broad sunlight. I wanted to see if there was any flare issues. The photo below was the surprising result. It was taken at 4:24 pm CDT.

The bands of coloration reminded me of photos taken before the IR blocking filter was installed. What is strange is that the effect is worse when the lens is facing away from the direction of the sun. To verify that the effect was due to direct sunlight, I moved the PanoramaScanCam™ back into the shade to take some more photos. The photos returned to their normal quality. Could there be a light leak somewhere? I'll have to do some additional testing.

In the meantime, I decided to try tweaking the gamma settings so I would not have to do the contrast adjust from within GIMP. I set the red gamma to 1.0 and the green and blue gammas to 1.25. The results are in the photo below. This photo was taken at 5:17 pm CDT. No modifications had to be made to the photo other than the aspect ratio correction.

Once the weather improves again, I'll have to experiment with some form of shield to protect the sensor from the direct sunlight. I'll experiment with aluminum foil or something else that is suitably opaque. In the meantime, I'm looking for another scanner to hack!

© 2007 Mac A. Cody
Last updated Tuesday, June 26, 2007