How can I convert multiple images to grayscale thresholds, furthermore how can I convert those thresholds to binary strings?

6 views (last 30 days)
I've exported many frames from saved videos (.mp4) to .jpg and I want to convert them all to grayscale thresholds and then ideally into binary strings so that I can show a simplistic version of how the video progresses in a coded format.
I am new to MATLAB and would appreciate it if some advice could be in laymans terms/not hurl me immediately out of my depth. Thank you in advance.

Answers (1)

Image Analyst
Image Analyst on 15 Feb 2016
Attached is an example of how to read in a video and do something to each frame (get the mean), and plot it. I am not sure what algorithm you plan on using to convert the frame into a threshold - please share it. To convert a number to a binary string, use dec2bin(). I do not know how you would like to display all those binary strings, for example as numbers in the command window, as a line or bar plot, as an image, or ??????
  5 Comments
Duncan Lawford
Duncan Lawford on 15 Feb 2016
Edited: Duncan Lawford on 15 Feb 2016
Sorry I didn't see your comment an hour ago. I've toyed around with a couple of threshold values to see what seems acceptable when it comes up in the figure window, and the amount of frames I will have is still to be determined; I need the framework to be in place for when I start experimenting with my own footage, but it will be approximately 10,000 frames.
I'll contextualise my project a bit more and then maybe you could give me some guidance if that's OK? After all I could be going about this in completely the wrong way.
I'm a first year postgraduate art student studying Moving Image at the Royal College of Art. I'm very taken with the idea of a post-human digital immersion, furthermore the idea of a character I've been writing/compiling for a few months now finding himself terrified by reality as he is unable to interpret the world as not being digital - this is largely resultant of his realisation that every visual he percives physiologically could be represented by a string of characters.
So what I would like to do is be able to translate/output a video into a textual coded format, so that with each new frame of the video there would be progressive visual representations of the code. If it was a success then the dream would be to record, live render and output these coded visual representations - an object would move past a lens and the code would be altered and shown accordingly.
Image Analyst
Image Analyst on 16 Feb 2016
I'm still not sure how you're going to derive the threshold number. And if you're going to threshold/binarize the image with that, and if you do, whether you want to display the binary image or just the binary value of the string of 1's and zeros.
See attached code where I build up a N by 8 image of binary data from randomly generated threshold values.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!