乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      OpenCV2.3翻譯為Delphi--測試 .

       aaie_ 2012-08-06

      unit MainForm;

      interface

      uses
        Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
        Dialogs, StdCtrls, OpenCV, IPL;

      type
        TFrmMain = class(TForm)
          Button1: TButton;
          Button2: TButton;
          procedure Button1Click(Sender: TObject);
          procedure Button2Click(Sender: TObject);
        private
          { Private declarations }
        public
          { Public declarations }
        end;

      var
        FrmMain: TFrmMain;
        box: CVRect;
      implementation


      {$R *.dfm}

      procedure MouseCallback(event, x, y, flags: Integer; param: Pointer); cdecl;
      var
        image: PIplImage;
      begin
        image := PIplImage(param);
        case event of
          CV_EVENT_MOUSEMOVE:
            ShowMessage('d');
        end;
      end;

      procedure SwitchCallback(pos: Integer);
      begin
        pos := cvGetTrackbarPos('Switch', 'Example1');
        ShowMessage(IntToStr(pos));
      end;

      procedure TFrmMain.Button1Click(Sender: TObject);
      var
        img: PIplImage;
        smt: PIplImage;
        iot: PIplImage;
        i: Integer;
        threshold_type: Integer;
        adaptive_method: Integer;
        block_size: Integer;
        offset: Double;
        value: PInteger;
        sz: TSize;
        pnt: CvPoint;
        vl: CvScalar;
        storage: PCvMemStorage;
        res: PCvSeq;
        //銳化
        knl: PCvMat;
        pdata: array[0..9] of float;
        p: PFloat;
      //adaptThresh 15 1 1 71 15 ../Data/cal3-L.bmp
      begin
        threshold_type := CV_THRESH_BINARY;
        adaptive_method := CV_ADAPTIVE_THRESH_MEAN_C;

        block_size := 71;
        offset := 30;
        img := cvLoadImage(PChar(ExtractFilePath(ParamStr(0)) + '2.jpg'), CV_LOAD_IMAGE_GRAYSCALE);
        smt := cvCloneImage(img);
        iot := cvCloneImage(smt);
        //cvSmooth(img, smt, CV_GAUSSIAN, 5, 5);
        cvCanny(img, smt, 30, 60);
      //  storage := cvCreateMemStorage(0);
      //  res := cvHoughCircles(smt, storage, CV_HOUGH_GRADIENT, 1, 100, 150, 55, 0, 0);
      //  for i := 0 to res^.total - 1 do
      //  begin
      //    p := PFloat(cvGetSeqElem(res, i));
      //    pnt := cvPoint_(cvRound(p^), cvRound(p^));
      //    Inc(p);
      //    pnt.y := cvRound(p^);
      //    Inc(p);
      //    cvCircle(smt, pnt, cvRound(p^), CV_RGB($33, $55, $77));
      //  end;

        cvNamedWindow('Example1', CV_WINDOW_AUTOSIZE);
        cvNamedWindow('Example2', CV_WINDOW_AUTOSIZE);
        //cvSetMouseCallback('Example1', MouseCallback, smt);
        //cvCreateTrackbar('Switch', 'Example1', value, 1, SwitchCallback);
        cvShowImage('Example1', img);
        cvShowImage('Example2', smt);
        cvWaitKey(0);
        cvReleaseImage(img);
        cvReleaseImage(smt);
        cvDestroyWindow('Example1');
        cvDestroyWindow('Example2');
      end;

      procedure TFrmMain.Button2Click(Sender: TObject);
      var
        Igray, It, Iat: PIplImage;
        threshold: Double;
        threshold_type: Integer;
        adaptive_method: Integer;
        block_size: Integer;
        offset: Double;

        sz: TSize;
      //adaptThresh 15 1 1 71 15 ../Data/cal3-L.bmp
      begin
        threshold := 82;
        threshold_type := CV_THRESH_BINARY;
        adaptive_method := CV_ADAPTIVE_THRESH_MEAN_C;

        block_size := 71;
        offset := 25;

        Igray := cvLoadImage(PChar(ExtractFilePath(ParamStr(0)) + '01.jpg'), CV_LOAD_IMAGE_GRAYSCALE);
        if not Assigned(Igray) then
          Exit;

        It := cvCreateImage(cvSize_(Igray.Width, Igray.Height), IPL_DEPTH_8U, 1);
        Iat := cvCreateImage(cvSize_(Igray.Width, Igray.Height), IPL_DEPTH_8U, 1);
        //Threshold
        cvThreshold(Igray, It, threshold, 255, threshold_type);

        cvAdaptiveThreshold(Igray, Iat, 255, adaptive_method, threshold_type, block_size, offset);
        cvSaveImage('c:\1.bmp', Iat);
        cvNamedWindow('Raw', 1);
        cvNamedWindow('Threshold', 1);
        cvNamedWindow('Adaptive Threshold', 1);

        cvShowImage('Raw', Igray);
        cvShowImage('Threshold', It);
        cvShowImage('Adaptive Threshold', Iat);

        cvWaitKey(0);

        cvReleaseImage(Igray);
        cvReleaseImage(It);
        cvReleaseImage(Iat);

        cvDestroyWindow('Raw');
        cvDestroyWindow('Threshhold');
        cvDestroyWindow('Adaptive Threshold');
      end;

      end

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類似文章 更多