Full Version: Problem with TVLAxisCapture and TVLMotionDetect because of Bitmap formats
You're currently viewing a stripped down version of our content. View the full version with proper formatting.


Hi all,

I’ve another issue with the TVLAxisCapture.

My application uses a TVLMotionDetect and a TVLGenericFilter.

So I get the BMP from TVLGenericFilter when no motion, and from TVLMotionDetect when a motion is detected in order to analyse the picture which triggered it.

The GenericFilter works perfectly with the TVLAxisCapture and TVLDSCapture.

But the MotionDetect doesn’t.
It works with any USB Webcam using TVLDSCapture. It also works with the Axis Cam if I use the Axis Driver instead of TVLAxisCapture.

I guess the cause is that the MotionDetect gives me a VCL TBitmap. So I have to convert it to FMX TBitmap.

When I use TVLDSCapture, I can choose the BMP format and I set it to RGB24.
When I use TVLAxisCapture, I have no idea of the format and I can’t set it.
But it’s obviously different from RGB24, so the conversion doesn’t work. I get a grey BMP with white lines and so on.

Anybody knows how I can get the format ? Or is there a more recent release of VisionLab with a MotionDetect using FMX TBitmap ?


Ps: Here is my conversion procedure which works for RGB24 Bitmaps.

Procedure ToFmxBmp(Src: vcl.Graphics.TBitmap; Dst:FMX.Types.TBitmap);
  ScanFMX : PAlphaColorArray;
  Bites : PAlphaColorRecArray;
  Scan : TAlphaColorRec;
  ScanVCL: TypePRGBArray;
  x,y: integer;
  for y:=0 to Src.height - 1 do begin
      ScanVCL  := Src.ScanLine[y];
      ScanFMX  := Dst.ScanLine[y];
      Bites := PAlphaColorRecArray(ScanFMX);
      for x:=0 to Src.Width - 1 do begin
        Scan := Bites[x];
        Scan.R := ScanVCL[x].Rouge;
        Scan.G := ScanVCL[x].Vert;
        Scan.B := ScanVCL[x].Bleu;
        Scan.A := 255;
        Bites[x] := Scan;
Reference URL's