CN106846354A - A kind of Book Inventory method on frame converted based on image segmentation and random hough - Google Patents

A kind of Book Inventory method on frame converted based on image segmentation and random hough Download PDF

Info

Publication number
CN106846354A
CN106846354A CN201710057749.3A CN201710057749A CN106846354A CN 106846354 A CN106846354 A CN 106846354A CN 201710057749 A CN201710057749 A CN 201710057749A CN 106846354 A CN106846354 A CN 106846354A
Authority
CN
China
Prior art keywords
image
parameter
pixel
hough
value
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
Application number
CN201710057749.3A
Other languages
Chinese (zh)
Other versions
CN106846354B (en
Inventor
曹倩
于洪波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Naval Aeronautical University
Original Assignee
Naval Aeronautical Engineering Institute of PLA
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 Naval Aeronautical Engineering Institute of PLA filed Critical Naval Aeronautical Engineering Institute of PLA
Priority to CN201710057749.3A priority Critical patent/CN106846354B/en
Publication of CN106846354A publication Critical patent/CN106846354A/en
Application granted granted Critical
Publication of CN106846354B publication Critical patent/CN106846354B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20021Dividing image into blocks, subimages or windows
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30242Counting objects in image

Landscapes

  • Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a kind of Book Inventory method on frame converted based on image segmentation and random hough, belong to library management technical field.First, frame information is extracted according to image edge pixels accumulation, so as to divide the image into multiple subgraphs, each subgraph represents a spine image put in lattice on bookshelf;Then, by Rapid Accumulation of the books boundary straight line in parameter space in random hough Mapping implementations subgraph;Finally, local peaking is detected in parameter space, so as to realize that each counting for putting books volumes in lattice is checked on bookshelf, and the volumes of all books on bookshelf is finally given;The present invention preferably combines the advantage of image procossing and random hough conversion, and the auto inventory of books on frame is realized using computer disposal;Method is simply efficient, it is easy to implement, and greatly reduces the workload of Book Inventory, with stronger practicality and application value.

Description

A kind of Book Inventory method on frame converted based on image segmentation and random hough
Technical field
The invention belongs to library management technical field, and in particular to one kind is converted based on image segmentation and random hough Frame on Book Inventory method.
Background technology
Book Inventory is the basic data in books statistical indicator, is a difficulties of library management.By clear Point books can accurately determine the existing books property in library, for objectively reflect school run a school strength, strive for more Input has important reference value.Therefore, Book Inventory Work is very necessary for the daily management in library, but Traditional artificial mode of checking not only has taken but also laborious, have that labour demand is big, information updating not in time the shortcomings of.For books It is an important research direction for the management of shop, traditional Book Inventory Work to be digitized, automate improvement, in recent years Come, image processing techniques has obtained fruitful application in terms of taking care of books, for Book Inventory provides a kind of new side Method.
[Liu your emerald green is based on the automatic Book Inventory method of spine characteristics of image and airspace filter to background technology:China, ZL201410383904.7,2016.05.04], spine image is processed using the method for characteristics of image and airspace filter, The auto inventory of single books is realized, improve the efficiency of Book Inventory, the method is mainly comprised the following steps:
1) the spine image in collection stack room, it is ensured that row's books are comprised only in image;
2) the orientation inclination angle of books is obtained, edge pixel is projected, obtain spine word projection oscillogram;
3) edge projection oscillogram is filtered, obtains smooth edge projection oscillogram;
4) number of edge projection waveform medium wave peak is detected, the volumes comprising books as in image.
The method that the above method employs image procossing realizes checking for single books, improves operating efficiency;But its Mainly for the image procossing of simple single books, i.e., the books that can only be put to single books on bookshelf in lattice are carried out clearly Point, and the collected books quantity in library is very huge now, has multiple books to put lattice on each bookshelf, the above method is difficult to efficiently Check these magnanimity collected books;On the other hand, the above method calculates the accumulation of spine word using the method that edge projection is detected Peak value, the method is higher to the requirement of spine background situation;When word is less on books spine or distinguishes little with background, hold It is easily caused books missing inspection;And it is more to work as word, when being in two column distributions on spine, books false is easily caused.Above mentioned problem Occur, limit the practicality and range of application of background technology.
The content of the invention
1. the technical problem to be solved
The purpose of the present invention is to propose to a kind of Book Inventory method on frame converted based on image segmentation and random hough, So as to overcome the deficiencies in the prior art, the efficiency of Book Inventory is greatly improved.
2. technical scheme
The invention provides a kind of Book Inventory method on frame converted based on image segmentation and random hough, using skill Art protocol step is as follows:
Step 1:Image preprocessing
Coloured image of the collection comprising bookshelf framework and spine, is modified to picture, obtains the consistent figure of horizontal direction Piece, and ensure that bookshelf framework takes entire image, the image is designated as P;With the image lower left corner as origin, x-y rectangular co-ordinates are set up System, wherein coordinate system x-axis direction overlaps with image lower boundary, and coordinate system y-axis direction overlaps with left picture boundary;I and j is made to distinguish It is image in the number of pixel cells in coordinate system x and y directions, then image P can be expressed as the form of picture element matrixWherein p (i, j) is the pixel value at pixel cell (i, j) place, and I is figure P in the total pixel in x directions Number, J is the total number of pixels in y directions;
Step 2:Image segmentation
(1) coloured image P is converted into 256 grades of gray-scale map F, the gray-scale map can be represented in x-y rectangular coordinate systems It is imaged the form of prime matrixWherein f (i, j) is the pixel value at pixel cell (i, j) place;For any Pixel cell f (i, j), the gradient f that differential process calculate x directions is carried out by neighborhood unit pixelxWith the gradient f in y directionsy
Then gradient magnitude of the image at coordinate unit (i, j) place isGradient direction is α (i, j) =arctan (fy/fx), wherein arctan () represents tan of negating;
(2) local extremum at edge is extracted by non-maxima suppression, so as to reject the influence of part non-edge point;It is first First, according to the value of α (i, j), it is four sectors interval that the gradient direction at pixel cell f (i, j) place is evenly dividing, respectively generation The gradient of table horizontal direction, left-leaning direction, Right deviation direction and vertical direction:
Wherein, s (i, j) is the sector belonging to coordinate unit (i, j) place gradient direction, and π is the corresponding radian number in 180 ° of angles; Then according to s (i, j) value, two 8 neighborhood coordinate units of the same gradient direction in coordinate unit (i, j) place are searched
Wherein,WithRespectively number of pixel cells of the two 8 neighborhood coordinate units of (i, j) in coordinate system x and y directions; Finally, by the neighborhood territory pixel of the gradient magnitude at coordinate unit (i, j) place and same gradient directionCompare, extract gradient magnitude Local maximum:
(3) binary conversion treatment is carried out to gradient magnitude using dual threshold thresholding, if Low threshold thresholding is σlow, high threshold door It is limited to σhigh, rim detection is carried out to image and obtains binary imageWherein b (i, j) is pixel cell The binaryzation pixel value at (i, j) place:
For gradient magnitude between σlowAnd σhighBetween coordinate unit (i, j), the value of b (i, j) is according to 8 neighborhood pictures The gradient of plain unit determines
Wherein, MmaxIt is the maximum of the neighborhood territory pixel unit gradient of coordinate unit (i, j) place 8;
(4) edge of each lattice bookshelf framework is straight line both horizontally and vertically, and the edge of books is then deposited in framework In more diagonal oblique line, therefore treatment is filtered to binary image B using a diagonal matrix, obtains new pixel Value:
B (i, j)=max [b (i, j), b (i-1, j-1), b (i+1, j+1), b (i-1, j+1), b (i+1, j-1)], wherein, Max [] is represented and is taken maximum computing;Then bianry image is obtained into image in level respectively to both horizontally and vertically projecting The accumulation parameter Q in directionxThe accumulation parameter Q of (i) and vertical directiony(j):
According to the horizontal detection threshold γ of accumulation parameterxWith vertical detection thresholding γy, extract QxThe corresponding sequence of (i) valley Number it is stored in array Dx, extract QyJ the corresponding sequence number of () valley is stored in array Dy
Wherein, arg [] represents the sequence number for meeting constraints [], then DxData correspondence bookshelf framework is in level side To coordinate, DyCoordinate of the data correspondence bookshelf framework in vertical direction;
(5) original image is next divided into multiple subgraphs using the information of framework, in each subgraph correspondence bookshelf One rectangle puts the spine image in lattice;First, the position coordinates D of bookshelf framework is extractedxAnd Dy, so as to realize in bookshelf Each rectangle puts the positioning of lattice;Then, the border that lattice are put according to rectangle is split to coloured image P, obtains multiple subgraphs Picture, realizes the dividing processing of original image:
Wherein N is the total number of subgraph, PnRepresent n-th subgraph.
Step 3:Stochastical sampling
(1) for n-th subgraph Pn, remember InIt is it in the total number of pixels in x directions, JnIt is it in the total pixel in y directions Number;Pre-processed, obtained the gradient direction α at pixel cell (i, j) placen(i,j);Then by αnIt is four that (i, j) is evenly dividing Individual sector is interval;Use sn(i, j) represents subgraph PnIn the sector belonging to coordinate unit (i, j) place gradient direction;Carry out edge inspection Measure binary imageWherein bn(i, j) is subgraph PnIn the two-value at pixel cell (i, j) place Change pixel value;
(2) in binary image BnIn randomly select a pixel cell (i for nonzero element1,j1) so that 0.3Jn≤j1 ≤0.7JnAnd bn(i1,j1) ≠ 0, it is s that the corresponding gradient direction of the pixel cell is intervaln(i1,j1);
(3) in binary image BnSecond pixel cell (i of nonzero element of middle selection2,j2)≠(i1,j1) so that 0.3Jn≤j2≤0.7JnAnd bn(i2,j2) ≠ 0, it is s that the corresponding gradient direction of the pixel cell is intervaln(i2,j2);If sn(i1, j1)≠sn(i2,j2), resampling, until sn(i1,j1)=sn(i2,j2), by two pixel cell (i1,j1) and (i2,j2) group Into a stochastical sampling pixel pair;;
(4) repeated sampling, obtains L stochastical sampling pixel pair.
Step 4:Parameter is accumulated
Accumulative element distance is calculated, hough parameter spaces (ρ, θ) are set up, ρ and θ is respectively distance and angle in space Parameter;By two pixel cell (i of stochastical sampling1,j1) and (i2,j2) parameter space is projected to by hough conversion, calculate Corresponding parameters unit (ρhoughhough), ρhoughAnd θhoughDistance and angle after respectively hough conversion in parameter space Parameter;Ballot accumulation is carried out in corresponding accumulative element, the collinear sampled point of correspondence is fallen into identical accumulation single Unit, obtains parameter and accumulates matrix H (ρ, θ), and specific method is as follows:
(1) sliding-model control is carried out to parameter ρ and θ according to discrete interval Δ ρ and Δ θ, forms parameter space (ρ, θ), The central point parameter of (u, v) individual parameters unit is ρuAnd θv
ρu=(u-1/2) Δ ρ, u=1,2 ..., U,
θv=(v-1/2) Δs θ-pi/2, v=1,2 ..., V,
Wherein, u and v are respectively the sequence number of parameter ρ and θ, and the parameters unit number V of parameters unit the number U and θ of ρ takes Value is respectively:V=Int (π/Δ θ), Int () represent rounding operation, and π is that 180 ° of angles are corresponding Radian number;Set up parameter and accumulate matrix H (ρ, θ), it is 0 to put each unit initial value;
(2) by first pixel of stochastical sampling to (i1,j1) and (i2,j2) parameter sky is projected to by hough conversion Between, the pixel is calculated to identified parameter ρhoughAnd θhough
θhough=arctan [- (i1-i2)/(j1-j2)];
ρhough=0.5 (i1+i2)cos(θhough)+0.5(j1+j2)sin(θhough);
(3) corresponding unit (ρ is searched in parameter space (ρ, θ)uv) so that | | ρhoughu||≤Δρ,|| θhoughv||≤Δθ;If (ρuv) exist, then in the memory cell (ρ of parameter accumulation matrix H (ρ, θ)uv) in tired out Plus:H(ρuv)=H (ρuv)+1;Otherwise, by (ρhoughhough) insertion parameter space (ρ, θ), and take initial value H (ρhough, θhough)=1;
(4) repeat to accumulate, until L stochastical sampling pixel is to being mapped to parameter space, obtain parameter accumulation matrix H (ρ,θ)。
Step 5:Peakvalue's checking
(1) according to detection threshold G1, matrix H (ρ, θ) accumulating to parameter and is detected, value is less than G in making H (ρ, θ)1's Element value is zero, and detection threshold is set to G1=0.3Jn;Consider books inclination angle, angle restriction value θ is setT, make θ in H (ρ, θ) Absolute value is less than θTElement value be zero;
(2) parameters unit (ρ that any one is not zero in H (ρ, θ)uv), define its local search area Ω (ρu, θv) be:Ω(ρuv)={ (ρ, θ) | [| | ρ-ρu| |≤5, θ=θv,H(ρ,θ)≠0]};
(3) next according to Ω (ρuv) judged:If Ω (ρuv) it is sky, this parameters unit (ρuv) it is one Individual local peaking;If Ω (ρuv) it is not sky, if H (ρuv) value more than or equal to region Ω (ρuv) in all units Value:H(ρuv) >=H (ρ, θ), (ρ, θ) ∈ Ω (ρuv), then parameters unit (ρuv) it is a local peaking;
(4) H (ρ, θ) all of local peaking's unit is extracted, the number t of local peaking is calculatedn, then subgraph PnMiddle books Volumes be tn-1;
Step 6:Counting is checked
When the value of n changes from 1 to N, for all of subgraph Pn, the process of repeat step 3 to step 5, detection Obtain the peak value number t in all subgraph parameter accumulation matrixesn, n=1,2 ..., N, then on whole bookshelf books volumes T For:
3. beneficial effect
Compared with background technology, beneficial effects of the present invention explanation:
(1) Book Inventory method on a kind of frame converted based on image segmentation and random hough that the present invention is used, first Multiple subgraphs are divided the image into by image segmentation, Book Inventory then is carried out to each subgraph, magnanimity can be solved Books check problem on frame, with good actual application value;
(2) being converted by random hough carries out Rapid Accumulation to books borderline region, and detection determines the number of border peak value Amount, can reduce the amount of calculation for the treatment of, the accuracy that raising is checked.
Brief description of the drawings
Accompanying drawing 1 is overall flow figure of the invention;
Accompanying drawing 2 is book image on frame to be processed in the embodiment of the present invention;
Accompanying drawing 3 is the image after binary conversion treatment in the embodiment of the present invention;
Accompanying drawing 4 is the image after filtering process in the embodiment of the present invention;
Accompanying drawing 5 is the gentle vertical direction pixel accumulation result figure of embodiment of the present invention reclaimed water;
Accompanying drawing 6 is the subgraph obtained after image segmentation in the embodiment of the present invention;
Accompanying drawing 7 is first sub- Image Edge-Detection result in the embodiment of the present invention;
Accompanying drawing 8 is first sub- image parameter accumulation result in the embodiment of the present invention;
Accompanying drawing 9 is the parameter accumulation figure after Threshold detection and angle restriction in the embodiment of the present invention;
Accompanying drawing 10 is local peak detection result in first subgraph in the embodiment of the present invention;
Specific embodiment
Main adopting of the invention is experimentally verified that all steps, conclusion are verified all on Matlab2010a. Below in conjunction with Figure of description 1 to Book Inventory side on a kind of frame converted based on image segmentation and random hough of the invention Method is described in detail.As shown in Figure 1, processing procedure of the present invention is segmented into 3 modules:M1 is image segmentation module, main Bookshelf framework is extracted according to image information, so as to be split according to the lattice of putting of bookshelf, divide the image into multiple subgraphs; M2 is random hough conversion process module, mainly by edge pixel in hough Mapping implementation subgraphs in parameter space Accumulation;M3 is peak detection block, and the main detection by parameter space local peaking realizes that the counting of books volumes is checked.
Specific handling process of the invention is as follows:
Step 1:Image preprocessing
Coloured image of the collection comprising bookshelf framework and spine, is modified to picture, obtains the consistent figure of horizontal direction Piece, and ensure that bookshelf framework takes entire image, the image is designated as P, as shown in Figure 2;With the image lower left corner as origin, x- is set up Y rectangular coordinate systems, wherein coordinate system x-axis direction overlap with image lower boundary, and coordinate system y-axis direction overlaps with left picture boundary; I and j respectively image are made in the number of pixel cells in coordinate system x and y directions, then image P can be expressed as the form of picture element matrixWherein p (i, j) is the pixel value at pixel cell (i, j) place, and I is figure P in the total pixel in x directions Number, J is the total number of pixels in y directions;
Step 2:Image segmentation
(1) coloured image P is converted into 256 grades of gray-scale map F, the gray-scale map can be represented in x-y rectangular coordinate systems It is imaged the form of prime matrixWherein f (i, j) is the pixel value at pixel cell (i, j) place;For any Pixel cell f (i, j), the gradient f that differential process calculate x directions is carried out by neighborhood unit pixelxWith the gradient f in y directionsy, then Gradient direction of the image at coordinate unit (i, j) place is α (i, j)=arctan (fy/fx), gradient magnitude is
(2) local extremum at edge is extracted by non-maxima suppression, so as to reject the influence of part non-edge point;It is first First, according to the value of α (i, j), it is four sectors interval s (i, j) that the gradient direction at pixel cell f (i, j) place is evenly dividing, The gradient of horizontal direction, left-leaning direction, Right deviation direction and vertical direction is represented respectively;Then according to s (i, j) value, search and sit Mark two 8 neighborhood coordinate units of the same gradient direction in unit (i, j) placeFinally, by the gradient at coordinate unit (i, j) place The neighborhood territory pixel of amplitude and same gradient directionCompare, extract the local maximum of gradient magnitude;
(3) binary conversion treatment is carried out to gradient magnitude using dual threshold thresholding, if Low threshold thresholding is σlow, high threshold door It is limited to σhigh, rim detection is carried out to image and obtains binary imageWherein b (i, j) is pixel cell The binaryzation pixel value at (i, j) place;For gradient magnitude between σlowAnd σhighBetween coordinate unit (i, j), b's (i, j) takes Value determines according to the gradient of 8 neighborhood territory pixel units;The binary image obtained after treatment is as shown in Figure 3, it is seen that bookshelf framework picture There is nuance between element and books pixel, but discrimination is little;
(4) edge of each lattice bookshelf framework is straight line both horizontally and vertically, and the edge of books is then deposited in framework In more diagonal oblique line, therefore treatment is filtered to binary image B using a diagonal matrix, obtains new pixel Value;The image obtained after filtering is as shown in Figure 4, it is seen that after processing after filtering, effectively reduces the influence of background, increased frame Otherness between frame pixel and books pixel;
(5) by bianry image respectively to both horizontally and vertically projecting, image accumulation pixel Q in the horizontal direction is obtainedx The accumulation pixel Q of (i) and vertical directiony(j), as shown in figure 5, pixel accumulation figures of the wherein Fig. 5 (a) for horizontal direction, Fig. 5 B () is the pixel accumulation figure of vertical direction;Comparison diagram 2 and Fig. 5 can be seen that the valley of pixel accumulation in Fig. 5 just corresponding diagram 2 The frame position of middle bookshelf;
(6) according to the horizontal detection threshold γ of accumulation parameterxWith vertical detection thresholding γy, extract QxI () valley is corresponding Sequence number is stored in array Dx, extract QyJ the corresponding sequence number of () valley is stored in array, then DxData correspondence bookshelf framework is in level The coordinate in direction, DyCoordinate of the data correspondence bookshelf framework in vertical direction;Original image is divided into using the information of framework many Individual subgraph, rectangle puts the spine image in lattice in each subgraph correspondence bookshelf, realizes the segmentation portion of original image Reason, obtains image segmentation result as shown in Figure 6;As can be seen that by after image segmentation, original image puts lattice according to bookshelf Position has accurately been divided into 4 subgraphs, and segmentation effect is preferable;
Step 3:Stochastical sampling
(1) for the n-th=1 subgraph, pre-processed, obtained the gradient direction α at pixel cell (i, j) placen(i, j);Then by αnIt is four sectors interval that (i, j) is evenly dividing;Use sn(i, j) represents subgraph PnAt coordinate unit (i, j) place Sector belonging to gradient direction;Carry out rim detection and obtain binary imageAs shown in Figure 7;Can be with Find out, after treatment, the edge of books is more obvious;
(2) in binary image BnIn randomly select a pixel cell (i for nonzero element1,j1) so that 0.3Jn≤j1 ≤0.7JnAnd bn(i1,j1) ≠ 0, it is s that the corresponding gradient direction of the pixel cell is intervaln(i1,j1);
(3) in binary image BnSecond pixel cell (i of nonzero element of middle selection2,j2)≠(i1,j1) so that 0.3Jn≤j2≤0.7JnAnd bn(i2,j2) ≠ 0, it is s that the corresponding gradient direction of the pixel cell is intervaln(i2,j2);If sn(i1, j1)≠sn(i2,j2), resampling, until sn(i1,j1)=sn(i2,j2), by two pixel cell (i1,j1) and (i2,j2) group Into a stochastical sampling pixel pair;
(4) repeated sampling, obtains L stochastical sampling pixel pair;
Step 4:Parameter is accumulated
Accumulative element distance is calculated, hough parameter spaces (ρ, θ) are set up, ρ and θ is respectively distance and angle in space Parameter;By two pixel cell (i of stochastical sampling1,j1) and (i2,j2) parameter space is projected to by random hough conversion, Calculate corresponding parameters unit (ρhoughhough);Ballot accumulation is carried out in corresponding accumulative element, makes correspondence collinear Sampled point can fall into identical accumulative element, obtain parameter and accumulate matrix H (ρ, θ), as shown in figure 8, wherein Fig. 8 (a) is three The three-dimensional histogram of dimension, Fig. 8 (b) is H (ρ, θ) to the two-dimentional display figure obtained after ρ-θ plane projections;It can be seen that by Accumulated in random hough conversion is employed, the parameter accumulation matrix for obtaining is sparse, and the method need to only carry out limited adopting The mapping of sample pixel can be achieved with the sparse accumulation on books border, therefore its amount of calculation is lower than traditional hough conversion;
Step 5:Peakvalue's checking
(1) according to detection threshold G1=0.3Jn, matrix H (ρ, θ) is accumulated to parameter and is detected that value is small in making H (ρ, θ) In G1Element value be zero;Consider books inclination angle, angle restriction value θ is setT=10 °, θ absolute values are less than θ in making H (ρ, θ)T Element value be zero, obtain result as shown in Figure 9;Understood with Fig. 8 (b) contrasts, after over-threshold detection and angle restriction, Fig. 9 In eliminate a large amount of unrelated accumulative elements;
(2) parameters unit (ρ that any one is not zero in H (ρ, θ)uv), define its local search area Ω (ρu, θv) be:Ω(ρuv)={ (ρ, θ) | [| | ρ-ρu| |≤5, θ=θv,H(ρ,θ)≠0]};
(3) next according to Ω (ρuv) judged:If Ω (ρuv) it is sky, parameters unit (ρuv) it is one Local peaking;If Ω (ρuv) it is not sky, if H (ρuv) value more than or equal to region Ω (ρuv) in all units Value:H(ρuv) >=H (ρ, θ), (ρ, θ) ∈ Ω (ρuv), then parameters unit (ρuv) it is a local peaking;
(4) H (ρ, θ) all of local peaking's unit is extracted, as shown in Figure 10, wherein white rectangle represents local peaking Position, carrying out counting to number of peaks can obtain t1=48, then subgraph P1The volumes of middle books is t1- 1=47, this and the subgraph The volumes of books is consistent as in;
Step 6:Counting is checked
When the value of n changes from 1 to N, for all of subgraph Pn, the process of repeat step 3 to step 5, detection The peak value number in all subgraph parameter accumulation matrixes is obtained, as shown in table 1:
The Book Inventory result of table 1
Image category Actual volumes
47 47 47
37 37 37
44 44 44
38 35 38
General image P 166 163 166
For the ease of comparing, table 1 is in angle restriction value θTValue be respectively 5 °, verified in 10 ° of environment, can be with Find out θTValue it is larger to the performance impact of method;For example, in subgraph P4In, because the inclination angle of part books is larger, when θTWhen value is smaller, missing inspection can be caused;By adjusting θTValue, the accuracy of Book Inventory can be improved, if books pendulum Being tried one's best when putting is disposed vertically books, and the effect that this method is checked is more preferable.
Problem is checked from what embodiment the result can be seen that the present invention solves books on frame well:First, root Frame information is extracted according to image edge pixels accumulation, so as to divide the image into multiple subgraphs, each subgraph is represented on bookshelf One spine image put in lattice;Then, it is empty in parameter by books boundary straight line in random hough Mapping implementations subgraph Between in Rapid Accumulation;Finally, local peaking is detected in parameter space, so as to realize each on bookshelf putting books volume in lattice Several countings are checked, and finally give the volumes of all books on bookshelf;The present invention preferably combines image procossing and random The advantage of hough conversion, the auto inventory of books on frame is realized using computer disposal;Method is simply efficient, it is easy to implement, greatly The big workload for reducing Book Inventory, with stronger practicality and application value.
The part that the present embodiment is not described in detail belongs to conventional means commonly understood in the industry, does not describe one by one here.

Claims (5)

1. a kind of Book Inventory method on frame converted based on image segmentation and random hough, it is characterised in that including following step Suddenly:
Step 1:Image preprocessing
Coloured image of the collection comprising bookshelf framework and spine, is modified to picture, obtains the consistent picture of horizontal direction, and Ensure that bookshelf framework takes entire image, the image is designated as P;With the image lower left corner as origin, x-y rectangular coordinate systems are set up, its Middle coordinate system x-axis direction overlaps with image lower boundary, and coordinate system y-axis direction overlaps with left picture boundary;I and j is made to be respectively figure As coordinate system x and y directions pixel cell sequence number, then P can be expressed as the form of picture element matrix Wherein p (i, j) is the pixel value at pixel cell (i, j) place, I be P in the total number of pixels in x directions, J is the total pixel in y directions Number;
Step 2:Image segmentation
Image P is converted into gray-scale map first, neighborhood differential treatment is carried out, the marginal information of image is extracted;Then, by pixel Integration detection obtains the position of bookshelf framework, so as to extract the boundary information that rectangle in bookshelf puts lattice;Finally, put according to rectangle The boundary information of lattice is put, image P is divided into N number of subgraph, during a rectangle puts lattice in each subgraph correspondence bookshelf Spine image, wherein n-th subgraph is designated as Pn
Step 3:Stochastical sampling
For n-th subgraph Pn, remember InIt is it in the total number of pixels in x directions, JnIt is it in the total number of pixels in y directions;It is first Image preprocessing is first carried out, the gradient direction α at pixel cell (i, j) place is extractedn(i,j);Then according to αnThe value of (i, j) will It is four sectors interval that gradient direction is evenly dividing, and carries out rim detection and obtain binary image Finally, two pixel cell (i are randomly selected from the interval of same sector1,j1) and (i2,j2) as a pixel pair, wherein i1 And j1Respectively first sampled pixel coordinate system x and y directions unit number, i2And j2Respectively second sampled pixel In the pixel cell sequence number in coordinate system x and y directions;
Step 4:Parameter is accumulated
Accumulative element distance is calculated, hough parameter spaces (ρ, θ) are set up, ρ and θ is respectively distance and angle parameter in space; By two pixel cell (i of stochastical sampling1,j1) and (i2,j2) parameter space is projected to by hough conversion, calculate corresponding Parameters unit (ρhoughhough), ρhoughAnd θhoughDistance and angle parameter after respectively hough conversion in parameter space; Corresponding accumulative element carries out ballot accumulation, the collinear sampled point of correspondence is fallen into identical accumulative element, obtains Parameter accumulates matrix H (ρ, θ);
Step 5:Peakvalue's checking
According to detection threshold, accumulating matrix H (ρ, θ) to parameter carries out Threshold detection, obtains the number t of local peaking in matrixn, Then subgraph PnThe volumes of middle books is tn-1;
Step 6:Counting is checked
When the value of n changes from 1 to N, for all of subgraph Pn, repeat step 3 to step 5 process, detection obtain institute There is the peak value number t that subgraph parameter is accumulated in matrixn, n=1,2 ..., N, then the volumes T of books is on whole bookshelf:
T = Σ n = 1 N ( t n - 1 ) ,
Wherein,Represent when the value of n changes from 1 to N to bracket in content carry out read group total.
2. Book Inventory method on a kind of frame converted based on image segmentation and random hough according to claim 1, its It is characterised by the image partition method described in step 2:
S21:Gray proces
Coloured image P is converted into 256 grades of gray-scale map, the gray-scale map is designated as F, it can be represented in x-y rectangular coordinate systems It is imaged the form of prime matrixWherein f (i, j) is the pixel value at pixel cell (i, j) place;
S22:Neighborhood differential treatment
For any pixel cell f (i, j), differential process are carried out by neighborhood unit pixel, calculate the gradient f in x directionsxWith y side To gradient fy
f x = f ( i , j ) + f ( i + 1 , j ) - f ( i , j + 1 ) - f ( i + 1 , j + 1 ) f y = - f ( i , j ) + f ( i + 1 , j ) - f ( i , j + 1 ) + f ( i + 1 , j + 1 ) ,
Then gradient magnitude of the image at coordinate unit (i, j) place isGradient direction be α (i, j)= arctan(fy/fx), wherein arctan () represents tan of negating;
S23:Extract edge local extremum
The local extremum of image border is extracted by non-maxima suppression, so as to reject the influence of part non-edge point;First, According to the value of α (i, j), it is four sectors interval that the gradient direction at pixel cell f (i, j) place is evenly dividing, and is represented respectively The gradient of horizontal direction, left-leaning direction, Right deviation direction and vertical direction:
Wherein, s (i, j) is the sector belonging to coordinate unit (i, j) place gradient direction, and π is the corresponding radian number in 180 ° of angles;So Afterwards, according to s (i, j) value, two 8 neighborhood coordinate units of the same gradient direction in coordinate unit (i, j) place are searched
Wherein,WithRespectively pixel cell sequence number of the two 8 neighborhood coordinate units of (i, j) in coordinate system x and y directions;Most Afterwards, by the neighborhood territory pixel of the gradient magnitude at coordinate unit (i, j) place and same gradient directionCompare, extract gradient magnitude Local maximum:
S24:Rim detection
Binary conversion treatment is carried out to gradient magnitude using dual threshold thresholding, if Low threshold thresholding is σlow, high threshold thresholding is σhigh, Rim detection is carried out to image and obtains binary imageWherein b (i, j) is pixel cell (i, j) place Binaryzation pixel value:
For gradient magnitude between σlowAnd σhighBetween coordinate unit (i, j), the value of b (i, j) is according to 8 neighborhood territory pixel units Gradient determine
Wherein, MmaxIt is the maximum of the neighborhood territory pixel unit gradient of coordinate unit (i, j) place 8;
S25:Framework is extracted
The edge of bookshelf framework is straight line both horizontally and vertically, and in framework the edge of books then exist it is more diagonal oblique Line, therefore treatment is filtered to binary image B using a diagonal matrix, obtain new pixel value:
B (i, j)=max [b (i, j), b (i-1, j-1), b (i+1, j+1), b (i-1, j+1), b (i+1, j-1)],
Wherein, max [] is represented and is taken maximum computing;Then bianry image is obtained into figure respectively to both horizontally and vertically projecting As accumulation parameter Q in the horizontal directionxThe accumulation parameter Q of (i) and vertical directiony(j):
Q x ( i ) = Σ j = 1 J b ( i , j ) Q y ( j ) = Σ i = 1 I b ( i , j ) ,
According to the horizontal detection threshold γ of accumulation parameterxWith vertical detection thresholding γy, extract QxI the corresponding sequence number of () valley is deposited Enter array Dx, extract QyJ the corresponding sequence number of () valley is stored in array Dy
D x = arg i ∈ [ 0 , I ] [ Q x ( i ) ≥ γ x ] D y = arg j ∈ [ 0 , J ] [ Q y ( j ) ≥ γ y ]
Wherein, arg [] represents the sequence number for taking and meeting constraints [], then DxData correspondence bookshelf framework is in the horizontal direction Coordinate, DyCoordinate of the data correspondence bookshelf framework in vertical direction;
S26:Segmentation figure picture
Next original image is divided into multiple subgraphs, each subgraph correspondence bookshelf gets on during a rectangle puts lattice Spine image;First, the position coordinates D of bookshelf framework is extractedxAnd Dy, so as to realize putting each rectangle in bookshelf the positioning of lattice; Then, the border that lattice are put according to rectangle is split to coloured image P, obtains multiple subgraphs, realizes dividing for original image Cut treatment:
Wherein N is the total number of subgraph, PnRepresent n-th subgraph.
3. Book Inventory method on a kind of frame converted based on image segmentation and random hough according to claim 1, its It is characterised by the stochastical sampling method described in step 3:
S31:Image preprocessing
According to the method for step S22 to subgraph PnPre-processed, obtained the gradient direction α at pixel cell (i, j) placen(i, j);Then according to the method for step S23 by αnIt is four sectors interval that (i, j) is evenly dividing;Use sn(i, j) represents subgraph Pn The sector belonging to gradient direction at coordinate unit (i, j) place;Method according to step S24 carries out rim detection and obtains binaryzation ImageWherein bn(i, j) is subgraph PnIn the binaryzation pixel value at pixel cell (i, j) place;
S32:Choose first pixel
In binary image BnIn randomly select a pixel cell (i for nonzero element1,j1) so that 0.3Jn≤j1≤0.7Jn And bn(i1,j1) ≠ 0, it is s that the corresponding gradient direction of the pixel cell is intervaln(i1,j1);
S33:Choose second pixel point
In binary image BnSecond pixel cell (i of nonzero element of middle selection2,j2)≠(i1,j1) so that 0.3Jn≤j2≤ 0.7JnAnd bn(i2,j2) ≠ 0, it is s that the corresponding gradient direction of the pixel cell is intervaln(i2,j2);
If sn(i1,j1)=sn(i2,j2), carry out step S34;
If sn(i1,j1)≠sn(i2,j2), repeat step S33, until sn(i1,j1)=sn(i2,j2), carry out step S34;
S34:Composition stochastical sampling pixel pair
By two pixel cell (i1,j1) and (i2,j2) one stochastical sampling pixel pair of composition;
S35:Terminate sampling
Repeat step S32~S34, obtains L stochastical sampling pixel pair.
4. Book Inventory method on a kind of frame converted based on image segmentation and random hough according to claim 1, its It is characterised by the parameter accumulation method described in step 4:
S41:Set up parameter accumulation space:
Sliding-model control is carried out to parameter ρ and θ according to discrete interval △ ρ and △ θ, parameter space (ρ, θ) is formed, (u, v) is individual The central point parameter of parameters unit is ρuAnd θv
ρu=(u-1/2) △ ρ, u=1,2 ..., U,
θv=(v-1/2) △ θ-pi/2, v=1,2 ..., V,
Wherein, u and v are respectively the sequence number of parameter ρ and θ, the parameters unit number V values point of parameters unit the number U and θ of ρ It is not:V=Int (π/△ θ), Int () represent rounding operation, and π is the corresponding radian in 180o angles Number;
S42:Set up parameter accumulation matrix
According to the parameter space (ρ, θ) of definition, set up parameter and accumulate matrix H (ρ, θ), it is 0 to put each unit initial value;
S43:Image border is mapped to parameter space
By first pixel of stochastical sampling to (i1,j1) and (i2,j2) parameter space is projected to by hough conversion, calculating should Pixel is to identified parameter ρhoughAnd θhough
θhough=arctan [- (i1-i2)/(j1-j2)];
ρhough=0.5 (i1+i2)cos(θhough)+0.5(j1+j2)sin(θhough);
S44:Ballot accumulation
Corresponding unit (ρ is searched in parameter space (ρ, θ)uv) so that | | ρhoughu||≤△ρ,||θhoughv||≤ △ θ, wherein | | | | absolute value is sought in expression;
If (ρuv) exist, then enter line parameter in the corresponding units of parameter accumulation matrix H (ρ, θ) and add up:H(ρuv)=H (ρuv)+1;
Otherwise, by (ρhoughhough) insertion parameter space (ρ, θ), and take initial value H (ρhoughhough)=1;
S45:Terminate accumulation
Repeat step S43~S44, until L stochastical sampling pixel is to being mapped to parameter space, obtains parameter accumulation matrix H (ρ,θ)。
5. Book Inventory method on a kind of frame converted based on image segmentation and random hough according to claim 1, its It is characterised by the peak-value detection method described in step 5:
S51:Threshold detection
According to detection threshold G1, matrix H (ρ, θ) accumulating to parameter and is detected, value is less than G in making H (ρ, θ)1Element value be Zero, detection threshold is set to G1=0.3Jn
S52:Angle restriction
Consider books inclination angle, angle restriction value θ is setT, parameter θ absolute value is less than θ in obtaining H (ρ, θ)TUnit, make the list First respective element value is zero;
S53:Local Search
Parameters unit (the ρ that any one is not zero in H (ρ, θ)uv), define its local search area Ω (ρuv) be:
Ω(ρuv)={ (ρ, θ) | [| | ρ-ρu| |≤5, θ=θv,H(ρ,θ)≠0]};
S54:Peak extraction
Next according to Ω (ρuv) judged:
If 1) Ω (ρuv) it is sky, then parameters unit (ρuv) it is a local peaking;
If 2) Ω (ρuv) it is not sky, if H (ρuv) value be more than or equal to Ω (ρuv) in all units value, i.e., Meet:
H(ρuv) >=H (ρ, θ), (ρ, θ) ∈ Ω (ρuv),
Then parameters unit (ρuv) it is a local peaking;
S55:Peak counting
Repeat step S53~S54, extracts H (ρ, θ) all of local peaking's unit, calculates the number t of local peakingn, then subgraph As PnThe volumes of middle books is tn-1。
CN201710057749.3A 2017-01-23 2017-01-23 A kind of Book Inventory method on the frame converted based on image segmentation and random hough Active CN106846354B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710057749.3A CN106846354B (en) 2017-01-23 2017-01-23 A kind of Book Inventory method on the frame converted based on image segmentation and random hough

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710057749.3A CN106846354B (en) 2017-01-23 2017-01-23 A kind of Book Inventory method on the frame converted based on image segmentation and random hough

Publications (2)

Publication Number Publication Date
CN106846354A true CN106846354A (en) 2017-06-13
CN106846354B CN106846354B (en) 2019-07-23

Family

ID=59121259

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710057749.3A Active CN106846354B (en) 2017-01-23 2017-01-23 A kind of Book Inventory method on the frame converted based on image segmentation and random hough

Country Status (1)

Country Link
CN (1) CN106846354B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109544577A (en) * 2018-11-27 2019-03-29 辽宁工程技术大学 A kind of improvement lines detection method based on marginal point marshalling
CN111898555A (en) * 2020-07-31 2020-11-06 上海交通大学 Book checking identification method, device, equipment and system based on images and texts
CN111967526A (en) * 2020-08-20 2020-11-20 东北大学秦皇岛分校 Remote sensing image change detection method and system based on edge mapping and deep learning
CN113507546A (en) * 2021-06-01 2021-10-15 暨南大学 Image encryption method based on DCT-64
CN113642406A (en) * 2021-07-14 2021-11-12 广州市玄武无线科技股份有限公司 System, method, device, equipment and storage medium for counting densely hung paper sheets

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2199976A3 (en) * 2008-11-10 2012-05-09 FUJIFILM Corporation Image processing method, image processing apparatus and image processing program
CN103295034A (en) * 2013-04-30 2013-09-11 中南大学 Embedded type system and method for checking books being placed on shelf disorderly based on DSP
CN103777187A (en) * 2014-01-15 2014-05-07 杭州电子科技大学 Weak target track-before-detect method based on traversal random Hough conversion
CN104182934A (en) * 2014-08-06 2014-12-03 西安电子科技大学 Automatic book counting method based on spine image characteristics and spatial filtering
CN104808173A (en) * 2015-05-14 2015-07-29 中国人民解放军海军航空工程学院 Hough transformation-based false point elimination method for direction-finding cross location system
CN105354610A (en) * 2014-08-18 2016-02-24 无锡慧眼电子科技有限公司 Random Hough transform-based people counting method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2199976A3 (en) * 2008-11-10 2012-05-09 FUJIFILM Corporation Image processing method, image processing apparatus and image processing program
CN103295034A (en) * 2013-04-30 2013-09-11 中南大学 Embedded type system and method for checking books being placed on shelf disorderly based on DSP
CN103777187A (en) * 2014-01-15 2014-05-07 杭州电子科技大学 Weak target track-before-detect method based on traversal random Hough conversion
CN104182934A (en) * 2014-08-06 2014-12-03 西安电子科技大学 Automatic book counting method based on spine image characteristics and spatial filtering
CN105354610A (en) * 2014-08-18 2016-02-24 无锡慧眼电子科技有限公司 Random Hough transform-based people counting method
CN104808173A (en) * 2015-05-14 2015-07-29 中国人民解放军海军航空工程学院 Hough transformation-based false point elimination method for direction-finding cross location system

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
YU HONGBO等: "Fusion based particle filter TBD algorithm for dim targets", 《 CHINESE JOURNAL OF ELECTRONICS》 *
张江鑫等: "快速随机hough变换多直线检测算法", 《浙江工业大学学报》 *
李芳等: "随机Hough变换在高压输电线检测中的应用", 《软件导刊》 *
王国宏等: "基于点集合并的修正 Hough 变换 TBD 算法", 《航空学报》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109544577A (en) * 2018-11-27 2019-03-29 辽宁工程技术大学 A kind of improvement lines detection method based on marginal point marshalling
CN109544577B (en) * 2018-11-27 2022-10-14 辽宁工程技术大学 Improved straight line extraction method based on edge point grouping
CN111898555A (en) * 2020-07-31 2020-11-06 上海交通大学 Book checking identification method, device, equipment and system based on images and texts
CN111898555B (en) * 2020-07-31 2023-05-19 上海交通大学 Book checking identification method, device, equipment and system based on images and texts
CN111967526A (en) * 2020-08-20 2020-11-20 东北大学秦皇岛分校 Remote sensing image change detection method and system based on edge mapping and deep learning
CN111967526B (en) * 2020-08-20 2023-09-22 东北大学秦皇岛分校 Remote sensing image change detection method and system based on edge mapping and deep learning
CN113507546A (en) * 2021-06-01 2021-10-15 暨南大学 Image encryption method based on DCT-64
CN113507546B (en) * 2021-06-01 2023-07-18 暨南大学 DCT-64-based image encryption method
CN113642406A (en) * 2021-07-14 2021-11-12 广州市玄武无线科技股份有限公司 System, method, device, equipment and storage medium for counting densely hung paper sheets

Also Published As

Publication number Publication date
CN106846354B (en) 2019-07-23

Similar Documents

Publication Publication Date Title
CN106846354A (en) A kind of Book Inventory method on frame converted based on image segmentation and random hough
CN111814722B (en) Method and device for identifying table in image, electronic equipment and storage medium
CN108647681B (en) A kind of English text detection method with text orientation correction
Hauagge et al. Image matching using local symmetry features
CN108805076B (en) Method and system for extracting table characters of environmental impact evaluation report
CN102254159B (en) Interpretation method for digital readout instrument
CN103793708B (en) A kind of multiple dimensioned car plate precise positioning method based on motion correction
CN111598770A (en) Object detection method and device based on three-dimensional data and two-dimensional image
CN103824373B (en) A kind of bill images amount of money sorting technique and system
CN106250895A (en) A kind of remote sensing image region of interest area detecting method
CN107918953B (en) Three-dimensional space-based laser scanning power line point cloud extraction method and device
CN113392856B (en) Image forgery detection device and method
CN113643365B (en) Camera pose estimation method, device, equipment and readable storage medium
CN111460927A (en) Method for extracting structured information of house property certificate image
CN110335280A (en) A kind of financial documents image segmentation and antidote based on mobile terminal
CN106909869A (en) A kind of sampling grid partitioning method and device of matrix two-dimensional code
CN114529773A (en) Form identification method, system, terminal and medium based on structural unit
CN112308040A (en) River sewage outlet detection method and system based on high-definition images
CN116052105A (en) Pavement crack identification classification and area calculation method, system, equipment and terminal
CN103106412B (en) Flaky medium recognition methods and recognition device
CN106324708B (en) Digitizing solution, the device of rainfall record drawing
CN104182934A (en) Automatic book counting method based on spine image characteristics and spatial filtering
CN107066997B (en) A kind of electrical component price quoting method based on image recognition
CN108388920B (en) HOG and LBPH characteristic fused identity card copy detection method
CN112418210A (en) Intelligent classification method for tower inspection information

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
TA01 Transfer of patent application right

Effective date of registration: 20190627

Address after: 264001 scientific research office, two Road 188, Zhifu District, Yantai, Shandong

Applicant after: Naval Aviation University of PLA

Address before: 264001 scientific research department, two Road 188, Yantai, Shandong

Applicant before: Naval Aeronautical Engineering Institute PLA

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant