Background technology
Sometimes, when we want to measure the displacement of length, object of object or speed, often measuring instrument is notTo be easy to obtain, even if or have a measuring instrument, the residing environment inconvenience of object being measured or testeeIn measurement. And along with the development of present society, people also more and more pay close attention to object motion at short noticeDistance or movement velocity, for example various ball flying distances or speed, or speed in running car.
And current electronic installation, particularly mobile device, the camera head of all having arranged in pairs or groups, camera head possessesHave and take a picture and the function of making video recording. And image recognition technology is also very ripe now. Thereby can be in conjunction with existingElectronic installation carry out the various measurements of object. Image recognition is to utilize computer intelligence Processing Algorithm to numeralImage is processed, is analyzed and explains, to reach the target of the various different conditions of identification and the technology to picture,It is a key areas of artificial intelligence. Image recognition has become the important subject of artificial intelligence field at present,In scientific research and industrial production, be widely applied, its main application utilizes computer to image exactlyProcess processing, to obtain some expected effect, and therefrom obtain useful information, realize people to thingsOr the analysis of phenomenon, description, judgement and identification.
Patent TW093130560 " method of using fuzzy image to test the speed ", has disclosed a kind of by once takingFuzzy image carry out the method for the translational speed of this object of inversion reckoning. Because camera head is once being takenIn process, there is certain time for exposure, thereby cause mobile object can be taken into fuzzy image. Can rootCalculate this object within this time for exposure according to the offset distance of fuzzy image and the object distance of this object and image distanceActual displacement, and then can calculate the displacement of this object. But along with the progress of technology, existingCamera head can carry out the continuous shooting of object within the very short time, and each time for exposure of taking veryOf short duration. Thereby make the inapplicable of said method change. US Patent No. 20110157407 is " next with file cameraEstimate the method for estimation of object size ", disclose a kind of by measuring the object distance of measured object and taking the large of districtLittle, then calculate the pixel count of measured object and then the actual size of definite measured object. Above-mentioned two kinds of methodsAll need the object distance of measured object to measure, and then be subject to the restriction of the distance of camera head and object to be measured,Be subject to this band to survey the restriction of the object distance of object. In the time cannot determining the distance of filming apparatus and object to be measured, justCannot adopt said method. Therefore, need a kind of distance between camera head and determinand that do not need to measure,Only can be finally inversed by the length of determinand or the method for displacement by the image of determinand.
Summary of the invention
The invention provides a kind of measuring method and system thereof based on image recognition, by determinand and reference substanceImage comparison, calculate the real data of determinand according to the real data of reference substance.
For achieving the above object, the invention provides a kind of measuring method based on image recognition, the steps include:
Step 1, in same shooting form picked-up with take form apart from identical reference substance and determinandImage;
Step 2, the respectively pixel count of reference substance and determinand in described image;
Step 3, identifies reference substance, obtains the real data of reference substance;
Step 4, according to the real data of reference substance, determines actual number corresponding to each pixel in described imageAccording to;
Step 5, the real data corresponding according to each pixel, determines the real data of determinand.
Preferably, in the described measuring method based on image recognition, described reference substance and determinand inOn same plane, described shooting form is parallel to this plane.
Preferably, in the described measuring method based on image recognition, described determinand is static object,Described image is the image that simultaneously absorbs described reference substance and determinand in same shooting form, described to be measuredThe real data of thing is length or the area of this reference substance.
Preferably, in the described measuring method based on image recognition, described determinand is the object of motion,Described image is before and after a time interval, to absorb closing of reference substance and determinand twice in same shooting formBecome image, the displacement that the real data of described determinand is this determinand.
Preferably, in the described measuring method based on image recognition, described reference substance and determinand are sameOne object, described image is the composograph that this object is taken for twice before and after a time interval, described ginsengThe real data of examining thing is the length of this object self, the real data of described determinand be this object this timeBetween displacement in interval.
Preferably, in the described measuring method based on image recognition, be somebody's turn to do the measurement side based on image recognitionMethod also comprises, after determining the displacement of this object within this time interval, also determines that this object is at thisSpeed in the time interval or acceleration.
Preferably, in the described measuring method based on image recognition, be somebody's turn to do the measurement side based on image recognitionMethod also comprises the image of pre-stored reference substance, identifies reference substance and also comprise in described step 3, and comparison prestoresReference substance in storage image and the reference substance in described image.
Preferably, in the described measuring method based on image recognition, be somebody's turn to do the measurement side based on image recognitionMethod also comprises the real data that pre-stored is corresponding with the image of described stored reference thing.
Preferably, in the described measuring method based on image recognition, in described step 2, described ginsengExamining the real data of thing obtains by an input unit.
The present invention also provides a kind of measuring system based on image recognition, and it comprises with lower module:
Taking module, for absorbing the reference substance identical with taking form distance and treating in same shooting formSurvey the image of thing;
Computing module, for calculating respectively the shared pixel count of described image reference substance and determinand;
Identification module, for identifying reference substance, obtains the real data of reference substance;
Processing module, for according to the real data of reference substance, determines that in described image, each pixel is correspondingReal data;
Generation module, for the real data corresponding according to each pixel, determines the real data of determinand.
Compared with prior art, by picked-up in same shooting form and the reference of taking form same distanceThe image of thing and determinand, the pixel in described image according to the known real data of reference substance and reference substanceNumber, calculates real data corresponding to each pixel in described image, then in conjunction with the pixel count of determinand,Can determine the real data of determinand.
Detailed description of the invention
For making that object of the present invention, structure, feature and function thereof are had to further understanding, hereby coordinate realExecuting example is described in detail as follows.
As shown in Figure 1, be the measuring method flow chart based on image recognition of a preferred embodiment of the present invention,The steps include:
Step S101, picked-up reference substance and the determinand identical with taking form distance in same shooting formImage. Wherein, described determinand can be static object, can be also the object of motion. Described ginsengExamine thing and generally choose static object, thereby be convenient to follow-up identification reference substance. And described reference substance should be use upSimple or the object that is easy to obtain of possible selecting structure. For example, described reference substance is coin. Described picked-upReference substance and the image of determinand can in same shooting form, absorb reference substance and determinand simultaneouslyImage, preferred, described reference substance and determinand are in the same plane, and described shooting form is parallel to thisPlane. Thereby can ensure that reference substance in described image and determinand can distortions, in described imagePixel count can reflect the real data of reference substance and determinand really. As shown in Figure 2, filming apparatus 9Take at it image that simultaneously absorbs reference substance 7 and determinand 6 in direction 8. When described reference substance and to be measuredThing and the distance of taking form enough far time, can be similar to and think that reference substance and determinand are in same shooting direction,Be that reference substance overlaps with determinand. The reference substance of described picked-up and the image of determinand can be also in same batTake the photograph the composograph that absorbs reference substance and determinand in form before and after a time interval for twice. Described determinandMotion in interval at this moment, but as long as described in the displacement of described determinand within this time interval be far smaller thanObserved range, thus can think that this object two positions before and after this time interval is identical with the distance of taking form.Should the measuring method based on image recognition both can measure static object, also can measure the object of motion.Can be length or the area of this determinand to the measurement data of described determinand, can be also the to be measured of motionThe displacement of thing. In the time of the determinand of premeasuring campaign, described reference substance and determinand can be same object,The image of described picked-up is the composograph that this object is taken for twice before and after a time interval. Described referenceThe real data of thing is the length of this object, and the real data of described determinand is that this object is in this time intervalInterior displacement. After determining the displacement of this object within this time interval, can also be furtherDetermine speed or the acceleration of this object within this time interval.
Step S102, calculates respectively the shared pixel count of reference substance and determinand in described image. Pass through stepAfter S101 obtains the image of reference substance and determinand, calculate respectively reference substance and determinand in described imageShared pixel count, because the reference substance in described image is identical with the distance of shooting form with determinand, fromAnd the real data reality corresponding with each pixel of described reference substance corresponding to each pixel of determinand in imageBorder data are identical. And can be as required, can determine reality corresponding to each pixel in described imageBorder data. In the time need to measuring the length of determinand self, can calculate determinand self in described imageShared pixel count on length direction. According to actual needs, can calculate this determinand in different directionsThe pixel count that length is corresponding, and then can determine the length of this determinand at different directions. When needs are measuredWhen the area of determinand self, can calculate the shared pixel count of determinand self in described image. Enter oneStep also can be determined the local particular area of this determinand.
Step S103, identifies reference substance, obtains the real data of reference substance. Wherein, step S102 and stepThe order of S103 in no particular order, also can first be identified reference substance, obtains the real data of reference substance, then distinguishesCalculate the pixel count of reference substance and determinand in described image. In described identification reference substance step, also comprise pre-The image of stored reference thing, the reference substance in comparison prestored images and the reference substance in described image. InstituteState the image of the multiple reference substances of pre-stored in camera head, by image recognition technology, to the reference substance of picked-upImage compare with the image of the reference substance of having stored, thereby the reference substance being taken described in determining.Wherein, described image recognition technology is according to personal characteristics in the image of reference substance, and according to the figure in imageCase is carried out layout and is stored as template. In Practical Project mainly with profile information as template, and by these templatesStore in memory space internal memory with the form of data structure. In the time that the image of reference substance is identified, onlyThe contrast that template need to be compared is one by one mated, and just can identify the reference substance image of required identification.Adopt the non-similarity based on template and picture registration part, and phase based on template and picture registration partJudge scheduling algorithm like degree. After the reference substance identifying in image, carry out the real data of described reference substanceObtain. The real data of described reference substance can be that pre-stored is corresponding with the image of described stored reference thingReal data. In the time of the image of stored reference thing, store the real data relevant to this reference substance simultaneously.For example reference substance is a coin, the diameter that the real data of described reference substance is this coin. In addition, described ginsengExamining the real data of thing also can obtain by an input unit. The real data of described reference substance is userThe real data of this reference substance of inputting by input unit. When identifying after this reference substance, need to usePerson inputs the real data of this reference substance, then carries out subsequent calculations according to the real data of user's input. ExampleAs, identify the automobile that this reference substance is the specific model of a certain brand, thus the user who gets inputThis motor vehicle length be three meters.
Step S104, according to the real data of reference substance, determines reality corresponding to each pixel in described imageData. Obtain the real data of reference substance by step S103 after, then integrating step S102 calculatesDescribed reference substance is shared pixel count in the described image of picked-up, and the real data of described reference substance is divided by thisThe pixel count that reference substance is shared, thus can determine real data corresponding to each pixel in described image. ByReference substance in described image is identical with the distance of shooting form with determinand, thus determinand in imageReal data corresponding to the each pixel real data corresponding with each pixel of described reference substance is identical. AndCan be as required, can determine real data corresponding to each pixel in described image. When in stepWhile obtaining the length of reference substance in S103, thereby can calculate reality corresponding to each pixel in described imageLength. In the time obtaining the area of reference substance in described step S103, thereby can calculate in described image everyThe real area that individual pixel is corresponding. This measuring method is determined described reference substance figure by reference to the real data of thingReal data corresponding to each pixel in picture, easy and simple to handle, do not need observed range to measure.
Step S105, the real data corresponding according to each pixel, determines the real data of determinand. Pass throughAfter above-mentioned steps S104 has determined real data corresponding to each pixel in described image, then integrating stepPixel count corresponding to determinand in the described image that S102 calculates. The shared pixel count of this determinand is multiplied by oftenAfter real data corresponding to individual pixel, be the real data of this determinand. When each picture in described imageWhen the real data that element is corresponding is length, according to actual needs, can calculate this determinand in different directionsCorresponding pixel count, and then can determine the length of this determinand at different directions. When every in described imageReal data corresponding to individual pixel is area, thereby can determine the gross area of this determinand or local specificArea. Described reference substance and determinand can be same object, and the real data of described determinand is this objectDisplacement. Take the image of this object for twice by front and back in the short time, and by the figure of this twice shootingPicture synthesizes an image, thus the distance of the displacement correspondence that can determine this object in described image. AsThe length of fruit this mobile object self is known, thereby can determine this thing by measuring method of the present inventionThe displacement of body. For example, this object is an automobile, and the physical length of this automobile is known, the reality of this automobileLength can, by being pre-stored in filming apparatus, also can be determined by user's input. TakingIn the constant situation of form, before and after a time period, take continuously twice location drawing picture of this automobile, and by thisTwice location drawing looks like to synthesize an image. Thereby can in this composograph, present the movement of this automobileDistance. By the shared pixel count of the displacement of this automobile in image, can calculate the reality of this automobileDisplacement.
For clearer description measuring method of the present invention, as shown in Figure 3, be the better enforcement of the present invention oneExample is measured the image schematic diagram of stationary object. Determinand 3 and reference substance 2 are put at grade, and instituteState determinand 3 and reference substance 2 is ingested in same shooting form 1 simultaneously. Be described determinand 3 and ginsengExamine thing 2 identical to the distance of taking form. After having absorbed the image of determinand 3 and reference substance 2, rightDescribed image carries out image recognition, and then identify the reference substance 2 in image, and obtains described reference substance 2Physical length. Wherein, the physical length of described reference substance 2 can be pre-stored in camera head, works as needsWhen the real data of reference substance 2, directly extract from memory space. Or, the reality of described reference substance 2Border length also user by an input unit directly input obtain. Distinguish again computing reference thing 2 HesThe pixel count of determinand 3. Because reference substance 2 is identical to the distance of camera point with determinand 3, thus referenceThe physical length that thing 2 is corresponding with each pixel count in determinand 3 is identical. Be each pixel and reality in imageThe ratio of length is identical. The physical length of described reference substance 2 is known, and then can determine the reality of determinand 3Border length. For example described reference substance 2 is coin, and the diameter of this coin is 26mm. This coin is straight in imageThe shared pixel count in footpath is 50, and the shared pixel count of determinand 3 length is 150, so each picture in imageThe physical length that element is corresponding is 0.52mm, and the physical length of this determinand 3 is 78mm. Wherein said referenceThing 2 is not limited in coin, and the selecting structure of described reference substance 2 is simple, the object that is easy to obtain, orThe real data of described reference substance 2 has been stored in camera head. Generally speaking, described reference substance 2Real data must be known or known. According to the real data of described reference substance 2, and by figureObtain the real data of determinand 3 as recognition technology.
As shown in Fig. 4 A, 4B and 4C, the image of measuring mobile object for another preferred embodiment of the present invention showsIntention. Wherein, described reference substance and determinand are all mobile object 5. In Fig. 4 A, at a shooting formIn 4, take this mobile object 5. In Fig. 4 B, after elapsed time t, in same shooting form 4, clap againTake the photograph this mobile object 5. Described time t chooses very of short duration, and this mobile object 5 is not enough to move out this shootingForm 4, and the displacement of this mobile object 5 is negligible with respect to observed range. Can be similar toThink before and after this time t that the shooting distance of twice is identical. In Fig. 4 C, this of above-mentioned twice shooting movedThe instantaneous position image of object 5 synthesizes an image. Thereby this composograph presents this mobile object 5Displacement y. Self physical length of this mobile object 5 is known, and for example described mobile object 5 is automobile,Thereby can determine brand and the model of this automobile by image recognition technology, and then can determine this automobilePhysical length. Wherein self physical length of this mobile object 5 can be to be pre-stored in filming apparatus, straightConnect from memory space and extract, or self physical length of this mobile object 5 fills by an input for userPut input and obtain. Self of displacement y by this mobile object 5 in image and this mobile object 5Length x compares, and in conjunction with self physical length of this known mobile object 5, thereby can determine thisThe actual displacement of mobile object 5. Further, can also determine the speed of this mobile object 5. By upperAfter stating the actual displacement of this definite mobile object 5, after this time t, be this and moveThe actual speed of object 5.
The present invention also provides a kind of measuring system 200 based on image recognition, and this measuring system 200 comprises batTake the photograph module 201, computing module 202, identification module 203, processing module 204 and generation module 205. ItsIn, described taking module 201 is for picked-up in same shooting form and the reference of taking form same distanceThe image of thing and determinand. The image that described taking module 201 absorbs can, by once taking, also canRear synthetic for repeatedly taking. Can in a shooting form, absorb the image of reference substance and determinand, also simultaneouslyCan be in same shooting form the image of time segment picked-up reference substance and determinand. As long as described reference substance withDeterminand is identical to described shooting form. Described computing module 202 is for calculating respectively described imageThe pixel count that middle reference substance and determinand are shared. Described computing module 202 absorbs described taking module 201Image in reference substance and the shared pixel count of determinand carry out statistical computation. And can be according to different needCalculate determinand shared pixel count in different directions in described image. Described identification module 203 useIn identification reference substance, obtain the real data of reference substance. The figure of described identification module 203 pre-stored reference substancesPicture, identifies reference substance by the reference substance in comparison prestored images and the reference substance in described image.Described identification module 203 can the multiple reference substances of pre-stored image, by image recognition technology, to picked-upThe image of reference substance is compared with the image of the reference substance of storing, thus the ginseng being taken described in determiningExamine thing. Described identification module 203 obtains personal characteristics in the image of reference substance, and according to the pattern in imageCarry out layout and be stored as template. For example, in Practical Project mainly with profile information as template. And by theseTemplate stores in memory space internal memory with the form of data structure. In the time that the image of reference substance is identified,The contrast that only template need to be compared is one by one mated, and just can identify the reference substance image of required identification.After identifying reference substance, further obtain the real data of this reference substance. Described identification module 203 canThe real data of this reference substance of pre-stored. Or described identification module 203 makes user defeated by man-machine interfaceEnter the real data of this reference substance. Described processing module 204, for according to the real data of reference substance, is determinedReal data corresponding to each pixel in described image. Described processing module 204 is according to described computing module 202The described reference substance calculating shared pixel count in image, and obtain in conjunction with described identification module 203The real data of this reference substance, thus can calculate real data corresponding to each pixel in described image.Described generation module 205, for the real data corresponding according to each pixel, is determined the actual number of determinandAccording to. Each pixel in the image that described generation module 205 further calculates according to described processing module 204Corresponding real data, then the determinand calculating in conjunction with described computing module 202 shared picture in imagePrime number, thus can calculate the real data of determinand. Described generation module 205 treating its calculating againThe real data of surveying thing feeds back to user, thereby completes this measurement. Compared with prior art, byIn same shooting form, absorb the image of reference substance and determinand, according to known real data and the ginseng of reference substanceExamine thing shared pixel count in described image, calculate real data corresponding to each pixel in described image,In conjunction with the pixel count of determinand, can determine the real data of determinand again. The method is easy, and does not needMeasure shooting distance.
The present invention is described by above-mentioned related embodiment, but above-described embodiment is only of the present invention for implementingExample. Must be pointed out that, the embodiment having disclosed does not limit the scope of the invention. On the contrary, notDepart from change and the retouching in the spirit and scope of the present invention, done, all belong to scope of patent protection of the present invention.