<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://boofcv.org/index.php?action=history&amp;feed=atom&amp;title=Example_Feature_Selector_Limit</id>
	<title>Example Feature Selector Limit - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://boofcv.org/index.php?action=history&amp;feed=atom&amp;title=Example_Feature_Selector_Limit"/>
	<link rel="alternate" type="text/html" href="https://boofcv.org/index.php?title=Example_Feature_Selector_Limit&amp;action=history"/>
	<updated>2026-05-08T05:42:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.36.2</generator>
	<entry>
		<id>https://boofcv.org/index.php?title=Example_Feature_Selector_Limit&amp;diff=3206&amp;oldid=prev</id>
		<title>Peter at 23:03, 2 September 2022</title>
		<link rel="alternate" type="text/html" href="https://boofcv.org/index.php?title=Example_Feature_Selector_Limit&amp;diff=3206&amp;oldid=prev"/>
		<updated>2022-09-02T23:03:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:03, 2 September 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;gallery heights=220 widths=220 &amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;gallery heights=220 widths=220 &amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;File:Standard_boat.jpg|Input&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;File:Standard_boat.jpg|Input&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;File:Example_limit_select_n.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;png&lt;/del&gt;|Select N most intense features&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;File:Example_limit_select_n.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jpg&lt;/ins&gt;|Select N most intense features&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;File:Example_limit_uniform.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;png&lt;/del&gt;|Forces features to be selected across the image using bining&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;File:Example_limit_uniform.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jpg&lt;/ins&gt;|Forces features to be selected across the image using bining&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;File:Example_limit_random.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;png&lt;/del&gt;|Randomly selects N features&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;File:Example_limit_random.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jpg&lt;/ins&gt;|Randomly selects N features&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/gallery&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/gallery&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://boofcv.org/index.php?title=Example_Feature_Selector_Limit&amp;diff=3202&amp;oldid=prev</id>
		<title>Peter at 22:53, 2 September 2022</title>
		<link rel="alternate" type="text/html" href="https://boofcv.org/index.php?title=Example_Feature_Selector_Limit&amp;diff=3202&amp;oldid=prev"/>
		<updated>2022-09-02T22:53:58Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:53, 2 September 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;gallery heights=220 widths=220 &amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;gallery heights=220 widths=220 &amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;File:Standard_boat.jpg|Input&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;File:Example_limit_select_n.png|Select N most intense features&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;File:Example_limit_select_n.png|Select N most intense features&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;File:Example_limit_uniform.png|Forces features to be selected across the image using bining&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;File:Example_limit_uniform.png|Forces features to be selected across the image using bining&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://boofcv.org/index.php?title=Example_Feature_Selector_Limit&amp;diff=3201&amp;oldid=prev</id>
		<title>Peter: Created page with &quot;&lt;center&gt; &lt;center&gt; &lt;gallery heights=220 widths=220 &gt; File:Example_limit_select_n.png|Select N most intense features File:Example_limit_uniform.png|Forces features to be selecte...&quot;</title>
		<link rel="alternate" type="text/html" href="https://boofcv.org/index.php?title=Example_Feature_Selector_Limit&amp;diff=3201&amp;oldid=prev"/>
		<updated>2022-09-02T22:48:07Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;center&amp;gt; &amp;lt;center&amp;gt; &amp;lt;gallery heights=220 widths=220 &amp;gt; File:Example_limit_select_n.png|Select N most intense features File:Example_limit_uniform.png|Forces features to be selecte...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;gallery heights=220 widths=220 &amp;gt;&lt;br /&gt;
File:Example_limit_select_n.png|Select N most intense features&lt;br /&gt;
File:Example_limit_uniform.png|Forces features to be selected across the image using bining&lt;br /&gt;
File:Example_limit_random.png|Randomly selects N features&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When detecting interest points and other point features inside an image there&amp;#039;s often the need to limit how many you consider. This can be a way to limit the amount of computational resources required. BoofCV provides the NonMaxLimiter as an abstract way to do just that and several different implementations. For some applications you might wish to only select the most intense features, others you might need to select features across the entire image to ensure numeric stability, or maybe random is good enough.&lt;br /&gt;
&lt;br /&gt;
Example File: [https://github.com/lessthanoptimal/BoofCV/blob/v0.41/examples/src/main/java/boofcv/examples/calibration/ExampleCalibrateMonocular.java ExampleCalibrateMonocular.java]&lt;br /&gt;
&lt;br /&gt;
Calibration Tutorial: [[Tutorial_Camera_Calibration|Wikipage]]&lt;br /&gt;
&lt;br /&gt;
Concepts:&lt;br /&gt;
* Corner detectors&lt;br /&gt;
* Interest point detectors&lt;br /&gt;
&lt;br /&gt;
Related Examples:&lt;br /&gt;
* [[Example_Detect_Interest_Points| Detect Interest Points]]&lt;br /&gt;
* [[Example_Detect_Corners| Corner Detectors]]&lt;br /&gt;
&lt;br /&gt;
= Example Code =&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Visualization of feature Select Limit. After non-maximum suppression, select limit decides which detected&lt;br /&gt;
 * features should be used when the requested number of features is exceeded by the number of detected features.&lt;br /&gt;
 * Typically, you either want the most intense features or you want to ensure that features are selected&lt;br /&gt;
 * throughout the image.&lt;br /&gt;
 *&lt;br /&gt;
 * @author Peter Abeles&lt;br /&gt;
 */&lt;br /&gt;
public class ExampleFeatureLimit {&lt;br /&gt;
	// Radius for non-maximum suppression&lt;br /&gt;
	public static final int NON_MAX_RADIUS = 5;&lt;br /&gt;
&lt;br /&gt;
	// Maximum number of features it will return&lt;br /&gt;
	public static final int MAX_FEATURES = 200;&lt;br /&gt;
&lt;br /&gt;
	public static BufferedImage renderLimit( GrayF32 intensity, SelectLimitTypes type ) {&lt;br /&gt;
		// Configure how it will select features inside the intensity image&lt;br /&gt;
		var limit = new ConfigSelectLimit(type, 0xBEEF);&lt;br /&gt;
		NonMaxLimiter nonmax = FactoryFeatureExtractor.nonmaxLimiter(new ConfigExtract(NON_MAX_RADIUS, 0), limit, MAX_FEATURES);&lt;br /&gt;
&lt;br /&gt;
		// Detect the features&lt;br /&gt;
		nonmax.process(intensity);&lt;br /&gt;
		FastAccess&amp;lt;LocalExtreme&amp;gt; features = nonmax.getFeatures();&lt;br /&gt;
&lt;br /&gt;
		// Visualize the intensity image&lt;br /&gt;
		var output = new BufferedImage(intensity.width, intensity.height, BufferedImage.TYPE_INT_RGB);&lt;br /&gt;
		VisualizeImageData.colorizeSign(intensity, output, -1);&lt;br /&gt;
&lt;br /&gt;
		// render each selected maximum with a circle&lt;br /&gt;
		Graphics2D g2 = output.createGraphics();&lt;br /&gt;
		g2.setColor(Color.blue);&lt;br /&gt;
		for (int i = 0; i &amp;lt; features.size(); i++) {&lt;br /&gt;
			LocalExtreme c = features.get(i);&lt;br /&gt;
			VisualizeFeatures.drawCircle(g2, c.location.x, c.location.y, NON_MAX_RADIUS);&lt;br /&gt;
		}&lt;br /&gt;
		return output;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public static void main( String[] args ) {&lt;br /&gt;
		BufferedImage buffered = UtilImageIO.loadImageNotNull(UtilIO.pathExample(&amp;quot;standard/boat.jpg&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
		GrayF32 input = ConvertBufferedImage.convertFrom(buffered, (GrayF32)null);&lt;br /&gt;
&lt;br /&gt;
		// Compute the image gradient&lt;br /&gt;
		GrayF32 derivX = input.createSameShape();&lt;br /&gt;
		GrayF32 derivY = input.createSameShape();&lt;br /&gt;
&lt;br /&gt;
		GImageDerivativeOps.gradient(DerivativeType.SOBEL, input, derivX, derivY, BorderType.EXTENDED);&lt;br /&gt;
&lt;br /&gt;
		// From the gradient compute intensity of shi-tomasi features&lt;br /&gt;
		GeneralFeatureIntensity&amp;lt;GrayF32, GrayF32&amp;gt; featureIntensity =&lt;br /&gt;
				FactoryIntensityPoint.shiTomasi(3, false, GrayF32.class);&lt;br /&gt;
&lt;br /&gt;
		featureIntensity.process(input, derivX, derivY, null, null, null);&lt;br /&gt;
		GrayF32 intensity = featureIntensity.getIntensity();&lt;br /&gt;
&lt;br /&gt;
		var panel = new ListDisplayPanel();&lt;br /&gt;
		panel.addImage(buffered, &amp;quot;Input Image&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		// Detect maximums with different settings and visualize the results&lt;br /&gt;
		for (var type : SelectLimitTypes.values()) {&lt;br /&gt;
			panel.addImage(renderLimit(intensity, type), type.name());&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		ShowImages.showWindow(panel, &amp;quot;Non-Max with Limiter&amp;quot;, true);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
</feed>