Jump to content

Kris Avonts

Members
  • Posts

    92
  • Joined

  • Last visited

Everything posted by Kris Avonts

  1. Hello, It’s time for some evaluation of this modified proxxon KT 70. As a test I made a setup to use the xy-table over its whole range with fixed steps in both x and y direction. In x it was 8.9 mm step and in y 3.1 mm. That way the whole range is covert with 15 steps. I use the scale ring to make the steps and note the DRO display values. Here you see the setup with a camera positioned to show the readings. This is how the table is stepped from bottom-right to top-left. I also did the inverse movement from top-left to bottom-right and again noted all displayed values. When entering the values in a spreadsheet and plotting things you get the following results. You can see that the curves are not ‘flat’ and that moving up and down follow a different path. Not flat means that the pitch of the xy-table is slightly off its nominal 1 mm. In the x direction we have about 0.3 mm error after 120 mm and that can be explained with a pitch being 0.9975 mm. For the y direction it is about the same result, a pitch of 0.9980. The different paths are a result from backlash, that is ‘play’ between nut and screw. For both x and y it is about 0.1 mm. I assume the DRO is correct and has no play. To be sure I also checked a small movement (8 mm) in the x direction somewhat in the middle of its range with a dial indicator. The result is shown next. The dial indicator and the readout give almost identical values. Ok, then I trust the DRO from now on. It is convenient because it keeps track of the millimetres already moved and it eliminates the backlash error. That is it for now, hope you liked it. Best regards, Kris
  2. Hi Mike, I understand your wish to position the display at a more convenient location. The display is an LCD type and requires a large amount op signals to display the information. The power and signal connection to the pcb is done with a 'zebra strip'. That is a kind of foam with alternating layers that are isolators and layers that conduct current. It is compressed between PCB and display, so no connector is used. On some PCB's of digital calipers you can find 2 interface signals intended for connection to a remote interface. These are clock and data signals. In combination with a small microcontroller board (e.g. Arduino) you can then decipher the data and put meaningful values on an extra display. This type of caliper had no such interface. So I had to use the display as it is positioned over the ruler. You are right, the Y-axis hand wheel is very close to the readout but it is possible to use it. I should have cut the extruding bulb before mounting. That gives about 5mm extra play. Now that it is already glued in place, I leave it as is. I'm glad you like my report on this modification. best regards, Kris
  3. Hello, The next thing is to make a hole at the right of the cast aluminium block where the dowel pin will be inserted. I made a quite complex setup to drill that 3 mm hole as correct as possible. First job was the fixation of the xy-table to my work surface and checking its squareness (see the next picture). Then a rather unusual setup for my drill press where the base was turned to the back and using a counterweight to stabilize the drill press. That went well and the dowel pin fits with very little play. As a last adaption for the Y-readout, I soldered some wires to the metal battery clips in order to power the readout from a power supply. That should avoid battery replacements in the future. The X-DRO was made following the same principles but the ruler will be fixed to the mill table with a support instead of a pin. The next picture shows the readout already prepared with wiring, the ruler and both supports. You may notice that I cut away some plastic at the battery location to bring the readout as close as possible to the X-table side. Then the supports need to be fixed. The ruler support is attached to the mill table. With the threaded hole for the readout support I had bad luck. The M3 tap broke off but there was just enough of it sticking out so that I could remove it with a good forceps. The next picture shows the parts of the X-DRO ready for glueing to the mounted supports. Then with some metal epoxy glue all parts are glued, compressed and left for 24 hours to allow the epoxy to cure to its final strength. As a last addition I soldered the wiring to a small step down converter that will supply the 3V DC for both readouts. At the back is now a connector that mates with an old 12V DC supply of a laptop. Here is the finished KT 70 with its added DRO. Next time I will try to report on some test regarding the precision of this setup. Best regards, Kris
  4. Hello All, I use my Proxxon micro-mill a lot when it comes to precise shaping of wooden parts. The complete setup consists of a MB 200 drill stand, a MICRO compound table KT 70 and a 230V ISB/E drill/grinder. One of my frustrations with this setup is keeping track of the position of the end mill relative to the workpiece. How many turns did I already gave in the X or Y direction? Of course each decent mill is equipped with a Digital ReadOut system (DRO). But adding such hardware to the KT 70 is not obvious, especially because the KT 70 is a ‘MICRO’ xy-table. I also didn’t want to spend a lot of money on it, so I parked it in a wish list. But then I saw that digital calipers were sold at 7.99 euro in a supermarket. I couldn't resist and bought 2 calipers guided by ‘it’s now or never’. So I will describe here the process of adding these calipers to the KT 70. It is certainly not the only way to do it but it is what worked for me. And maybe it can inspire other members. So lets start. The first thing is to dismount the complete caliper. Then the metal parts need some cuts. I used a small hacksaw but soon experienced that the metal was quite hard and I had to replace the saw-blade twice before finishing the job. I was afraid that these cuts would disturb the measurement principle. I quick check gave me piece of mind. Then you have to decide where you want to attach the ruler part of the caliper and where the readout unit. After some puzzling, I decided to position the readout units close to the respective hand-wheels. The ruler then needs to be attached to a moving part of the xy-table. For the Y-direction I will use a 3 mm dowel pin glued in a filed grove at the ruler end. To mount that Y-ruler as low as possible, a small cut had to be made at the right front corner of the xy-table. This way the Y-ruler can be positioned horizontal as the check on the next picture illustrates. Next the Y-readout needs a support. I found a complex metal (zamac) part that could be used when all excess material was cut away. It will be fixed in place using the right screw (original screw replaced by a longer one) in the lower cover. That is enough work for today, have a nice evening and see you back soon. Best regards, Kris
  5. Hi Wefalck, You are right, it was a serious challenge but I'm glad I could make it to a usable tool. In a 3D cad program it all seems very simple (no tolerance and no misalignment) but in the real world it requires some skills to get it done. Your solution is indeed simpler and very robust. For me it comes a little too late. I hope my tilting table will serve me well for upcoming ship projects. best regards, Kris
  6. Hi All, After the metal epoxy glue had set (24 hours), 2 bolts are added just to be sure it will withstand vibration and forces during milling operations. Curious about the outcome of the glueing I measured the misalignment. As you can see in de following picture there is a small gap (0.1 mm) between the highest point of the cylinder and the tilting plate. Next was again a check of the flat surface on the xy-table over a 50x50 mm area. I was disappointed but the inclinometer showed it as ‘flat’, so I will accept the result and start making the last parts: the 2 plates that lock the tilted plate in position. The tilt-locker plates have an arc at its top and a slit also in the form of an arc. All arcs have the same centre point. First I start with marking and drilling 3 holes as a reference. To mill the arcs I will use a jig that I already made earlier and consists of a base plate with 5 positions, spaced 20 mm apart, that can hold a pin that will act as the rotation centre. The next picture shows it on the xy-table. For wooden parts I use a plate with some sandpaper glued on it and lots of holes that have an M4 nut at the back of the plate. A workpiece can then be fixed with some small clamps. For the metal tilt-locker parts I need firmer clamping, so I will construct a different plate from a scrap piece of MDF (shown bottom left in next picture). It starts with marking 3 positions: 2 holes of the tilt-locker and the centre of the arcs. For the arc slit, a number of holes along the arc are marked and drilled. Next I use my mini saw to cut off some excess material of the plates. Then both plates are fixed on the piece of scrap MDF. Milling starts with positioning the base MDF plate: the centre pin is mounted in the proxxon mill and lowered to make a fit in the middle hole of the base plate. Then the base plate is fixed in place to the xy-table with the 2 sunken bolds at its sides. The proxxon mill is brought up again and the centre pin replaced with a 2 mm end mill. The center pin is now placed in the lowest hole. That makes the distance from rotation centre to end mill centre exactly 40 mm. From there the y position can be set at the required position to start milling, see next picture. The result of milling: For the final shaping of the tilt-locker plates I convert my mini saw into a mini disc sander. The finished parts are shown next (you can see that at least 1 hole was drilled a bit to much off centre). And here is the tilting table, set at a 20° inclination. It can hold the MS4 machine vice as well as a small rotating table (if I ever need that extra degree of freedom for a workpiece). As a last tip to set an inclination with good precision, you can use a long M4 bolt to make fine adjustments before tightening all 4 M3 bolts. That ends the making of a small tilting table. Hope you enjoyed it and maybe you start making your own. Best regards, Kris
  7. Hello All, As announced work on the tilting table now concentrates on fixing the bad alignment of the pins that connect the tilting table to the bearings. The ‘plan B’ is presented in the next figure. As you can see the 2 pins are replaced with 1 cylinder that is mounted to the tilting plate with a V-groove. The 1 cylinder will result in better alignment to the bearings. But that shifts the problem now to the fit of the cylinder in the V-groove. I have no equipment (larger mill) to make this accurate groove. So I will make it to the best of my abilities and use a clever interconnection technique to join cylinder to the tilting plate. First things first: the V-groove. I first removed both steel pins and then cut off a small strip of the edge. This is to assure that the new cylinder which has a 6 mm diameter will be in the same position then the former pins. Next is the V-groove that I will make with 2 saw cuts at 45°. For that I need a fixture to hold the tilting plate at 45°. The fixture is made of some scrap wood glued together and then sanded a bit. It is not perfect at 45° but will do. Then the V-groove can be sawn. The next close-up of the V-groove show that it is far from perfect. When the cylinder is pressed in the groove it shows small misalignment to the top or bottom of the tilting plate. Then I realise that gluing the 2 parts together can compensate for the misalignment on condition the I can position both correctly to one another. So lets start, the next picture shows all parts involved before gluing. I have 3 dowel pins that are ground accurate at a diameter of 3 mm. That is exact the distance between base plate and tilting plate in horizontal position, see the picture below. The 2 dowel pins under the cylinder will support both the cylinder and the tilting plate so that they are level. The 2 small plates at both sides of the base plate will align base and tilting plate. A weight on top covering part of the tilting plate and cylinder assures that everything stays in contact while the glue sets. As a last measure I put 2 calipers set at 73.1mm over tilting plate and cylinder at both sides. Now I hope I cancelled most sources of bad alignment. The whole setup is shown next. Now its time to take a break and cross my fingers. Best regards, Kris
  8. Hello All, This is my mini proxxon mill. It consists of a MB200 drill stand, a KT70 xy-table and a 230V ISB/E drill/grinder. I already added an extra z-control on top of the drill stand as you can observe in the next picture. Milling small wooden (or aluminium) parts to precise dimensions is possible but you must take into account that total run-out at the end mill can be up to 0.2mm. From time to time I need to do milling at an angle and I used to make small wedges to be placed under the workpiece. An example is shown next. It requires some calculation of the wedge dimensions and precision sawing to get it right. The problem is that a next piece more often then not requires a different angle and a repeated effort to make the wedge. That is the reason I want a small tilting table on this mini mill. Looking around on the internet, I could not find any suitable solution for such a small mill. So I started my CAD program and tried to design something that would support the MS4 machine vice at an angle. See below an animation of this design. And here is a view with all parts made semi transparent. So I started construction. First ordered some aluminium parts of different sections: 6x70 mm for a base- and the tilting-plate, 3x20 mm for the bearing-holders and 2x15 mm for the locking plates. The base and tilting plate were sanded to make the surfaces clean and flat. Then some machining followed: threaded holes for M3 and M4, 10 mm holes for the MF105zz bearings and 4 mm holes for the cylinder pins that connect the tilting plate to the bearings. Here you see some finished parts. These parts could be assembled and checked on the xy-table. While the result was quit good (< 0.1 mm over a 50x50 mm area) I could see that when tilted the tilting plate moves different left compared to right. That is because the holes for the cylinder pins are not positioned equal at both sides (see next picture). I already noticed that the 4 mm drill was wandering a bit to much at 1 side when making the hole. Also drilling the 10mm holes in such small parts is not easy to keep them at the wanted position. I tried to fix things by enlarging the M3 holes to 3.5 mm in the bearing holders. It helped a little but not sufficient to meet my requirements. So it is time for a ‘plan B’ to fix this. But that is for a next update. best regards, Kris
  9. Just as a check for the angles, I made a superposition of the top view in the pdf document over a contemporary drawing of 1775 (see post #8 in the 'Gun Carriage questions' thread). The image from the pdf (red colour) was scaled, respecting the ratio, to align both wheel axles. The comparison of the angles seem to give evidence for druxey’s observation. best regards, Kris
  10. Hello James, I just tested the fix and it all works again. Thank you and best regards, Kris Avonts
  11. I get an error when I wanted to make a reply to a post. This reply had a link tin it to a previous post I made in October 2022. After pasting the link, it was replaced by a picture of part of that reply. When I hit 'Submit Topic', I get 'access denied'. Its a firewall issue: Any help to avoid this is appreciated. Best regards, Kris Avonts
  12. Hi Gary, I went to a local printing shop and asked if they could do binding with metal rings. I was lucky they could do that. It requires some special tool that can insert the perforated sheets in this metal ring. I prefer this binding because you can open the document at any page and it will lay flat on the table. I hope you can find a shop offering the same binding system. best regards, Kris
  13. Hi Alan, I once scanned all the articles written by David White and published in the Model Shipwright magazine. They are an invaluable treasure for information on 18th century shipbuilding. The scans are bundled into a pdf document and I printed it out to have it on my workbench. See the next 2 pictures that show the result. If you are interested in the pdf, here is a link where you can download it: https://we.tl/t-kKyChhdXqo This document is made and intended strictly for personal use. I hope you can find good information in it. Best regards, Kris
  14. Hi Ben, For you and anyone interested I can share the python source code. There are some comments written in the code file that can explain the order of things and the calculations done. If you encounter difficulties or other unclear parts in the code you can always send me a personal mail. This is the code file: ship-plan-adjuster.py best regards, Kris
  15. Hi Ben, Thank you for the appreciation of my image transformation program. It is however less advanced than you might think. I like to keep things as simple as possible but still try to reach the target I have in mind. A checkerboard correction method would only be applicable in the sheer view where you have the waterlines that should be straight and equidistant. The complexity of the transformation would become much higher and have no effect on the half-breadth plan where the waterlines are most important to give a representation of the ship's lines. Only when you could combine the intersection points of waterlines with station-planes of all 3 views (that is a lot of points) to map exactly on the same 3D point (most often called a vertex) by a transformation it makes sense. I think that is best solved in a 3D modelling program. @druxey, the ship plan scans of the RMG are such high quality, I think there is very little lens distortion. The paper distortion is more a concern and very difficult to correct due its irregular nature. I use my own transformation program to get the 3 views out of a ship plan and have them properly aligned before importing into a 3D drawing program. The workflow to make the transformations is important as I noticed in this detail of a half-breadth plan. I always try to analyse what could cause such artifacts. In this case it is not a bug in the transformation program but just me wanting to do correction of the half-breadth plan in just one go (single warp transform) instead of a 2 step square and warp transform. So you need to plan carefully the steps to follow, certainly when reusing results from previous transforms in other views (sheer in this case). best regards, Kris
  16. Hello all, Many topics in this wood discussion forum relate to finding the precious wood we all like to use for our ship models. It is not only difficult to find a supplier but also not easy to compare the cost of different offerings. So, I thought about making a small app that can calculate the cost per weight unit for a specific piece of wood. That makes comparing cost per kilogram or pound a little easier. It looks like this: The first 2 items ‘Wood supplier’ and ‘Product name’ are not used for the calculation but it can come in handy to remember later where your found what. Next you need to select the wood species of the piece you want to make the calculation for. There are some wood species already defined in the wood-cost.cfg file, but you can always add some more using the ‘Add new species’ button. Then it is time to enter the dimensions of the piece. Although it looks complex at first sight, I tried to make entering the numeric data easy. You can only enter digits and a decimal separator. You move to a next field with the TAB key. If select inch for the units then the additional fields for entering fractions get enabled. You can mix inch fraction with inch decimal dimensions. As a last item you enter the cost of that piece of wood and check that the currency selection is the correct one. Clicking the ‘Calculate cost per weight unit >>>’ will then display a cost per weight value for that specific piece of wood. And in the output window below a summary line for that piece will be added. Better then much explanation, I can show what it looks like when used in Europe: And this is for the English speaking users: You can see that there can can be significant cost differences based on size and/or wood quality. I add 3 files that you can put in one folder of your choice. A double click on the exe file will start the calculator. wood-cost.exe wood-cost.cfg plank.ico I hope it helps you making the right choice when ordering some ‘costly’ wood. best regards, Kris
  17. Hello Waldemar, Thanks for sharing your results with my transformation program. It can be a help before you start CAD work. My program uses the 'Python Image Library' also known as 'Pillow'. It supports a large amount of image file formats: BMP, GIF, JPEG, PNG, TIFF, ... You can find more information here: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html I did not try all these formats but only JPEG and PNG. @Dart, maybe you can explain in some words how you tackled the problem. best regards, Kris
  18. Sorry guys, I have to report a bug in the program. When doing a distribute or warp action on an image and you do give the optional x coordinates Xd in the ship-plan-adjuster.txt file, then the program crashes. You can see that by the CMD window suddenly closing unexpectedly. There will be no output image file nor text file. I ran into this when I tried to warp a half-breadth view and reused the Xd data that was calculated in a previous warping of the sheer view. I already corrected the program and changed the version it reports to 0.3 (mentioned on the first line in the CMD window or the output text file). Here is the update: ship-plan-adjuster.exe Hopefully it didn't cause much frustration yet. best regards, Kris
  19. Just some addition about the transforms that are used. The first step is always a perspective transform and that does exactly what its name hints. It corrects the perspective view in 2D of a given object. It is especially useful for aligning features in an image of which you know that they should be vertical or horizontal. I made the following illustration to show how it is used to get the base line of a ship plan horizontal and the perpendiculars vertical. The transform squeezes the blue quadrilateral (figure with 4 sides and 4 corners) into the red rectangle. As you can see at the edges, the blue quadrilateral extends beyond the original ship plan image (black rectangle). That will cause points in the red rectangle that will not get a transformed pixel. These will get a fill colour that will be close to the average background colour. The next problem to tackle is flattening the base line and setting some stations vertical. That is a perfect task for a mesh transform. In the Pillow image manipulation library it is described as a series of quad transforms that are done one after the other on the same image. Now we must explain a quad transform, .... well that is just a transform which again maps a quadrilateral into a rectangle. Lets make it more clear with a next illustration. Here you see all the different quad transforms numbered from 1 to 6 that take place for a flattening action when Es and Fs each have 3 coordinate values. We start at the left side and map a blue rectangle with the aft perpendicular as its right side to the red rectangle that has the same size. This is actually a copy. That part was already corrected by the previous transform. Then the real work starts: the next quadrilateral has a left side that is taken over from the one to its left, the right side is a line passing through an Es, Fs pair, the top and bottom sides are parallel with a line through A and Es[0] (or Es[0] and Es[1], Es[1] and Es[2] ....you get the point). It is transformed to the red rectangle with its right side passing through Es[0] (or Es[1], Es[2] ...). The same action is repeated until we reach the fore perpendicular. The remaining part is again a simple copy. Then we are done The warp transform is a sequence of a perspective transform followed by a mesh transform with the one exception that the right sides of the red rectangles will not be defined by the Ls points (same as Es shown in the illustration above) but by distributed x coordinates Xd that are calculated by the program or given as extra input by the user. I did not include any math here to keep the description as intuitive as possible. For those who want a more closer look to the illustrations, I provide here also the pdf version where you can zoom for details. perspective-transform.pdfmesh-transform.pdf That is it for now. I hope that takes away a bit of the hocus pocus by just clicking an exe program. Best regards, Kris
  20. Thanks druxey for your trust in my programming skills. I must however admit that some ship plans are a bit to complex to benefit from the auto distribution calculation for the stations. During the development I also tried the sheer view of the Hayling Hoy, but that was no success. I guess it was not designed according a 'room and space' rule. I know it is not a Royal Navy vessel. In such cases you are on your own. But with the help of a spreadsheet program you could check and eventually correct station distances by entering the optional destination points Xd. If there is some interest in what happens behind the scenes in the program, I could give some more information showing also the (simple) mathematics that come to the rescue. best regards, Kris
  21. Hello, It's time for an update. The past weeks I worked further on this program and added several new features that can make it easier to do a transformation. In my previous post I promised to include a workflow to do a 'flattening' action for the base line. The several steps described in that post are now replaced by a single mesh transform. That is a transformation that maps a series of quadrilaterals onto a series of rectangles. This solves the problem of stitching the different parts that was present as the last step in my original workflow. I will not go into every detail for using this new version of the program here because I have made a user manual. ship-plan-adjuster_UM.pdf The name of the program was changed from scan-adjust into ship-plan-adjuster because that is just what I expect it to do. The most important addition is the 'warp' transformation that can do most of the work in one single step. The next figure illustrates what it is expected to do. For all details about this transformation, the points to input and how to use the program, please read the user manual. And here is the new program. See next posts for a more recent or less buggy version. ship-plan-adjuster.exe Although there was not much reaction on this topic I noticed it had quite some downloads. So maybe some of you can make use of it. If it serves your needs then it would be nice if you could show some examples here. Thanks in advance. As a last note I must warn that this program can not solve every issue that you may want to fix in a scanned ship plan. So always check the output image and reject it when it doesn't match your expectations. best regards, Kris
  22. Hello again, While the result of the sheer plan adjustment with my scan_adjust.exe program was not bad, I noticed that it still has some deviations in the mid-ship area. The top of keel line on the plan was a little above the horizontal guide in GIMP that connects the intersections of fore and aft perpendiculars with the base line. Also some residual slant could be noticed for station (3). I wondered if that could be corrected using the same program. It is possible but it takes several steps: Divide the image in 2 halves with station (3) as the separating edge but allow some overlap (80 pixels) I named these J3351_sheer_a_aft.jpg and J3351_sheer_a_fore.jpg J3351_sheer_a_aft was adjusted with both source and destination points given: As = Ad, Ds = Dd, Bd 6 pixels below Bs and Cd 6 pixels below and 8 pixels right of Cs J3351_sheer_a_fore was adjusted with both source and destination points given: Bs = Bd, Cs = Cd, Ad 6 pixels below As and Dd 6 pixels below and 8 pixels right of Ds Then the 2 resulting half images and the original full image are opened as layers in GIMP. Shift the 2 half images until they stitch nicely (Bd and Cd of the aft half should map on Ad and Dd of the fore half) The layer on top (fore half in my case) will spoil the stitching because its edge has black (not transformed) pixels, so make a crop to get rid of these pixels Remove the layer with the full image and merge down what is left over That should give you a result with almost perfectly horizontal and flat base line and vertical stations. I do realise that this is a quite complex process just to correct for a mere 6 or 8 pixels. When I find some time, I may upgrade my scan_adjust program to recognise this special case and do all the required steps in the background and just saves the final result. Best regards, Kris
  23. Thanks Jaager for spotting my typo. I corrected it before anyone else starts a search for that ship.
  24. Hello Jaager, I’m very sorry that my post here gave you the impression that this program would solve any issues with misaligned or distorted plans. I wish it could. As for all tools or programs: garbage in is garbage out. The figures I added are more to illustrate the concept then to give a real world example. It should be used with care and a lot of scepticism regarding the resulting output. That is something I can not code into the program and is left to the judgment of the user. All of the ship plans I looked at until now are plans of the RMG collection. You can find a small fraction (3678 to be precisely) of these plans on the wikimedia commons: https://commons.wikimedia.org/wiki/Category:Ship_plans_of_the_Royal_Museums_Greenwich These plans are scanned and show high resolution but I suppose the alignment on the scanner was done with respect to the edges of the document and not its content. That is one of the reasons to make this program. I will show a real world example to demonstrate what you can expect from the program. I choose the file ‘Resolution’ (1770) RMG J3351.png and made a cut out of the sheer plan (shown below, reduced to 10% of its original resolution). It is a huge file (image size: 20567 x 5521, file size: 25.3MB) and it was also a test if my program could handle it. So I entered the required 4 source points and made a run. Apart from giving a warning that the image has more pixels than a preset limit, a result file (image size: 20567 x 5521, file size: 9.25MB) was produced. To show what the differences are, I opened the 2 image files as layers in GIMP. Then by toggling the visibility of the top layer while zoomed in on one of the source points you can observe the changes made by the perspective transformation. This is an animated gif made from 2 screenshots zoomed at point As (intersection of base line with aft perpendicular) before and after the transformation: The same for point Bs (intersection of base line with fore perpendicular): The same for point Cs (top of fore perpendicular): The same for point Ds (top of aft perpendicular): For me this is a reasonable improvement when using such scans as a background image in a 3D CAD program. And even then I never just draw over the lines but make horizontals, verticals and curves (splines) that are fair. Best regards, Kris
  25. It’s time to give some update information and explain how to use the scan-adjust program. I developed this program mainly to fix misalignment and wanted as result a horizontal baseline (top of keel for 18th century ship plans) and vertical perpendiculars. So that is what I call the standard way to adjust a sheer plan. It is illustrated in the drawing below. You can see how the pixels coordinates are interpreted and where I intend to put the 4 source reference points: As, Bs, Cs and Ds. As is at the intersection of the aft perpendicular with the baseline Bs is at the intersection of the fore perpendicular with the baseline Cs is at the uppermost point of the fore perpendicular Ds is at the uppermost point of the aft perpendicular You may observe that these 4 points go round in a counter-clockwise direction and that they delineate a quadrilateral (a figure with 4 corners and 4 sides). The counter-clockwise direction is chosen because it is mentioned in the documentation for the used software (PIL, Python Image Library) that does the image transformation. These 4 source points need to be mapped to 4 destination points. You guessed it: Ad, Bd, Cd and Dd. You can also input these additional points to the program but if the adjustment you are after resembles the ‘standard situation’ then the program can calculate these 4 points based on the knowledge that Bd=Bs, Ad has same y-coordinate as Bd, Cd has same x-coordinate as Bd and Dd has same x-coordinate as Ad. What remains is to find the x-coordinate of Ad and y-coordinates of Cd and Dd. Well there we can make sure that the difference in x-coordinate between Ad and Bd is equal to the number of pixels between As and Bs counted on the line that connects As to Bs. That sounds like trigonometry and it is, see the illustration below. The calculation of n is used to determine the x-coordinate of Ad. A similar calculation yields y-coordinates for Cd and Dd. So all destination points are fully defined and the transform can be started. Next I explain how we enter the required data into the program. I choose not to develop a GUI (Graphical User Interface) for my program but simply to look for all required data in a text file that has the same name as the program file but a txt extension. So the program will be ‘scan_adjust.exe’ and the data file ‘scan_adjust.txt’. Next is shown the content of this data file as I used it for my initial test of the program. test-scan.jpg As=(82, 184) Bs=(425, 178) Cs=(429, 48) Ds=(77, 48) The next problem to tackle is how to get these coordinate values. Well there are very good image manipulation programs with very good GUI’s to zoom into images and by positioning a cursor where you want to set your source point (As, Bs, Cs, or Ds) will show the x and y coordinate values. You can note these down and then enter the values in the scan_adjust.txt file. I always use the GIMP program for this and next I show the steps I take to get these values. Open your image in GIMP and zoom so that the whole image is shown. Then add 4 horizontal guides (position your cursor in the ruler above the image window, click and drag down) close to the source points you intend to use. Now do the same for 4 vertical guides (position your cursor in the left ruler click and drag into the image) Now you can zoom into each source point and refine the positioning of the guides. Next is shown the final guide positioning for As. I set the horizontal guide above and the vertical left of the reference point. When you position your cursor just below and at the right of the intersection of the guides, you will see the coordinates to use for As at the left in the status bar below the image window (82, 184). Then do the same for Bs, Cs and Ds. Edit the scan_adjust.txt file with your image file name on the first line followed by the 4 source points. How to install my program? Just put it in a folder of your choice. Then add the text file and your image file in the same folder. Double click the scan_adjust.exe file and the transformation will start. It should bring up a CMD window that show some steps that are executed and at the end it waits until you press a key (this is just to help you read its content). The transformed image will have the name of the input image with ‘_a’ added (to refer to the adjusted status) or a file name and extension that you entered as last line in the data file. When something goes wrong, I try to give a meaningful message and keep the CMD window open until you press a key. Here is an example warning. And her is a successful run. Now I only have to provide you with the program itself. For a more recent or less buggy version see next posts. scan_adjust.exe Good luck with it and best regards, Kris
×
×
  • Create New...