🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: sci.image.processing
1 messages
1 total messages Started by Alan Peters Thu, 20 Aug 1992 15:58
Binary morphology with morph
#534
Author: Alan Peters
Date: Thu, 20 Aug 1992 15:58
42 lines
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


-- 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads