![]() See his script "white board"Ĭode: Select all convert SCAN0375.JPG -level 80,20% -morphology erode disk:4.3 \ -morphology hitandmiss peaks:1.5,2.5 punch_holes.pngon the original scan I got a black image. Fred Weinhaus as some edge detection scripts that will work perfectly for this, though his scripts work best when ALL the edges of the paper is visible. That may be easier to use to match up images. You fee those two items into a SRT distortionĪnother method is to ignore the punch holes completely. So you get a 'handle' for translation and a angle of rotation, but no scaling factor. A separate search from the two thinner long holes will then give it a line for the rotation of the image. That is your position adjustment (translation and center of rotation). With those two points you can translate, rotate and scale the images to match!įor a image with 'acme' punched paper, the above (with approprite adjustments) will only find the center hole. Take the two outermost pixel locations and use a 2 point Affine Distortion to align the original image (See Distort using control points) morphology hitandmiss peaks:1.5,2.5 punch_holes.png I can now find those dots (center of punch holes) using a 'peak' kernel and hit and missĬonvert bulldog.jpg -level 80,20% -morphology erode disk:4.3 \ Of course other parts will still remain, like the black edge, the nose and inside the mouth, but they will not be a small simple isolated 'dot'. The 'erode' then reduces the size of all lines and dots so that punch holes become a very very I first use -level to negate and increase the contrast of the imageto reduce the off-colors And that requires morphology.Ĭonvert bulldog.jpg -level 80,20% -morphology erode disk:4.3 bulldog_nolines.png The better method is to program in an better understanding of the things you are searching for. This however will generate a lot of false positives. This is a sub-image search and a number of methods exist, though "compare" is probably the simplest. One method is to make a small image of the punch hole, and search the image for the location of the punch hole. Those locations will give you the coordinates needed to do the distortion. The tricky part is to find the location of the punch hole holes. ![]() The tricky part is not distorting the image to align them. You do not need a 'reference' image, though it could be some help. Re-positioning the pegbar to the same position is pretty much impossible so if I need to do a fix on paper and re-scan a drawing, the entire scene needs to be re-scanned-Ugh! Going paperless and drawing on a Wacom tablet or Cintiq isn't an option. I'm currently solving this problem by temporarily taping a metal pegbar directly to the scanner's glass platen but the pegbar cannot stay attached permanently because the scanner is used for other purposes. Note that I'm using standard 1/4 inch 3-hole punched paper but the script should also be able to handle acme punched paper. I made these scans with the scanner top open so the hole punches would show up better and so the built in automatic cropping wouldn't cut off any of the image. However, I'm not very skilled at coding and have no idea where to begin. It seems to me that it would be trivial to write a script that would line up a batch of scans to a reference image of a blank sheet of paper with just the hole punches. Although it is written in Java, it doesn't work at all on Linux. I tried converting the scans with imagemagick but the program seems to work only on files captured on a Macintosh via TWAIN in Photoshop. ![]() In addition, there is a free program specifically for this purpose called ScanFix - but it can only use TIFF files with Macintosh byte order-my scanner writes to a memory card in JPEG format. There are several commercial animation packages that can do this including Toon Boom, TV Paint, DigiCel Flipbook, Animo and probably a few others. I'm doing some hand drawn 2D paper animation and would like to line up my scanned images using the hole punches.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |