Last year has been doing a book on the collection of the app, there are about this app currently has a ' sun study ', but there is no use of image processing related knowledge, only a sweep ISBN code entrance, or manual entry ISBN; there is a ' Shelfie ', not only can sweep the book code, and can be directly to the bookshelf to take pictures, to identify, although the speed is a bit slow, but the accuracy is good; so we expect to do a full-featured and upgrade the speed of such a bookshelf app.
About Bookshelf Book recognition, mainly divides into two big steps: spine segment,and,recognition; The image recognition, the method has many, commonly used is the OCR and the library match, here does not intend to repeat, The main review of the spine of the cutting algorithm, do a summary;
(Note: This app is mainly for the home bookshelf, the library, or even a few books on hand, can be taken into account, considering that there are many kinds of books, but mainly vertical placement of the majority, but there are also a lot of cluttered shelves, so probably can be divided into four kinds of situation, vertical, horizontal, slightly left tilt, Slightly to the right tilt, in fact, see the main point is an angle of the problem. )
Step1: pretreatment, including image scaling, grayscale, adaptive histogram equalization, edge extraction, etc.
Step2: (spine) line detection, here is the key, the straight line of good or bad and how much directly affect the subsequent cutting results; There are many methods of line detection, we have tried three ways in practice, respectively,
1 The linear detection operator with CV;
Figure A
Figure B is clearly visible and is shown directly on the black background map.
2 CV self-band Houghline;
Figure C
Figure D
3 self-rewriting of the Hough line detection;
Figure E My
Figure F matlab
By comparison, it is not difficult to find that method 1 get the straight line more messy, relatively fragmented, according to the need to filter in accordance with angle and length, and need to block and fit, not conducive to follow-up work, the need for a large number of heavy (to go heavy is a pit, haha) work; the effect of Law 2 is not ideal, The edge of the spine will check out a lot of non-spine edge line, and for figure C such a spine, the effect of abnormal, with the houghline of MATLAB is simply impossible to compare; Method 3 is based on the idea of peak detection, their own implementation and rewrite the Hough, the effect can be comparable with MATLAB, or even , and such a straight line to the back of the heavy pressure will be reduced very much, because the line is more neat and clean;
Ste3: Straight line sorting;
Step4: Cutting segment, that is, find the spine PR box, if the original Hough straight line to the cut, there may be superfluous parts of the spine, and we do not need these non-spine parts, we need to locate the actual spine of the effective part, so need to cut, The method of cutting is the energy growth method; The main idea of energy growth is to start with a minimal projection rectangle (a small part of the spine), to determine whether or not to stop growing or continue to grow according to the magnitude of the power value of the rectangular line at both ends.
Finally, paste the segment results.
Reprint Please indicate the source, thank you for your cooperation.