Thread Subject: "Internet" cameras

Subject: "Internet" cameras

From: Joel

Date: 15 Aug, 2007 15:54:07

Message: 1 of 15

I use the Image Aqu toolbox with standard webcams now.
Looking into buying a wireless camera to replace it but it
seems like these work a little differently. They have an
IP address on a local wireless network and you use your
webbrowser to view their images. They do not
have "driver software".

Can I use the image aquistion toolbox with these products?

Here is an example, but I am not married to this model.
http://www.dlink.com/products/?sec=0&pid=365

Subject: "Internet" cameras

From: Mark Jones

Date: 17 Aug, 2007 13:44:41

Message: 2 of 15

Joel wrote:
> I use the Image Aqu toolbox with standard webcams now.
> Looking into buying a wireless camera to replace it but it
> seems like these work a little differently. They have an
> IP address on a local wireless network and you use your
> webbrowser to view their images. They do not
> have "driver software".
>
> Can I use the image aquistion toolbox with these products?
>
> Here is an example, but I am not married to this model.
> http://www.dlink.com/products/?sec=0&pid=365

Hi Joel,

Currently we do not support these types of cameras because they are only
usable through a web browser.

Mark

Subject: "Internet" cameras

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 17 Aug, 2007 18:48:04

Message: 3 of 15

In article <46C5A649.2000705@mathworks.com>,
Mark Jones <mark.jones@mathworks.com> wrote:
>Joel wrote:
>> I use the Image Aqu toolbox with standard webcams now.
>> Looking into buying a wireless camera to replace it but it
>> seems like these work a little differently. They have an
>> IP address on a local wireless network and you use your
>> webbrowser to view their images.

>Currently we do not support these types of cameras because they are only
>usable through a web browser.

Perhaps urlread() could be used?
--
  There are some ideas so wrong that only a very intelligent person
  could believe in them. -- George Orwell

Subject: Web cam access in Matlab

From: Michele

Date: 22 Aug, 2007 00:24:08

Message: 4 of 15

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <fa4qh4$hli$1@canopus.cc.umanitoba.ca>...
> In article <46C5A649.2000705@mathworks.com>,
> Mark Jones <mark.jones@mathworks.com> wrote:
> >Joel wrote:
> >> I use the Image Aqu toolbox with standard webcams now.
> >> Looking into buying a wireless camera to replace it but it
> >> seems like these work a little differently. They have an
> >> IP address on a local wireless network and you use your
> >> webbrowser to view their images.
>
> >Currently we do not support these types of cameras
because they are only
> >usable through a web browser.
>
> Perhaps urlread() could be used?

I'm working on this right now. If your web cam is not
password protected, this should be easy. For example, I
have a TrendNet IP-100W camera that doesn't require a
password. I can load its video into Matlab with the single
command:

img = imread ('http://192.168.0.100/image.jpg') ;

The camera server stores the current frame in a file called
"image.jpg". Your camera might be different. Just connect
to it from a browesr and then view the page source - it
should be in there.

My problem is getting Matlab to do the WWW authentication
properly. The TrendNet cameras use Basic authentication. I
can easily do the Base 64 encode of the user name and the
password. Unfortunately, for me this ends with an "=" sign.
 For some reason, Matlab insists on writing this out on the
wire as "%3D" (ie. the 3 separate bytes 25 33 44) instead of
the single byte 3D (which is hex for "="). The camera then
gives me a password error.

Here's my code:

opt{1} = {'Authentication: Basic'}
opt{2} = {base64encode ('username:password')}
urlread ('http://192.168.0.101', 'POST', opt)

This is in R6 v.13 on a PC with XP if that matters.

I'm stuck. How can I get urlread to write "=" out as one
byte, 3D? Any help would be appreciated. Thanks!

Subject: Web cam access in Matlab

From: Matthew Simoneau

Date: 22 Aug, 2007 19:28:28

Message: 5 of 15

I took a quick look at URLREAD. In R2007a, line 85 looks
like this:

  value = char(java.net.URLEncoder.encode(params{i+1}))

I think this is where your "=" is becoming "%3D". This is
because these values are being passed as part of a form
submit, and not a header.

I think these threads will get you pointed in the right
direction:

http://www.mathworks.com/matlabcentral/newsreader/view_thread/81924
http://www.mathworks.com/matlabcentral/newsreader/view_thread/85012
http://www.mathworks.com/matlabcentral/newsreader/view_thread/52859

Subject: Web cam access in Matlab

From: Michele

Date: 24 Aug, 2007 00:15:05

Message: 6 of 15

"Matthew Simoneau" <matthew@mathworks.com> wrote in message
<fai2os$5pa$1@fred.mathworks.com>...
> I took a quick look at URLREAD. In R2007a, line 85 looks
> like this:
>
> value = char(java.net.URLEncoder.encode(params{i+1}))
>
> I think this is where your "=" is becoming "%3D". This is
> because these values are being passed as part of a form
> submit, and not a header.

Thanks very much, Matthew! We're halfway there. Your
analysis of the byte problem was correct. I modified
urlread by adding a urlConnection.setRequestProperty line
after the urlConnection = url.openConnection;. Now the
username:password combination gets written out properly and
it looks like the camera server accepts that.

Unfortunately, I still can't read my image. What's odd is
that, looking at the byte stream using Ethereal, it seems
like the camera is actually sending the requested image (I
see a TCP packet on the wire containing the string "Content
type: image/jpg", followed by lots of imagy-looking bytes)

But from this: imread ('http://192.168.0.103/image.jpg')
I get this:
??? Error using ==> imread
Unable to determine the file format.

If I say: urlread ('http://192.168.0.103/image.jpg')

I get

ans = yØÿâ

The imread does work just fine with a different camera (same
model) that doesn't require authentication.

I'm guessing that urlread isn't picking up the camera server
reply properly. Or maybe there's some funniness in imread??
 I'm going to work on this some more. In the meantime, if
anyone else has any ideas, I'd love to hear them. Thanks
for the help so far!

Subject: Web cam access in Matlab

From: Michele

Date: 24 Aug, 2007 00:56:02

Message: 7 of 15

OK, duh. I guess it helps to read the documentation. Right
at the start of urlread, it plainly says "If the server
returns binary data, the string will contain garbage." And
my camera is indeed returning my image, image.jpg, as binary
data.

So I guess my question now simply boils down to: how do I
read binary data from a server?

Subject: Web cam access in Matlab

From: Michele

Date: 24 Aug, 2007 20:31:59

Message: 8 of 15

Success! Turns out that urlread won't read binary data but
urlwrite will, and in fact imread calls urlwrite. So I just
applied the above authentication mod to urlwrite instead of
urlread. I can now read frames from my password-protected
Trendnet web cam. Code:

cam103 = imreadauth ('http://192.168.0.103/image.jpg') ;

"imreadauth" simply calls my modified version of urlwrite.

Note that a lot of other popular web cams (eg. D-Link) use
the same protocols, so this solution should work for them too.

In retrospect, I found the taxonomy of urlread/urlwrite
confusing. You've got urlread which reads urls as you might
expect. But urlwrite does not write urls - it just also
reads them and then saves them to a file. I submit that all
of this would be clearer and simpler if there was only one
function, urlread, with an optional file argument to save
the data to a file. Either that or let urlread work with
binary data the same way that urlwrite does. Right now, the
two functions seem to be slightly at odds with one another.

Subject: Web cam access in Matlab

From: Patrick

Date: 29 Jul, 2008 10:08:02

Message: 9 of 15

"Michele " <denber.nospam@mindspringNOSPAM.com> wrote in
message <fanf7v$h7f$1@fred.mathworks.com>...
> Success! Turns out that urlread won't read binary data but
> urlwrite will, and in fact imread calls urlwrite. So I just
> applied the above authentication mod to urlwrite instead of
> urlread. I can now read frames from my password-protected
> Trendnet web cam. Code:
>
> cam103 = imreadauth ('http://192.168.0.103/image.jpg') ;
>
> "imreadauth" simply calls my modified version of urlwrite.
>
> Note that a lot of other popular web cams (eg. D-Link) use
> the same protocols, so this solution should work for them too.
>
> In retrospect, I found the taxonomy of urlread/urlwrite
> confusing. You've got urlread which reads urls as you might
> expect. But urlwrite does not write urls - it just also
> reads them and then saves them to a file. I submit that all
> of this would be clearer and simpler if there was only one
> function, urlread, with an optional file argument to save
> the data to a file. Either that or let urlread work with
> binary data the same way that urlwrite does. Right now, the
> two functions seem to be slightly at odds with one another.


Hi,

I was wondering if you could list out the steps needed to
access the wireless IP camera. Seem to have missed some
steps in getting the images from the camera. Is there any
difference in the code for determining the code for a
password and non-password protected camera.

Thanks.

Subject: Web cam access in Matlab

From: Michele

Date: 29 Jul, 2008 17:19:01

Message: 10 of 15

> I was wondering if you could list out the steps needed to
> access the wireless IP camera. Seem to have missed some
> steps in getting the images from the camera. Is there any
> difference in the code for determining the code for a
> password and non-password protected camera.

OK, quick review: this applies to Trendnet webcams, models
100, 200, and 400, both the wired and wireless versions.
I've also tested it successfully with a DLink DCS-2000
webcam. It may work with other types too - I suspect all
these cameras use the same chip from some giant factory in
Malaysia.

If your camera is not password-protected, the job is easy.
The following line will grab one frame from the camera and
store it in a variable:

img = imread ('http://192.168.0.109/image.jpg') ;

(Obviously, you substitute the URL of your own camera there,
but the file name on the server is always "image.jpg")

If your camera requires a password, imread will not work
because there is no provision to supply one there. You need
to modify the urlwrite function to support the Basic
authentication these cameras use. You'd think that you want
to modify urlread but there's a confusing relationship
between imread, imwrite, urlread, and urlwrite. That's what
I was trying to untangle last year and you can read about it
in my previous posts. Anyway...

Step 1: Open up your copy of urlwrite and find the line that
says

urlConnection = url.openConnection;

Right after that, add this:

% The following line added as per
http://www.mathworks.com/matlabcentral/newsreader/view_thread/52859
urlConnection.setRequestProperty('Authorization','Basic xxx') ;

Save this modified imread as imreadauth.

(Thanks again to Matthew Simoneau for that wonderful piece
of code)

Step 2: Perform a Base64 encoding of your user name and
password and put the resulting string in place of "xxx"
above. I use:

pw = base64encode ('username:password') ;

Step 3: Modify your copy of imread to call imreadauth
instead of imread. Now, as I mentioned in my last post, you
can call

cam103 = imreadauth ('http://192.168.0.103/image.jpg') ;

This will log you in and retrieve the current frame to the
variable cam103.

Obviously, there's other ways of getting your username and
password in there, or having one function handle both
password and non-password webcams, but this is the gist of
it, and it works. Cheers.

Now if only I could get some kind soul to help me figure out
how to keep Matlab from hanging if the requested url is not
answering...

Subject: Web cam access in Matlab

From: Lynn

Date: 1 Oct, 2008 21:24:01

Message: 11 of 15

I was wondering if anyone else had attempted to adapt this to AXIS webcams (207MW). I am having difficulty and was hoping to get a real-time image through matlab to do some image processing. If you have any advice it would be appreciated.


"Michele " <denber.nospam@mindspringNOSPAM.com> wrote in message <g6nje5$m9a$1@fred.mathworks.com>...
> > I was wondering if you could list out the steps needed to
> > access the wireless IP camera. Seem to have missed some
> > steps in getting the images from the camera. Is there any
> > difference in the code for determining the code for a
> > password and non-password protected camera.
>
> OK, quick review: this applies to Trendnet webcams, models
> 100, 200, and 400, both the wired and wireless versions.
> I've also tested it successfully with a DLink DCS-2000
> webcam. It may work with other types too - I suspect all
> these cameras use the same chip from some giant factory in
> Malaysia.
>
> If your camera is not password-protected, the job is easy.
> The following line will grab one frame from the camera and
> store it in a variable:
>
> img = imread ('http://192.168.0.109/image.jpg') ;
>
> (Obviously, you substitute the URL of your own camera there,
> but the file name on the server is always "image.jpg")
>
> If your camera requires a password, imread will not work
> because there is no provision to supply one there. You need
> to modify the urlwrite function to support the Basic
> authentication these cameras use. You'd think that you want
> to modify urlread but there's a confusing relationship
> between imread, imwrite, urlread, and urlwrite. That's what
> I was trying to untangle last year and you can read about it
> in my previous posts. Anyway...
>
> Step 1: Open up your copy of urlwrite and find the line that
> says
>
> urlConnection = url.openConnection;
>
> Right after that, add this:
>
> % The following line added as per
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/52859
> urlConnection.setRequestProperty('Authorization','Basic xxx') ;
>
> Save this modified imread as imreadauth.
>
> (Thanks again to Matthew Simoneau for that wonderful piece
> of code)
>
> Step 2: Perform a Base64 encoding of your user name and
> password and put the resulting string in place of "xxx"
> above. I use:
>
> pw = base64encode ('username:password') ;
>
> Step 3: Modify your copy of imread to call imreadauth
> instead of imread. Now, as I mentioned in my last post, you
> can call
>
> cam103 = imreadauth ('http://192.168.0.103/image.jpg') ;
>
> This will log you in and retrieve the current frame to the
> variable cam103.
>
> Obviously, there's other ways of getting your username and
> password in there, or having one function handle both
> password and non-password webcams, but this is the gist of
> it, and it works. Cheers.
>
> Now if only I could get some kind soul to help me figure out
> how to keep Matlab from hanging if the requested url is not
> answering...
>
>
>

Subject: "Internet" cameras

From: Md. wahid

Date: 21 Sep, 2009 17:37:20

Message: 12 of 15

"Joel " <esposito@usna.edu> wrote in message <f9v7iv$76g$1@fred.mathworks.com>...
> I use the Image Aqu toolbox with standard webcams now.
> Looking into buying a wireless camera to replace it but it
> seems like these work a little differently. They have an
> IP address on a local wireless network and you use your
> webbrowser to view their images. They do not
> have "driver software".
>
> Can I use the image aquistion toolbox with these products?
>
> Here is an example, but I am not married to this model.
> http://www.dlink.com/products/?sec=0&pid=365
can u pls be more specific? i still got the error!

>> s= imread_b('http://192.168.2.100/image.jpg');
??? Error using ==> imread_b at 307
Can't read URL "http://192.168.2.100/image.jpg".

Subject: Web cam access in Matlab

From: Teoh

Date: 8 Sep, 2011 08:22:08

Message: 13 of 15

"Michele" wrote in message <fanf7v$h7f$1@fred.mathworks.com>...
> Success! Turns out that urlread won't read binary data but
> urlwrite will, and in fact imread calls urlwrite. So I just
> applied the above authentication mod to urlwrite instead of
> urlread. I can now read frames from my password-protected
> Trendnet web cam. Code:
>
> cam103 = imreadauth ('http://192.168.0.103/image.jpg') ;
>
> "imreadauth" simply calls my modified version of urlwrite.
>
> Note that a lot of other popular web cams (eg. D-Link) use
> the same protocols, so this solution should work for them too.
>
> In retrospect, I found the taxonomy of urlread/urlwrite
> confusing. You've got urlread which reads urls as you might
> expect. But urlwrite does not write urls - it just also
> reads them and then saves them to a file. I submit that all
> of this would be clearer and simpler if there was only one
> function, urlread, with an optional file argument to save
> the data to a file. Either that or let urlread work with
> binary data the same way that urlwrite does. Right now, the
> two functions seem to be slightly at odds with one another.

Hi Michele,

I am currently using R2009b. It seen like the urlwrite had been changed, because I can't find the urlConnection = url.OpenConnection. Please give some advice where can I find it? Appreciate it.

Subject: Web cam access in Matlab

From: Michele

Date: 8 Sep, 2011 16:52:07

Message: 14 of 15

> I am currently using R2009b. It seen like the urlwrite had been changed, because I can't find the urlConnection = url.OpenConnection. Please give some advice where can I find it? Appreciate it.

I am still running R6 V13, mostly because I can't afford the price tag MathWorks wants for the latest version. I am not a giant software corporation, I am just one person. The version of urlwrite I have is: 1.4.

Here's the entire function I'm using. The line you mention is line 70. I hope this helps, though given Matlab's track record of iffy backwards compatibility, it may not. Good luck.

function [f,status] = urlwrite(urlChar,location,method,params);
%URLWRITE Save the contents of a URL to a file.
% URLWRITE(URL,FILENAME) saves the contents of a URL to a file. FILENAME
% can specify the complete path to a file. If it is just the name, it will
% be created in the current directory.
%
% F = URLWRITE(...) returns the path to the file.
%
% S = URLWRITE(...,METHOD,PARAMS) passes information to the server as
% part of the request. The 'method' can be 'get', or 'post' and PARAMS is a
% cell array of param/value pairs.
%
% [F,STATUS](...) catches any errors and returns the error code.
%
% Examples:
% urlwrite('http://www.mathworks.com/',[tempfile '.html')
% urlwrite('ftp://ftp.mathworks.com/pub/pentium/Moler_1.txt','cleve.txt)
% urlwrite('file:///C:\winnt\matlab.ini',fullfile(pwd,'my.ini'))
%
% See also URLREAD.

% Matthew J. Simoneau, 13-Nov-2001
% Copyright 1984-2002 The MathWorks, Inc.
% $Revision: 1.4 $ $Date: 2002/06/05 20:10:21 $
% Modified 8/24/07 by MD, added line 73

import com.mathworks.mlwidgets.io.InterruptibleStreamCopier;

% Check number of inputs and outputs.
error(nargchk(2,4,nargin))
error(nargoutchk(0,2,nargout))
if (nargin > 2) && ~strcmpi(method,'get') && ~strcmpi(method,'post')
    error('Second argument must be either "get" or "post".');
end

% Do we want to throw errors or catch them?
if nargout == 2
    catchErrors = true;
else
    catchErrors = false;
end

% Set default outputs.
f = '';
status = 0;

% GET method. Tack param/value to end of URL.
if (nargin > 2) && strcmpi(method,'get')
    if mod(length(params),2) == 1
        error('Invalid parameter/value pair arguments.');
    end
    for i=1:2:length(params)
        if (i == 1), separator = '?'; else, separator = '&'; end
        param = char(java.net.URLEncoder.encode(params{i}));
        value = char(java.net.URLEncoder.encode(params{i+1}));
        urlChar = [urlChar separator param '=' value];
    end
end

% Create the URL object.
try
    url = java.net.URL(urlChar);
catch
    if catchErrors, return
    else error('Either this URL could not be parsed or the protocol is not supported.',catchErrors);
    end
end

% Open a connection to the URL.
urlConnection = url.openConnection;

% The following line added as per http://www.mathworks.com/matlabcentral/newsreader/view_thread/52859
% Encoding of 'username:password' using base64encode in work subdir.
urlConnection.setRequestProperty('Authorization','Basic YWRtaW46a29wYW5qYTE=') ;

% POST method. Write param/values to server.
if (nargin > 2) && strcmpi(method,'post')
    try
        urlConnection.setDoOutput(true);
        urlConnection.setRequestProperty( ...
            'Content-Type','application/x-www-form-urlencoded');
        printStream = java.io.PrintStream(urlConnection.getOutputStream);
        for i=1:2:length(params)
            if (i > 1), printStream.print('&'); end
            param = char(java.net.URLEncoder.encode(params{i}));
            value = char(java.net.URLEncoder.encode(params{i+1}));
            printStream.print([param '=' value]);
        end
        printStream.close;
    catch
        if catchErrors, return
        else error('Could not POST to URL.');
        end
    end
end

% Open the output file.

file = java.io.File(location);
try
    fileOutputStream = java.io.FileOutputStream(file);
catch
    error('Could not open output file "%s".',location);
end
% Read the data from the connection.
try
    inputStream = urlConnection.getInputStream;
    % This StreamCopier is unsupported and may change at any time.
    isc = InterruptibleStreamCopier.getInterruptibleStreamCopier;
    isc.copyStream(inputStream,fileOutputStream);
    inputStream.close;
    fileOutputStream.close;
    f = char(file.getAbsolutePath);
    status = 1;
catch
    if catchErrors, return
    else error('Error downloading URL.');
    end
end

Subject: Web cam access in Matlab

From: Teoh

Date: 9 Sep, 2011 01:42:11

Message: 15 of 15

"Michele" wrote in message <j4arrn$eg9$1@newscl01ah.mathworks.com>...
> > I am currently using R2009b. It seen like the urlwrite had been changed, because I can't find the urlConnection = url.OpenConnection. Please give some advice where can I find it? Appreciate it.
>
> I am still running R6 V13, mostly because I can't afford the price tag MathWorks wants for the latest version. I am not a giant software corporation, I am just one person. The version of urlwrite I have is: 1.4.
>
> Here's the entire function I'm using. The line you mention is line 70. I hope this helps, though given Matlab's track record of iffy backwards compatibility, it may not. Good luck.
>
> function [f,status] = urlwrite(urlChar,location,method,params);
> %URLWRITE Save the contents of a URL to a file.
> % URLWRITE(URL,FILENAME) saves the contents of a URL to a file. FILENAME
> % can specify the complete path to a file. If it is just the name, it will
> % be created in the current directory.
> %
> % F = URLWRITE(...) returns the path to the file.
> %
> % S = URLWRITE(...,METHOD,PARAMS) passes information to the server as
> % part of the request. The 'method' can be 'get', or 'post' and PARAMS is a
> % cell array of param/value pairs.
> %
> % [F,STATUS](...) catches any errors and returns the error code.
> %
> % Examples:
> % urlwrite('http://www.mathworks.com/',[tempfile '.html')
> % urlwrite('ftp://ftp.mathworks.com/pub/pentium/Moler_1.txt','cleve.txt)
> % urlwrite('file:///C:\winnt\matlab.ini',fullfile(pwd,'my.ini'))
> %
> % See also URLREAD.
>
> % Matthew J. Simoneau, 13-Nov-2001
> % Copyright 1984-2002 The MathWorks, Inc.
> % $Revision: 1.4 $ $Date: 2002/06/05 20:10:21 $
> % Modified 8/24/07 by MD, added line 73
>
> import com.mathworks.mlwidgets.io.InterruptibleStreamCopier;
>
> % Check number of inputs and outputs.
> error(nargchk(2,4,nargin))
> error(nargoutchk(0,2,nargout))
> if (nargin > 2) && ~strcmpi(method,'get') && ~strcmpi(method,'post')
> error('Second argument must be either "get" or "post".');
> end
>
> % Do we want to throw errors or catch them?
> if nargout == 2
> catchErrors = true;
> else
> catchErrors = false;
> end
>
> % Set default outputs.
> f = '';
> status = 0;
>
> % GET method. Tack param/value to end of URL.
> if (nargin > 2) && strcmpi(method,'get')
> if mod(length(params),2) == 1
> error('Invalid parameter/value pair arguments.');
> end
> for i=1:2:length(params)
> if (i == 1), separator = '?'; else, separator = '&'; end
> param = char(java.net.URLEncoder.encode(params{i}));
> value = char(java.net.URLEncoder.encode(params{i+1}));
> urlChar = [urlChar separator param '=' value];
> end
> end
>
> % Create the URL object.
> try
> url = java.net.URL(urlChar);
> catch
> if catchErrors, return
> else error('Either this URL could not be parsed or the protocol is not supported.',catchErrors);
> end
> end
>
> % Open a connection to the URL.
> urlConnection = url.openConnection;
>
> % The following line added as per http://www.mathworks.com/matlabcentral/newsreader/view_thread/52859
> % Encoding of 'username:password' using base64encode in work subdir.
> urlConnection.setRequestProperty('Authorization','Basic YWRtaW46a29wYW5qYTE=') ;
>
> % POST method. Write param/values to server.
> if (nargin > 2) && strcmpi(method,'post')
> try
> urlConnection.setDoOutput(true);
> urlConnection.setRequestProperty( ...
> 'Content-Type','application/x-www-form-urlencoded');
> printStream = java.io.PrintStream(urlConnection.getOutputStream);
> for i=1:2:length(params)
> if (i > 1), printStream.print('&'); end
> param = char(java.net.URLEncoder.encode(params{i}));
> value = char(java.net.URLEncoder.encode(params{i+1}));
> printStream.print([param '=' value]);
> end
> printStream.close;
> catch
> if catchErrors, return
> else error('Could not POST to URL.');
> end
> end
> end
>
> % Open the output file.
>
> file = java.io.File(location);
> try
> fileOutputStream = java.io.FileOutputStream(file);
> catch
> error('Could not open output file "%s".',location);
> end
> % Read the data from the connection.
> try
> inputStream = urlConnection.getInputStream;
> % This StreamCopier is unsupported and may change at any time.
> isc = InterruptibleStreamCopier.getInterruptibleStreamCopier;
> isc.copyStream(inputStream,fileOutputStream);
> inputStream.close;
> fileOutputStream.close;
> f = char(file.getAbsolutePath);
> status = 1;
> catch
> if catchErrors, return
> else error('Error downloading URL.');
> end
> end

Thanks for the good support Michele! I somehow solved it. Well, it might work for fixed IP cameras but not box type cameras for example D-link DCS-3410. May be the URL for the still image I enter was wrong because I had tried
img = imread_auth('http://192.168.1.200/image.jpg');
and
img = imread_auth('http://192.168.1.200/cgi-bin/video.jpg');
and it's not work.
Any expert here know where actually I can find the still image URL for the D-link DCS-3410? Any help will appreciate it.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
image aquisition Fabiano Santos 9 Jan, 2009 16:27:53
dicom format Michael Habib 14 Jun, 2008 07:13:15
urlwrite Michele 24 Aug, 2007 16:35:06
binary data Michele 23 Aug, 2007 21:00:21
imread Michele 23 Aug, 2007 20:20:23
web cam Michele 23 Aug, 2007 20:20:22
internet Michele 23 Aug, 2007 20:20:22
server Michele 21 Aug, 2007 20:25:23
authentication Michele 21 Aug, 2007 20:25:23
password Michele 21 Aug, 2007 20:25:23
urlread Michele 21 Aug, 2007 20:25:23
wireless Joel 15 Aug, 2007 11:55:05
web camera Joel 15 Aug, 2007 11:55:05
image aquisition Joel 15 Aug, 2007 11:55:05
rssFeed for this Thread

Contact us at files@mathworks.com