forked from BradLarson/GPUImage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed some Xcode 6 compilation warnings / errors. Mac framework can n…
…ow build as a module in Xcode 6.
- Loading branch information
1 parent
506ec69
commit 9c85264
Showing
10 changed files
with
152 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ter/SimpleVideoFileFilter.xcodeproj/xcshareddata/xcschemes/SimpleVideoFileFilter.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
framework/GPUImage.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
framework/GPUImage.xcodeproj/xcshareddata/xcschemes/GPUImage.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,33 @@ | ||
#import "GPUImageFilterGroup.h" | ||
|
||
@class GPUImageGrayscaleFilter; | ||
@class GPUImage3x3TextureSamplingFilter; | ||
@class GPUImageNonMaximumSuppressionFilter; | ||
|
||
/* | ||
An implementation of the Features from Accelerated Segment Test (FAST) feature detector as described in the following publications: | ||
E. Rosten and T. Drummond. Fusing points and lines for high performance tracking. IEEE International Conference on Computer Vision, 2005. | ||
E. Rosten and T. Drummond. Machine learning for high-speed corner detection. European Conference on Computer Vision, 2006. | ||
For more about the FAST feature detector, see the resources here: | ||
http://www.edwardrosten.com/work/fast.html | ||
*/ | ||
|
||
typedef enum { kGPUImageFAST12Contiguous, kGPUImageFAST12ContiguousNonMaximumSuppressed} GPUImageFASTDetectorType; | ||
|
||
@interface GPUImageFASTCornerDetectionFilter : GPUImageFilterGroup | ||
{ | ||
GPUImageGrayscaleFilter *luminanceReductionFilter; | ||
GPUImage3x3TextureSamplingFilter *featureDetectionFilter; | ||
GPUImageNonMaximumSuppressionFilter *nonMaximumSuppressionFilter; | ||
// Generate a lookup texture based on the bit patterns | ||
|
||
// Step 1: convert to monochrome if necessary | ||
// Step 2: do a lookup at each pixel based on the Bresenham circle, encode comparison in two color components | ||
// Step 3: do non-maximum suppression of close corner points | ||
} | ||
|
||
- (id)initWithFASTDetectorVariant:(GPUImageFASTDetectorType)detectorType; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,89 @@ | ||
#import "GPUImageFASTCornerDetectionFilter.h" | ||
|
||
#import "GPUImageGrayscaleFilter.h" | ||
#import "GPUImage3x3TextureSamplingFilter.h" | ||
#import "GPUImageNonMaximumSuppressionFilter.h" | ||
|
||
// 14 total texture coordinates from vertex shader for non-dependent reads | ||
// 3 texture coordinates for dependent reads, then | ||
|
||
NSString *const kGPUImageFASTDetectorFragmentShaderString = SHADER_STRING | ||
( | ||
precision highp float; | ||
|
||
varying vec2 textureCoordinate; | ||
varying vec2 leftTextureCoordinate; | ||
varying vec2 rightTextureCoordinate; | ||
|
||
varying vec2 topTextureCoordinate; | ||
varying vec2 topLeftTextureCoordinate; | ||
varying vec2 topRightTextureCoordinate; | ||
|
||
varying vec2 bottomTextureCoordinate; | ||
varying vec2 bottomLeftTextureCoordinate; | ||
varying vec2 bottomRightTextureCoordinate; | ||
|
||
uniform sampler2D inputImageTexture; | ||
uniform sampler2D lookupTable; | ||
|
||
void main() | ||
{ | ||
lowp float centerIntensity = texture2D(inputImageTexture, textureCoordinate).r; | ||
lowp float bottomLeftIntensity = texture2D(inputImageTexture, bottomLeftTextureCoordinate).r; | ||
lowp float topRightIntensity = texture2D(inputImageTexture, topRightTextureCoordinate).r; | ||
lowp float topLeftIntensity = texture2D(inputImageTexture, topLeftTextureCoordinate).r; | ||
lowp float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r; | ||
lowp float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r; | ||
lowp float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r; | ||
lowp float bottomIntensity = texture2D(inputImageTexture, bottomTextureCoordinate).r; | ||
lowp float topIntensity = texture2D(inputImageTexture, topTextureCoordinate).r; | ||
|
||
lowp float byteTally = 1.0 / 255.0 * step(centerIntensity, topRightIntensity); | ||
byteTally += 2.0 / 255.0 * step(centerIntensity, topIntensity); | ||
byteTally += 4.0 / 255.0 * step(centerIntensity, topLeftIntensity); | ||
byteTally += 8.0 / 255.0 * step(centerIntensity, leftIntensity); | ||
byteTally += 16.0 / 255.0 * step(centerIntensity, bottomLeftIntensity); | ||
byteTally += 32.0 / 255.0 * step(centerIntensity, bottomIntensity); | ||
byteTally += 64.0 / 255.0 * step(centerIntensity, bottomRightIntensity); | ||
byteTally += 128.0 / 255.0 * step(centerIntensity, rightIntensity); | ||
|
||
// TODO: Replace the above with a dot product and two vec4s | ||
// TODO: Apply step to a matrix, rather than individually | ||
|
||
gl_FragColor = vec4(byteTally, byteTally, byteTally, 1.0); | ||
} | ||
); | ||
|
||
|
||
@implementation GPUImageFASTCornerDetectionFilter | ||
|
||
- (id)init; | ||
{ | ||
if (!(self = [self initWithFASTDetectorVariant:kGPUImageFAST12ContiguousNonMaximumSuppressed])) | ||
{ | ||
return nil; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (id)initWithFASTDetectorVariant:(GPUImageFASTDetectorType)detectorType; | ||
{ | ||
if (!(self = [super init])) | ||
{ | ||
return nil; | ||
} | ||
|
||
// [derivativeFilter addTarget:blurFilter]; | ||
// [blurFilter addTarget:harrisCornerDetectionFilter]; | ||
// [harrisCornerDetectionFilter addTarget:nonMaximumSuppressionFilter]; | ||
// [simpleThresholdFilter addTarget:colorPackingFilter]; | ||
|
||
// self.initialFilters = [NSArray arrayWithObjects:derivativeFilter, nil]; | ||
// self.terminalFilter = colorPackingFilter; | ||
// self.terminalFilter = nonMaximumSuppressionFilter; | ||
|
||
return self; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters