Answers.Body: <p>Using <a href="https://ffmpeg.org/download.html" rel="nofollow noreferrer">ffmpeg</a>, a free command-line tool, you can do</p>
  
  <pre><code>ffmpeg -i in.mp4 -vf "crop=1:1:234:541:exact=1,tile=50x10,format=rgb24,histogram" out.png
  </code></pre>
  
  <p>A series of filters are run on the input video.</p>
  
  <p>The <a href="https://ffmpeg.org/ffmpeg-filters.html#crop" rel="nofollow noreferrer">crop</a> filter takes each frame and extracts a 1x1 sized window i.e. a single pixel at co-ordinates (234,541) measured from top-left of frame. Numbering starts at 0.</p>
  
  <p>The <a href="https://ffmpeg.org/ffmpeg-filters.html#tile" rel="nofollow noreferrer">tile</a> filter collects all of these single pixel frames into a single frame of dimensions 50x10. It is important that the product of these dimensions (500) match the total number of frames in the video. If it's greater, the difference will be black pixels added by the tile filter and throw off your histogram; if less, frames will be skipped. Worst case scenario, your frame count is prime, so you can either do <code>Countx1</code> or <code>MxN</code> where M*N is <code>count + 1</code>.</p>
  
  <p>The next filter converts the tile output to a RGB pixel format, since videos typically are YUV.</p>
  
  <p>The <a href="https://ffmpeg.org/ffmpeg-filters.html#histogram" rel="nofollow noreferrer">histogram</a> filter generates a graphical RGB histogram which is saved to a PNG. See the filter doc for options to change layout or image size.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-25T06:17:00.767Z
Answers.LastActivityDate: 2018-05-25T06:17:00.767Z
Answers.UserDisplayName: Gyan
Answers.Body: <p>The first thing I'd be looking at is <a href="https://processing.org/" rel="nofollow noreferrer">Processing</a>. There's a library that lets you read video, there's an example <a href="https://processing.org/reference/libraries/video/Movie_read_.html" rel="nofollow noreferrer">here</a> that shows how to to sequentially grab frames from a video.</p>
  
  <p>Then (instead of displaying the frame like it does in that example) you need to find the channel values for the spot which you could do by copying the frame to a <a href="https://processing.org/reference/PImage.html" rel="nofollow noreferrer">PImage</a>. Then the value of the pixel (x,y) is found in the PImage property <code>pixels[x,y]</code>. Finally use <a href="https://processing.org/reference/createWriter_.html" rel="nofollow noreferrer">createWriter()</a> to output the data to a file. You could even get fancy and use the mouse to control your sample point, and so on.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-25T03:47:25.163Z
Answers.LastActivityDate: 2018-05-25T03:47:25.163Z
Answers.UserDisplayName: stib
Body: <p>I have a video that I shot for scientific purposes. I would like to measure the colour information in a single spot and export for example the RGB or CMYK values of that spot through every frame into a text file.</p>
  
  <p>The video itself is a .MOV file which I colour-balanced with a white card. I just couldn't find any information on how to extract the information with any software. My university provides Adobe Photoshop in which I am able to open the video.</p>
  
  <p>Does anyone know a software which enables me to extract that data? Or does someone know how I can do that with Photoshop?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-24T10:50:32.547Z
Comments.Text: A histogram is a representation of the distribution of channel values for the entire picture. You *can't* have a histogram of a single pixel. You might get better search results if you search for "point sample". https://en.wikipedia.org/wiki/Histogram
Comments.UserDisplayName: stib
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-24T14:16:52.857Z
Comments.Text: Oh, sorry, that was a terminology mistake of mine. I am looking for the colour information in one spot, as for example the RGB information.
Comments.UserDisplayName: Crystal Lettuce
Tags: <software-recommendation><color>
Title: Histogram measurement in single spot
UserDisplayName: Crystal Lettuce
ThreadText: # Histogram measurement in single spot
  
  (Asked by: username_0 on 2018-05-24)
  
  I have a video that I shot for scientific purposes. I would like to measure the colour information in a single spot and export for example the RGB or CMYK values of that spot through every frame into a text file.
  
  The video itself is a .MOV file which I colour-balanced with a white card. I just couldn't find any information on how to extract the information with any software. My university provides Adobe Photoshop in which I am able to open the video.
  
  Does anyone know a software which enables me to extract that data? Or does someone know how I can do that with Photoshop?
  
  **Tags:** software-recommendation, color
  
  > **Comments:**
  > **username_1**: A histogram is a representation of the distribution of channel values for the entire picture. You *can't* have a histogram of a single pixel. You might get better search results if you search for "point sample". https://en.wikipedia.org/wiki/Histogram  
  > **username_0**: Oh, sorry, that was a terminology mistake of mine. I am looking for the colour information in one spot, as for example the RGB information.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-05-25. Score: 1 | Accepted answer
  
  Using [ffmpeg](https://ffmpeg.org/download.html), a free command-line tool, you can do
  
  ```
  ffmpeg -i in.mp4 -vf "crop=1:1:234:541:exact=1,tile=50x10,format=rgb24,histogram" out.png
  
  ```
  
  A series of filters are run on the input video.
  
  The [crop](https://ffmpeg.org/ffmpeg-filters.html#crop) filter takes each frame and extracts a 1x1 sized window i.e. a single pixel at co-ordinates (234,541) measured from top-left of frame. Numbering starts at 0.
  
  The [tile](https://ffmpeg.org/ffmpeg-filters.html#tile) filter collects all of these single pixel frames into a single frame of dimensions 50x10. It is important that the product of these dimensions (500) match the total number of frames in the video. If it's greater, the difference will be black pixels added by the tile filter and throw off your histogram; if less, frames will be skipped. Worst case scenario, your frame count is prime, so you can either do `Countx1` or `MxN` where M\*N is `count + 1`.
  
  The next filter converts the tile output to a RGB pixel format, since videos typically are YUV.
  
  The [histogram](https://ffmpeg.org/ffmpeg-filters.html#histogram) filter generates a graphical RGB histogram which is saved to a PNG. See the filter doc for options to change layout or image size.
  
  
  ---
  
  ### Answer by username_1 on 2018-05-25. Score: 1
  
  The first thing I'd be looking at is [Processing](https://processing.org/). There's a library that lets you read video, there's an example [here](https://processing.org/reference/libraries/video/Movie_read_.html) that shows how to to sequentially grab frames from a video.
  
  Then (instead of displaying the frame like it does in that example) you need to find the channel values for the spot which you could do by copying the frame to a [PImage](https://processing.org/reference/PImage.html). Then the value of the pixel (x,y) is found in the PImage property `pixels[x,y]`. Finally use [createWriter()](https://processing.org/reference/createWriter_.html) to output the data to a file. You could even get fancy and use the mouse to control your sample point, and so on.
  
  
  ---
  
  