Searches for features inside the provided scale space

@param ss Scale space of an image
321509
@Override
	public void detect(PyramidFloat<T> ss) {
		spaceIndex = 0;
		if (intensities == null) {
			intensities = new GrayF32[3];
			intensities[0] = new GrayF32(1, 1);
			intensities[1] = new GrayF32(1, 1);
			intensities[2] = new GrayF32(1, 1);

			maximums = new List[3];
			maximums[0] = new ArrayList<>();
			maximums[1] = new ArrayList<>();
			maximums[2] = new ArrayList<>();
		}
		foundPoints.clear();

		// compute feature intensity in each level
		for (int i = 0; i < ss.getNumLayers(); i++) {
			detectCandidateFeatures(ss.getLayer(i), ss.getSigma(i));

			// find maximum in NxNx3 (local image and scale space) region
			if (i >= 2) {
				findLocalScaleSpaceMax(ss, i - 1);
			}
		}
	}
292211
public void setSS(java.util.Collection<String> sS) {
        if (sS == null) {
            this.sS = null;
            return;
        }

        this.sS = new java.util.ArrayList<String>(sS);
    }
1094613
private void findLocalScaleSpaceMax(int []size, int level, int skip) {
		int index0 = spaceIndex;
		int index1 = (spaceIndex + 1) % 3;
		int index2 = (spaceIndex + 2) % 3;

		ImageBorder_F32 inten0 = (ImageBorder_F32)FactoryImageBorderAlgs.value(intensity[index0], 0);
		GrayF32 inten1 = intensity[index1];
		ImageBorder_F32 inten2 = (ImageBorder_F32)FactoryImageBorderAlgs.value(intensity[index2], 0);

		// find local maximums in image 2D space.  Borders need to be ignored since
		// false positives are found around them as an artifact of pixels outside being
		// treated as being zero.
		foundFeatures.reset();
		extractor.setIgnoreBorder(size[level] / (2 * skip));
		extractor.process(intensity[index1],null,null,null,foundFeatures);

		// Can't consider feature which are right up against the border since they might not be a true local
		// maximum when you consider the features on the other side of the ignore border
		int ignoreRadius = extractor.getIgnoreBorder() + extractor.getSearchRadius();
		int ignoreWidth = intensity[index1].width-ignoreRadius;
		int ignoreHeight = intensity[index1].height-ignoreRadius;

		// number of features which can be added
		int numberRemaining;

		// if configured to do so, only select the features with the highest intensity
		QueueCorner features;
		if( sortBest != null ) {
			sortBest.process(intensity[index1],foundFeatures,true);
			features = sortBest.getBestCorners();
			numberRemaining = maxFeaturesPerScale;
		} else {
			features = foundFeatures;
			numberRemaining = Integer.MAX_VALUE;
		}

		int levelSize = size[level];
		int sizeStep = levelSize-size[level-1];

		// see if these local maximums are also a maximum in scale-space
		for( int i = 0; i < features.size && numberRemaining > 0; i++ ) {
			Point2D_I16 f = features.get(i);

			// avoid false positives.  see above comment
			if( f.x < ignoreRadius || f.x >= ignoreWidth || f.y < ignoreRadius || f.y >= ignoreHeight )
				continue;

			float val = inten1.get(f.x,f.y);

			// see if it is a max in scale-space too
			if( checkMax(inten0,val,f.x,f.y) && checkMax(inten2,val,f.x,f.y) ) {

				// find the feature's location to sub-pixel accuracy using a second order polynomial
				// NOTE: In the original paper this was done using a quadratic.  See comments above.
				// NOTE: Using a 2D polynomial for x and y might produce better results.
				float peakX = polyPeak(inten1.get(f.x-1,f.y),inten1.get(f.x,f.y),inten1.get(f.x+1,f.y));
				float peakY = polyPeak(inten1.get(f.x,f.y-1),inten1.get(f.x,f.y),inten1.get(f.x,f.y+1));
				float peakS = polyPeak(inten0.get(f.x,f.y),inten1.get(f.x,f.y),inten2.get(f.x,f.y));

				float interpX = (f.x+peakX)*skip;
				float interpY = (f.y+peakY)*skip;
				float interpS = levelSize+peakS*sizeStep;

				double scale =  1.2*interpS/9.0;
				foundPoints.grow().set(interpX,interpY,scale);
				numberRemaining--;
			}
		}
	}
668946
public static void scale(ImageInputStream srcStream, ImageOutputStream destStream, int width, int height, Color fixedColor) throws IORuntimeException {
		scale(read(srcStream), destStream, width, height, fixedColor);
	}
635515
public void scale(float sx, float sy) {
		this.sx = this.sx * sx;
		this.sy = this.sy * sy;
		
		checkPush();

		predraw();
		GL.glScalef(sx, sy, 1);
		postdraw();
	}
717349
public static void scale(InputStream srcStream, OutputStream destStream, float scale) {
		scale(read(srcStream), destStream, scale);
	}
360250
public void detect( II integral ) {
		if( intensity == null ) {
			intensity = new GrayF32[3];
			for( int i = 0; i < intensity.length; i++ ) {
				intensity[i] = new GrayF32(integral.width,integral.height);
			}
		}
		foundPoints.reset();

		// computes feature intensity every 'skip' pixels
		int skip = initialSampleRate;
		// increment between kernel sizes
		int sizeStep = scaleStepSize;
		// initial size of the kernel in the first octave
		int octaveSize = initialSize;
		for( int octave = 0; octave < numberOfOctaves; octave++ ) {
			for( int i = 0; i < sizes.length; i++ ) {
				sizes[i] = octaveSize + i*sizeStep;
			}
			// if the maximum kernel size is larger than the image don't process
			// the image any more
			int maxSize = sizes[sizes.length-1];
			if( maxSize > integral.width || maxSize > integral.height )
				break;
			// detect features inside of this octave
			detectOctave(integral,skip,sizes);
			skip += skip;
			octaveSize += sizeStep;
			sizeStep += sizeStep;
		}

		// todo save previously computed sizes for reuse in higher octaves and reuse it
	}
28637
public void setSS(java.util.Collection<String> sS) {
        if (sS == null) {
            this.sS = null;
            return;
        }

        java.util.List<String> sSCopy = new java.util.ArrayList<String>(sS.size());
        sSCopy.addAll(sS);
        this.sS = sSCopy;
    }
582555
public static void scale(Image srcImg, OutputStream out, float scale) throws IORuntimeException {
		scale(srcImg, getImageOutputStream(out), scale);
	}
51274
@Override
    public FeatureResponseResult extractFeature(UploadSearchParams uploadSearchParams) {
        try {
            ViSearchHttpResponse response = getPostImageSearchHttpResponse(uploadSearchParams, ENDPOINT_EXTRACT_FEATURE);
            return getFeatureResponseResult(response);
        } catch (InternalViSearchException e) {
            return new FeatureResponseResult(e.getMessage(), e.getCause(), e.getServerRawResponse());
        }
    }
212296
def zoom_cb(self, fitsimage, event):
        
        chviewer = self.fv.getfocus_viewer()
        bd = chviewer.get_bindings()

        if hasattr(bd, 'sc_zoom'):
            return bd.sc_zoom(chviewer, event)

        return False
837599
protected boolean internalSetDescriptionBorder(KltFeature feature) {

		computeSubImageBounds(feature, feature.x, feature.y);

		ImageMiscOps.fill(feature.desc, Float.NaN);
		feature.desc.subimage(dstX0, dstY0, dstX1, dstY1, subimage);
		interpInput.setImage(image);
		interpInput.region(srcX0, srcY0, subimage);

		feature.derivX.subimage(dstX0, dstY0, dstX1, dstY1, subimage);
		interpDeriv.setImage(derivX);
		interpDeriv.region(srcX0, srcY0, subimage);

		feature.derivY.subimage(dstX0, dstY0, dstX1, dstY1, subimage);
		interpDeriv.setImage(derivY);
		interpDeriv.region(srcX0, srcY0, subimage);

		int total= 0;

		Gxx = Gyy = Gxy = 0;
		for( int i = 0; i < lengthFeature; i++ ) {
			if( Float.isNaN(feature.desc.data[i]))
				continue;

			total++;

			float dX = feature.derivX.data[i];
			float dY = feature.derivY.data[i];

			Gxx += dX * dX;
			Gyy += dY * dY;
			Gxy += dX * dY;
		}

		// technically don't need to save this...
		feature.Gxx = Gxx;
		feature.Gyy = Gyy;
		feature.Gxy = Gxy;

		float det = Gxx * Gyy - Gxy * Gxy;

		return (det >= config.minDeterminant*total);
	}
826651
function shrink(s,scale=1,square=false) {
       var btop =[],bbottom =[],bleft=[],bright=[];
       //var s = document.getElementsByTagName('svg')[3];
       var swidth = s.clientWidth;
       var sheight = s.clientHeight;


       s.removeAttribute('viewBox');


       [...s.children].forEach(c =>{
       var val = c.getBoundingClientRect();
       // filter points not on image
       if (isFinite(val.top)){btop.push(val.top)};
       if (isFinite(val.bottom)){bbottom.push(val.bottom)};
       if (isFinite(val.left)){bleft.push(val.left)};
       if (isFinite(val.right)){bright.push(val.right)};
       })
console.log(bleft)

       btop = Math.min(...btop)/sheight;
       bbottom = Math.max(...bbottom)/sheight;
       bleft = Math.min(...bleft)/swidth
       bright = Math.max(...bright)/swidth;

       var by= Math.abs(btop-bbottom)*sheight;
       var bx= Math.abs(bleft-bright)*swidth ;
              //btop = (btop <0)?0:btop;
              //bleft = (bleft <0)?0:bleft;
console.log(bleft,bright,bbottom,btop,bx,by,'cw',swidth,sheight)

       s.setAttribute('preserveAspectRatio',"none");
       scale += .5e-4
       console.log(''+ (bleft)*scale+' '+(btop)*scale+
        ' '+bx+' '+by)


       s.setAttribute('viewBox',''+

         (bleft)*scale*swidth+' '+(btop)*scale*sheight+
         ' '+bx+' '+by);
       scale += .5e-4
       s.setAttribute('preserveAspectRatio',"xMinYMin meet");


         s.style.width = bx*scale;
         s.style.height = by*scale;
       if (square){
         s.style.width = square;
         s.style.height = square;
       }

    /*if (loop >0 ){
      loop += 1
      shrink(s,scale=1,loop=loop)
    }  else{
       return s
    }*/
    return s
 }
61867
protected void convertFromARtoVRSpace(float scale) {
        mPose.update(mAnchor.getPose(), scale);
        getTransform().setModelMatrix(mPose.getPoseMatrix());
    }
393832
def scale_WCS(self,pixel_scale,retain=True):
        ''' 
        '''
        _ratio = pixel_scale / self.pscale

        # Correct the size of the image and CRPIX values for scaled WCS
        self.naxis1 /= _ratio
        self.naxis2 /= _ratio
        self.crpix1 = self.naxis1/2.
        self.crpix2 = self.naxis2/2.

        if retain:
            # Correct the WCS while retaining original distortion information
            self.cd11 *= _ratio
            self.cd12 *= _ratio
            self.cd21 *= _ratio
            self.cd22 *= _ratio
        else:
            pscale = pixel_scale / 3600.
            self.cd11 = -pscale * N.cos(pa)
            self.cd12 = pscale * N.sin(pa)
            self.cd21 = self.cd12
            self.cd22 = -self.cd11

        # Now make sure that all derived values are really up-to-date based
        # on these changes
        self.update()
118243
public void findSSSP() {
        Record<N, E> initRec = new Record<>(init, 0.0f);
        if (records.put(init, initRec) != null) {
            throw new IllegalStateException("Search has already been performed!");
        }

        SmartDynamicPriorityQueue<Record<N, E>> pq = BinaryHeap.create(graph.size());
        initRec.ref = pq.referencedAdd(initRec);

        while (!pq.isEmpty()) {
            // Remove node with minimum distance
            Record<N, E> rec = pq.extractMin();
            float dist = rec.dist;

            N node = rec.node;

            // edge scanning
            for (E edge : graph.getOutgoingEdges(node)) {
                float w = edgeWeights.getEdgeWeight(edge);
                float newDist = dist + w;

                N tgt = graph.getTarget(edge);
                Record<N, E> tgtRec = records.get(tgt);
                if (tgtRec == null) {
                    // node has not been visited before, add a record
                    // and add it to the queue
                    tgtRec = new Record<>(tgt, newDist, edge, rec);
                    tgtRec.ref = pq.referencedAdd(tgtRec);
                    records.put(tgt, tgtRec);
                } else if (newDist < tgtRec.dist) {
                    // using currently considered edge decreases current distance
                    tgtRec.dist = newDist;
                    tgtRec.reach = edge;
                    tgtRec.depth = rec.depth + 1;
                    tgtRec.parent = rec;
                    // update it's position in the queue
                    pq.keyChanged(tgtRec.ref);
                }
            }
        }
    }
459563
public ImageScale lookup( double sigma ) {
		ImageScale best = null;
		double bestValue = Double.MAX_VALUE;

		for (int i = 0; i < usedScales.size(); i++) {
			ImageScale image = usedScales.get(i);
			double difference = Math.abs(sigma-image.sigma);
			if( difference < bestValue ) {
				bestValue = difference;
				best = image;
			}
		}
		return best;
	}