OriginLab Corporation - Data Analysis and Graphing Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis                     
 

2.81 FAQ-852 Can I subtract two images or two matrices?

Last Update: 3/10/2017

Yes, though if the images differ in size the operation is a bit more involved.

Importing Images to the Matrix

  1. Click the New Matrix button Button New Matrix.png on the Standard toolbar.
  2. From Windows Explorer, CTRL + select your image files and drop them onto the matrix window.
  • If the images are of the same dimensions, they will be imported as separate objects into the matrix window.
  • If the images are of different dimensions, each will be imported into a separate sheet in the matrix window.


NOTE: You can also drop images onto Origin outside of any window. A new matrix window will be created.


Subtracting Images or Matrices in the Same Sheet
The following assumes your images are of the same size:

  1. If you want to send output to a new matrix object in the same sheet, you should first create an empty object by clicking image icon Matrix object image button.png, then choosing Add.
  2. From the menu, choose Image: Arithmetic Transform: Simple Math: Open Dialog.
  3. Specify your input and output using the arrow buttons beside Input Image1, Input Image2 and Output Image, choosing your newly-created (empty) matrix object for your Output Image.
  4. Click the Math Function drop-down and specify the operation to perform (e.g. "Add", "img1 - img2", etc.).
  5. Choose channel, Z offsets and crop, as needed.
  6. Click OK.


Subtracting Images or Matrices in Different Sheets or Books

  1. Activate the matrix book containing two or more sheets, then choose Image: Arithmetic Transform: Simple Math: Open Dialog.
  2. Click the arrow button next Input Image1 and Input Image2 and use the Image Browser (use the List Images drop-down list at the top to filter) and choose where to send the Output Image.
  3. Click the Math Function drop-down and specify the operation to perform (e.g. "Add", "img1 - img2", etc.).
  4. Choose channel, Z offsets and crop, as needed.
  5. Click OK.

Also, see this blog post: Align and Subtract Two Images.


Keywords:matrix, matrices, simple math, matrix object,


 

© OriginLab Corporation. All rights reserved.