Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news.linkpendium.com!news.linkpendium.com!panix!not-for-mail From: john hevelin Newsgroups: comp.sys.mac.system Subject: Re: Any quick, easy way to compare two images? Date: Sat, 25 Jan 2014 18:51:21 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 45 Message-ID: References: <2ridndio-M0kOnzPnZ2dnUVZ8kmdnZ2d@giganews.com> <2fd2jijlbb.fsf@ethel.the.log> <161tzyjibp.fsf@ethel.the.log> <5cKdnS2-vfr0cX_PnZ2dnUVZ_oSdnZ2d@giganews.com> <6jy523synp.fsf@ethel.the.log> NNTP-Posting-Host: panix2.panix.com X-Trace: reader1.panix.com 1390675881 3624 166.84.1.2 (25 Jan 2014 18:51:21 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Sat, 25 Jan 2014 18:51:21 +0000 (UTC) User-Agent: tin/2.0.0-20110823 ("Ardenistiel") (UNIX) (NetBSD/6.1 (i386)) Xref: csiph.com comp.sys.mac.system:55337 Beating a dead horse for my own satisfaction.... The original poster has a set of data which he submits to image processing. The OP might receive duplicate copies of the data set, but does not want to process the duplicates. The OP sought a way to detect duplicate data. Several utilities were suggested as solutions, including cmp(1), diff(1), and something termed "XOR" which I'm not familiar with but which I assume is some sort of CRC utility like sum(1) or md5(1). Another poster suggested a motion detection application. Several posters pointed out for image processing, many factors can introduce changes in data that are not visually significant, and hence a check for absolute equality would not have the result sought by the OP. The OP said this didn't matter, and is presumably satisfied with the solutions at hand. But suppose it did matter? Suppose by theory or experiment we could establish a threshold of difference between the data sets that would enable us to process only the new sets with a meaningful probability of the result being visually significant? [Caveat: I know nothing about image processing.] The command cmp -l generates a list of the differing bytes in two files. For example, for these files: % cat file1 How now brown cow. % cat file2 Hoy not brown coi. The command cmp -l produces: % cmp -l file1 file2 3 167 171 7 167 164 17 167 151 If the count of differing bytes exceeds the pre-established threshold, then process the data; otherwise, wait for the next batch of data.