L_BlurDetection

#include "Ltimgcor.h"

L_LTIMGCOR_API L_INT L_BlurDetection(pBitmap, Blurred, BlurExtent)

Determines whether an image is blurred.

Parameters

pBITMAPHANDLE pBitmap

Pointer to the bitmap handle referencing the bitmap to be tested.

L_BOOL* 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.

L_DOUBLE* BlurExtent

The amount of blurring. Valid values range from 0 to 1.0.

Returns

Value Meaning
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 BlurExtent 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

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

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

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 21.0.2023.2.15
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.