Subtract average image from a series of images

I’m having some difficulty subtracting an averaged image from a series of images from which the average was obtained. The images have been obtained from a MP4 video file.

This is what i have done:

Ven23 = VideoReader('MyVideo23.MP4'); %Read in the video fileVen23frame1 = read(Ven23,1); % Read in the first frame of the videosumImage23 = im2double(Ven23frame1); %Double the accuracy of the framefor i=2:30
Ven23Frames= read(Ven23,i);
sumImage23 = sumImage23 + im2double(Ven23Frames);
end
avgVen23= imshow(sumImage23/30);

This all seems to work; I get an image which looks like the average. However, whenever I try to subtract this average image from any particular frame from the video I get this error:

Undefined operator '-' for
input arguments of type
'matlab.graphics.primitive.Image'.

Then I tried to save the average image and frames as bmp files, load them back in and subtract them. Doing this just returns a black screen. I also tried doubling the accuracy of the reloaded images to no avail.

I’m obviously doing something wrong and I would be grateful if anyone could point it out to me. Thanks.

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

In view of the error, I would suspect that you’re trying to subtract your mean image from a variable called exactly image. Unfortunately, at the point where you’re doing the subtraction, the variable image does not exist, so instead matlab calls the function image which returns an object of type ‘matlab.graphics.primitive.Image’. Subtraction is not defined for that (a graphics object), hence the error message. At the same time, you probably have an upside down picture of a boy’s head popping up in a figure.

In conclusion:

SEE COMPLETE ANSWER CLICK THE LINK

--

--

--

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Future of Web: Interoperability & Extensibility | TechAffinity

Difference Between 1PL, 2PL and 3PL

Why Mandated in School Testing During COVID Is a Waste of Time and Money, Not to Mention a…

One annoying problem I encountered while testing AWS CDK Constructs using pytest

How To Implement Bollinger Bands For Trading In Python

DenoPress Part 2 — Decoding More WordPress Features

Get Apollo Wallet Version 1.47.7

Viessmann Boiler Data to InfluxDB Cloud

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Technical Source

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

More from Medium

Deblurring an Image using inverse filtering

Color Spaces in OpenCV

It's Just a Network of neurons!

Image Classification on Grape Leaves Disease using Deep Learning