AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

RGBTRIPLE - Analog in Delphi

Ein Thema von Virchov · begonnen am 22. Mär 2004 · letzter Beitrag vom 22. Mär 2004
Antwort Antwort
Virchov

Registriert seit: 15. Mär 2004
Ort: Bäärlin
109 Beiträge
 
#1

RGBTRIPLE - Analog in Delphi

  Alt 22. Mär 2004, 11:33
Tach!

In C++ beschreibt diese Struktur die Farbenintensität für Rot, Blau und Grün entsprechend. Gibt es da keine Äquivalente in Delphi dazu?

Danke.
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#2

Re: RGBTRIPLE - Analog in Delphi

  Alt 22. Mär 2004, 11:36
Suche mal nach Hier im Forum suchenTRGB...

......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
Virchov

Registriert seit: 15. Mär 2004
Ort: Bäärlin
109 Beiträge
 
#3

Re: RGBTRIPLE - Analog in Delphi

  Alt 22. Mär 2004, 12:03
Danke.
Ich habe nachgeschaut, bloß der Unterschied zwischen TRGBtriple und RGBtriple in Delphi ist mir immer noch unklar.
  Mit Zitat antworten Zitat
Benutzerbild von Sharky
Sharky

Registriert seit: 29. Mai 2002
Ort: Frankfurt
8.251 Beiträge
 
Delphi 2006 Professional
 
#4

Re: RGBTRIPLE - Analog in Delphi

  Alt 22. Mär 2004, 12:07
Zitat von Virchov:
Danke.
Ich habe nachgeschaut, bloß der Unterschied zwischen TRGBtriple und RGBtriple in Delphi ist mir immer noch unklar.
Hai Virchov,

frage ich mal anderst herum: Was möchtest Du denn machen?
Stephan B.
"Lasst den Gänsen ihre Füßchen"
  Mit Zitat antworten Zitat
Virchov

Registriert seit: 15. Mär 2004
Ort: Bäärlin
109 Beiträge
 
#5

Re: RGBTRIPLE - Analog in Delphi

  Alt 22. Mär 2004, 13:08
Tja, was will ich damit machen Diese Prozedur in Deplhi übersetzen

Delphi-Quellcode:

// GetROI_CAL_RGB_VIS
//
// ROI calibration based on Histogram treshold on multiple frames

procedure GetROI_CAL_RGB_VIS
(prgb: pRGBTRIPLE; //Pointer to first pixel
cxImage, cyImage:integer; //Width, Height   of total image
ShowBoundingBox, //if !0, Bounding Box is drawn
ShowROIHistogram: boolean; //if !0, ROI Histogram is drawn
roiPosArray: pInteger; //Array   containg ROI positions
roiMask: pBoolean; //Mask,pixel[i]   is in ROI if roiMask[i]
minLeft, maxLeft: pinteger; //Vertical Bounding   Box   Scanlines
minTop, maxTopa: pinteger; //Horizontal Bounding Box Scanlines
numROIPixels: pinteger; //number of pixels contained in ROI
Check4Rect: boolean; //1 = check for ellipse and rectangle, 0 just ellipse
fROICutOffLevel: single); //ROI minimal Histogram presence





  //declares
 var V:BYTE;                         //Brightness (V=Max(R,G,B))
  R,G,B:BYTE;                      //Red, Green, Blue
   Histogram[LENBYTE]: integer; //={0};       //Brightness Histogram for this   frame
  const int numPixels = cxImage*cyImage;      //Total   number of pixels
  BYTE roiTreshold;                //Treshold for non-ROI exclusion
  static BYTE roiHistogramMax=0;    //Maximum of times a certain pixel was in ROI
  register idx; //Loop counter for pixels
  static BYTE roiHistogram[STATICMASKSIZE] = {0}; //Times a   pixel was included to ROI because of low brightness
  RGBTRIPLE* prgb0 = prgb;             //Pointer to pixel (0,0)
  const   int   centerCrossRadius =   5;      //Size of the cross   mark representing the center.
  int* YPosArray;                  //Array   containing vertical roi-edges
  int* PosArrayRect; //temp. array containing roi-edges
  static bool OTSUMask[STATICMASKSIZE];   //mask containing !0 for each pix>OTSUthreshold
  static bool EllipseMask[STATICMASKSIZE]; //mask derived from the ellipse approximation
  static bool RectMask[STATICMASKSIZE]; //mask derived from the rectangle approximation
  static int ROIBase=0;               //Contains counter for number of frames   the   roi   is based on

begin

  //allocate memory   for   temporary buffers
  YPosArray   = (int*) calloc(cxImage*2,sizeof(int));
  PosArrayRect = (int*) calloc(cyImage*2,sizeof(int));

  //Flip Bounding Box fictive values, which   are   adjusted later on
  *minTop=cyImage-1,
  *maxTop=0;      
  *minLeft=cxImage-1;
  *maxLeft=0;

  //Build Brightness Histogram of this frame only
  GetBrightnessHistogram(prgb, numPixels, 0, Histogram);
  prgb=prgb0;

  //Get   Treshold for roi and store it in variable roiTreshold
  roiTreshold = (BYTE)(ROISENSE*getTresholdOTSU(Histogram, numPixels));


  //Find roi using treshold and   create a roi/time histogram
  for (prgb=prgb0, idx=0; idx < numPixels; idx++, prgb++){
   //processing in   RGB   space, V-channel = max(R,G,B)
   GetRGB(prgb,&R,&G,&B);
   V=GetTripleMax(R,G,B);
   if ((V > roiTreshold) && (V<=MAXBYTE)){
     //Store the fact that   this pixel was >OSTU   threshold
      // DO NOT use V >= roiThreshold
      // (why? test an image with an image containing only values of 0 and 255)
     OTSUMask[idx]=1;
     if (roiHistogram[idx] < MAXBYTE){
      //Raise   number of times this pixel was included   in ROI,   with a max of MAXBYTE
      roiHistogram[idx]++;

      if (roiHistogram[idx] > roiHistogramMax)
         roiHistogramMax = roiHistogram[idx];
     }
 // roiHistogram<MAXBYTE
   }
   else
      {
      OTSUMask[idx]=0;
      // added by BF in order to be able to remove errand pixels again from roi:
      if (roiHistogram[idx] > 0)
         roiHistogram[idx]--;
      }
 // else

     //Set   this pixel to 1   in the mask   if they   are   more then %   of the times
     //detected as   higher than   the   treshold
     //else added by BF, Jul 11, 2003
     if ((roiHistogram[idx] / (float)roiHistogramMax) > fROICutOffLevel)
        roiMask[idx]   = 1;
     else
        roiMask[idx]   = 0;
     } // for prgb,idx
  prgb = prgb0;
  ROIBase++;
  Mit Zitat antworten Zitat
Virchov

Registriert seit: 15. Mär 2004
Ort: Bäärlin
109 Beiträge
 
#6

Re: RGBTRIPLE - Analog in Delphi

  Alt 22. Mär 2004, 13:35
Darum bitte ich aber nicht! So frech bin ick ja uch nich
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:18 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz