package com.github.axet.lookup.common;
import java.awt.image.BufferedImage;
* Container for ImageBinary and Feature class for each channel (one gray channel here)
public class ImageBinaryGreyFeature implements ImageBinaryFeature {
public ImageBinaryChannelFeature grey;
List<ImageBinaryChannelFeature> list;
public ImageBinaryGreyFeature(BufferedImage img, double threshold) {
FeatureSet lr = new FeatureSetAuto(grey, threshold);
public void init(BufferedImage img) {
grey = new ImageBinaryChannelFeature();
list = Arrays.asList(new ImageBinaryChannelFeature[] { grey });
this.grey.initBase(this.image.r);
for (int x = 0; x < this.image.cx; x++) {
for (int y = 0; y < this.image.cy; y++) {
grey.zeroMean = new ImageZeroMean();
grey.zeroMean.init(grey.integral);
for (int x = 0; x < this.image.cx; x++) {
for (int y = 0; y < this.image.cy; y++) {
grey.zeroMean.step(x, y);
grey.zeroMeanIntegral = new IntegralImage();
grey.zeroMeanIntegral.initBase(grey.zeroMean);
for (int x = 0; x < this.image.cx; x++) {
for (int y = 0; y < this.image.cy; y++) {
grey.zeroMeanIntegral.step(x, y);
return image.cx * image.cy;
public BufferedImage getImage() {
public List<ImageBinaryChannelFeature> getFeatureChannels() {