📄 img_sobel.h64
字号:
;* ======================================================================== *;
;* TEXAS INSTRUMENTS, INC. *;
;* *;
;* IMGLIB DSP Image/Video Processing Library *;
;* *;
;* Release: Revision 1.04b *;
;* CVS Revision: 1.6 Fri Oct 10 16:01:13 2003 (UTC) *;
;* Snapshot date: 23-Oct-2003 *;
;* *;
;* This library contains proprietary intellectual property of Texas *;
;* Instruments, Inc. The library and its source code are protected by *;
;* various copyrights, and portions may also be protected by patents or *;
;* other legal protections. *;
;* *;
;* This software is licensed for use with Texas Instruments TMS320 *;
;* family DSPs. This license was provided to you prior to installing *;
;* the software. You may review this license by consulting the file *;
;* TI_license.PDF which accompanies the files in this library. *;
;* ------------------------------------------------------------------------ *;
;* Copyright (C) 2003 Texas Instruments, Incorporated. *;
;* All Rights Reserved. *;
;* ======================================================================== *;
;* ======================================================================== *;
;* Assembler compatibility shim for assembling 4.30 and later code on *;
;* tools prior to 4.30. *;
;* ======================================================================== *;
;* ======================================================================== *;
;* End of assembler compatibility shim. *;
;* ======================================================================== *;
* ========================================================================= *
* TEXAS INSTRUMENTS, INC. *
* *
* NAME *
* IMG_sobel, Little Endian. *
* *
* REVISION DATE *
* 10-Oct-2003 *
* *
* USAGE *
* This routine is C-callable and can be called as: *
* *
* void IMG_sobel *
* ( *
* const unsigned char *in_data, /* Input image data */ *
* unsigned char *out_data, /* Output image data */ *
* short cols, short rows /* Image dimensions */ *
* ) *
* *
* The IMG_sobel filter is applied to the input image. The input image *
* dimensions are given by the arguments 'cols' and 'rows'. The *
* output image is 'cols' pixels wide and 'rows - 2' pixels tall. *
* *
* DESCRIPTION *
* *
* To see how the implementation is going to work on the input *
* buffer, lets imagine we have the following input buffer: *
* *
* yyyyyyyyyyyyyyyy *
* yxxxxxxxxxxxxxxy *
* yxxxxxxxxxxxxxxy *
* yxxxxxxxxxxxxxxy *
* yxxxxxxxxxxxxxxy *
* yyyyyyyyyyyyyyyy *
* *
* The output buffer would be: *
* *
* tXXXXXXXXXXXXXXz *
* zXXXXXXXXXXXXXXz *
* zXXXXXXXXXXXXXXz *
* zXXXXXXXXXXXXXXt *
* *
* Where: *
* *
* X = IMG_sobel(x) The algorithm is applied to that pixel. *
* The correct output is obtained, the data *
* around the pixels we work on is used *
* *
* t Whatever was in the output buffer in that *
* position is kept there. *
* *
* z = IMG_sobel(y) The algorithm is applied to that pixel. *
* The output is not meaningful, because the *
* necessary data to process the pixel is not *
* available. This is because for each output *
* pixel we need input pixels from the right and *
* from the left of the output pixel. But this *
* data doesn't exist. *
* *
* This means that we will only process (rows-2) lines. Then, we *
* will process all the pixels inside each line. Even though the *
* results for the first and last pixels in each line will not *
* be relevant, it makes the control much simpler and ends up *
* saving cycles. *
* *
* Also the first pixel in the first processed line and the *
* last pixel in the last processed line will not be computed. *
* It is not necessary, since the results would be bogus. *
* *
* The following horizontal and vertical masks that are *
* applied to the input buffer to obtain one output pixel. *
* *
* Horizontal: *
* -1 -2 -1 *
* 0 0 0 *
* 1 2 1 *
* *
* Vertical: *
* -1 0 1 *
* -2 0 2 *
* -1 0 1 *
* *
* This is a C model of the Sobel implementation. This C code *
* is functionally equivalent to the assembly code without *
* restrictions. The assembly code may impose additional *
* restrictions. *
* *
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -