Skip to content

Commit

Permalink
Ensure that ImageTransforms are applied in all cases (this was patchy
Browse files Browse the repository at this point in the history
before; some features did & some didn't!)
  • Loading branch information
jonhare committed Aug 10, 2017
1 parent 64cffde commit ee56d60
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

/**
* Types of local feature
*
*
* @author Jonathon Hare (jsh2@ecs.soton.ac.uk)
*/
public enum LocalFeatureMode implements CmdLineOptionsProvider {
Expand Down Expand Up @@ -151,12 +151,12 @@ public LocalFeatureModeOp getOptions() {

/**
* Associated options for each {@link LocalFeatureMode}.
*
*
* @author Jonathon Hare (jsh2@ecs.soton.ac.uk)
*/
public static abstract class LocalFeatureModeOp
implements
LocalFeatureExtractor<LocalFeature<?, ?>, MBFImage>
LocalFeatureExtractor<LocalFeature<?, ?>, MBFImage>
{
private LocalFeatureMode mode;

Expand All @@ -171,7 +171,7 @@ public static abstract class LocalFeatureModeOp

/**
* Extract features based on the options.
*
*
* @param image
* the image
* @return the features
Expand Down Expand Up @@ -200,7 +200,7 @@ public LocalFeatureMode getMode() {

/**
* Associated options for things built on a {@link DoGSIFTEngine}.
*
*
* @author Jonathon Hare (jsh2@ecs.soton.ac.uk)
*/
public static abstract class AbstractDoGSIFTModeOp extends LocalFeatureModeOp {
Expand Down Expand Up @@ -282,7 +282,7 @@ public LocalFeatureList<? extends Keypoint> extract(byte[] img) throws IOExcepti
switch (this.cm) {
case SINGLE_COLOUR:
case INTENSITY:
keys = engine.findFeatures((FImage) cmOp.process(img));
keys = engine.findFeatures((FImage) itOp.transform(cmOp.process(img)));
break;
case INTENSITY_COLOUR:
throw new UnsupportedOperationException();
Expand All @@ -292,6 +292,7 @@ public LocalFeatureList<? extends Keypoint> extract(byte[] img) throws IOExcepti

@Override
public LocalFeatureList<? extends Keypoint> extractFeature(MBFImage img) {
img = (MBFImage) this.itOp.transform(img);
final MinMaxDoGSIFTEngine engine = new MinMaxDoGSIFTEngine();
LocalFeatureList<MinMaxKeypoint> keys = null;
switch (this.cm) {
Expand Down Expand Up @@ -517,6 +518,8 @@ private DenseSiftMode(LocalFeatureMode mode) {
}

LocalFeatureList<? extends LocalFeature<?, ?>> extract(FImage image) {
image = (FImage) this.itOp.transform(image);

final DenseSIFT dsift;

if (approximate)
Expand Down Expand Up @@ -562,6 +565,8 @@ private static class ColourDenseSiftMode extends DenseSiftMode {

@Override
public LocalFeatureList<? extends LocalFeature<?, ?>> extractFeature(MBFImage image) {
image = (MBFImage) this.itOp.transform(image);

final ColourDenseSIFT dsift;

if (approximate)
Expand Down Expand Up @@ -626,6 +631,8 @@ protected int[] toArray(List<Integer> in) {
}

LocalFeatureList<? extends LocalFeature<?, ?>> extractFeature(FImage image) {
image = (FImage) this.itOp.transform(image);

final PyramidDenseSIFT<FImage> dsift;

if (approximate)
Expand Down Expand Up @@ -672,6 +679,8 @@ private static class PyramidColourDenseSiftMode extends PyramidDenseSiftMode {

@Override
public LocalFeatureList<? extends LocalFeature<?, ?>> extractFeature(MBFImage image) {
image = (MBFImage) this.itOp.transform(image);

final PyramidDenseSIFT<MBFImage> dsift;

if (approximate)
Expand Down

0 comments on commit ee56d60

Please sign in to comment.