Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Camera still image capture?



Permlink Replies: 4 - Last Post: Jun 27, 2017 8:58 AM Last Post By: Francesco Marano
Markus Humm

Posts: 5,113
Registered: 11/9/03
Camera still image capture?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 27, 2017 12:18 AM
Hello,

how to capture still image data from an inbuilt camera with live
preview? In the end I'd like to create some barcode scanning application
and therefore I'd need still image capturing of the back facing camera.

How can this be done in 10.1 Berlin?
Most solutions I've seen so far are about video capturing, what I
neither need nor like as it in most cases leeds to a reduction of
resolution, which is not desireable for barcode recognition afterwards.

And: there's an FMX component for camera handlin. has anybody already
created a QP feature request about getting such a component for VCL as
well? (maybe the existing component can be made compatible with both
frameworks?)

Greetings

Markus
Francesco Marano

Posts: 59
Registered: 11/18/02
Re: Camera still image capture?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 27, 2017 6:59 AM   in response to: Markus Humm in response to: Markus Humm
Hello,

For FMX, QR-Code scanning:

iOS
I use TTMSFMXBarReader, which uses a native view and libzbar.a

Android
I use TCameraComponent, and Winsoft.FireMonkey.Obr
In OnSampleBufferReady, I show every captured frame in a TImage component, then I scan for QR-Code in a thread, so that the frame-rate is sufficiently high.
I believe WinSoft also offers a native Android camera component.

Please note, in Delphi Seattle, TCameraComponent for FMX has an issue with ContinuousAutoFocus.
The following is a possible workaround:
  CameraComponent1.Active := True;
  Wait 100 ms
  CameraComponent1.Active := False;
  Wait 400/500 ms
  CameraComponent1.FocusMode := TFocusMode.ContinuousAutoFocus;
  CameraComponent1.Active := True;


Of course a native solution is preferable for Android.

Francesco

Edited by: Francesco Marano on Jun 27, 2017 6:59 AM

Edited by: Francesco Marano on Jun 27, 2017 7:31 AM
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: Camera still image capture? [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 27, 2017 8:03 AM   in response to: Francesco Marano in response to: Francesco Marano
Am 27.06.2017 um 16:35 schrieb Francesco Marano:
Hello,

For FMX, QR-Code scanning:

iOS
I use TTMSFMXBarReader, which uses a native view and libzbar.a

Android
I use TCameraComponent, and Winsoft.FireMonkey.Obr
In OnSampleBufferReady, I show every captured frame in a TImage component, then I scan for QR-Code in a thread, so that the frame-rate is sufficiently high.
I believe WinSoft also offers a native Android camera component.

Please note, in Delphi Seattle, TCameraComponent for FMX has an issue with ContinuousAutoFocus.
The following is a possible workaround:
  CameraComponent1.Active := True;
  Wait 100 ms
  CameraComponent1.Active := False;
  Wait 400/500 ms
  CameraComponent1.FocusMode := TFocusMode.ContinuousAutoFocus;
  CameraComponent1.Active := True;


Of course a native solution is preferable for Android.

Francesco

Edited by: Francesco Marano on Jun 27, 2017 6:59 AM

Edited by: Francesco Marano on Jun 27, 2017 7:31 AM

Hello,

thanks for sharing all of this, unfortunatelly the app I want to add
these capabilities is a VCL Win32 app, so I'd need a solution for this
one and afaik the FMX based solutions are not platform neutral, even if
FMX seems to contain a camera component which may work on Win32 as well.

Greetings

Markus
Francesco Marano

Posts: 59
Registered: 11/18/02
Re: Camera still image capture? [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 27, 2017 8:20 AM   in response to: Markus Humm in response to: Markus Humm
Hello,

Please find at the following address a camera component for VCL, plus barcode recognition demo:
http://winsoft.sk/wcamera.htm

I run the barcode recognition demo on Windows 10 (front camera only tablet), frame rate is ok and it appears to work with complex QR-code.

Francesco

Edited by: Francesco Marano on Jun 27, 2017 8:52 AM
steven chesser

Posts: 401
Registered: 4/13/09
Re: Camera still image capture?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 27, 2017 7:30 AM   in response to: Markus Humm in response to: Markus Humm
Markus Humm wrote:
Hello,

how to capture still image data from an inbuilt camera with live
preview? In the end I'd like to create some barcode scanning application
and therefore I'd need still image capturing of the back facing camera.

How can this be done in 10.1 Berlin?
Most solutions I've seen so far are about video capturing, what I
neither need nor like as it in most cases leeds to a reduction of
resolution, which is not desireable for barcode recognition afterwards.

And: there's an FMX component for camera handlin. has anybody already
created a QP feature request about getting such a component for VCL as
well? (maybe the existing component can be made compatible with both
frameworks?)

Greetings

Markus

I've been trying to get something like this for YEARS now for VCL and now for FMX.

Saving a frame off a video stream doesn't cut it. As you mentioned, the "Video" mode resolutions are lower than
the "Still Image" mode of actually taking a true still image picture. Plus saving a frame off a video stream usually ends
up a blurry mess.

I created this a while back for FMX

https://quality.embarcadero.com/browse/RSP-15868
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02