<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://boofcv.org/index.php?action=history&amp;feed=atom&amp;title=Example_Simulate_Motion_Blur</id>
	<title>Example Simulate Motion Blur - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://boofcv.org/index.php?action=history&amp;feed=atom&amp;title=Example_Simulate_Motion_Blur"/>
	<link rel="alternate" type="text/html" href="http://boofcv.org/index.php?title=Example_Simulate_Motion_Blur&amp;action=history"/>
	<updated>2026-05-30T15:09:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.36.2</generator>
	<entry>
		<id>http://boofcv.org/index.php?title=Example_Simulate_Motion_Blur&amp;diff=3023&amp;oldid=prev</id>
		<title>Peter at 03:25, 9 October 2021</title>
		<link rel="alternate" type="text/html" href="http://boofcv.org/index.php?title=Example_Simulate_Motion_Blur&amp;diff=3023&amp;oldid=prev"/>
		<updated>2021-10-09T03:25:28Z</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 03:25, 9 October 2021&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-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&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; 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;&amp;lt;gallery caption=&amp;quot;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Example input and output Images&lt;/del&gt;&amp;quot; heights=200 widths=250 &amp;gt;&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;&amp;lt;gallery caption=&amp;quot;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Simulated Motion Blur From Chessboard Pattern&lt;/ins&gt;&amp;quot; heights=200 widths=250 &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:Example_simulate_motion_blur_01.jpg&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_simulate_motion_blur_01.jpg&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_simulate_motion_blur_02.jpg&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_simulate_motion_blur_02.jpg&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>http://boofcv.org/index.php?title=Example_Simulate_Motion_Blur&amp;diff=3022&amp;oldid=prev</id>
		<title>Peter: Created page with &quot;&lt;center&gt; &lt;gallery caption=&quot;Example input and output Images&quot; heights=200 widths=250 &gt; File:Example_simulate_motion_blur_01.jpg File:Example_simulate_motion_blur_02.jpg &lt;/galler...&quot;</title>
		<link rel="alternate" type="text/html" href="http://boofcv.org/index.php?title=Example_Simulate_Motion_Blur&amp;diff=3022&amp;oldid=prev"/>
		<updated>2021-10-09T03:24:39Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;center&amp;gt; &amp;lt;gallery caption=&amp;quot;Example input and output Images&amp;quot; heights=200 widths=250 &amp;gt; File:Example_simulate_motion_blur_01.jpg File:Example_simulate_motion_blur_02.jpg &amp;lt;/galler...&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;gallery caption=&amp;quot;Example input and output Images&amp;quot; heights=200 widths=250 &amp;gt;&lt;br /&gt;
File:Example_simulate_motion_blur_01.jpg&lt;br /&gt;
File:Example_simulate_motion_blur_02.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simulates linear motion blur by creating a PSF. This is useful when you want to generate a test set of synthetic images under blurred conditions.&lt;br /&gt;
&lt;br /&gt;
Example Code:&lt;br /&gt;
* [https://github.com/lessthanoptimal/BoofCV/blob/v0.39/examples/src/main/java/boofcv/examples/imageprocessing/ExampleSimulateMotionBlur.java ExampleSimulateMotionBlur.java]&lt;br /&gt;
&lt;br /&gt;
Concepts:&lt;br /&gt;
* Convolution&lt;br /&gt;
* Simulation&lt;br /&gt;
&lt;br /&gt;
Relevant Examples:&lt;br /&gt;
* [[Example_Image_Blur|Image Blur]]&lt;br /&gt;
&lt;br /&gt;
= Example Code =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Shows you how to simulate motion blur in an image and what the results look like.&lt;br /&gt;
 *&lt;br /&gt;
 * @author Peter Abeles&lt;br /&gt;
 */&lt;br /&gt;
public class ExampleSimulateMotionBlur {&lt;br /&gt;
	public static void main( String[] args ) {&lt;br /&gt;
		// Load a chessboard image since it&amp;#039;s easy to see blur with it&lt;br /&gt;
		GrayF32 image = UtilImageIO.loadImage(UtilIO.fileExample(&amp;quot;calibration/mono/Sony_DSC-HX5V_Chess/frame03.jpg&amp;quot;), true, ImageType.SB_F32);&lt;br /&gt;
		GrayF32 blurred = image.createSameShape();&lt;br /&gt;
&lt;br /&gt;
		var panel = new ListDisplayPanel();&lt;br /&gt;
&lt;br /&gt;
		for (int degrees : new int[]{0, 25, -75}) {&lt;br /&gt;
			double radians = UtilAngle.degreeToRadian(degrees);&lt;br /&gt;
			for (double lengthOfMotion : new double[]{5, 15, 30}) {&lt;br /&gt;
				// Create the PSF (i.e. Kernel) that models motion blur with constant velocity&lt;br /&gt;
				// radians is the motion blur&amp;#039;s direction&lt;br /&gt;
				Kernel2D_F32 kernel = MotionBlurOps.linearMotionPsf(lengthOfMotion, radians);&lt;br /&gt;
				GConvolveImageOps.convolve(kernel, image, blurred, BorderType.EXTENDED);&lt;br /&gt;
&lt;br /&gt;
				// Visualize results&lt;br /&gt;
				BufferedImage visualized = ConvertBufferedImage.convertTo(blurred, null);&lt;br /&gt;
				panel.addImage(visualized, String.format(&amp;quot;linear: angle=%d motion=%.0f&amp;quot;, degrees, lengthOfMotion));&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		ShowImages.showWindow(panel, &amp;quot;Simulated Motion Blur&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>