CN108961333A - Efficient calculation method for pixel area of image area - Google Patents
Efficient calculation method for pixel area of image area Download PDFInfo
- Publication number
- CN108961333A CN108961333A CN201810641311.4A CN201810641311A CN108961333A CN 108961333 A CN108961333 A CN 108961333A CN 201810641311 A CN201810641311 A CN 201810641311A CN 108961333 A CN108961333 A CN 108961333A
- Authority
- CN
- China
- Prior art keywords
- equal
- image
- quadrant
- region
- pixel
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/62—Analysis of geometric attributes of area, perimeter, diameter or volume
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Geometry (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
Discloses an efficient calculation method for the pixel area of an image region, namely, the center point C (x) of the image region in a known binary image Ic,yc) 1, setting a linked list L = { a =i(p, q) } and a table-tail pointer ep; 2. the center point C (x)c,yc) storing the pixel points around the chain list L, 3, judging the quadrant position of the elements in the chain list L relative to the central point C, entering the corresponding step, if the pointer ep of the table tail is 0, obtaining the pixel area value s of the image area, ending the process, 4, searching from the center to the outside in the first quadrant, accumulating the pixel number, 5, searching from the center to the outside in the second quadrant, accumulating the pixel number, 6, storing the pixel number in the second quadrant, and finally, obtaining the pixel area value of the image areaSearching the third quadrant from the center to the outside, and accumulating the number of pixels; 7. searching from the center outwards in the fourth quadrant, the number of pixels is accumulated.
Description
Technical field
The present invention relates to a kind of efficient calculation methods of image-region elemental area, belong to field of image processing.
Background technique
Computer vision is using more and more extensive, from simple videograph, develops as image recognition and analysis, than
Such as Car license recognition, recognition of face, human body tracking and binocular stereo vision etc..Therefore the importance of image processing algorithm highlights
Come, promote image denoising, image transformation, image segmentation, compression of images, image enhancement, image Fuzzy Processing scheduling algorithm it is fluffy
It is vigorous fast-developing.
Summary of the invention
The present invention provides a kind of efficient calculation method of image-region elemental area, and the program is set out using central point, spiral shell
The method for searching for the area pixel point outside rotation direction, this method have detection reliable, and algorithm arithmetic speed is fast, calculate accurate excellent
Point.
The technical solution adopted by the present invention to solve the technical problems is:
A kind of efficient calculation method of image-region elemental area, it is known that bianry image I (x, y), wherein x=1 ~ M, y=1 ~ N, M
For the maximum pixel number in x-axis direction, N is the maximum pixel number on y-axis direction, image-region I (x, y) be equal to 1, x=1 ~
M, y=1 ~ N, M are the maximum pixel number in x-axis direction, and N is the maximum pixel number on y-axis direction, and central point is C (xc,
yc), it is achieved by the steps of:
(1) chained list L={ a is seti, wherein ai=(p, q), i=1,2,3......, table tail pointer ep is set, is directed toward in chained list L
The elemental area s in interest region, initial value 1 is arranged in the position of latest data, initial value 0;
(2) chained list L is initialized, if I (xc+1,yc) be equal to 1, then s=s+1, ep=ep+1, aep=(xc+1,yc), I (xc+1,
yc)=0;If I (xc,yc+ 1) it is equal to 1, then s=s+1, ep=ep+1, aep=(xc,yc+ 1), I (xc,yc+1)=0;If I (xc-1,
yc) be equal to 1, then s=s+1, ep=ep+1, aep=(xc-1,yc), I (xc-1,yc)=0;If I (xc,yc- 1) it is equal to 1, then s=s+1,
Ep=ep+1, aep=(xc,yc- 1), I (xc,yc-1)=0;
(3) is calculated by completion, the pixel faces product value s of image-region is obtained, terminates the mistake if ep is equal to 0 by chained list L
Journey;If aep.p-xc> 0, and aep.q-yc>=0, execute step 4;If aep.p-xc≤ 0, and aep.q-yc> 0, execute step
Rapid 5;If aep.p-xc< 0, and aep.q-yc≤ 0, execute step 6;If aep.p-xc>=0, and aep.q-yc< 0, execute step
Rapid 7;
(4) temporary variable (m, n) is established, m=a is enabledep.P, n=aep.Q, then ep=ep-1;If I (m+1, n) is equal to 1, then s=s
+ 1, ep=ep+1, aep=(m+1, n), I (m+1, n)=0;If I (m, n+1) is equal to 1, then s=s+1, ep=ep+1, aep=(m,n+
1), I (m, n+1)=0;Return step 3;
(5) temporary variable (m, n) is established, m=a is enabledep.P, n=aep.Q, then ep=ep-1;If I (m-1, n) is equal to 1, then s=s
+ 1, ep=ep+1, aep=(m-1, n), I (m-1, n)=0;If I (m, n+1) is equal to 1, then s=s+1, ep=ep+1, aep=(m,n+
1), I (m, n+1)=0;Return step 3;
(6) temporary variable (m, n) is established, m=a is enabledep.P, n=aep.Q, then ep=ep-1;If I (m-1, n) is equal to 1, then s=s
+ 1, ep=ep+1, aep=(m-1, n), I (m-1, n)=0;If I (m, n-1) is equal to 1, then s=s+1, ep=ep+1, aep=(m,n-
1), I (m, n-1)=0;Return step 3;
(7) temporary variable (m, n) is established, m=a is enabledep.X, n=aep.Y, then ep=ep-1;If I (m+1, n) is equal to 1, then s=s
+ 1, ep=ep+1, aep=(m+1, n), I (m+1, n)=0;If I (m, n-1) is equal to 1, then s=s+1, ep=ep+1, aep=(m,n-
1), I (m, n-1)=0;Return step 3.
Beneficial effects of the present invention are mainly manifested in: 1, method is simple, high-efficient, therefore arithmetic speed is fast;2, knot is calculated
Fruit is accurate, and error is small.
Detailed description of the invention
Fig. 1 is the schematic diagram of the efficient calculation method of image-region elemental area.
Specific embodiment
The invention will be further described below in conjunction with the accompanying drawings:
Referring to Fig.1, a kind of efficient calculation method of image-region elemental area, it is known that bianry image I (x, y), wherein x=1 ~ M,
Y=1 ~ N, M are the maximum pixel number in x-axis direction, and N is the maximum pixel number on y-axis direction, image-region I (x, y) etc.
In 1, other regions I (x, y) is equal to 0, and central point is C (xc,yc).The efficient calculation method is achieved by the steps of:
(1) chained list L={ a is seti, wherein ai=(x, y), i=1,2,3......, table tail pointer ep is set, is directed toward in chained list L
The elemental area s in interest region, initial value 1 is arranged in the position of latest data, initial value 0;
Step 1 is that subsequent calculating is prepared.Chained list L is used to store the outermost pixel from center radiation search around.
(2) chained list L is initialized, if I (xc+1,yc) be equal to 1, then s=s+1, ep=ep+1, aep=(xc+1,yc), I (xc+
1,yc)=0;If I (xc,yc+ 1) it is equal to 1, then s=s+1, ep=ep+1, aep=(xc,yc+ 1), I (xc,yc+1)=0;If I (xc-
1,yc) be equal to 1, then s=s+1, ep=ep+1, aep=(xc-1,yc), I (xc-1,yc)=0;If I (xc,yc- 1) it is equal to 1, then s=s+
1, ep=ep+1, aep=(xc,yc- 1), I (xc,yc-1)=0;
In step 2, with central point C (xc,yc) be core, be to establish initiation search path, centered on point C (xc,yc) left up and down
Right consecutive points.
(3) is calculated by completion, the pixel faces product value s of image-region is obtained, terminates this if ep is equal to 0 by chained list L
Process;If aep.p-xc> 0, and aep.q-yc>=0, execute step 4;If aep.p-xc≤ 0, and aep.q-yc> 0, it executes
Step 5;If aep.p-xc< 0, and aep.q-yc≤ 0, execute step 6;If aep.p-xc>=0, and aep.q-yc< 0, it executes
Step 7;
Step 3 is the entrance of cyclic search, therefore carries out the judgement of termination condition first, if ep is equal to 0, completes image
The calculating of the elemental area s in region, terminates the process;Otherwise, the position of latest data in chained list L is judged, according to place
Relative to central point C (xc,yc) quadrant position select different steps to be handled.
(4) temporary variable (m, n) is established, m=a is enabledep.P, n=aep.Q, then ep=ep-1;If I (m+1, n) is equal to 1,
Then s=s+1, ep=ep+1, aep=(m+1, n), I (m+1, n)=0;If I (m, n+1) is equal to 1, then s=s+1, ep=ep+1, aep=
(m, n+1), I (m, n+1)=0;Return step 3;
(5) temporary variable (m, n) is established, m=a is enabledep.P, n=aep.Q, then ep=ep-1;If I (m-1, n) is equal to 1, then s=s
+ 1, ep=ep+1, aep=(m-1, n), I (m-1, n)=0;If I (m, n+1) is equal to 1, then s=s+1, ep=ep+1, aep=(m,n+
1), I (m, n+1)=0;Return step 3;
(6) temporary variable (m, n) is established, m=a is enabledep.P, n=aep.Q, then ep=ep-1;If I (m-1, n) is equal to 1, then s=s
+ 1, ep=ep+1, aep=(m-1, n), I (m-1, n)=0;If I (m, n-1) is equal to 1, then s=s+1, ep=ep+1, aep=(m,n-
1), I (m, n-1)=0;Return step 3;
(7) temporary variable (m, n) is established, m=a is enabledep.P, n=aep.Q, then ep=ep-1;If I (m+1, n) is equal to 1, then s=s
+ 1, ep=ep+1, aep=(m+1, n), I (m+1, n)=0;If I (m, n-1) is equal to 1, then s=s+1, ep=ep+1, aep=(m,n-
1), I (m, n-1)=0;Return step 3.
Step 4 is the searching method of first quartile, first upward again to the right;Step 5 is the searching method of the second quadrant, first to
It is left upward again;Step 6 is the searching method of third quadrant, first to the left still further below;Step 7 is the searching method of fourth quadrant, first
To the right still further below.When all paths reach the outermost of image-region, then the data in chained list L are deleted one by one, without new
Data are added, then final ep is equal to 0, terminate calculating process.
Claims (1)
1. a kind of efficient calculation method of image-region elemental area, it is known that bianry image I (x, y), wherein x=1 ~ M, y=1 ~ N,
M is the maximum pixel number in x-axis direction, and N is the maximum pixel number on y-axis direction, and image-region I (x, y) is equal to 1, x=1
~ M, y=1 ~ N, M are the maximum pixel number in x-axis direction, and N is the maximum pixel number on y-axis direction, and central point is C (xc,
yc), it is characterised in that: it is achieved by the steps of:
(1) chained list L={ a is seti, wherein ai=(p, q), i=1,2,3......, table tail pointer ep is set, is directed toward in chained list L most
The elemental area s in interest region, initial value 1 is arranged in the position of new data, initial value 0;
(2) chained list L is initialized, if I (xc+1,yc) be equal to 1, then s=s+1, ep=ep+1, aep=(xc+1,yc), I (xc+1,yc)
=0;If I (xc,yc+ 1) it is equal to 1, then s=s+1, ep=ep+1, aep=(xc,yc+ 1), I (xc,yc+1)=0;If I (xc-1,yc)
Equal to 1, then s=s+1, ep=ep+1, aep=(xc-1,yc), I (xc-1,yc)=0;If I (xc,yc- 1) it is equal to 1, then s=s+1, ep=
Ep+1, aep=(xc,yc- 1), I (xc,yc-1)=0;
(3) is calculated by completion, the pixel faces product value s of image-region is obtained, terminates the mistake if ep is equal to 0 by chained list L
Journey;If aep.p-xc> 0, and aep.q-yc>=0, execute step 4;If aep.p-xc≤ 0, and aep.q-yc> 0, execute step
Rapid 5;If aep.p-xc< 0, and aep.q-yc≤ 0, execute step 6;If aep.p-xc>=0, and aep.q-yc< 0, execute step
Rapid 7;
(4) temporary variable (m, n) is established, m=a is enabledep.P, n=aep.Q, then ep=ep-1;If I (m+1, n) is equal to 1, then s=s
+ 1, ep=ep+1, aep=(m+1, n), I (m+1, n)=0;If I (m, n+1) is equal to 1, then s=s+1, ep=ep+1, aep=(m,n+
1), I (m, n+1)=0;Return step 3;
(5) temporary variable (m, n) is established, m=a is enabledep.P, n=aep.Q, then ep=ep-1;If I (m-1, n) is equal to 1, then s=s
+ 1, ep=ep+1, aep=(m-1, n), I (m-1, n)=0;If I (m, n+1) is equal to 1, then s=s+1, ep=ep+1, aep=(m,n+
1), I (m, n+1)=0;Return step 3;
(6) temporary variable (m, n) is established, m=a is enabledep.P, n=aep.Q, then ep=ep-1;If I (m-1, n) is equal to 1, then s=s
+ 1, ep=ep+1, aep=(m-1, n), I (m-1, n)=0;If I (m, n-1) is equal to 1, then s=s+1, ep=ep+1, aep=(m,n-
1), I (m, n-1)=0;Return step 3;
(7) temporary variable (m, n) is established, m=a is enabledep.X, n=aep.Y, then ep=ep-1;If I (m+1, n) is equal to 1, then s=s
+ 1, ep=ep+1, aep=(m+1, n), I (m+1, n)=0;If I (m, n-1) is equal to 1, then s=s+1, ep=ep+1, aep=(m,n-
1), I (m, n-1)=0;Return step 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810641311.4A CN108961333B (en) | 2018-06-21 | 2018-06-21 | Efficient calculation method for pixel area of image area |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810641311.4A CN108961333B (en) | 2018-06-21 | 2018-06-21 | Efficient calculation method for pixel area of image area |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108961333A true CN108961333A (en) | 2018-12-07 |
CN108961333B CN108961333B (en) | 2021-05-14 |
Family
ID=64491545
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810641311.4A Active CN108961333B (en) | 2018-06-21 | 2018-06-21 | Efficient calculation method for pixel area of image area |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108961333B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100552698C (en) * | 2007-12-11 | 2009-10-21 | 中国科学院长春光学精密机械与物理研究所 | Real-time detection method to airfield runway in the image of taking photo by plane |
CN101950420A (en) * | 2010-08-26 | 2011-01-19 | 广东宝莱特医用科技股份有限公司 | Image area calculation method for single region encircled by random communicated boundaries |
CN102521600A (en) * | 2011-11-03 | 2012-06-27 | 北京农业信息技术研究中心 | Method and system for identifying white-leg shrimp disease on basis of machine vision |
US20130265287A1 (en) * | 2012-04-04 | 2013-10-10 | Samsung Electronics Co., Ltd. | Apparatus and method to detect coordinates in a penbased display device |
CN104123431A (en) * | 2013-04-24 | 2014-10-29 | 国民技术股份有限公司 | Element modular inversion calculation method and device |
CN106152978A (en) * | 2016-06-20 | 2016-11-23 | 陕西师范大学 | A kind of untouchable area measurement method based on graphical analysis |
-
2018
- 2018-06-21 CN CN201810641311.4A patent/CN108961333B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100552698C (en) * | 2007-12-11 | 2009-10-21 | 中国科学院长春光学精密机械与物理研究所 | Real-time detection method to airfield runway in the image of taking photo by plane |
CN101950420A (en) * | 2010-08-26 | 2011-01-19 | 广东宝莱特医用科技股份有限公司 | Image area calculation method for single region encircled by random communicated boundaries |
CN102521600A (en) * | 2011-11-03 | 2012-06-27 | 北京农业信息技术研究中心 | Method and system for identifying white-leg shrimp disease on basis of machine vision |
US20130265287A1 (en) * | 2012-04-04 | 2013-10-10 | Samsung Electronics Co., Ltd. | Apparatus and method to detect coordinates in a penbased display device |
CN104123431A (en) * | 2013-04-24 | 2014-10-29 | 国民技术股份有限公司 | Element modular inversion calculation method and device |
CN106152978A (en) * | 2016-06-20 | 2016-11-23 | 陕西师范大学 | A kind of untouchable area measurement method based on graphical analysis |
Non-Patent Citations (1)
Title |
---|
李伟 等: "一种基于链表的二值图像像素标记改进算法", 《科技风》 * |
Also Published As
Publication number | Publication date |
---|---|
CN108961333B (en) | 2021-05-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108388879B (en) | Target detection method, device and storage medium | |
CN111340195B (en) | Training method and device for network model, image processing method and storage medium | |
CN113095370B (en) | Image recognition method, device, electronic equipment and storage medium | |
CN110097050B (en) | Pedestrian detection method, device, computer equipment and storage medium | |
CN107272899B (en) | VR (virtual reality) interaction method and device based on dynamic gestures and electronic equipment | |
CN111242925A (en) | Target detection method and device for CT image data and electronic equipment | |
CN112149713B (en) | Method and device for detecting insulator image based on insulator image detection model | |
WO2022237902A1 (en) | Method, apparatus, and device for detecting object, and computer storage medium | |
CN116485817A (en) | Image segmentation method, device, electronic equipment and storage medium | |
CN112418089A (en) | Gesture recognition method and device and terminal | |
CN111210398A (en) | White blood cell recognition system based on multi-scale pooling | |
CN107886093B (en) | Character detection method, system, equipment and computer storage medium | |
CN115147618A (en) | Method for generating saliency map, method and device for detecting abnormal object | |
CN108961333A (en) | Efficient calculation method for pixel area of image area | |
CN112416128B (en) | Gesture recognition method and terminal equipment | |
CN115861659A (en) | Object matching method, device, equipment and computer storage medium | |
US20240013521A1 (en) | Sequence processing for a dataset with frame dropping | |
CN110288572A (en) | Blood vessel center line automatic extraction method and device | |
CN115457385A (en) | Building change detection method based on lightweight network | |
CN111125414B (en) | Automatic searching method for specific target of unmanned aerial vehicle remote sensing image | |
CN109213322B (en) | Method and system for gesture recognition in virtual reality | |
US20230040195A1 (en) | Three-dimensional point cloud identification device, learning device, three-dimensional point cloud identification method, learning method and program | |
CN113139549A (en) | Parameter self-adaptive panorama segmentation method based on multitask learning | |
CN112950652A (en) | Robot and hand image segmentation method and device thereof | |
CN112541428B (en) | Football recognition method, football recognition device and robot |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220512 Address after: 322000 floor 2, administrative building 1, No. 648, Qijiguang Road, Houjiang street, Yiwu City, Jinhua City, Zhejiang Province (self declaration) Patentee after: Zhejiang ruitest Technology Co.,Ltd. Address before: 310013 no.256, 6th floor, building 2, Huahong building, 248 Tianmushan Road, Xihu District, Hangzhou City, Zhejiang Province Patentee before: HANGZHOU JINGYI INTELLIGENT SCIENCE & TECHNOLOGY Co.,Ltd. |
|
TR01 | Transfer of patent right |