I want to use IOS core image filter CIPerspectiveTransform
. I have fund a function but when I call this function the image is disapper from the view I am unable to understand why image is disappear ?
// I have picked picture from UIImageView
CIImage *inputImage = [[CIImage alloc] initWithImage:getImageFOrOCR.image];
CIFilter *filter2 = [CIFilter
filterWithName:@"CIPerspectiveTransform"];
[filter2 setDefaults];
[filter2 setValue:beginImage forKey:@"inputImage"];
[filter2 setValue:[CIVector vectorWithX:100 Y:500 ]
forKey:@"inputTopLeft"];
[filter2 setValue:[CIVector vectorWithX:600 Y:500 ]
forKey:@"inputTopRight"];
[filter2 setValue:[CIVector vectorWithX:600 Y:0 ]
forKey:@"inputBottomLeft"];
[filter2 setValue:[CIVector vectorWithX:0 Y:0 ]
forKey:@"inputBottomRight"];
CIImage *ciImageOut = [filter2 valueForKey:@"outputImage"];
CIContext *context = [CIContext contextWithOptions:nil];
// set image to UIImageView
getImageFOrOCR.image = [UIImage imageWithCGImage:
[context createCGImage:ciImageOut
fromRect:ciImageOut.extent]];