CN109801213A - Picture Spot detection method, apparatus and terminal device is imaged in flake - Google Patents

Picture Spot detection method, apparatus and terminal device is imaged in flake Download PDF

Info

Publication number
CN109801213A
CN109801213A CN201910104677.2A CN201910104677A CN109801213A CN 109801213 A CN109801213 A CN 109801213A CN 201910104677 A CN201910104677 A CN 201910104677A CN 109801213 A CN109801213 A CN 109801213A
Authority
CN
China
Prior art keywords
pixel
original image
picture
flake
imaged
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
CN201910104677.2A
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.)
TP Link Technologies Co Ltd
Original Assignee
TP Link Technologies 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 TP Link Technologies Co Ltd filed Critical TP Link Technologies Co Ltd
Priority to CN201910104677.2A priority Critical patent/CN109801213A/en
Publication of CN109801213A publication Critical patent/CN109801213A/en
Pending legal-status Critical Current

Links

Abstract

The present invention is suitable for field of camera technology, provides flake imaging picture Spot detection method and device, comprising: obtain original image, wherein the original image is the rectangular image that picture is imaged comprising circle fisheye;The original image is scanned by desired guiding trajectory, obtain the first pixel and the second pixel, wherein first pixel is first pixel that the gray value from left to right scanned by column is greater than or equal to default gray threshold, and second pixel is first pixel that the gray value scanned by column from right to left is greater than or equal to default gray threshold;According to first pixel and second pixel, the center of the flake imaging picture is calculated.The embodiment of the present invention being capable of center that is inexpensive, accurately detecting flake imaging picture.

Description

Picture Spot detection method, apparatus and terminal device is imaged in flake
Technical field
The invention belongs to field of camera technology more particularly to a kind of flake imaging picture Spot detection method, apparatus and ends End equipment.
Background technique
Fish eye lens is that a kind of focal length is shorter and visual angle is close or equal to 180 ° of camera lens, is a kind of extreme wide-angle lens Head.Imaging sensor can be realized into the Image Acquisition of ultra-large vision field range with fish eye camera made of fish eye lens collocation and taken the photograph As monitoring.
In fish eye camera, the raw frames region of imaging sensor acquisition is rectangle, which includes saturating Fish-eye circular flake imaging region is crossed, the rectangle in circular diameter close to the raw frames region of flake imaging region is short Side.Since usual imaging sensor is not overlapped with fish eye lens, image is likely to result in without correction Distortion, in image inactive area it is excessive and situations such as picture loss is effectively imaged, therefore usually require to raw frames region into Row imaging picture cent(e)ring finds out the center of imaging picture and carries out picture adjustment, to improve general image effect.
The core of the imaging picture cent(e)ring of fish eye camera is to find out the center of flake imaging picture.It is existing Flake is imaged there are two types of picture Spot detection methods, and a kind of method is that a picture is shot under uniform source of light, using related soft The most bright spot of image on picture is calculated as picture center in part;Another method is that shooting includes circle under white light source The picture of shape image chooses any point on picture and establishes coordinate system as origin, then chooses on circular image circumference at least Three points, obtain 1 points of coordinate, and tondo is calculated according to round normal equation and 1 points of coordinate Face center.
First method needs to guarantee that entire imaging picture brightness is uniform, has strict demand to light source and style of shooting, The brightness in picture center and surrounding fraction region is not much different even without difference simultaneously, if calculating brightness software resolution ratio The picture center accuracy that not enough will lead to acquisition is not high.Second method also there are certain requirements light source, topological complexity compared with Height, additionally, due to camera lens inner wall imaging etc. interference circular image circumference define it is relatively difficult, therefore on circumference each point choosing Taking all has certain error, and the corresponding error of one point of every increase also will increase, and is calculated caused by the center of circle using at least three point Error also can be bigger than normal.
In conclusion there is cost and complexity height, precision are low for existing flake imaging picture Spot detection method Defect.
Summary of the invention
In view of this, the embodiment of the invention provides flake imaging picture Spot detection method, apparatus and terminal device, with Solve the problems, such as in the prior art how low cost, accurately detect flake imaging picture center.
The first aspect of the embodiment of the present invention provides a kind of flake imaging picture Spot detection method, comprising:
Obtain original image, wherein the original image is the rectangular image that picture is imaged comprising circle fisheye;
The original image is scanned by desired guiding trajectory, the first pixel and the second pixel are obtained, wherein first picture Vegetarian refreshments is first pixel that the gray value that from left to right scans by column is greater than or equal to default gray threshold, described the Two pixels are first pixel that the gray value scanned by column from right to left is greater than or equal to default gray threshold;
According to first pixel and second pixel, the center of the flake imaging picture is calculated.
The second aspect of the embodiment of the present invention provides a kind of flake imaging picture central detection device, comprising:
Acquiring unit, for obtaining original image, wherein the original image is the square that picture is imaged comprising circle fisheye Shape image;
Scanning element, for scanning the original image, the first pixel of acquisition and the second pixel by desired guiding trajectory, Described in the first pixel be that the gray value that from left to right scans by column is greater than or equal to default gray threshold first Pixel, second pixel are that the gray value that scans by column from right to left is greater than or equal to the of default gray threshold One pixel;
First computing unit, for calculating the flake imaging according to first pixel and second pixel The center of picture.
The third aspect of the embodiment of the present invention provides a kind of terminal device, including memory, processor and is stored in In the memory and the computer program that can run on the processor, when the processor executes the computer program It realizes such as the step of flake imaging picture Spot detection method.
The fourth aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, is realized when the computer program is executed by processor such as flake imaging picture center inspection The step of survey method.
Existing beneficial effect is the embodiment of the present invention compared with prior art: former by scanning in the embodiment of the present invention Beginning image obtains the pixel that two gray values are greater than or equal to default gray threshold, the two pixels from both direction respectively Point is two points on circle fisheye imaging diameter of picture area, and the center for calculating the two points just can obtain flake imaging picture Center, due to do not need special light source and to software for calculation resolution requirement it is not high, and can by Scanning Detction gray value Obtain two points on circle fisheye imaging diameter of picture area accurately to obtain the center of flake imaging picture, therefore can be The precision of flake imaging picture Spot detection is improved in the case where controlling cost.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without creative efforts, can also be attached according to these Figure obtains other attached drawings.
Fig. 1 is the implementation process signal of the first flake imaging picture Spot detection method provided in an embodiment of the present invention Figure;
Fig. 2 is a kind of exemplary diagram of the raw frames of flake camera module shooting provided in an embodiment of the present invention;
Fig. 3 is a kind of scanning track schematic diagram of flake imaging picture Spot detection method provided in an embodiment of the present invention;
Fig. 4 is the scanning track signal of another flake imaging picture Spot detection method provided in an embodiment of the present invention Figure;
Fig. 5 is the implementation process signal of second of flake imaging picture Spot detection method provided in an embodiment of the present invention Figure;
Fig. 6 is a kind of image procossing schematic diagram of flake imaging picture Spot detection method provided in an embodiment of the present invention;
Fig. 7 is the image procossing signal of another flake imaging picture Spot detection method provided in an embodiment of the present invention Figure;
Fig. 8 is a kind of schematic diagram of flake imaging picture cent(e)ring provided in an embodiment of the present invention;
Fig. 9 is a kind of schematic diagram of flake imaging picture central detection device provided in an embodiment of the present invention;
Figure 10 is the schematic diagram of terminal device provided in an embodiment of the present invention.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " instruction is described special Sign, entirety, step, operation, the presence of element and/or component, but be not precluded one or more of the other feature, entirety, step, Operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this present specification merely for the sake of description specific embodiment And be not intended to limit the application.As present specification and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in present specification and the appended claims is Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or " if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
In addition, term " first ", " second ", " third " etc. are only used for distinguishing description, and cannot in the description of the present application It is interpreted as indication or suggestion relative importance.
Embodiment one:
Fig. 1 shows the process signal of the first flake imaging picture Spot detection method provided by the embodiments of the present application Figure, details are as follows:
In S101, original image is obtained, wherein the original image is the histogram that picture is imaged comprising circle fisheye Picture.
Image taking is carried out by the flake camera module being made of imaging sensor and fish eye lens, obtains original graph Picture.Original image is rectangular image, which contains circular flake imaging picture, is illustrated in figure 2 a kind of original The exemplary diagram of image.The actual photographed imaging region of original image is fallen in circular flake imaging picture, and the flake is imaged The usual gray value of picture is higher, i.e., the scene usually shot is not black or more gloomy scene;And other regions are The inactive area of black, is known as unimaged region for the inactive area here, and usual flake is imaged in the border circular areas of picture Gray value is higher than unimaged region.
In S102, the original image is scanned by desired guiding trajectory, obtains the first pixel and the second pixel, wherein institute Stating the first pixel is first pixel that the gray value from left to right scanned by column is greater than or equal to default gray threshold Point, second pixel are first that the gray value scanned by column from right to left is greater than or equal to default gray threshold Pixel.
As shown in figure 3, it using A point as coordinate origin is x with the direction AD that four vertex of original image, which are respectively A, B, C, D, Axis positive direction establishes reference axis by y-axis direction of the direction AB, wherein positive direction of the x-axis is direction from left to right, x-axis losing side To direction as from right to left.
Original image is scanned according to desired guiding trajectory, from left to right scans by column the gray value detected on the original image, First pixel that obtained gray value is greater than or equal to default gray threshold is the first pixel (C i.e. as shown in Figure 31 Point).Such as using A point as starting point, the gray value on positive direction of the y-axis Scanning Detction original image completes first row up to B point Scanning;Then to be located at ash of the neighbor pixel on the right of A point as starting point, on positive direction of the y-axis Scanning Detction original image Angle value completes the second column scan until the point on the contact side BC;And so on, every time be located at the side AD on and and previous column The point for scanning the right neighbour of starting point is starting point, the gray value on positive direction of the y-axis vertical sweep detection original image, until being located at BC Until point on side, i.e., original image is scanned by column from left to right with same vertical sweep direction (positive direction of the y-axis), until scanning It is more than or equal to the pixel of default gray threshold to first gray value, and the point is recorded as the first pixel.Alternatively, (as shown in Figure 4) using A point as starting point, the gray value on positive direction of the y-axis Scanning Detction original image completes first up to B point Column scan;Then to be located at the neighbor pixel on the right of B point as starting point, along negative direction of the y-axis Scanning Detction original image Gray value, until the point position on the contact side AD, completes the second column scan;And so on, every time with right with previous column sweep stopping point Adjacent point is starting point, the gray value in the positive direction of y-axis or negative direction vertical sweep detection original image, i.e., along Z-shaped Type from left to right scans by column original image, until scanning is more than or equal to the picture of default gray threshold to first gray value Vegetarian refreshments, and the point is recorded as the first pixel.
It should be understood that original can also from left to right be scanned by column with same vertical sweep direction (negative direction of the y-axis) using B point as starting point Beginning image, or original image is from left to right scanned by column along Z-shaped using B point as starting point, it is greater than or waits to obtains gray value In first pixel of default gray threshold, i.e. the first pixel.
Similarly, original image is scanned according to desired guiding trajectory, is scanned by column on the detection original image from right to left Gray value, first pixel that obtained gray value is greater than or equal to default gray threshold is the second pixel (i.e. such as Fig. 3 institute The C shown2Point).As shown in figure 3, scanning by column original from right to left for starting point with D point (or C point) with same vertical sweep direction Beginning image until scanning is more than or equal to the pixel of default gray threshold to first gray value, and the point is recorded as Second pixel;Alternatively, as shown in figure 4, scanning by column original graph from right to left along Z-shaped for starting point with D point (or C point) The point until scanning is more than or equal to the pixel of default gray threshold to first gray value, and is recorded as second by picture Pixel.
It is alternatively possible to repeatedly along same desired guiding trajectory (such as every time with same starting point, same vertical sweep direction Mode) the scanning original image, it records first that scanning every time obtains and is greater than or equal to default gray threshold to gray value Pixel, ask the average value of these pixels to obtain the first pixel or the second pixel, i.e., ask flat by Multiple-Scan Equal mode finally determines the first pixel or the second pixel, to improve the standard for seeking the first pixel, the second pixel Exactness.
It is alternatively possible to record scanning every time by scanning the original image along different desired guiding trajectories respectively twice and obtain First obtained is greater than or equal to the pixel of default gray threshold to gray value, and the average value of these pixels is asked to obtain first Perhaps the second pixel finally determines the first pixel or second to pixel i.e. in such a way that different scanning track is averaging Pixel, to improve the accuracy for seeking the first pixel, the second pixel.Such as the first time using A point as starting point, with same perpendicular Straight scanning direction (positive direction of the y-axis) from left to right scans by column original image and obtains first gray value more than or equal to default ash Spend the pixel of threshold value;It is from left to right scanned by column using B point as starting point with same vertical sweep direction (negative direction of the y-axis) for the second time Original image obtains the pixel that first gray value is greater than or equal to default gray threshold;By the seat of the pixel obtained twice Scale value is averaging, and obtains the first final pixel.
Optionally, before the S102, further includes: receive setting instruction, the default gray threshold is set.
In S103, according to first pixel and second pixel, calculate in the flake imaging picture The heart.
The first pixel and the second pixel obtained by above method scanning is to be located at circle fisheye picture is imaged Two o'clock diametrically, therefore seek the line midpoint between the first pixel and the second pixel, circle fisheye can be obtained The center of circle of picture, the as center (O as shown in Figure 3 of flake imaging picture is imaged1Point).It can be by obtaining the first pixel And second pixel coordinate value, calculate the centre coordinate value of two coordinate values, obtain the center of flake imaging picture.
In the embodiment of the present invention, by scanning original image, obtains two gray values respectively from both direction and be greater than or wait In the pixel of default gray threshold, the two pixels are two points on circle fisheye imaging diameter of picture area, calculate this The center of two points just can obtain the center of flake imaging picture, due to not needing special light source and to software for calculation resolution ratio It is of less demanding, and by Scanning Detction gray value can accurately obtain circle fisheye be imaged diameter of picture area on two points to The center of flake imaging picture is obtained, therefore the essence of flake imaging picture Spot detection can be improved in the case where controlling cost Degree.
Embodiment two:
Fig. 5 shows the process signal of second of flake imaging picture Spot detection method provided by the embodiments of the present application Figure, details are as follows:
In S501, original image is obtained, wherein the original image is the histogram that picture is imaged comprising circle fisheye Picture.
S501 is identical as the S101 in a upper embodiment in the present embodiment, referring specifically to the phase of S101 in a upper embodiment Description is closed, is not repeated herein.
Optionally, before the S501, further includes:
Issue the information that predetermined physical environment is built in prompt.
For guarantee circular flake in original image be imaged the fringe region in picture can in original image The lower unimaged region of gray value better discriminates between out, and can be come by before image taking, building preset physical environment The fringe region gray value bordered in flake imaging picture with unimaged region is set to be maintained at higher level.For example, being taken the photograph in flake As each side placing a blank sheet of paper or paper, the cloth of other light tones etc. vertically in front of mould group, predetermined physical is completed Environment is built.Before obtaining original image for the first time, the information of predetermined physical environment can be built by issuing prompt, such as In such a way that screen displaying character or voice play, prompt is issued in flake camera module and each side places a Zhang Bai The prompt information of paper allows operator according to prompt information, completes building for predetermined physical environment.Optionally, in order to mention High operator completes to build the accuracy of predetermined physical environment, after issuing prompt and building the information of predetermined physical environment, shows Show the schematic diagram of predetermined physical environment to be built.
The information for building predetermined physical environment by issuing prompt before obtaining original image, it is ensured that picture is imaged in flake The gray value for the fringe region bordered in face with unimaged region is maintained at higher level, preferably distinguishes with unimaged region It opens, to further increase accuracy when determining the first pixel, the second pixel.
In S502, the original image is scanned by desired guiding trajectory, obtains the first pixel and the second pixel, wherein institute Stating the first pixel is first pixel that the gray value from left to right scanned by column is greater than or equal to default gray threshold Point, second pixel are first that the gray value scanned by column from right to left is greater than or equal to default gray threshold Pixel.
Optionally, the original image includes the first vertex positioned at the original image left side, the second vertex and is located at Third vertex, the 4th vertex on the right of the original image, the step S502 are specifically included:
Using the first vertex of the original image or the second vertex as starting point, the original image is from left to right scanned by column Obtain the first pixel undetermined that first gray value is greater than or equal to default gray threshold;
Using the described first pixel undetermined as starting point, the first neighbor pixel of predetermined number is from left to right detected, if institute The gray value for stating the first neighbor pixel of the predetermined number is all larger than or is equal to default gray threshold, it is determined that described first Pixel undetermined is the first pixel;
Using the third vertex of the original image or the 4th vertex as starting point, the original image is scanned by column from right to left Obtain the second pixel undetermined that first gray value is greater than or equal to default gray threshold;
Using the described second pixel undetermined as starting point, the second neighbor pixel of predetermined number is detected from right to left, if institute The gray value for stating the second neighbor pixel of predetermined number is all larger than or is equal to default gray threshold, it is determined that described second is undetermined Pixel is the second pixel.
By taking situation shown in Fig. 3 as an example, 4 points of A, B, C, D are respectively the first vertex of original image, the second vertex, third Vertex and the 4th vertex.Using A point or B point as starting point, original image is from left to right scanned by column, it is big to obtain first gray value In or equal to default gray threshold pixel, which is set as the first pixel undetermined;Then, with the first picture undetermined Vegetarian refreshments is starting point, the first adjacent picture adjacent with the first pixel undetermined along positive direction of the x-axis detection predetermined number (such as 3) Vegetarian refreshments, if the gray threshold of these the first neighbor pixels both greater than or is equal to default gray threshold, it is determined that this first to Determining pixel is the first pixel C1;Otherwise, it is continued to scan on from the described first pixel undetermined, it is big until finding a gray value In or equal to default gray threshold and the predetermined number pixel of right neighbour gray value also greater than or equal to default gray threshold Pixel, it is determined as the first pixel.Using C point or D point as starting point, original image is scanned from right to left, obtains first gray scale Value is more than or equal to the pixel of default gray threshold, which is set as the second pixel undetermined;Then, with second to Determining pixel is starting point, second neighbor pixel adjacent along negative direction of the x-axis detection predetermined number and the second pixel undetermined, If the gray threshold of these the second neighbor pixels is both greater than or equal to default gray threshold, it is determined that second pixel undetermined Point is the second pixel C2;Otherwise, it is continued to scan on from the described second pixel undetermined, is greater than or waits until finding a gray value In the gray value of default gray threshold and the predetermined number pixel of left neighbour also greater than or equal to default gray threshold pixel, It is set to the second pixel.
In original image, unimaged region is it is possible that some interference pixel, Huo Zheyou such as white noise There is light leakage phenomena in camera lens material is bad, the partial region picture that may result in unimaged region is partially bright, by obtaining It obtains first gray value to be greater than or equal to after the pixel undetermined of default gray threshold, further detection and pixel phase undetermined The gray value of adjacent predetermined number pixel can further increase to avoid the influence of interference pixel or interference region The accuracy of the first pixel and the second pixel that arrive, to improve the accuracy of flake imaging picture Spot detection.
In S503, according to first pixel and second pixel, calculate in the flake imaging picture The heart.
S503 is identical as the S103 in a upper embodiment in the present embodiment, referring specifically to the phase of S103 in a upper embodiment Description is closed, is not repeated herein.
Optionally, after the step S503, further includes:
Calculate the center of the flake imaging picture and the deviation value at original image center.
If the coordinate value at the center for the flake imaging picture being calculated in S503 is O1(xo1,yo1), and according to rectangle The coordinate value O at original image center can be calculated in the coordinate value on four vertex of original image2(xo2,yo2).When rectangle The width of original image be far smaller than original image it is long when (such as differing by more than 50pixel), as shown in fig. 6, due to flake at As picture diameter close to original image most short side, therefore at this time flake imaging picture center and original image center exist Deviation on y-axis direction is to influence the key factor of picture imaging effect.In this case, with the center of flake imaging picture Ordinate yo1It is deviation value with the phase difference of the ordinate yo2 at original image center, i.e. d=| yo1-yo2|.It is original when rectangle The length of image and wide size be not much different (such as difference within 50pixel) when, as shown in fig. 7, flake imaging picture The deviation in the direction of the x axis of center and original image center and deviation in the y-axis direction are all likely to become influence picture imaging The factor of effect, in this case using the distance value at the center of flake imaging picture and original image center as deviation value, i.e.,
The center of flake imaging picture and the deviation value at original image center is obtained by calculation, operator can be allowed to understand It is corresponding to make to current flake camera module installation situation, that is, imaging sensor and fish-eye relative positional relationship Adjustment.
Optionally, after the deviation value at the center for calculating the flake imaging picture and original image center, also Include:
If the deviation value is greater than predetermined deviation value, the information of prompt adjustment camera lens is issued.
By presetting a predetermined deviation value, when deviation value d is greater than predetermined deviation value Δ d, by voice, or The mode that screen is shown issues the information of prompt adjustment camera lens, operator is prompted to adjust the camera lens installation position of flake camera module It sets.
When deviation value is larger, shows that the offset of fish eye lens and imaging sensor is larger, influence picture imaging effect, leads to Sending information is crossed, operator can be reminded to adjust camera lens in time, thus the quality of the original image shot after improving.
Optionally, it if the deviation value is greater than predetermined deviation value, before the information for issuing prompt adjustment camera lens, also wraps It includes:
According to the resolution ratio and target resolution of the original image, the predetermined deviation value is determined.
Target resolution is the resolution ratio that the effective image of picture is imaged comprising flake, since flake imaging picture is circle Shape, therefore effective image is generally square, the lateral resolution of target resolution is equal with longitudinal resolution.As shown in fig. 6, For the original image of resolution ratio 2048 × 1536, generally make the diameter of flake imaging picture close to the short side of original image 1536pixel, and in order to eliminate the useless projection of camera lens inner wall, to camera lens installation deflection, there are certain surpluses, can generally allow Target resolution is slightly less than the short side of original image, such as is set to 1440 × 1440.
When the width of the original image of rectangle be far smaller than original image it is long when (such as differing by more than 50pixel), when, such as Shown in Fig. 6, the center of the picture of flake imaging at this time and the deviation of original image center in the y-axis direction are to influence picture imaging effect The key factor of fruit, deviation value d=| yo1-yo2|, picture center and original image center is imaged in the y-axis direction in flake at this time The maximum offset of permission is predetermined deviation value.If the resolution ratio of original image is 2048 × 1536, target resolution is 1440 × 1440, and the maximum offset that flake imaging picture center and original image center allow in the y-axis direction are as follows: (1536-1440)/2=48pixel, i.e., predetermined deviation value Δ d at this time are 48pixel.
When the length of the original image of rectangle and wide size are not much different (such as difference is within 50pixel), as shown in fig. 7, Deviation value at this timeFlake imaging picture center and original image center allow most at this time Big distance value is predetermined deviation value.If the resolution ratio of original image be 1540 × 1536, target resolution be 1440 × 1440, flake at The maximum range value allowed as picture center and original image center are as follows:I.e. this When predetermined deviation value Δ d be 69pixel.
In S504, center and the target resolution of picture are imaged according to the flake, cuts the original image, completes Picture cent(e)ring is imaged in flake.
Target resolution is the resolution ratio that the effective image (referred to herein as target image) of picture is imaged comprising flake, due to It is circle that picture, which is imaged, in flake, therefore target image is generally square, the lateral resolution and longitudinal resolution of target resolution Rate is equal.As shown in figure 8, setting the resolution ratio of original image as 2048 × 1536, generally make the diameter of flake imaging picture close The short side 1536pixel of original image, and in order to eliminate the useless projection of camera lens inner wall, and there are certain to camera lens installation deflection Surplus, can generally allow target resolution to be slightly less than the short side of original image, such as be set to 1440 × 1440.
As shown in figure 8, the center O of picture is imaged according to flake1(xo1,yo1), target resolution 1440 × 1440, with O1For Center cuts original image using target resolution as the size of target image, obtain flake imaging picture be maximized it is aobvious Show and unimaged region is maximized the target image of rejecting, completes flake and picture cent(e)ring is imaged.
In the embodiment of the present invention, after the center for detecting flake imaging picture, the center of picture is imaged according to flake Original image is cut with target resolution, deletes most of invalid imaging region, obtains that flake imaging picture can be made by most The target image that bigization is presented effectively improves final image and effect is presented.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
Embodiment three:
Fig. 9 shows a kind of structural schematic diagram of flake imaging picture central detection device provided by the embodiments of the present application, For ease of description, part relevant to the embodiment of the present application is illustrated only:
It includes: acquiring unit 91, scanning element 92, the first computing unit 93 that picture central detection device, which is imaged, in the flake. Wherein:
Acquiring unit 91, for obtaining original image, wherein the original image is that picture is imaged comprising circle fisheye Rectangular image.
Image taking is carried out by the flake camera module being made of imaging sensor and fish eye lens, obtains original graph Picture.Original image is rectangular image, which contains circular flake imaging picture, is illustrated in figure 2 a kind of original The exemplary diagram of image.The actual photographed imaging region of original image is fallen in circular flake imaging picture, and the flake is imaged The usual gray value of picture is higher, i.e., the scene usually shot is not black or more gloomy scene;And other regions are The inactive area of black, is known as unimaged region for the inactive area here, and usual flake is imaged in the border circular areas of picture Gray value is higher than unimaged region.
Optionally, picture central detection device is imaged in the flake further include:
First prompt unit builds the information of predetermined physical environment for issuing prompt.
Scanning element 92, for scanning the original image, the first pixel of acquisition and the second pixel by desired guiding trajectory, Wherein first pixel is that the gray value from left to right scanned by column is greater than or equal to the first of default gray threshold A pixel, second pixel are that the gray value scanned by column from right to left is greater than or equal to default gray threshold First pixel.
As shown in figure 3, it using A point as coordinate origin is x with the direction AD that four vertex of original image, which are respectively A, B, C, D, Axis positive direction establishes reference axis by y-axis direction of the direction AB, wherein positive direction of the x-axis is direction from left to right, x-axis losing side To direction as from right to left.
Original image is scanned according to desired guiding trajectory, from left to right scans by column the gray value detected on the original image, First pixel that obtained gray value is greater than or equal to default gray threshold is the first pixel (C i.e. as shown in Figure 31 Point).Such as using A point as starting point, the gray value on positive direction of the y-axis Scanning Detction original image completes first row up to B point Scanning;Then to be located at ash of the neighbor pixel on the right of A point as starting point, on positive direction of the y-axis Scanning Detction original image Angle value completes the second column scan until the point on the contact side BC;And so on, every time be located at the side AD on and and previous column The point for scanning the right neighbour of starting point is starting point, the gray value on positive direction of the y-axis vertical sweep detection original image, until being located at BC Until point on side, i.e., original image is scanned by column from left to right with same vertical sweep direction (positive direction of the y-axis), until scanning It is more than or equal to the pixel of default gray threshold to first gray value, and the point is recorded as the first pixel.Alternatively, (as shown in Figure 4) using A point as starting point, the gray value on positive direction of the y-axis Scanning Detction original image completes first up to B point Column scan;Then to be located at the neighbor pixel on the right of B point as starting point, along negative direction of the y-axis Scanning Detction original image Gray value, until the point position on the contact side AD, completes the second column scan;And so on, every time with right with previous column sweep stopping point Adjacent point is starting point, the gray value in the positive direction of y-axis or negative direction vertical sweep detection original image, i.e., along Z-shaped Type from left to right scans by column original image, until scanning is more than or equal to the picture of default gray threshold to first gray value Vegetarian refreshments, and the point is recorded as the first pixel.
It should be understood that original can also from left to right be scanned by column with same vertical sweep direction (negative direction of the y-axis) using B point as starting point Beginning image, or original image is from left to right scanned by column along Z-shaped using B point as starting point, it is greater than or waits to obtains gray value In first pixel of default gray threshold, i.e. the first pixel.
Similarly, original image is scanned according to desired guiding trajectory, is scanned by column on the detection original image from right to left Gray value, first pixel that obtained gray value is greater than or equal to default gray threshold is the second pixel (i.e. such as Fig. 3 institute The C shown2Point).As shown in figure 3, scanning by column original from right to left for starting point with D point (or C point) with same vertical sweep direction Beginning image until scanning is more than or equal to the pixel of default gray threshold to first gray value, and the point is recorded as Second pixel;Alternatively, as shown in figure 4, scanning by column original graph from right to left along Z-shaped for starting point with D point (or C point) The point until scanning is more than or equal to the pixel of default gray threshold to first gray value, and is recorded as second by picture Pixel.
Optionally, the original image includes the first vertex, the second vertex, third vertex and the 4th vertex, wherein first Vertex and the second vertex are located at the left side of the original image, and third vertex and the 4th vertex are located at the right of image, described to sweep Retouching unit 92 includes the first determining module and the second determining module:
First determining module, for using the first vertex of the original image or the second vertex as starting point, from a left side to The right side scans by column the original image and obtains the first pixel undetermined that first gray value is greater than or equal to default gray threshold; Using the described first pixel undetermined as starting point, the first neighbor pixel of predetermined number is from left to right detected, if described default The gray value of the first several neighbor pixels is all larger than or is equal to default gray threshold, it is determined that first pixel undetermined is First pixel.
Second determining module, for using the third vertex of the original image or the 4th vertex as starting point, from the right side to A left side scans by column the original image and obtains the second pixel undetermined that first gray value is greater than or equal to default gray threshold; Using the described second pixel undetermined as starting point, the second neighbor pixel of predetermined number is detected from right to left, if described default The gray value of the second several neighbor pixels is all larger than or is equal to default gray threshold, it is determined that second pixel undetermined is Second pixel.
First computing unit 93, for according to first pixel and second pixel, calculate the flake at As the center of picture.
First computing unit obtains the coordinate value of the first pixel and the second pixel, and the center for calculating two coordinate values is sat Scale value obtains the center of the flake imaging picture.
Optionally, picture central detection device is imaged in the flake further include:
Second computing unit, for calculating the center of the flake imaging picture and the deviation value at original image center.
Optionally, picture central detection device is imaged in the flake further include:
Second prompt unit issues the information of prompt adjustment camera lens if being greater than predetermined deviation value for the deviation value.
Optionally, picture central detection device is imaged in the flake further include:
Predetermined deviation value determination unit, for the resolution ratio and target resolution according to the original image, determine described in Predetermined deviation value.
Optionally, picture central detection device is imaged in the flake further include:
Correct unit, for according to the flake be imaged picture center and target resolution, cut the original image, It completes flake and picture cent(e)ring is imaged.
In the embodiment of the present invention, by scanning original image, obtains two gray values respectively from both direction and be greater than or wait In the pixel of default gray threshold, the two pixels are two points on circle fisheye imaging diameter of picture area, calculate this The center of two points just can obtain the center of flake imaging picture, due to not needing special light source and differentiating to computer software Rate is of less demanding, and by Scanning Detction gray value can accurately obtain circle fisheye be imaged diameter of picture area on two points from And the center of flake imaging picture is obtained, therefore flake imaging picture Spot detection can be improved in the case where controlling cost Precision.
Example IV:
Figure 10 is the schematic diagram for the terminal device that one embodiment of the invention provides.As shown in Figure 10, the terminal of the embodiment Equipment 10 includes: processor 100, memory 101 and is stored in the memory 101 and can be on the processor 100 Picture Spot detection program is imaged in the computer program 102 of operation, such as flake.The processor 100 executes the computer The step in above-mentioned each flake imaging picture Spot detection embodiment of the method, such as step shown in FIG. 1 are realized when program 102 S101 to S103.Alternatively, the processor 100 is realized in above-mentioned each Installation practice respectively when executing the computer program 102 Module/unit function, such as the function of module 91 to 93 shown in Fig. 9.
Illustratively, the computer program 102 can be divided into one or more module/units, it is one or Multiple module/the units of person are stored in the memory 101, and are executed by the processor 100, to complete the present invention.Institute Stating one or more module/units can be the series of computation machine program instruction section that can complete specific function, the instruction segment For describing implementation procedure of the computer program 102 in the terminal device 10.For example, the computer program 102 Acquiring unit, scanning element, the first computing unit can be divided into, each unit concrete function is as follows:
Acquiring unit, for obtaining original image, wherein the original image is the square that picture is imaged comprising circle fisheye Shape image.
Scanning element, for scanning the original image, the first pixel of acquisition and the second pixel by desired guiding trajectory, Described in the first pixel be that the gray value that from left to right scans by column is greater than or equal to default gray threshold first Pixel, second pixel are that the gray value that scans by column from right to left is greater than or equal to the of default gray threshold One pixel.
First computing unit, for calculating the flake imaging according to first pixel and second pixel The center of picture.
The terminal device 10 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set It is standby.The terminal device may include, but be not limited only to, processor 100, memory 101.It will be understood by those skilled in the art that Figure 10 is only the example of terminal device 10, does not constitute the restriction to terminal device 10, may include more or more than illustrating Few component perhaps combines certain components or different components, such as the terminal device can also be set including input and output Standby, network access equipment, bus etc..
Alleged processor 100 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 101 can be the internal storage unit of the terminal device 10, such as the hard disk of terminal device 10 Or memory.The memory 101 is also possible to the External memory equipment of the terminal device 10, such as on the terminal device 10 The plug-in type hard disk of outfit, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) Card, flash card (Flash Card) etc..Further, the memory 101 can also be both interior including the terminal device 10 Portion's storage unit also includes External memory equipment.The memory 101 is for storing the computer program and the terminal Other programs and data needed for equipment.The memory 101, which can be also used for temporarily storing, have been exported or will be defeated Data out.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute The division of module or unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation, such as Multiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.Separately A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, device Or the INDIRECT COUPLING or communication connection of unit, it can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or In use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned implementation All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium It may include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic that can carry the computer program code Dish, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described The content that computer-readable medium includes can carry out increasing appropriate according to the requirement made laws in jurisdiction with patent practice Subtract, such as does not include electric carrier signal and electricity according to legislation and patent practice, computer-readable medium in certain jurisdictions Believe signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. picture Spot detection method is imaged in a kind of flake characterized by comprising
Obtain original image, wherein the original image is the rectangular image that picture is imaged comprising circle fisheye;
The original image is scanned by desired guiding trajectory, the first pixel and the second pixel are obtained, wherein first pixel Gray value from left to right to scan by column is greater than or equal to first pixel of default gray threshold, second picture Vegetarian refreshments is first pixel that the gray value scanned by column from right to left is greater than or equal to default gray threshold;
According to first pixel and second pixel, the center of the flake imaging picture is calculated.
2. picture Spot detection method is imaged in flake as described in claim 1, which is characterized in that in the acquisition original image Before, further includes:
Issue the information that predetermined physical environment is built in prompt.
3. picture Spot detection method is imaged in flake as described in claim 1, which is characterized in that the original image includes position In first vertex on the original image left side, the second vertex and third vertex, the 4th top on the right of the original image Point, it is described to scan the original image by desired guiding trajectory, obtain the first pixel and the second pixel, comprising:
Using the first vertex of the original image or the second vertex as starting point, from left to right scans by column the original image and obtain First gray value is greater than or equal to the first pixel undetermined of default gray threshold;
Using the described first pixel undetermined as starting point, the first neighbor pixel of predetermined number is from left to right detected, if described pre- If the gray value of the first neighbor pixel of number is all larger than or is equal to default gray threshold, it is determined that first pixel undetermined Point is the first pixel;
Using the third vertex of the original image or the 4th vertex as starting point, the original image is scanned by column from right to left and is obtained First gray value is greater than or equal to the second pixel undetermined of default gray threshold;
Using the described second pixel undetermined as starting point, the second neighbor pixel of predetermined number is detected from right to left, if described pre- If the gray value of the second neighbor pixel of number is all larger than or is equal to default gray threshold, it is determined that second pixel undetermined Point is the second pixel.
4. picture Spot detection method is imaged in flake as described in claim 1, which is characterized in that described according to described first Pixel and second pixel calculate the flake and are imaged after the center of picture, further includes:
Calculate the center of the flake imaging picture and the deviation value at original image center.
5. picture Spot detection method is imaged in flake as claimed in claim 4, which is characterized in that calculate the flake described It is imaged after the center of picture and the deviation value at original image center, further includes:
If the deviation value is greater than predetermined deviation value, the information of prompt adjustment camera lens is issued.
6. picture Spot detection method is imaged in flake as claimed in claim 5, which is characterized in that if in the deviation value Greater than predetermined deviation value, then before the information for issuing prompt adjustment camera lens, further includes:
According to the resolution ratio and target resolution of the original image, the predetermined deviation value is determined.
7. picture Spot detection method is imaged in the flake as described in Claims 1-4 any one, which is characterized in that the side Method further include:
Center and the target resolution of picture are imaged according to the flake, cuts the original image, completes flake and picture is imaged Cent(e)ring.
8. picture central detection device is imaged in a kind of flake characterized by comprising
Acquiring unit, for obtaining original image, wherein the original image is the histogram that picture is imaged comprising circle fisheye Picture;
Scanning element obtains the first pixel and the second pixel, wherein institute for scanning the original image by desired guiding trajectory Stating the first pixel is first pixel that the gray value from left to right scanned by column is greater than or equal to default gray threshold Point, second pixel are first that the gray value scanned by column from right to left is greater than or equal to default gray threshold Pixel;
First computing unit, for calculating the flake imaging picture according to first pixel and second pixel Center.
9. a kind of terminal device, including memory, processor and storage are in the memory and can be on the processor The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 7 when executing the computer program The step of any one the method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as claim 1 to 7 of realization the method.
CN201910104677.2A 2019-02-01 2019-02-01 Picture Spot detection method, apparatus and terminal device is imaged in flake Pending CN109801213A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910104677.2A CN109801213A (en) 2019-02-01 2019-02-01 Picture Spot detection method, apparatus and terminal device is imaged in flake

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910104677.2A CN109801213A (en) 2019-02-01 2019-02-01 Picture Spot detection method, apparatus and terminal device is imaged in flake

Publications (1)

Publication Number Publication Date
CN109801213A true CN109801213A (en) 2019-05-24

Family

ID=66561839

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910104677.2A Pending CN109801213A (en) 2019-02-01 2019-02-01 Picture Spot detection method, apparatus and terminal device is imaged in flake

Country Status (1)

Country Link
CN (1) CN109801213A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113888448A (en) * 2021-12-08 2022-01-04 深圳市先地图像科技有限公司 Image partition processing method and system for laser imaging and related equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106910173A (en) * 2017-02-27 2017-06-30 武汉大学 The method that flake video wicket real time roaming is realized based on correcting fisheye image
CN107689033A (en) * 2017-07-21 2018-02-13 哈尔滨工程大学 A kind of fish eye images distortion correction method based on ellipse segmentation
CN107767422A (en) * 2017-09-18 2018-03-06 深圳开阳电子股份有限公司 A kind of fish-eye bearing calibration, device and portable terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106910173A (en) * 2017-02-27 2017-06-30 武汉大学 The method that flake video wicket real time roaming is realized based on correcting fisheye image
CN107689033A (en) * 2017-07-21 2018-02-13 哈尔滨工程大学 A kind of fish eye images distortion correction method based on ellipse segmentation
CN107767422A (en) * 2017-09-18 2018-03-06 深圳开阳电子股份有限公司 A kind of fish-eye bearing calibration, device and portable terminal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113888448A (en) * 2021-12-08 2022-01-04 深圳市先地图像科技有限公司 Image partition processing method and system for laser imaging and related equipment

Similar Documents

Publication Publication Date Title
CN107767422B (en) Fisheye lens correction method and device and portable terminal
US20220076391A1 (en) Image Distortion Correction Method and Apparatus
US20220270293A1 (en) Calibration for sensor
EP3595285A1 (en) Photography processing method and device for camera module, and terminal apparatus
CN111339951A (en) Body temperature measuring method, device and system
CN108257186B (en) Method and device for determining calibration image, camera and storage medium
CN107356213B (en) Optical filter concentricity measuring method and terminal equipment
CN109194954B (en) Method, device and equipment for testing performance parameters of fisheye camera and storable medium
CN111105452B (en) Binocular vision-based high-low resolution fusion stereo matching method
CN113077459B (en) Image definition detection method and device, electronic equipment and storage medium
CN113301320B (en) Image information processing method and device and electronic equipment
CN108632604B (en) Method and device for detecting optical center of lens
CN113989336A (en) Visible light image and infrared image registration method and device
CN109801213A (en) Picture Spot detection method, apparatus and terminal device is imaged in flake
EP4336449A1 (en) Mark hole positioning method and apparatus, assembly device, and storage medium
WO2021056501A1 (en) Feature point extraction method, movable platform and storage medium
US20220076428A1 (en) Product positioning method
CN114120518B (en) Paper money continuous sheet detection method and device, electronic equipment and storage medium
CN113160259B (en) Edge detection method, edge detection device, computer equipment and storage medium
CN104866808A (en) Human eye positioning method and device
CN111028264B (en) Rotation robust three-dimensional object detection optimization method and device
CN111489384B (en) Method, device, system and medium for evaluating shielding based on mutual viewing angle
WO2019165611A1 (en) Method and device for detecting water ripple of image, and unmanned aerial vehicle and storage device
CN112364693A (en) Barrier identification method, device and equipment based on binocular vision and storage medium
CN115836322A (en) Image cropping method and device, electronic equipment and storage medium

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