L_BlurDetection

#include "Ltimgcor.h"

L_LTIMGCOR_API L_INT L_BlurDetection(pBitmap, Blurred, BlurExtent)

pBITMAPHANDLE pBitmap;

pointer to the bitmap handle

L_BOOL* Blurred;

pointer to an L_BOOL variable that indicates whether the image is blurred

L_DOUBLE* BlurExtent;

The amount of blurring

Determines whether an image is blurred.

Parameter Description
pBitmap Pointer to the bitmap handle referencing the bitmap to be tested.
Blurred Address of a variable to be updated with a value indicating whether the image is blurred. Possible values are:
  Value Meaning
  TRUE The image is blurred.
  FALSE The image is not blurred.
BlurExtent The amount of blurring. Valid values range from 0 to 1.0.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function determines whether an image is blurred. If it is blurred, it calculates the amount of blurring.

The pBlurExtent parameter has no meaning unless the image is blurred.

This function can only process entire images. It does not support regions.

This function supports 8-,12-, and 16-bit grayscale images and 24- and 32-bit colored images.

Required DLLs and Libraries

LTIMGCOR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64, Linux.

See Also

Functions:

L_GlareDetection, L_TextBlurDetectorL_SignalToNoiseRatio 

Topics:

Raster Image Functions: Image Analysis

Processing an Image

 

Removing Noise

Example

This example loads a bitmap and applies Blur detection filter and find Blur Extent factor.

#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName 
L_INT BlurDetectionExample(L_VOID) 
{ 
   L_INT nRet; 
   BITMAPHANDLE LeadBitmap;   /* Bitmap handle to hold the loaded image. */ 
   /* Load the bitmap, keeping the bits per pixel of the file */ 
   nRet = L_LoadBitmap (MAKE_IMAGE_PATH(TEXT("cannon.jpg")), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL); 
   if(nRet !=SUCCESS) 
      return nRet; 
   /* Apply a blur detector */ 
   L_BOOL Blurred ; 
   L_DOUBLE BlurExtent ; 
   nRet = L_BlurDetection(&LeadBitmap, &Blurred, &BlurExtent); 
   if(nRet !=SUCCESS) 
      return nRet; 
   //free bitmap 
   if(LeadBitmap.Flags.Allocated) 
      L_FreeBitmap(&LeadBitmap); 
   return SUCCESS; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C API Help