CN1297944C - A method for detecting image gray scale change - Google Patents

A method for detecting image gray scale change Download PDF

Info

Publication number
CN1297944C
CN1297944C CNB2005100029424A CN200510002942A CN1297944C CN 1297944 C CN1297944 C CN 1297944C CN B2005100029424 A CNB2005100029424 A CN B2005100029424A CN 200510002942 A CN200510002942 A CN 200510002942A CN 1297944 C CN1297944 C CN 1297944C
Authority
CN
China
Prior art keywords
pixel
value
sensing range
gray
pixels
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CNB2005100029424A
Other languages
Chinese (zh)
Other versions
CN1632831A (en
Inventor
孙丰强
赵原
刘世伟
Original Assignee
Vimicro Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vimicro Corp filed Critical Vimicro Corp
Priority to CNB2005100029424A priority Critical patent/CN1297944C/en
Publication of CN1632831A publication Critical patent/CN1632831A/en
Application granted granted Critical
Publication of CN1297944C publication Critical patent/CN1297944C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present invention discloses a method for detecting image gray scale change. A first detection range for calculating a level difference value and a second detection range for calculating a vertical difference value are previously set. The present invention has the following processes: A, acquiring each pixel datum of an image; B, traversing the whole image and executing each pixel; B1, selecting a level reference pixel and a vertical reference pixel for the pixel; B2, solving for the level difference value by using the sum of gray scale values of all pixels in the pixel first detection range and the sum of the gray scale values of all the pixels in the first detection range of the level reference pixel; B3, solving for the vertical difference value by using the sum of the gray scale values of all the pixels in the pixel second detection range and the sum of the gray scale values of all the pixels in the second detection range of the vertical reference pixel; B4, calculating a gradient value of the pixel by using the calculated level difference value and the vertical difference value; C, obtaining the gray scale change condition of the image according to the calculated gradient value. The condition of gray scale slow change can be detected by using the present invention.

Description

A kind of method of detected image grey scale change
Technical field
The present invention relates to the image detecting technique in the Flame Image Process, particularly a kind of method of detected image grey scale change.
Background technology
In image detecting technique, it is an important step that the grey scale change of image is detected, and for example: during rim detection, texture detected, the testing result that all is based on grey scale change was handled, thereby finally detects the texture of edge of image or image.
At present, the method of detected image grey scale change is to realize by the Grad of difference operation acquisition pixel, its ultimate principle is exactly the difference that calculates the neighbor gray scale, calculate the Grad of pixel by difference, the big more rate of gray level of just representing of Grad is big more, therefore embodies the situation of variation of image grayscale with Grad.
Referring to Fig. 1, Fig. 1 is the principle schematic of prior art detected image grey scale change.Wherein, pixel P point and pixel P1, pixel P2 point are distinguished adjacent.The Grad that P is ordered by respectively with the P1 point and with the P2 point calculate the level error score value and vertically difference value obtain.Its concrete processing procedure is referring to Fig. 2, and Fig. 2 is the process flow diagram of prior art detected image grey scale change.This flow process may further comprise the steps:
Step 201, the coordinate figure of each pixel of reading images and gray value data store function f (x into, y) in, wherein stored the horizontal ordinate of each pixel, represented with x, y, also stored the gray-scale value (being also referred to as pixel value usually) of each pixel, by f (x, value representation y).
Step 202, the traversal entire image calculates the Grad of each pixel with formula (1), (2), (3), and stores.
At first, calculate level error score value Δ with formula (1), (2) x(x is y) with vertical difference value Δ for f yF (x, y):
Δ xf(x,y)=f(x,y)-f(x+1,y) (1)
Δ yf(x,y)=f(x,y)-f(x,y-1) (2)
Then, calculate Grad  f with formula (3).
▿ f = ( Δ x f ) 2 + ( Δ y f ) 2 - - - ( 3 )
Wherein, Grad can also use formula (4) to calculate acquisition.
|f|=|Δxf|+|Δyf| (4)
Step 203 according to the Grad of each pixel of storing, obtains the variation of image grayscale situation.
So just can be according to the bigger principle of texture grey scale change of the edge or the image of general pattern, according to the variation of image grayscale situation that obtains, finally detect the texture of edge of image or image, common way is to judge whether to be edge or texture by predetermined threshold value, if greater than predetermined threshold, then be judged as edge or texture, otherwise be not edge or texture.
But in fact, a lot of images do not have tangible edge, the gray-scale value at its edge is gradual change, place, the image border grey scale change that has is violent, situation for example shown in Figure 3, Fig. 3 is grey scale pixel value first curve map on the horizontal direction of image border, and wherein neighbor P point and the P2 gray-scale value of ordering differs bigger.Place, the image border that has grey scale change is slow, situation for example shown in Figure 4, and Fig. 4 is grey scale pixel value second curve map on the horizontal direction of image border, wherein neighbor P point and the P2 gray-scale value of ordering differs less.
For situation shown in Figure 3, the Grad that obtains with said method is bigger, so can detect the edge; And for situation shown in Figure 4, human eye can distinguish grey scale change and determine the edge, but in said method, because a gray-scale value calculated difference with each pixel adjacent pixels, obtain Grad then, the Grad that obtains under gray scale gradual change situation will be smaller like this.If Grad is less than threshold value, then can't judge is the edge.
Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of method of detected image grey scale change, and this method can detect grey scale change under the situation that gray scale slowly changes, help detecting exactly the texture of edge of image or image.
For achieving the above object, technical scheme of the present invention specifically is achieved in that a kind of method of detected image grey scale change, this method sets in advance first sensing range of calculated level difference value and calculates second sensing range of vertical difference value, and the process of detected image grey scale change comprises:
A, obtain each pixel data of image;
B, traversal entire image, each pixel is carried out:
B1, for a be separated by pixel of first sensing range of pixel selection and this pixel level is set to the horizontal reference pixel, and be set to vertical reference pixel with vertically a be separated by pixel of second sensing range of this pixel;
B2, with the gray-scale value of all pixels in pixel first sensing range and and horizontal reference pixel first sensing range in all pixels gray-scale value and, obtain the level error score value;
B3, with the gray-scale value of all pixels in pixel second sensing range and and vertically in reference pixel second sensing range gray-scale value of all pixels and, obtain vertical difference value;
B4, with the level error score value that calculates and vertical difference value, calculate the Grad of this pixel;
The Grad that C, basis calculate obtains the variation of image grayscale situation.
Wherein, the value that described first sensing range can be set equates with the value of second sensing range or does not wait.
The described selection horizontal reference of step B1 pixel and vertically reference pixel method can for:
Step B2 is described obtain the level error score value method can for:
With the gray-scale value of all pixels in horizontal reference pixel first sensing range and with pixel first sensing range in all pixels gray-scale value and ask poor, obtain the level error score value.
Step B3 is described obtain vertical difference value method can for:
With the gray-scale value of all pixels in vertical reference pixel second sensing range and with pixel second sensing range in all pixels gray-scale value and ask poor, obtain vertical difference value.
The method of the Grad of described this pixel of calculating can for:
With the level error score value of pixel and vertically difference value respectively square after addition, the result of addition is carried out evolution, obtain the Grad of this pixel.
The method of the Grad of described this pixel of calculating also can for:
With the level error score value of pixel and the vertically difference value back addition that takes absolute value respectively, obtain the Grad of this pixel.
As seen from the above technical solutions, the method of this detected image grey scale change of the present invention, widen the scope of detection, statistics with one section zone around each pixel is come the compute gradient value, just is extended to contrast between regional area from point and the contrast of putting, and gray scale difference has been widened, the Grad that obtains has also strengthened, therefore can under the situation that gray scale slowly changes, detect grey scale change, help detecting exactly the texture of edge of image or image.
Description of drawings
Fig. 1 is the principle schematic of prior art detected image grey scale change;
Fig. 2 is the process flow diagram of prior art detected image grey scale change;
Fig. 3 is grey scale pixel value first curve map on the horizontal direction of image border;
Fig. 4 is grey scale pixel value second curve map on the horizontal direction of image border;
Fig. 5 is the preferred embodiment principle schematic of detected image grey scale change of the present invention;
Fig. 6 is a process flow diagram embodiment illustrated in fig. 5;
Fig. 7 is grey scale pixel value the 3rd curve map on the horizontal direction of image border.
Embodiment
For making purpose of the present invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in more detail.
The main thought of the method for detected image grey scale change of the present invention is: the scope of widening detection, statistics with one section zone around each pixel is come the compute gradient value, just be extended to contrast between regional area from point and the contrast of putting, gray scale difference has been widened, the Grad that obtains has also strengthened, therefore can under the situation that gray scale slowly changes, detect grey scale change, help detecting exactly the texture of edge of image or image.
Referring to Fig. 5, Fig. 5 is the preferred embodiment principle schematic of detected image grey scale change of the present invention.Set in advance first sensing range value n of calculated level difference value and the second sensing range value m of the vertical difference value of calculating in the present embodiment, easy in order to handle, n=m in the present embodiment also can be unequal in the practical application.
Among Fig. 5, the P point is detected pixel, the horizontal reference pixel that the P2 point is ordered for P; P1 selects the vertical reference image vegetarian refreshments of selecting into P.P1 point and P point n, P2 point and the P point level n of being separated by of vertically being separated by, the n/2 of being separated by respectively between A point, P point, B point, P2 point, C point.The n/2 of being separated by respectively between D point, P point, E point, P1 point, F point.
Referring to Fig. 6, Fig. 6 is a process flow diagram embodiment illustrated in fig. 5.This flow process may further comprise the steps:
Step 601, data such as the gray-scale value of each pixel of reading images, coordinate figure and storage.
In this step, the method for storage can be same as the prior art, promptly store into function f (x, y) in.Certainly adopt other modes to store, as long as can be with the gray-scale value and the coordinate figure corresponding stored of each pixel.
Step 602 is selected a pixel.
Step 603, calculate to select pixel level direction all neighbors in the n scope gray-scale value with 1.
Step 604 is set to the horizontal reference pixel with selecting the be separated by pixel of n of pixel level, obtain horizontal reference pixel level direction all adjacent pixels in the n scope gray-scale value with 2.
Step 605, the gray-scale value that step 604 is obtained with 2 gray-scale values that obtain with step 603 with 1 ask difference to calculate, obtain level error score value Δ xF (x, y).
Step 603~step 605 can be represented by formula (5):
Δ x f ( x , y ) = Σ i = ( a + n / 2 ) a + 3 * n / 2 f ( i , j ) - Σ i = ( a - n / 2 ) a + n / 2 f ( i , j ) - - - ( 5 )
Wherein, a is the abscissa value that P is ordered.
Step 606, calculate to select pixel vertical direction all neighbors in the n scope gray-scale value with 3.
Step 607 is set to vertical reference pixel with selecting vertically the be separated by pixel of n of pixel, obtain vertical reference pixel horizontal direction all adjacent pixels in the n scope gray-scale value with 4.
Step 608, gray-scale value that step 607 is obtained with 4 gray-scale values that obtain with step 606 with 3 ask difference to calculate, obtain vertical difference value Δ yF (x, y).
Step 606~step 608 can be represented by formula (6):
Δ y f ( x , y ) = Σ j = ( b + n / 2 ) b + 3 * n / 2 f ( i , j ) - Σ j = ( b - n / 2 ) b + n / 2 f ( i , j ) - - - ( 6 )
Wherein b is the ordinate value that P is ordered.
The level error score value Δ that step 609, usefulness calculate x(x is y) with vertical difference value Δ for f y(x y), calculates the Grad  f and the storage of this pixel to f.
Can employing formula same as the prior art (3) or formula (4) computing acquisition in this step.
Step 610 judges whether to also have non-selected pixel, if having then return execution in step 602, selects next pixel; Otherwise execution in step 611.
Step 611 according to the Grad of each pixel of storing, obtains the variation of image grayscale situation.
By above-mentioned process as seen, obtain horizontal difference and perpendicular value difference value with the gray-scale value of all pixels between detected pixel and the reference pixel in the present embodiment, the obvious result who obtains directly obtains horizontal difference than adjacent two pixels and vertically difference is big.
Referring to Fig. 7, Fig. 7 is grey scale pixel value the 3rd curve map on the horizontal direction of image border.Wherein the P point is a check point, and the P2 point is a horizontal reference point, and P point and P2 point standoff distance are the first sensing range value n of the calculated level difference value that sets in advance, the n/2 of being separated by respectively between A point, P point, B point, P2 point, C point.
As seen from Figure 7, in the horizontal direction, by with [B, C] all interior pixel values summation backs and [A of scope, B] the back horizontal difference that obtains of interior all pixel values summations of scope, it is big obviously directly to obtain horizontal difference than adjacent two pixels, and the Grad that calculates is also big.Principle is identical on the vertical direction, repeats no more here.Therefore, this method can detect grey scale change under the situation that gray scale slowly changes, help detecting exactly the texture of edge of image or image.

Claims (6)

1, a kind of method of detected image grey scale change is characterized in that: this method sets in advance first sensing range of calculated level difference value and calculates second sensing range of vertical difference value, and the process of detected image grey scale change comprises:
A, obtain each pixel data of image;
B, traversal entire image, each pixel is carried out:
B1, be set to the horizontal reference pixel, and be set to vertical reference pixel with vertically a be separated by pixel of second sensing range of this pixel with a be separated by pixel of first sensing range of this pixel level;
B2, with the gray-scale value of all pixels in pixel first sensing range and and horizontal reference pixel first sensing range in all pixels gray-scale value and, obtain the level error score value;
B3, with the gray-scale value of all pixels in pixel second sensing range and and vertically in reference pixel second sensing range gray-scale value of all pixels and, obtain vertical difference value;
B4, with the level error score value that calculates and vertical difference value, calculate the Grad of this pixel;
The Grad that C, basis calculate obtains the variation of image grayscale situation.
2, the method for claim 1 is characterized in that: the value that described first sensing range is set equates with the value of second sensing range or does not wait.
3, method as claimed in claim 1 or 2 is characterized in that, the described method of obtaining the level error score value of step B2 is:
With the gray-scale value of all pixels in horizontal reference pixel first sensing range and with pixel first sensing range in all pixels gray-scale value and ask poor, obtain the level error score value.
4, method as claimed in claim 1 or 2 is characterized in that, the described method of obtaining vertical difference value of step B3 is:
With the gray-scale value of all pixels in vertical reference pixel second sensing range and with pixel second sensing range in all pixels gray-scale value and ask poor, obtain vertical difference value.
5, method as claimed in claim 1 or 2 is characterized in that, the method for the Grad of described this pixel of calculating is:
With the level error score value of pixel and vertically difference value respectively square after addition, the result of addition is carried out evolution, obtain the Grad of this pixel.
6, method as claimed in claim 1 or 2 is characterized in that, the method for the Grad of described this pixel of calculating is:
With the level error score value of pixel and the vertically difference value back addition that takes absolute value respectively, obtain the Grad of this pixel.
CNB2005100029424A 2005-01-26 2005-01-26 A method for detecting image gray scale change Expired - Fee Related CN1297944C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100029424A CN1297944C (en) 2005-01-26 2005-01-26 A method for detecting image gray scale change

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100029424A CN1297944C (en) 2005-01-26 2005-01-26 A method for detecting image gray scale change

Publications (2)

Publication Number Publication Date
CN1632831A CN1632831A (en) 2005-06-29
CN1297944C true CN1297944C (en) 2007-01-31

Family

ID=34852993

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100029424A Expired - Fee Related CN1297944C (en) 2005-01-26 2005-01-26 A method for detecting image gray scale change

Country Status (1)

Country Link
CN (1) CN1297944C (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102621053B (en) 2005-09-21 2015-05-06 卢米尼克斯股份有限公司 Methods and systems for image data processing
CN101859384B (en) * 2010-06-12 2012-05-23 北京航空航天大学 Target image sequence measurement method
CN103292725A (en) * 2012-02-29 2013-09-11 鸿富锦精密工业(深圳)有限公司 Special boundary measuring system and method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5311328A (en) * 1989-12-29 1994-05-10 Matsushita Electric Industrial Co., Ltd. Image processing apparatus for performing an edge correction process and digital copying machine comprising said image processing apparatus therefor
EP0883288A1 (en) * 1997-06-04 1998-12-09 Hewlett-Packard Company System and method for selective application of sharpening to improve text component of halftone images
US5886745A (en) * 1994-12-09 1999-03-23 Matsushita Electric Industrial Co., Ltd. Progressive scanning conversion apparatus
CN1405734A (en) * 2002-10-28 2003-03-26 武汉大学 Method for reinforcing edge of medical picture

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5311328A (en) * 1989-12-29 1994-05-10 Matsushita Electric Industrial Co., Ltd. Image processing apparatus for performing an edge correction process and digital copying machine comprising said image processing apparatus therefor
US5886745A (en) * 1994-12-09 1999-03-23 Matsushita Electric Industrial Co., Ltd. Progressive scanning conversion apparatus
EP0883288A1 (en) * 1997-06-04 1998-12-09 Hewlett-Packard Company System and method for selective application of sharpening to improve text component of halftone images
CN1405734A (en) * 2002-10-28 2003-03-26 武汉大学 Method for reinforcing edge of medical picture

Also Published As

Publication number Publication date
CN1632831A (en) 2005-06-29

Similar Documents

Publication Publication Date Title
CN1276382C (en) Method and apparatus for discriminating between different regions of an image
EP1918877B1 (en) Correlation peak finding method for image correlation displacement sensing
JP6233345B2 (en) Road surface gradient detector
CN107832674B (en) Lane line detection method
CN1928535A (en) Machine vision based LCD spot flaw detection method and system
CN1633159A (en) A method for removing image noise
CN101551900A (en) Detection method for video mosaic images
CN1297944C (en) A method for detecting image gray scale change
CN1415105A (en) Optical flow and image forming
CN110533036B (en) Rapid inclination correction method and system for bill scanned image
CN114820773A (en) Silo transport vehicle carriage position detection method based on computer vision
CN1856028A (en) Camera and method for taking picture compensation
CN101029823A (en) Method for tracking vehicle based on state and classification
CN1451143A (en) Method and apparatus for edge detection
CN2838184Y (en) Border-based bar chart equalizer
CN106709952A (en) Automatic calibration method of display screen
CN1619790A (en) Method for inspecting defect
CN1704990A (en) Information embedding device, information detecting device, information embedding and detecting system, information embedding method, information detecting method, information embedding program, infor
IL184993A (en) Method for extracting edge in photogrammetry with subpixel accuracy
CN117173176B (en) Multi-layer photoetching process hot spot detection method based on image processing
CN112990192B (en) Barcode scale image positioning, identifying and detecting method for digital level
CN111429437B (en) Image non-reference definition quality detection method for target detection
US7116824B2 (en) Detection of a pattern in a digital image
CN1661771A (en) Method for aligning wafer
CN113298787A (en) Plate edge sealing defect detection method, controller and computer readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20090320

Address after: Tianjin economic and Technological Development Zone fourth, 80 Avenue, Tian Da Science and Technology Park, block A1, 2

Patentee after: Vimicro Electronics Co., Ltd.

Address before: No. 35, Xueyuan Road, Beijing, Haidian District, Nanjing building, 15 Floor

Patentee before: Beijing Vimicro Corporation

ASS Succession or assignment of patent right

Owner name: ZHONGXING ELECTRONIC CO., LTD.

Free format text: FORMER OWNER: ZHONGXING MICROELECTRONCI CO., LTD., BEIJING

Effective date: 20090320

C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20070131

Termination date: 20120126