help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: image-acquisition package install


From: Kire Pudsje
Subject: Re: image-acquisition package install
Date: Wed, 1 Mar 2017 20:34:59 +0100

To my understanding windows does not directly support a grayscale media type.
You could fake it in the c-source code, but it would be easier to just do it within octave:
imgbw = mean(img,3);
or the 'more correct'
imgbw = 0.2126 * img(:,:,1) + 0.7152 * img(:,:,2) + 0.072 * img(:,:,3);

On Tue, Feb 28, 2017 at 10:37 AM, Dominic Bitter <address@hidden> wrote:

Hey,

is there a way to set the capture mode to grayscale?

 

Von: Kire Pudsje [mailto:address@hidden]
Gesendet: Dienstag, 6. Dezember 2016 18:25
An: Dominic Bitter <address@hidden>

Betreff: Re: image-acquisition package install

 

I had a look at directshow. It is possible to perform cropping, but there is hardly any gain compared to doing the cropping yourself.
eg:
im=cam.snapshot()(10:20,40:50,:);

 

2016-12-06 15:42 GMT+01:00 Dominic Bitter <address@hidden>:

The update rate is fine, but it would get me smaller images for processing.

Testet the rate with this:

N=1000

tic ()

for i=1:N

  cam1.snapshot();

end

time=toc()

rate=N/time

 

Rate results:

293.08 with build in laptop webcam

17.371 with external connected USB 2.0 Cam (https://de.ids-imaging.com/store/ui-1540le.html)

 

Von: Kire Pudsje [mailto:address@hidden]
Gesendet: Dienstag, 6. Dezember 2016 15:22


An: Dominic Bitter <address@hidden>
Cc: Nicholas Jankowski <address@hidden>; Andreas Weber <address@hidden>; address@hidden
Betreff: Re: image-acquisition package install

 

No. I guess your question because of speed issues? I am looking into getting a higher update rate.

What kind of update rate do you get?

Here on my work machine octave is very slow, because the virus scanner constantly wants to check each file.

 

Could you try something like this (untested code), but you get the idea adjust N as appropriate?

N=100

tic

for i=1:N

  cam.capture();

end

toc

 

2016-12-06 14:28 GMT+01:00 Dominic Bitter <address@hidden>:

@Kire Pudsje

Is there a way to load a section of a snapshot, without getting the full image first?

 

 

 

Von: Kire Pudsje [mailto:address@hidden]
Gesendet: Sonntag, 4. Dezember 2016 19:55
An: Dominic Bitter <address@hidden>
Cc: Nicholas Jankowski <address@hidden>; Andreas Weber <address@hidden>; address@hidden


Betreff: Re: image-acquisition package install

 

And an updated version. Everything except help and live-preview should work now.

I also implemented the set function like the image-acquisition package, to give back the range and step size for the setting.

I will not be trying to get live preview to work. Next step is integrating it in the image-acquisition package. With a little lick I can re-use their preview stuff.

 

2016-12-02 22:58 GMT+01:00 Dominic Bitter <address@hidden>:

Hello Kire,

thanks for the code.

 

I have a Matlab script from a colleague which (if i remeber it right) is able to get live images from USB cams.

Sadly i can’t get a Matlab license for me there.

If it can help you i can ask him on Monday and send you the file.

 

Von: Kire Pudsje [mailto:address@hidden]
Gesendet: Freitag, 2. Dezember 2016 20:49
An: address@hidden; address@hidden; address@hidden; address@hidden
Betreff: Re: image-acquisition package install

 

Dominic,

 

I am busy implementing webcam support on Windows.

I based it on the interface described by the webcam package of matlab

https://nl.mathworks.com/help/supportpkg/usbwebcams/index.html

 

It is currently in a very early and rough stage. No help yet, very dirty code, etc. I only managed to get it working today, but it can already obtain images. Also Brightness, backlight etc, can be set. No resolution control at the moment.

Once I have everything working, I might try and integrate it in the img-acq package.

 

>> pkg load webcam
>> webcamlist
ans =
{
  [1,1] = VGA Webcam
  [2,1] = HD 720P Webcam
}
>> cam=webcam(1);
warning: This is work in progress, be prepared for segfaults
warning: called from
    webcam at line 8 column 15
>> cam.get()
ans =

  scalar structure containing the fields:

    Name = VGA Webcam
    Resolution = 640x480
    AvailableResolutions =
    {
      [1,1] = 640x480
      [2,1] = 640x360
    }
    Brightness = 0
    Contrast =  32
    Hue = 0
    Saturation =  64
    Sharpness =  4
    Gamma =  221
    WhiteBalance = auto
    BacklightCompensation = off
    Exposure = auto

imshow(cam.snapshot);

 

 

 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]