Displaying IP Cam Feed in MATLAB GUI - matlab

I am trying to display an IP Camera live feed in a MATLAB GUI. I am using the MATLAB IPCam Addon. I can successfully preview the live feed in MATLAB as follows:
cam = ipcam('url');
preview(cam);
However, I am unable to get the live feed in a GUI Axes. I was able to get a snapshot to display by adding the following code to the OpeningFcn of my GUI.
cam = ipcam('http://192.168.43.1:8080/video'); hImage=image(snapshot(cam),'Parent',handles.axes2);
However, when I replace the snapshot(cam) with preview(cam) to get a live feed instead of a single static snapshot, I get an error
the data type of image is invalid

The preview function does not apply to ipcam objects. Instead, its preview is a sub object that you should call, try the below instead:
cam = ipcam('url');
cam.preview;
Furthermore, the URL to stream live feed varies with the ipcam used. In my case, the URL is: http://192.168.1.70/cgi-bin/hi3510/mjpegstream.cgi?-chn=11&-usr=admin&-pwd=admin
I found a small list of functions here: https://www.instar.com/faq_cgi_hd
Hope this helps.

Related

How to read images from Google Drive

I need to read images saved in the Google drive. The URL links to these images are known. How to achieve this? Here is the link to one image: https://drive.google.com/u/1/open?usp=forms_web&id=1zy9oeFqsce4daMybpxULHADmEEfpsEru. I want to read this image to Matlab workspace.
You will likely have difficulty accessing an image directly unless you can set it as public access. MATLAB will encounter the same issue I encounter when trying to access that image, which is that I require permission to access it.
A solution to this might be to download the image and refer to it locally instead, or set the google drive copy to be public access.
After you ensure that MATLAB can access the image, use the imread function, as described in https://uk.mathworks.com/help/matlab/ref/imread.html.

Live video feed error message in simulink

I tried to run a live video feed using simulink and after connecting the "from video device" block to the "display" block and running it, I received this message
Truncating signals shown by 'untitled/Display'. Displays can only show at most 200 elements of a vector or [20x10] elements of a matrix signal
Can you guys help me fix it?
You should use something like "Video Viewer" block to see the video feed. Display block is used to see raw numbers and is limited to showing smaller set of input data if it is large.
The Video Viewer block is available with Computer Vision System toolbox in the Sinks library.

Automation of clicks on webpage using Matlab

So I'm looking for a way to systematically access data from a website. This data is updated every 15 minutes or so, and is generated through a datamart system that makes custom reports following several input parameters: the desired date interval, the specific dataset.
All these parameters require me to click on some specific buttons; I was wondering if it would be possible to automate these click inputs using Matlab (or something else if need be), to retrieve the data and treat it automatically.
Thanks in advance!
I suggest you take a look at http://www.autohotkey.com/. This is a great tool which allows for the automatic clicking on any window (including a browser page) under Windows. It even will let you "search" your screen for pixel images and then click on those images. This would allow you to make a very small bmp file of the link you would like to click on, and then your script can search your page and click directly on the link.
As far as getting data into matlab I'm not exactly sure of the best way to do this, but you might consider saving the html of the page, and then parsing that from matlab.

MATLAB GUI: Different results when opening a figure file using GUIDE and straightaway

I have made a MATLAB GUI but I am facing a problem. The problem is that when I open the GUI figure file straightaway, the resulting GUI does not work properly(I am guessing there is a problem with the loading of the opening_function). But when I open that figure file using GUIDE, I am getting proper results. I want the GUI figure to run properly when I click on it. I have provided the link for my GUI figure file and the M-file for the same in the below link using Google drive:
Google drive link for GUI figure file and code file (along with an image required for the working of the two)
your google drive link is not working. also if its your account of google drive which you have used to login then i can't access the files in it...use some other file hosting services to share the screenshot.
also you can always debug your callback functions using breakpoints to check why its not working properly.

filepicker.io mass convert image

Is there a way to mass convert an image? We're experimenting with replacing imagemagick and taking the load off of our servers -- I've got a version working that just loops through the sizes and calls convert on the original image, making 23 copies of differing styles (sizes and crops). However, if the user leaves the page before all the conversions are done, the script stops and I end up missing a bunch of image styles.
Is there a good way to get around this with Filepicker.io? I'd really like to be able to just pass a list of options to the convert method and have it complete in the background.
Thanks in advance,
- Jeff
The best way to do this is either using the /convert endpoint to do on-the-fly conversion (https://developers.filepicker.io/docs/web/#fpurl-images) or to do a POST to our rest endpoint to create the converted images and store them in S3 via a server-side call