CN113962902A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN113962902A
CN113962902A CN202111406615.0A CN202111406615A CN113962902A CN 113962902 A CN113962902 A CN 113962902A CN 202111406615 A CN202111406615 A CN 202111406615A CN 113962902 A CN113962902 A CN 113962902A
Authority
CN
China
Prior art keywords
target object
image
original image
position information
computer
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.)
Pending
Application number
CN202111406615.0A
Other languages
Chinese (zh)
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.)
Hangzhou Eastcom Software Technology Co ltd
Original Assignee
Hangzhou Eastcom Software Technology Co ltd
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 Hangzhou Eastcom Software Technology Co ltd filed Critical Hangzhou Eastcom Software Technology Co ltd
Priority to CN202111406615.0A priority Critical patent/CN113962902A/en
Publication of CN113962902A publication Critical patent/CN113962902A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The application provides an image processing method and device, and relates to the technical field of image processing. Wherein the method comprises the following steps: acquiring an original image, wherein the original image comprises a target object, and the target object is presented in the original image in a tilted posture; identifying a target object; and correcting the posture of the target object, and performing detail restoration to obtain a corrected and restored rich and clear image. In the application, if the target object in the original image is presented in the original image in the inclined posture, the target object is prevented from being unclear due to posture inclination through inclination correction of the target object.

Description

Image processing method and device
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image processing method and apparatus.
Background
With the development of camera technology, images shot by a camera are closer to a real scene. However, an image captured by a camera is not only related to hardware and software of the camera, but also related to a user photographing technology, and if a user does not photograph a target object at a correct angle or direction, the target object captured by the camera appears in an inclined posture in the image, which causes distortion of some small parts, marks, symbols and other contents on the target object and makes the target object unrecognizable. Therefore, a solution to the problem that the user does not distort the content in the image due to the angle or orientation of the photograph is needed.
Disclosure of Invention
In order to solve the above problem, embodiments of the present application provide an image processing method and apparatus, which perform overexposure or underexposure processing, tilt correction, component and symbol recognition and detail compensation on an image captured by a camera, so that the captured original image can clearly present a target object.
Therefore, the following technical scheme is adopted in the embodiment of the application:
in a first aspect, an embodiment of the present application provides an image processing method, including: acquiring an original image, wherein the original image comprises a target object, and the target object is presented in the original image in a tilted posture; identifying the target object; and correcting the posture of the target object to obtain a corrected image.
In one embodiment, the method further comprises: and segmenting the target object from the corrected image to obtain a target object image.
In one embodiment, before the identifying the target object, the method further includes: detecting a gray value in the original image; and when the gray value of the original image is not in the range of the set threshold value, carrying out overexposure or underexposure treatment on the original image.
In one embodiment, the method further comprises: and inputting the target object image into a Hough circle transformation algorithm to obtain the position information of the circular component in the target object image.
In one embodiment, the method further comprises: and determining the position information of other parts except the circular part on the target object image according to the position information of the circular part in the target object image and the arrangement characteristics of all parts on the target object.
In one embodiment, the method further comprises: inputting the target object image and the position information of each component on the target object image into a mobilenetv1 model, and determining the type of each component in the target object.
In one embodiment, the method further comprises: and determining the position information of each identification on the target object image according to the position information of each component on the target object image and the association characteristics between the identification on the target object and each component on the target object, wherein the identification is one or more of characters, letters and symbols.
In one embodiment, the method further comprises: and inputting the target object image and the position information of each identifier on the target object image into a pytesseract library, and identifying each identifier in the target object.
In a second aspect, an embodiment of the present application provides an image processing apparatus, including: a transceiving unit, configured to acquire an original image, where the original image includes a target object, and the target object is presented in the original image in a tilted posture; a processing unit for identifying the target object; and correcting the posture of the target object to obtain a corrected image.
In an embodiment, the processing unit is further configured to segment the target object from the corrected image to obtain a target object image.
In one embodiment, the processing unit is further configured to detect a gray value in the original image; and when the gray value of the original image is not in the range of the set threshold value, carrying out overexposure or underexposure treatment on the original image.
In one embodiment, the processing unit is further configured to input the target object image into a hough circle transformation algorithm, so as to obtain position information of the circular component in the target object image.
In one embodiment, the processing unit is further configured to determine position information of other parts on the target object image except for the circular part according to the position information of the circular part in the target object image and the arrangement characteristics of the parts on the target object.
In one embodiment, the processing unit is further configured to input the target object image and position information of each component on the target object image into a mobilenetv1 model, and determine a type of each component in the target object.
In an embodiment, the processing unit is further configured to determine, according to the position information of each component on the target object image and the association characteristics between the identifier on the target object and each component on the target object, the position information of each identifier on the target object image, where the identifier is one or more of a character, a letter, and a symbol.
In one embodiment, the processing unit is further configured to input the target object image and location information of each identifier on the target object image into a pytesseract library, and identify each identifier in the target object.
In a third aspect, an embodiment of the present application provides a terminal device, including: at least one transceiver, at least one memory, at least one processor for performing embodiments as various possible implementations of the first aspect.
In a fourth aspect, this application provides in an embodiment a computer-readable storage medium, on which a computer program is stored, which, when executed in a computer, causes the computer to perform various possible implementation examples as in the first aspect.
In a fifth aspect, this application provides a computer program product, which is characterized in that the computer program product stores instructions that, when executed by a computer, cause the computer to implement the embodiments as each possible implementation of the first aspect.
In the method, if the original image shot by the camera has the overexposure or underexposure problem, the brightness compensation can be firstly carried out on the original image, so that the definition of the whole image is improved and the image is closer to a real image; if the target object in the original image is presented in the original image in the inclined posture, the target object is prevented from being unclear due to the inclined posture through the inclination correction of the target object, then each part and each mark on the target object are recognized, and each part and each mark are compensated, so that each detail in the corrected image is clearer.
Drawings
The drawings that accompany the detailed description can be briefly described as follows.
Fig. 1 is a flow chart of an image processing method provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of an image processing method provided in an embodiment of the present application;
FIG. 3 is an original image including a photobox provided in an embodiment of the present application;
FIG. 4(a) is an under-exposed original image provided in an embodiment of the present application;
FIG. 4(b) is an overexposed original image provided in the embodiments of the present application;
FIG. 5 is a perspective transformation schematic;
FIG. 6 is a drawing of a corrected and segmented patch panel for an optical cross-connect box as provided in an embodiment of the present application;
FIG. 7 is a schematic diagram of five ports provided in an embodiment of the present application;
FIG. 8 is a schematic diagram of a partition for identifying a circular port provided in an embodiment of the present application;
FIG. 9 is a schematic diagram of the identification of all ports on a patch panel as provided in an embodiment of the present application;
FIG. 10 is a block diagram illustrating an architecture of an image processing apparatus according to an embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of a terminal device in an embodiment of the present application.
Detailed Description
The term "and/or" herein is an association relationship describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. The symbol "/" herein denotes a relationship in which the associated object is or, for example, a/B denotes a or B.
The terms "first" and "second," and the like, in the description and in the claims herein are used for distinguishing between different objects and not for describing a particular order of the objects. For example, the first response message and the second response message, etc. are for distinguishing different response messages, not for describing a specific order of the response messages.
In the embodiments of the present application, words such as "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
In the description of the embodiments of the present application, unless otherwise specified, "a plurality" means two or more, for example, a plurality of processing units means two or more processing units, or the like; plural elements means two or more elements, and the like.
Fig. 1 and fig. 2 are flowcharts of an image processing method provided in an embodiment of the present application. As shown in the figure, the method is implemented by the following specific steps:
in step S201, an original image is acquired.
In the present application, an acquired original image is generally obtained by photographing by a user, and due to a photographing technology of the user, an image shown in fig. 3 may appear in the obtained original image, and since an angle and an orientation of the original image are not directly opposite to a target object when the user photographs, that is, an optical cross connecting box in the figure, the optical cross connecting box is presented in the original image in an inclined posture, so that a port on the optical cross connecting box and remarked characters of the port cannot be clearly seen, and therefore, correction processing needs to be performed in the original image.
If the resulting original image appears as an image as shown in fig. 4(a), there is an overexposure problem, or if an image as shown in fig. 4(b) appears, there is an underexposure problem. Whether the original image has the problem of overexposure or underexposure, the problems that the original image cannot reflect a real scene, details in the image are unclear and the like are further aggravated.
Alternatively, overexposure or underexposure processing may be required on the original image before the original image correction processing. The overexposure or underexposure processing of the image is specifically as follows: inputting an image, segmenting the image, extracting information in an image region and extracting information of a region, estimating a brightness value between regions, calculating a brightness level change statistic, fitting a brightness level change curve, adjusting details and outputting the image. Firstly, averagely dividing the brightness of an acquired image into ten grades, and dividing the whole image into a plurality of sub-images; and then converting the image into information for acquiring and processing the regions forming the image, defining a Markov random field energy function of the image by taking the edge details of the image as a target according to the brightness values of the regions before and after compensation, and obtaining the optimal average brightness value of each region through a particle swarm optimization algorithm. Then, correcting the brightness value amplification of the image at each brightness level by utilizing the statistical information of the region; and finally, fitting by using a least square method to obtain a brightness mapping curve of the image, and performing compensation adjustment on the brightness of the image in different areas to recover the image details. Through the processed image, experimental results show that the algorithm improves the visual display effect of the image, so that the image is more real and the details are clearer. An application experiment aiming at the light intersection image processing shows that the technical scheme can effectively solve the problems of under exposure and over exposure of the image and recover the details of the over exposure and under exposure areas of the image.
In step S202, a target object is identified.
In the application, the target object can be identified actively by a person, or the image can be input into a neural network for identification, so that the target object in the original image can be identified. Optionally, taking neural network identification as an example, the method can be divided into four steps, specifically:
1. image pre-processing
Image preprocessing requires geometric specifications such as translation, rotation and scaling of an image, so that image recognition can be fast and accurate. Meanwhile, the main purpose of image filtering is to perform noise cancellation in a state of maintaining image characteristics, which can be divided into linear filtering and nonlinear filtering. Compared with linear filtering, nonlinear filtering can protect image details while denoising, and is a hotspot studied in an image filtering method. The nonlinear filter is typified by kalman filter and particle filter.
2. Image segmentation
Image segmentation is an important problem for realizing automatic recognition and analysis of machine vision images, and the segmentation quality of the image segmentation has an important influence on the analysis of subsequent images. The rapid and accurate segmentation of the feature target from the complex image is always the research focus of scholars at home and abroad. Image segmentation can take 3 approaches, namely region segmentation, boundary segmentation and boundary formation segmentation.
3. Feature extraction
As an intermediate node of the target recognition of the machine vision image, the feature extraction has important influence on the accuracy and speed of the target recognition. Useful features are extracted from complex image information, and the method plays a decisive role in realizing target recognition of machine vision. According to different classification methods, the image features can be classified into various types, for example, the image features can be classified into global features and local features according to the size of a region, and the image features can be classified into moment features, contour features, texture features and the like according to statistical features. Compared with the global characteristics, the local characteristics are used for describing the image target in a complex background very efficiently, and common detection methods comprise sparse selection, dense selection and other methods.
4. Object recognition
After the feature sequence of the target image is obtained, the feature sequence can be input into the trained neural network model for training, and the target in the target image is identified. In the present application, the selected neural network model may be a Convolutional Neural Network (CNN) model, a convolutional Recurrent Neural Network (RNN) model, or the like. Illustratively, taking the CRNN model as an example, the network architecture thereof is composed of three parts, including a convolutional layer, a loop layer and a transcription layer (from bottom to top). At the bottom of the CRNN model, the convolutional layer automatically extracts a characteristic sequence from each input image, a cyclic network layer for predicting each frame of the convolutional layer characteristic sequence is constructed on the convolutional network layer, and a transcription layer at the top of the CRNN model converts the frame prediction output by the cyclic layer into a tag sequence.
And step S203, correcting the inclination angle of the target object by using a perspective transformation algorithm to obtain a corrected image.
In the present application, the original image is subjected to an inclination angle correction mode, which mainly adopts a perspective transformation principle, wherein perspective transformation, also called projection transformation, refers to transformation that a shadow bearing surface (perspective surface) rotates around a trace line (perspective axis) by a certain angle according to a perspective rotation law under the condition that three points of a perspective center, an image point and a target point are collinear, so as to destroy an original projection light beam and still keep a projection geometric figure on the shadow bearing surface unchanged, as shown in fig. 5.
The perspective transformation matrix transformation formula is:
Figure BDA0003372480350000041
wherein the perspective transformation matrix is:
Figure BDA0003372480350000042
the points to be moved, i.e. the source target points, are:
Figure BDA0003372480350000043
in addition, the fixed points, i.e. the target points moved to, are:
Figure BDA0003372480350000051
since the perspective transformation is a transformation from two-dimensional space to three-dimensional space, the image is in a two-dimensional plane, divided by Z, where (X ', Y ', Z ') represents a point on the image:
Figure BDA0003372480350000052
Figure BDA0003372480350000053
let a33When the above formula is developed as 1, one point is obtained:
Figure BDA0003372480350000054
the 4 points can obtain 8 equations, i.e. a can be solved as:
Figure BDA0003372480350000055
in the application, the perspective principle is utilized to convert the problem of image correction into the transformation from an image on one object plane to an image on another object plane, so as to deduce the correction mode of perspective distortion images, namely, points on one plane are transformed to points on the other plane, and the original image shown in the figure 3 can be subjected to inclination correction. Alternatively, if the ratio of the target object in the original image is relatively small, the corrected original image may be segmented to obtain an image of only the target object, and the segmented effect is as shown in fig. 6.
Taking a target object as an example of a light distribution box wiring board, after the wiring board is corrected, each wiring port on the wiring board and a character mark corresponding to each port may be smaller, and the corrected wiring board may still have an unclear problem, so that each detail on the wiring board needs to be further processed.
As shown in fig. 7, the ports on the patch panel of the optical cross-connect box are divided into a red cap port, a white cap port, a patch cord port, a damaged port, and a shielded port. The red cap port, the white cap port and the wire plugging port are generally circular, so that circular features in an image can be searched through Hough circle transformation, and the positions of the red cap port, the white cap port and the wire plugging port on the wiring board of the light-emitting cross box can be searched, such as the ports of the red circle part in fig. 8; and the structural arrangement characteristics of the box body ports are utilized, so that damaged ports and shielded ports on the wiring board of the light-emitting cross box can be found through the intersection point position of the connecting lines of the circle centers of the transverse rows, such as ports except red circles in the cross in fig. 9.
Finally, the character that the letter, word or other mark position is positioned at the right end of each row of the light cross box can be reused, and the position area of the letter, word or other mark can be cut out by using the region of interest (ROI). Alternatively, the image of the target object and the position information of each port may be input to the ROI algorithm, and the position information of each marker on the image of the target object may be obtained. In machine vision and image processing, a region to be processed is outlined from a processed image in the form of a square, a circle, an ellipse, an irregular polygon, or the like, and is called ROI. The ROI belongs to one of Intelligent Video Encoding (IVE) technologies, the IVE technology can intelligently encode videos according to requirements of customers, the video encoding performance is optimized on the premise of not losing image quality, and finally the network bandwidth occupancy rate is reduced and the storage space is reduced. In the monitoring picture, some monitoring areas are monitoring objects which are not needed to be monitored or are irrelevant, such as sky, walls, grasslands and the like, and the common network monitoring camera performs video coding (compression) and transmission on the whole area, so that pressure is brought to network bandwidth and video storage. The ROI intelligent video coding technology well solves the problem, a camera with the ROI function can enable a user to select an interested area in a picture, after the ROI function is started, important or moving areas are subjected to high-quality lossless coding, the code rate and the image quality of the non-moving and non-selected areas are reduced, standard definition video compression is carried out, even the video of the area is not transmitted, and the purposes of saving network bandwidth occupation and video storage space are achieved.
After the positions of the ports on the patch panel of the optical cross-connect box are obtained, the ports need to be identified and classified, so that five kinds of ports shown in fig. 7 are obtained. Illustratively, the target object image and the position information of each port shown in fig. 6 may be input into the mobilenetv1 network, and the ports in fig. 6 may be classified into a red-hat port, a white-hat port, a plugged-line port, a damaged port, and an occluded port according to the shapes and sizes corresponding to the different types of ports defined in the mobilenetv1 network. The corresponding parameters between the two parameters of the shape and the size corresponding to the ports of different types in the mobilenetv1 network are as follows:
TABLE 1 Mobilenetv1 network model Structure
Figure BDA0003372480350000061
After obtaining the position information of each letter, character or other mark on the wiring board of the optical cross-connect box, each mark needs to be identified. Exemplarily, a tesseract library of an open source of python may be called, and by using the characteristic that the open source pytesseract library in python can identify Chinese and English letters, the position information of the target object image and each identifier shown in fig. 6 is input into the tesseract library for identification, and the meaning represented by the letters, the characters or other identifiers is identified.
In the embodiment of the application, after the port types and the meanings of letters, characters or other marks on the wiring board of the optical cross-connect box are recognized, the corrected target object image shown in fig. 6 can be further processed, and the detail part in the image is filled, so that the target object image is clearer.
The scheme of this application embodiment protection can use in the maintenance scene of optical cable light traffic case, the personnel of patrolling and examining, the workman can be shot the wiring board of light traffic case, then send the image for maintainer, maintainer can handle the image through the terminal that has above-mentioned protection scheme of storage, can obtain very clear image, then can be according to the content in the image, judge whether the light traffic case has the damage, can avoid maintainer to each light traffic case witnessed inspections, can effectively reduce the human cost.
Fig. 10 is a schematic diagram illustrating an architecture of an image processing apparatus according to an embodiment of the present application. As shown in fig. 10, the apparatus 1000 includes a transceiver 1001 and a processing unit 1002. The cooperative working process among all units is as follows:
the transceiving unit 1001 is configured to acquire an original image, where the original image includes a target object, and the target object is present in the original image in a tilted posture; the processing unit 1002 is configured to identify the target object; and correcting the posture of the target object to obtain a corrected image.
In one embodiment, the processing unit 1002 is further configured to segment the target object from the corrected image to obtain a target object image.
In one embodiment, the processing unit 1002 is further configured to detect a gray value in the original image; and when the gray value of the original image is not in the range of the set threshold value, carrying out overexposure or underexposure treatment on the original image.
In one embodiment, the processing unit 1002 is further configured to input the target object image into a hough circle transformation algorithm, and obtain position information of the circular component in the target object image.
In one embodiment, the processing unit 1002 is further configured to determine position information of other parts on the target object image except for the circular part according to the position information of the circular part in the target object image and the arrangement characteristics of the parts on the target object.
In one embodiment, the processing unit 1002 is further configured to input the target object image and position information of each component on the target object image into a mobilenetv1 model, and determine the type of each component in the target object.
In one embodiment, the processing unit 1002 is further configured to determine the position information of each identifier on the target object image according to the position information of each component on the target object image and the association characteristics between the identifier on the target object and each component on the target object, where the identifier is one or more of characters, letters, and symbols.
In one embodiment, the processing unit 1002 is further configured to input the target object image and location information of each identifier on the target object image into a pytesseract library, and identify each identifier in the target object.
Fig. 11 is a schematic structural diagram of a terminal device provided in an embodiment of the present application. As shown in fig. 11, the terminal device 1100 includes a transceiver 1101, a memory 1102, a processor 1103, and a bus 1104. The transceiver 1101, the memory 1102 and the processor 1103 are communicatively connected by a bus 1104, respectively, to achieve mutual communication.
The transceiver 1101 can implement, among other things, input (reception) and output (transmission) of signals. For example, the transceiver 1101 may include a transceiver or a radio frequency chip. The transceiver 1101 may also include a communication interface. For example, the terminal device 1100 may receive a control instruction sent by an external device such as a mobile phone, a camera, a video camera, a cloud, etc. through the transceiver 1101, and may also send an execution instruction to another device through the transceiver 1101.
The memory 1102 may have stored thereon programs (which may also be instructions or code) that are executable by the processor 1102 to cause the processor 1103 to perform the functions shown in fig. 1-9. Optionally, the memory 1102 may also have data stored therein. For example, the processor 1103 may read data stored in the memory 1102, the data may be stored at the same memory address as the program, or the data may be stored at a different memory address from the program. In this embodiment, the processor 1103 and the memory 1102 may be separately disposed, or may be integrated together, for example, on a single board or a System On Chip (SOC).
The processor 1103 may be a general-purpose processor or a special-purpose processor. For example, the processor 1103 may include a Central Processing Unit (CPU) and/or a baseband processor.
Illustratively, the processor 1103 is mainly used for processing the overexposure or underexposure of the picture, which may occur when the inspection personnel takes the image due to photographing. In the method, the brightness of the collected image is averagely divided into ten grades, and the whole image is divided into a plurality of sub-regions; and then, converting the image into the information collected by the regions forming the image and processing the information, defining a Markov random field energy function of the image by taking the edge details of the image as a target according to the brightness values of the regions before and after compensation, and obtaining the optimal average brightness value of each region through a particle swarm optimization algorithm. Then, correcting the brightness value amplification of the image at each brightness level by utilizing the statistical information of the region; and finally, fitting by using a least square method to obtain a brightness mapping curve of the image, and performing compensation adjustment on the brightness of the image in different areas to recover image details and solve the problems of overexposure and underexposure.
The image rectification and cropping of the processor 1103 are mainly used for processing the image inclination caused by the inclination of the photographing angle when the inspection personnel acquires the image, or the photographing field of view is larger than the cross-over box body and has many other factors around the box body, which interfere with the detection and identification of the target. In the application, the perspective principle is utilized to convert the problem of image correction into the transformation from an image on one object plane to an image on another object plane, so as to derive the correction mode of perspective distortion images, namely, the transformation from points on one plane to points on the other plane. The problem of picture inclination is solved.
The port and letter segmentation of the processor 1103 is mainly used to find all port positions and letter positions, and is a necessary task for classifying and identifying port states and letter identification. According to the invention, round features in an image can be searched through Hough circle transformation, wherein three states of a red cap, a white cap and a plug wire basically have the round features, so that the round features are easy to detect, damaged and shielded ports can be determined by utilizing the structural arrangement features of box body ports and the intersection point positions of line connection lines of circle centers of transverse rows, the positions of all the ports are found, and the positions of all the ports and the positions of letters are found by utilizing the characteristic that the positions of the letters are positioned at the right end of each row of an optical cross box through ROI segmentation.
Port classification of the processor 1103 mainly uses the mobilenetv1 network to realize classification of five port states (red cap, white cap, plugged line, damaged, occluded). The invention modifies the classification types by using the existing mobilenetv1 network through transfer learning, and well realizes the classification of five port states of the optical cable box.
Letter recognition by the processor 1103 is primarily used to recognize letters next to each row of ports of the light box. The method and the system realize accurate identification of the letters beside each row of ports by utilizing the characteristic that the open-source pytesseract library in python can identify Chinese and English letters.
The embodiment of the present application further provides a terminal device, where the terminal device includes a processor, and the processor may execute the technical solutions corresponding to the protection as shown in fig. 1 to fig. 9, so that the terminal device has the technical effect of the technical solution of the protection.
Also provided in an embodiment of the present application is a computer-readable storage medium having a computer program stored thereon, where the computer program is used to make a computer execute any one of the methods described in the above fig. 1-9 and the corresponding description when the computer program is executed in the computer.
Also provided in embodiments of the present application is a computer program product having instructions stored thereon, which when executed by a computer, cause the computer to implement any of the methods set forth above in fig. 1-9 and the corresponding description.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
Moreover, various aspects or features of embodiments of the application may be implemented as a method, apparatus, or article of manufacture using standard programming and/or engineering techniques. The term "article of manufacture" as used herein is intended to encompass a computer program accessible from any computer-readable device, carrier, or media. For example, computer-readable media can include but are not limited to magnetic storage devices (e.g., hard disk, floppy disk, magnetic strips, etc.), optical disks (e.g., Compact Disk (CD), Digital Versatile Disk (DVD), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROM), card, stick, or key drive, etc.). In addition, various storage media described herein can represent one or more devices and/or other machine-readable media for storing information. The term "machine-readable medium" can include, without being limited to, wireless channels and various other media capable of storing, containing, and/or carrying instruction(s) and/or data.
In the above embodiments, the window management apparatus 1000 in fig. 10 may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a Digital Video Disk (DVD)), or a semiconductor medium (e.g., a Solid State Disk (SSD)), among others.
It should be understood that, in various embodiments of the present application, the sequence numbers of the above-mentioned processes do not imply an order of execution, and the order of execution of the processes should be determined by their functions and inherent logic, and should not limit the implementation processes of the embodiments of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application, which essentially or partly contribute to the prior art, may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or an access network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only a specific implementation of the embodiments of the present application, but the scope of the embodiments of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the embodiments of the present application, and all the changes or substitutions should be covered by the scope of the embodiments of the present application.

Claims (10)

1. An image processing method, comprising:
acquiring an original image, wherein the original image comprises a target object, and the target object is presented in the original image in a tilted posture;
identifying the target object;
and correcting the posture of the target object to obtain a corrected image.
2. The method of claim 1, further comprising:
and segmenting the target object from the corrected image to obtain a target object image.
3. The method of claim 1 or 2, further comprising, prior to said identifying said target object:
detecting a gray value in the original image;
and when the gray value of the original image is not in the range of the set threshold value, carrying out overexposure or underexposure treatment on the original image.
4. The method according to any one of claims 1-3, further comprising:
and inputting the target object image into a Hough circle transformation algorithm to obtain the position information of the circular component in the target object image.
5. The method of claim 4, further comprising:
and determining the position information of other parts except the circular part on the target object image according to the position information of the circular part in the target object image and the arrangement characteristics of all parts on the target object.
6. The method according to claim 4 or 5, characterized in that the method further comprises:
inputting the target object image and the position information of each component on the target object image into a mobilenetv1 model, and determining the type of each component in the target object.
7. The method according to claim 4 or 5, characterized in that the method further comprises:
and determining the position information of each identification on the target object image according to the position information of each component on the target object image and the association characteristics between the identification on the target object and each component on the target object, wherein the identification is one or more of characters, letters and symbols.
8. The method of claim 7, further comprising:
and inputting the target object image and the position information of each identifier on the target object image into a pytesseract library, and identifying each identifier in the target object.
9. An image processing apparatus characterized by comprising:
at least one of the transceivers is provided with at least one transceiver,
at least one memory for storing at least one of the data,
at least one processor configured to execute instructions stored in a memory to perform the method of any of claims 1-8.
10. A computer-readable storage medium, on which a computer program is stored which, when executed in a computer, causes the computer to carry out the method of any one of claims 1-8.
CN202111406615.0A 2021-11-24 2021-11-24 Image processing method and device Pending CN113962902A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111406615.0A CN113962902A (en) 2021-11-24 2021-11-24 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111406615.0A CN113962902A (en) 2021-11-24 2021-11-24 Image processing method and device

Publications (1)

Publication Number Publication Date
CN113962902A true CN113962902A (en) 2022-01-21

Family

ID=79471813

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111406615.0A Pending CN113962902A (en) 2021-11-24 2021-11-24 Image processing method and device

Country Status (1)

Country Link
CN (1) CN113962902A (en)

Similar Documents

Publication Publication Date Title
US9767371B2 (en) Systems and methods for identifying traffic control devices and testing the retroreflectivity of the same
CN109993086B (en) Face detection method, device and system and terminal equipment
CN107103320B (en) Embedded medical data image identification and integration method
US20130129216A1 (en) Text Detection Using Multi-Layer Connected Components With Histograms
CN106709500B (en) Image feature matching method
CN108229232B (en) Method and device for scanning two-dimensional codes in batch
CN111445459A (en) Image defect detection method and system based on depth twin network
US20170011272A1 (en) Realtime object measurement
CN111784675A (en) Method and device for processing article texture information, storage medium and electronic equipment
CN112052730B (en) 3D dynamic portrait identification monitoring equipment and method
CN111383244A (en) Target detection tracking method
CN111046746A (en) License plate detection method and device
CN114049499A (en) Target object detection method, apparatus and storage medium for continuous contour
CN111695373A (en) Zebra crossing positioning method, system, medium and device
CN115841633A (en) Power tower and power line associated correction power tower and power line detection method
WO2022121021A1 (en) Identity card number detection method and apparatus, and readable storage medium and terminal
CN113283439B (en) Intelligent counting method, device and system based on image recognition
CN111027564A (en) Low-illumination imaging license plate recognition method and device based on deep learning integration
CN112802027A (en) Target object analysis method, storage medium and electronic device
US20220366651A1 (en) Method for generating a three dimensional, 3d, model
CN113962902A (en) Image processing method and device
CN113048950B (en) Base station antenna inclination angle measuring method and device, storage medium and computer equipment
CN110276260B (en) Commodity detection method based on depth camera
CN112634382A (en) Image recognition and replacement method and device for unnatural object
CN111079713A (en) Method for extracting pedestrian color features and terminal equipment

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