Hi Harvey, What values do you use for your grey scale? Using an image matrix with values of 0 - black to 1- white matrix, I played around with some bracketing functions and came up with:
pts=: 0.3 0.75 NB. Lower crush point , Upper crush point im =: 10 10 $ /:~ ?100 $ 0 NB. ordered matrix to make the results more obvious im 0.00250963 0.00622727 0.0100396 0.0135228 0.026295 0.0354648 0.0441196 0.0634095 0.0636887 0.0743274 0.0777468 0.0806589 0.0958341 0.104871 0.105966 0.107668 0.117839 0.159125 0.16308 0.16416 0.173968 0.178516 0.19215 0.193825 0.198699 0.216373 0.223244 0.23412 0.234715 0.236015 0.245395 0.248345 0.248398 0.268855 0.275797 0.27914 0.331849 0.332638 0.339126 0.362342 0.377342 0.386207 0.387631 0.392473 0.421612 0.426858 0.43757 0.437934 0.448136 0.45603 0.46794 0.469239 0.470724 0.484456 0.49807 0.513533 0.51932 0.532612 0.539394 0.545832 0.546122 0.552137 0.577239 0.621877 0.634726 0.670314 0.673257 0.675101 0.67628 0.677319 0.695419 0.700296 0.70091 0.726667 0.741175 0.744026 0.757192 0.75868 0.765208 0.76835 0.782616 0.785488 0.789083 0.812977 0.833975 0.834089 0.834361 0.842376 0.85476 0.870489 0.87588 0.881384 0.898155 0.909251 0.938587 0.947628 0.949301 0.949603 0.965512 0.989905 bb=: [ <. ( > {...@]) tb=: [ >. ( >: {:@]) im (bb tb ]) pts 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.331849 0.332638 0.339126 0.362342 0.377342 0.386207 0.387631 0.392473 0.421612 0.426858 0.43757 0.437934 0.448136 0.45603 0.46794 0.469239 0.470724 0.484456 0.49807 0.513533 0.51932 0.532612 0.539394 0.545832 0.546122 0.552137 0.577239 0.621877 0.634726 0.670314 0.673257 0.675101 0.67628 0.677319 0.695419 0.700296 0.70091 0.726667 0.741175 0.744026 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Hope this helps, it gave me a chance to play for a while :) Cheers, bob On -Feb13-2010, at -Feb13-201011:36 AM, PackRat wrote: > I have a very large number of scanned textual grayscale images where I > want to make the background white rather than a range of white to gray > (due to paper bends and other variations) as well as to darken the > black text a bit. (It would be far too labor-intensive to manually > adjust each image, one by one, with photo editing software.) > > Does anyone know if there is any J code or (preferably) a J control > where one can easily adjust the white point and black point on the > histogram of an image, seeing the image display change as the values > are changed? (The white point is where every value from there upward > to the maximum is converted to white, and, conversely, the black point > is where every value from there downward to the minimum is converted to > black.) > > I didn't see anything like this in Cliff Reiter's book, although he > does work a little with image histograms. > > It would be even nicer if this could be also scripted in some way to > automatically go through a series of images using two predetermined > values. > > Thanks in advance! > > Harvey > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm