home *** CD-ROM | disk | FTP | other *** search
- * Analysis of electronic scheme
- * by Cellular Logic Operations
- * Frans Groen
- *
- readf scheme,A
- @_corshad * correct the image for shading
- * obtain from the corrected image
- * a binary image by thresholding
- thresh B,B,1,220 * threshold
- toff
- doff * display off
- bcop 1,8 * copy the thresholded image
- bcop 1,6 * original in green
- inv 6 * after inversion
- *
- * separation of drawing and text
- *
- *
- * fill small holes
- bcop 8,7,b,b * copy bitplane
- don
- erosion 1,8,4,0,b * erode small holes away
- prop 511,8,7,8,0,b * propagate for what remains
- inv 8 * cleaned drawing in red
- don,4 * multi-bitplane display on
- bcopy 8,5,b,b * save original in b5
- doff * display off
- *
- * make skeleton
- skelet 511,8,1,b * skeleton in b8
- don * single bitplane display
- bcopy 8,4 * save skeleton in b4
- *
- * shave skeleton
- bcopy 8,7,b,b * copy in b7
- -skelet 16,7,1,b * remove strokes of length 16
- exor 8,7,7,b * find strokes
- vertices 8,0,b * vertices in bitplane 3
- dilation 1,8,8,0,b * enlarge vertices
- propag 511,8,7,8,0,b * propagate vertices in strokes
- exor 4,8,8,b * cleaned object in b8
- bcopy 8,4 * save in b4
- *
- * separate text based upon vertices in
- * the skeleton with removed strokes
- *
- bcopy 8,7 * copy for propagation mask
- vertices 8,0,b * find vertices
- propag 511,8,7,8,0,b * propagate vertices in skeleton
- bcop 8,4,b,b * save cleaned skeleton in b4
- propag 511,8,5,8,0,b * propagate skeleton in drawing
- doff * display off
- reset 7 * reset for display
- don,4 * multi-bitplane display
- bcop 8,5 * save original in b5
- *doff * display off
- *
- *analyse objects
- *capacitors : big objects
- bcop 5,6 * original in b8
- ero 4,6,4 * find capacitors
- prop 4,6,5,8,0,b * propagate back
- * capacitors in b6
- *resistors : objects enclosing small holes
- don,4
- inv 5,b * invert
- bcop 5,7 * original in b7
- ero 5,7 * erode 5 times
- propag 511,7,5,8,0,b * find what remains
- exor 5,7,7,b * find what disappears
- * resistors in b7
- * opamps
- bcop 5,8
- erosion 7,8,8,0,b * erode 7 times
- propag 511,8,5,8,0,b * find what remains
- exor 5,8,8,b * and what disappears
- exor 7,8,8,b * removes the resistors
- doff
- * opamps in b8
- * finds location of components in scheme
- * extend opamps
- dilation 2,8,6,0,b * extend opamps
- bcopy 8,1,b,b * save seed bitplane
- propag 3,8,4,6,0,b * propagate in skeleton
- or 1,8,8,b * or seed bitplane
- bcopy 8,1,b,b * opamps in b1
- * extend resistors
- dilation 2,7,6,0,b * extend resistors
- bcopy 7,2,b,b * save seed bitplane
- propag 3,7,4,6,0,b * propagate in skeleton
- or 2,7,7,b * or seed bitplane
- bcopy 7,2,b,b * resistors in b2
- * extend capacitors
- bcopy 6,3,b,b * save seed bitplane
- propag 3,6,4,6,0,b * propagate capacitors in skeleton
- or 3,6,6,b * or seed bitplane
- don,4 * multi-bitplane display on
- bcopy 6,3,b,b * capacitors in b3
- * determine endpoints and branchpoints
- * find scheme without components
- bcop 4,8 * get cleaned drawing (b4)
- inv 8 * invert
- or 1,8,8 * get rid of opamps
- or 2,8,8 * resistors
- or 3,8,8 * capacitors
- inv 8 * drawing without components
- bcopy 8,6 * copy in b6 for vertices
- bcopy 8,7 * copy in b7 for endpixels
- * find endpixels of the components
- endpix 7,0,b * find endpixels
- dilation 2,7,6,0,b * extend endpixels
- * find vertices
- vertices 6,0,b
- dilation 2,6,6,0,b
- *
- *dilate lines because of low_res display
- dilation 1,8,6,0,b
- or 6,8,8
- or 7,8,8 * lines : 876.....
- exor 8,6,6 * vertices : 87......
- exor 8,7,7 * endpixels: 8.6.....
- * insert components
- or 1,8,8 * opamps : 8......1
- or 2,7,7 * resistors: .7....2.
- or 3,6,6 * capacitors: ..6..3..
- reset 5 b
- gdisp b
- * Change the colours, using don,5 display mode
- * (Ed Doppenberg 5-8-90)
- clear c
- bcopy 1 5 b c * copy op.amp in bit plane 5 (red)
- bcopy 2 2 b c * copy resistors in bit plane 2 (blue)
- bcopy 3 3 b c * copy capacitors in bit plane 3 (green)
- bcopy 6 4 b c * copy vert.+horiz.+cap. bit plane 4 (l.blue)
- exor 3 4 4 c * strip capacitors
- bcopy 7 7 b c * copy endpoints + vert+horizon in bit plane 7 (yellow)
- exor 4 7 7 c * strip,
- and 4 7 7 c * every thing execpt endpoints
- exor 7 4 4 c * strip endpoints
- don,5
- gdisp c
- don 1 * back to normal display mode
-