Re: CIAreaMaximum filter not working
Re: CIAreaMaximum filter not working
- Subject: Re: CIAreaMaximum filter not working
- From: Kevin Meaney <email@hidden>
- Date: Wed, 26 Feb 2014 18:12:57 +0000
Well I've worked something out.
If the CGContext supplied buffer that the CIContext draws the results of the CIAreaMaximum filter to uses float components it doesn't work. Providing a context which is 8 bit ints per component with 4 components RGBA works.
Not the result I wanted, but at least I have something that works even thoug I lose some dynamic range.
Kevin
On 26 Feb 2014, at 12:50, Kevin Meaney <email@hidden> wrote:
> I've written a command line routine that compares two image files, in the hope of determining if the two files are different. Basically the tool only compares whether the dimensions are different or whether the pixel values are sufficiently different. So the routine has a distance option which is a threshold value over which any color component of any pixel needs to be over to decide if the images are different.
>
> The full single file source code for this is available here:
> https://gist.github.com/SheffieldKevin/9228574
>
> To implement this I've used two CIFilters, first the CIDifferenceBlendMode filter followed by the CIAreaMaximum.
>
> I've checked that the CIDifferenceBlendMode is working by grabbing the outputImage CIImage from the filter and saving it in a file on the desktop called deleteme.png. If you look at the code you'll see that the code for saving the intermediate image is still in there. If you compile and run you can setup the command line args similar to:
>
> compareimages -file1 "~/Pictures/DSCN1003.JPG" -file2 "~/Pictures/DSCN1004.JPG"
>
> The color distance option has a default value so is not required.
>
> The intermediate image looks as expected so I'm assuming that the problem has to be with how I'm using the CIAreaMaximum filter.
>
> Can anyone point me in the direction as to what it is I'm doing wrong?
>
> Kevin
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden