Skip to content

zoom_image_factorZoomImageFactorZoomImageFactorzoom_image_factorzoom_image_factor🔗

説明🔗

zoom_image_factorZoomImageFactorZoomImageFactorzoom_image_factorzoom_image_factor — 与えられた要素より画像を拡大・縮小する。

書式🔗

zoom_image_factor( image Image, out image ImageZoomed, extent.x ScaleWidth, extent.y ScaleHeight, string Interpolation )void ZoomImageFactor( const HObject& Image, HObject* ImageZoomed, const HTuple& ScaleWidth, const HTuple& ScaleHeight, const HTuple& Interpolation )static void HOperatorSet.ZoomImageFactor( HObject image, out HObject imageZoomed, HTuple scaleWidth, HTuple scaleHeight, HTuple interpolation )def zoom_image_factor( image: HObject, scale_width: float, scale_height: float, interpolation: str ) -> HObject

Herror zoom_image_factor( const Hobject Image, Hobject* ImageZoomed, double ScaleWidth, double ScaleHeight, const char* Interpolation )

Herror T_zoom_image_factor( const Hobject Image, Hobject* ImageZoomed, const Htuple ScaleWidth, const Htuple ScaleHeight, const Htuple Interpolation )

HImage HImage::ZoomImageFactor( double ScaleWidth, double ScaleHeight, const HString& Interpolation ) const

HImage HImage::ZoomImageFactor( double ScaleWidth, double ScaleHeight, const char* Interpolation ) const

HImage HImage::ZoomImageFactor( double ScaleWidth, double ScaleHeight, const wchar_t* Interpolation ) const (Windows only)

HImage HImage.ZoomImageFactor( double scaleWidth, double scaleHeight, string interpolation )

説明🔗

zoom_image_factorZoomImageFactor は、幅に対してファクタ ScaleWidthscaleWidthscale_width と高さに対してファクタ ScaleHeightscaleHeightscale_height に より、画像 Imageimageimage を拡大または縮小します。パラメーター Interpolationinterpolationinterpolation は使用される補間タイプ ( affine_trans_imageAffineTransImage を参照) を決定します。 入力画像にドメインを指定していたとしても無視されます。 zoom_image_factorZoomImageFactor は 画像全領域に対して拡大・縮小を行います

注意🔗

システムパラメーター 'int_zooming'"int_zooming" が 'true'"true" に 設定されている場合、内部的に使用される整数演算は以下の3つのケースでエラー となることがあります。1 つ目は、zoom_image_factorZoomImageFactor が \(0.5\) より小さい倍率と組み合わせて高ダイナミクスをもつ uint2 もしくは int2 画像(つまり、各制限に近い値を含む画像)で使用される場合、出 力画像のグレイ値は間違った値になることがあります。2 番目に、 Interpolationinterpolationinterpolation に 'nearest_neighbor'"nearest_neighbor" 以外の値を設 定した場合、大きい倍率が適用され、大きな出力画像を取得し、その後、 右下の画像境界で未定義のグレイ値が生じることがあります。未定義のグ レイ値境界の最大幅 \(B_{max}\) は \(B_{max}=0.5 \cdot S \cdot I / 2^{15}\) として計算され、\(S\) は 1 次元の倍率であり、$I $ は対応する次元での出力画像のサイズとなります。 3 番目にreal画像では、Interpolationinterpolationinterpolation が 'nearest_neighbor'"nearest_neighbor" に設定され、入力画像と出力画像の両方が大きい場合、画像の境界で未定義の グレイ値が生じることがあります。

これらすべてのケースで、オペレーター set_systemSetSystem を使って、'int_zooming'"int_zooming" を 'false'"false" に設定することを推奨します。

'nearest_neighbor'"nearest_neighbor" が補完手法として設定されている場合、 結果は画像タイプによってわずかに異なる可能性があります。 これは、適用された補間アルゴリズムの画像タイプ固有の最適化を使用しているためです。

ScaleWidthscaleWidthscale_width = \(0.5\) で ScaleHeightscaleHeightscale_height = \(0.5\) の場 合、zoom_image_factorZoomImageFactor は内部で並列化されます。さらに、 zoom_image_factorZoomImageFactor は Interpolationinterpolationinterpolation= 'nearest_neighbor'"nearest_neighbor" を使用する場合、内部的に並列化されませ ん。

zoom_image_factorZoomImageFactor は入力画像のサイズが使用するデバイスの 上限を超えなければ、OpenCLデバイス上で実行できます。OpenCLによる 処理では演算上の要因で、結果がCPUでの処理とわずかに異なる可能性があります。

実行情報🔗

実行情報
  • OpenCL演算デバイスによる演算をサポート

  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • tupleレベルで自動的に並列演算処理を実施

  • チャンネルレベルで自動的に並列演算処理を実施

  • 内部データレベルで自動的に並列演算処理を実施

パラメーター🔗

Imageimageimage (input_object) (multichannel-)image(-array) → object (byte* / int2* / uint2* / real*)HObject (byte* / int2* / uint2* / real*)HImage (byte* / int2* / uint2* / real*)HObject (byte* / int2* / uint2* / real*)Hobject (byte* / int2* / uint2* / real*) *計算デバイスに対して有効

入力画像

ImageZoomedimageZoomedimage_zoomed (output_object) (multichannel-)image(-array) → object (byte / int2 / uint2 / real)HObject (byte / int2 / uint2 / real)HImage (byte / int2 / uint2 / real)HObject (byte / int2 / uint2 / real)Hobject * (byte / int2 / uint2 / real)

スケールされた画像

ScaleWidthscaleWidthscale_width (input_control) extent.x → (real)HTuple (double)HTuple (double)floatHtuple (double)

画像幅に対するスケールファクタ

初期値: 0.50.5
推奨値: 0.25, 0.5, 1.5, 2.00.25, 0.5, 1.5, 2.0
値域: 0.001 ≤ ScaleWidth ≤ 10.0
最小増分: 0.001
推奨増分: 0.1

ScaleHeightscaleHeightscale_height (input_control) extent.y → (real)HTuple (double)HTuple (double)floatHtuple (double)

画像高さに対するスケールファクタ

初期値: 0.50.5
推奨値: 0.25, 0.5, 1.5, 2.00.25, 0.5, 1.5, 2.0
値域: 0.001 ≤ ScaleHeight ≤ 10.0
最小増分: 0.001
推奨増分: 0.1

Interpolationinterpolationinterpolation (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

補間のタイプ

初期値: 'constant'"constant"
値のリスト: 'bicubic', 'bilinear', 'constant', 'nearest_neighbor', 'weighted'"bicubic", "bilinear", "constant", "nearest_neighbor", "weighted"

例🔗

(HDevelop)


read_image(Image,'monkey')
dev_display (Image)
zoom_image_factor (Image, ZoomImage, 0.25, 0.25, 'constant')
dev_display (ZoomImage)
(C)
read_image(&Image,"monkey")\;
disp_image(Image,WindowHandle)\;
zoom_image_factor(Image,&ZooImage,0.25,0.25,"constant")\;
disp_image(ZooImage,WindowHandle)\;

他のオペレーターとの組み合わせ🔗

組み合わせ

他の選択候補

zoom_image_sizeZoomImageSize, affine_trans_imageAffineTransImage, hom_mat2d_scaleHomMat2dScale

関連項目

hom_mat2d_scaleHomMat2dScale, affine_trans_imageAffineTransImage

モジュール🔗

Foundation