Program e-paper on the STM32L053-Discovery Board with the BSP Library using STM32CubeIDE

The purpose of this post is to demonstrate how to include the BSP library in a project and program the e-paper on an STM32L053-Discovery board. This method of including the BSP library is a modified version of the method described in the reference below. References: Versions Used: In order to write to the e-paper included …

Simple Hit-Testing with wxWidgets

References: As far as I can tell, wxWidgets does not provide general-purpose hit-testing on the client area of a window in the way that C# does [3]. This is the simplest implementation of hit-testing that I could devise. It is closely modeled on the code reference [1], but with most of the features stripped out …

Create minimal wxWidgets program from empty VS 2022 project

This procedure creates a minimal wxWidgets static-library app that does nothing useful, but provides a framework for building more complex apps. Here is what it looks like, in all its glory: Versions Used: Main Reference: Other References: This procedure follows the explanation given in the YouTube video linked above, but with a few differences: Download …

WPF/C# Ribbon with commands, hotkeys, and unsaved document flag.

This post demonstrates the rudiments of an app with ribbon control. References: Introducing NET 4.5, Alex Mackey, William Tulloch, and Mahesh Krishnan. ribbon control WPF Programmer’s Reference, Rod Stephens. custom command hotkey for custom command hotkey for application command unsaved document flag Icons included with MS Visual Studio  or downloaded from the web (search for …

Add Resources (Images, etc.) to VS 2019 Project

Create Resource Folder Open the Solution Explorer tab in the Solution Explorer panel: RMB on the solution name (Ribbon_Demo, in this example). From the context menu, select Add → New Folder: Name the folder, in this example Resources. The folder should now appear in the solution tree: Move Resources to Folder In Windows Explorer, copy …

Rotate tetrahedron around coordinate axis

Very simple, but inefficient and unscalable rotation of tetrahedron about y-axis with no hidden line removal. References: plot and some concepts: “Python Graphics – A Reference for Creating 2D and 3D Images”, B.J. Korites. transform matrices: https://gist.github.com/jaseg/ef83d89b39ae69fad07a deleting lines from plot: from: https://sourceforge.net/p/matplotlib/mailman/message/9334388/ Tetrahedron is constructed with four points (vertices) and six lines (edges). The …

Delete line from matplotlib.pyplot

Two of many ways to do this: delete all lines delete one line using the line instance Delete all lines Import needed modules (numpy is only used to generate data): Generate dummy data and plot: Creates this plot: Get current instance of current axes: Loop through all lines and delete them: You may think that …

Implementation of discrete radon transform (parallel beam geometry)

The radon transformation was taken directly from https://gist.github.com/fubel/ad01878c5a08a57be9b8b80605ad1247, but with tweaks to allow variable steps in transform. The back-projection is a crude reverse of the forward transformation. This is an unfiltered back projection. skimage.transform.rotate instead of scipy.misc.imrotate (was removed from SciPy) reference for standard test image: https://scikit-image.org/docs/dev/auto_examples/transform/plot_radon_transform.html. This also has a scikit-image implementation of a …

Multiple Regression: Using PyTorch to Generate Regression Coefficients

This example generates parameters for a second order polynomial that fits synthetic data. The main source for this example comes from: https://donaldpinckney.com/books/pytorch/book/ch2-linreg/2018-03-21-multi-variable.html which has a good explanation of the underlying concepts, and a deeper explanation of the algorithm itself. Other sources for details on plotting and data generation are: https://www.kaggle.com/kanncaa1/pytorch-tutorial-for-deep-learning-lovers https://www.guru99.com/pytorch-tutorial.html The code Import modules: …

Classification in OpenCV Using Pre-built Caffe Model

Based upon: https://becominghuman.ai/face-detection-with-opencv-and-deep-learning-90b84735f421 With additional input from: 2. https://www.pyimagesearch.com/2017/08/21/deep-learning-with-opencv/ 3. https://nbviewer.jupyter.org/github/BVLC/caffe/blob/master/examples/00-classification.ipynb A) Download Caffe Models Need the following three files: .prototxt file containing model definition .caffemodel file containing layer weights a synset file containing category labels and an image file. Just steal one from the internet like everyone else does (or free from http://www.pexels.com). Before …

Design a site like this with WordPress.com
Get started