Article View: sci.image.processing
Article #534Binary morphology with morph
From: Alan Peters
Date: Thu, 20 Aug 1992 15:58
Date: Thu, 20 Aug 1992 15:58
42 lines
1900 bytes
1900 bytes
Linh Huynh worte to me as follows:
It seems all binary operations do not work on binary images.
For example I tried to erode binary image called ccitt-1.ras using
this command
berode < ccitt-1.ras > out.ras plus
It reports:
GetRasHeader: Input image must be 8 bits/pixel
This one is 1 bits/pixels
This person's email address bounces back at my mailer daemon so I am
replying here. (Moreover, others have probably experienced the same
problem with my morph software.)
My programs operate only on 8-bit rasterfiles. Of course, the programs
would be better without that restriction. It should not be terribly
difficult to modify the routine ReadRasterFile in morph/utils/rasterio.c
to read 1-bit rasterfiles. In the meantime you can use pbmplus, zcat,
and compress in conjunction with the binary morph operators to do what
you want as follows:
zcat ccitt-1.ras.Z | rasttopnm | pnmdepth 255 | pnmtorast -standard \
| berode plus | rasttopnm | pgmtopbm | pnmtorast -standard \
| compress -c > ccitt-1-erode.ras.Z
The "\"'s simply escape carriage returns.
I have tried this with the ccitt image and it works.
Be aware that you need a lot of memory to do this since the ccitt-N.ras.Z
images are very large.
Let me know if you have any other problems.
Alan Peters
--
Technical Details
Message-ID:
<1992Aug20.155831.20247@vuse.vanderbilt.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!vuse.vanderbilt.edu!rap2Show Full Headers
Complete Article Headers
Newsgroups: sci.image.processing Path: arc1-ca.pugleaf.net!sparky!uunet!vuse.vanderbilt.edu!rap2 From: rap2@vuse.vanderbilt.edu (Alan Peters) Subject: Binary morphology with morph Message-ID: <1992Aug20.155831.20247@vuse.vanderbilt.edu> Followup-To: sci.image.processing Summary: How to use one-bit rasterfiles with morph. Keywords: morph software, mathematical morphology, Sun rasterfiles Sender: Alan Peters Nntp-Posting-Host: image Organization: Vanderbilt University School of Engineering, Nashville, TN, USA Date: Thu, 20 Aug 1992 15:58:31 GMT Lines: 42