NACL_SDK How to intercept the video stream saved as a YUV image - google-nativeclient

nacl_sdk\pepper_44\examples\api\media_stream_video
this is a example.
i want to catch a frame to save as a YUV image.
PS.You can find some silly mistakes in my message. Sorry for my English.

The example plugin receives frames in the OnGetFrame method and converts them to Open GL textures. Here's the code that gets the frame information:
https://code.google.com/p/chromium/codesearch#chromium/src/ppapi/examples/media_stream_video/media_stream_video.cc&l=428
You would do something similar, except that instead of creating a GL texture you would save the YUV data.

Related

IDL and image format

I'm starting to use IDL because I want to use some analysis tools for videos that I have found on internet (https://physics.nyu.edu/~fcc4/HVM_site/HVM/software.html), I already have installed IDL package and works properly... When I load my image in PNG format I got
IDL> a=read_image('Imag1.png')
IDL> help, a
A BYTE =Array[3,424,382]
The point is that the routine that I want to use need two dimensional float array that came from an image save as two dimensional byte array. Why is this a three dimensional array? Is it due to the RGB that png format use? Can I converge it to a two dimensional and don't lost the information? The tutorial use uncompressed tif, is the some free tool like VirtualDub which split videos with this format?
This is the image that I load in the code above

How reduce the noise of a image?

I am loading text from some images. With some of them, I am having problems, with this type of image
library(magick)
library(tesseract)
image_read(fichero.jpg) %>%
tesseract::ocr(engine = tesseract("eng")) %>%
cat()
Result
I am assuming (correct me if not) that tesseract fail because of the low quality of the image (it is a scanned document), and I donĀ“t know if there is a way to make the image better.
I tried also some convultion methods with several kernels, trying to reduce the noise of the photo, but it was worse.
Is there a way to handle this or I have to assume that is not possible to get the text in this quality-images?
Regards
Looking at this with the experience of a photographer rather than as a programmer, I would guess that the poor focus and camera jiggle make this image pretty well unreadable by most OCR options. I just used the OCR in Adobe Acrobat to play with it on my own PC and I could get "FECHA" to recognize, but not "NUMERO" and not any of the numbers.
I pulled it into a photo editor and messed around with the contrast, as sometimes it's possible to convert a grayscale image such as this to pure black-and-white and get rid of some of the fuzziness, but I couldn't produce a readable image in my quick-and-dirty experiment.
So realistically, you'll need images that are scanned/photographed with higher resolution and better contrast to get reliable OCR.
It looks like you are trying to create a cow from ground beef. The big problem is that JPEG is not suited for this type of non-photographic image. Your png looks fine because it is a lossless format.
If you don't want this problem, do not save the files as JPEG.

Java or scala, GeoTools or GeoTrellis, how to convert sentinel 2 data to Multiband geotif

I am trying to process Sentinel 2 data from (example)
http://sentinel-s2-l1c.s3-website.eu-central-1.amazonaws.com/#tiles/10/S/EG/2016/10/12/0/
The jp2 files are not georeferenced, and I need to put all the jp2 files as bands in a geotif. I have googled aplenty and find no way to do this in Java or Scala.
I am pretty familiar with Geotools, i've done a lot of geotif processing with geotools, but I can't figure out how to
a. Make a geotif raster out of a jp2 file (given coords for the envelope), and
b. take those and make a multiband geotif out of them
I am decent with Scala, so I've looked at geotrellis, but don't see a solution with that either.
Does anyone know how to make geotifs out of JP2 files (given a polygon) and then make a multiband geotif?
thanks
I've never tried this, but, I would break the problem down to:
Import JP2 image
GeoReference the image
For each band in the image data, convert to GeoTiff
Step 1 will need you to make sure that you have the JP2K plugin, that page also gives some sample code showing how to use it.
Step 2 should just be a case of building a GridCoverage using a GridCoverageFactory - see the user guide for an example (I am assuming you know where the bounds of the grid are and it's projection etc).
Step 3 is a simple CoverageWriter, there is an example here.

Saving Scatterplot matrix to zoomable image

I have a huge scatter plot matrix to generate and save into a zoom-able image. I takes a bunch of hours to draw and then I got some errors like:
"Server Error Unabe to establish connection with R session".
Any ideas? The problem is obviously memory, but there must be a way to get around this.
I've managed to save the file as a pdf format of 28.7 MB, it takes a lot of time to display and makes inkscape crash. I know that people who generate fractals are able to make images of infinite resolution without consuming a lot of memory since the image is generate as u zoom into it. Problem is fractals are self similar and scatterplots are not, so I'm not sure if there's a smart way to get around this issue.
A possible way to get around this "information overload" is to plot variables in pairs using qplot() and then save the file using ggsave(), for example in bmp on jpeg files.

To play audio and image frames simultaneously in matlab

hello everyone
i am doing a project in lip sync.
however i am facing a problem here. i have each frame of a picture which is generated from a sound unit. now i would like to play the sound and the picture frames simultaneously so as to have an effect of a lip sync. i.e for a 2 second audio around 10 frames are generated.now how do i run this audio and picture frames together so as to obtain a 'lip sync' in matlab. thank u in advance
hey i found that out myself.The way to do is by using a TimerFcn with the required difference in the frame rate.the audio can be played by using 'audioplayer' and TimerFcn and TimerPeriod are the attributes of the audioplayer function.the TimerPeriod. for more help refer the link http://www.mathworks.com/help/techdoc/ref/audioplayer.html

Resources