Post Reply 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with TVLAxisCapture and TVLMotionDetect because of Bitmap formats
09-26-2012, 04:41 PM
Post: #1
Problem with TVLAxisCapture and TVLMotionDetect because of Bitmap formats
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;
Quote this message in a reply
Post Reply 

Forum Jump:

User(s) browsing this thread: 1 Guest(s)