Resize Opencv Delphi

cvResize komutu görüntülerinin boyutlarını değiştirmek için kullanılan bir prosedürdür.

Paramatreleri 3 tanedir: kaynak görüntü, hedef görüntü-boyutlandırılmış, ve ara-değerleme yöntemidir.

Ara-değerleme metodları:

  • CV_INTER_NN: nearest-neighbor interpolation (yakın komşuluk)
  • CV_INTER_LINEAR: bilinear interpolasyon (bilineer yada çift doğrusal)
  • CV_INTER_LINEAR: nearest benzer
  • CV_INTER_CUBIC : bicubic interpolasyon
procedure TForm2.btnresizeClick(Sender: TObject);
var
    img1,dst:PIplImage;
    smallratio:Integer;
    sz:CvSize;
begin
    smallratio:=30;
    img1:=cvLoadImage('canon550.png',0);
    sz:=cvGetSize(img1);
    sz.width:=Round(sz.width*smallratio/100);
    sz.height:=Round(sz.height*smallratio/100);
    dst:=cvCreateImage(sz,img1.depth,img1.nChannels);
    ShowMessage('depth=>'+IntToStr(img1.depth)+' , '+'nChannels=>'+inttostr(img1.nChannels));
    cvResize(img1,dst,CV_INTER_CUBIC);
    cvNamedWindow('s',1);
    cvShowImage('s',img1);
    cvNamedWindow('sm',1);
    cvShowImage('sm',dst);
end;

Bir Cevap Yazın