This non-provisional application claims priority under 35 U.S.C. § 119(a) on Patent Application No(s). 095140450 filed in Taiwan, R.O.C. on Nov. 1, 2006, the entire contents of which are hereby incorporated by reference.
1. Field of Invention
The present invention relates to a method for calculating distance and actual size of a shot object, and more particularly to a method for calculating distance and actual size of a shot object by utilizing a relationship table between focus pulse and object distance and the pinhole imaging principle.
2. Related Art
When taking a picture, the pinhole imaging principle is utilized, and the photosensitive medium is used to store the image. According to the pinhole imaging principle, the actual scene is projected on the photosensitive medium through the lens set of the camera, and the photosensitive medium, such as negative film, Charge Coupled Device (CCD), or Complementary Metal-Oxide Semiconductor (CMOS), is capable of recording the light beams of the actual scene after being shot, and converting the light beams to an image that can be recognized as the actual scene through chemical or digital process.
However, the actual size of the actual scene cannot be obtained from the image generated after the actual scene was shot by a camera. Therefore, as for the scene that requires marking the size as a reference, an object is usually added in the image for being shot as a length reference during the shooting process, for example, ruler or the commonly used coin. However, if merely the size of the scene needs to be simply marked, the above object used as the reference can be used to solve the problem. But, if the detailed dimension of the shot scene needs to be indicated, the above method gets some trouble. For example, when shooting a coat, if only a ruler or a coin is placed beside the coat, the person cannot correctly know the size of the coat upon looking at the picture. Therefore, in order to mark the size of the coat, the most direct method is measuring the length of the coat and marking the measured length. However, since the coat has a plurality of parts, the sizes of the parts desired by individual viewers are usually different from each other, if the size of the part desired by the viewer is not marked, the viewer still has to ask the photographer about the size of the part that he/she wants to know. The photographer has to again find out the shot coat, measure the size of the part desired by the viewer and then tell him/her. Such situation is a trouble for both the photographer and the viewer. Therefore, how to provide a function of directly knowing the actual size of the shot scene from the picture has become a problem to be solved.
In view of the above problems, the present invention is mainly directed to providing a method for calculating distance and actual size of a shot object, wherein a table of focus pulse and corresponding object distance is established in an image capture device; the image capture device utilizes the table to calculate the object distance; since the image distance and the pixel size are built-in parameter values of the image capture device, after the object distance has been calculated, the object height is calculated with the equation of “object distance/object height=image distance/image height”, thereby achieving the effect of obtaining the actual size of the shot object. Therefore, the problem in the prior art that the actual size of the shot scene cannot be obtained directly from the picture is solved.
In order to achieve the above object, the present invention discloses a method for calculating distance of a shot object, which comprises: establishing a table containing each focus pulse and the corresponding object distance; focusing the object to output a focus pulse; when the output focus pulse exists in the table, reading the corresponding object distance; and when the output focus pulse does not exist in the table, reading two focus pulses adjacent to the output focus pulse and the corresponding two object distances from the table to calculate the object distance between the object and the image capture device.
The method for calculating actual size of the shot object disclosed in the present invention comprises: reading a stored image file of the object shot by the image capture device; reading an object distance, an image distance, and a pixel size when shooting the object; selecting a measurement target from the image file; calculating a number of the pixels of the measurement target, multiplying the number of pixels with the pixel size to obtain the image height; and calculating the object height, i.e., actual size of the measurement target, according to the equation of “object distance/object height=image distance/image height”.
Further scope of applicability of the present invention will become apparent from the detailed description given hereinafter. However, it should be understood that the detailed description and specific examples, while indicating preferred embodiments of the invention, are given by way of illustration only, since various changes and modifications within the spirit and scope of the invention will become apparent to those skilled in the art from this detailed description.
The present invention will become more fully understood from the detailed description given herein below for illustration only, and thus is not limitative of the present invention, and wherein:
In order to recognize the image on the photosensitive medium 130 as the object 110, the distance between the lens set 120 of the image capture device and the photosensitive medium 130, i.e., the focal length, must be adjusted, so as to make the image on the photosensitive medium 130 clear, which is called focusing. As the progress of the science and technology, the existing image capture device already has the automatic focusing function.
When the image capture device automatically focuses, the detector on the photosensitive medium (e.g., CCD or CMOS) in the image capture device continuously receives light beams, and then converts the brightness information of the light beams into amplitudes. Since the image generated by the correct focal length is sharp (clear), the difference between the maximum amplitude and the minimum amplitude is the largest. If the focal length is incorrect, the image is correspondingly vague, and the amplitude is not significant. Therefore, the image capture device adjusts the position of the lens in the lens set until the amplitude reaches the maximum level, and at this time, the focal length is the most appropriate one.
During the automatically focusing, the image capture device moves the automatic-focusing lens back and forth within the lens set, therefore, the automatic-focusing pulse refers to the distance for which the automatic-focusing lens moves, wherein 1 pulse equals to 0.0125 mm.
The operation system and method of the present invention are illustrated below through an embodiment, and a digital camera is taken as an example for the image capture device in this embodiment, but not limited to this, and a coat is taken as an example for the object for being shot in this embodiment, but not limited to this. Referring to
Then, the first user uses the digital camera to take a picture of the coat, when the first user half presses the shutter button, the digital camera automatically focuses the target for being shot (i.e., the coat), and when the digital camera moves the automatic-focusing lens to the position of 80 pulse, the automatically focusing process is completed, so 80 is the focus pulse (Step 220). After the automatically focusing step, the digital camera reads the focus pulse before and after the automatic-focusing lens moves, and the object distance corresponding to the focus pulse is found out from the table 300a (Step 231). As known from
Through the above process, the distance between the shot object, i.e., the coat, and the digital camera is obtained. Then, the method for calculating actual size of the object in the picture is illustrated below with reference to
Besides the above calculation method, since not all the image files are used to store the additional information such as the object distance, the image distance and the pixel size, the second user may input the object distance, the image distance of the image file during the shooting process, and the pixel size of the digital camera into the image viewing program, such that the image viewing program reads the object distance, the image distance, and the pixel size (Step 520). Therefore, after the second user selects the target (Step 530), the object height can be calculated by the equation of “object distance/image distance=object height/image height” (Step 540, Step 550) for being provided to the user as a reference. Thus, the present invention solves the problem in the prior art, and obtains the actual size of the shot object directly from the image file.
In addition, the image viewing program for executing the method of the present invention is further capable of automatically detecting the edge. After the image viewing program reads the image file, each edge of the object in the image file can be automatically detected. Since when shooting the coat, there is surely a color difference between the coat and the background, the image viewing program finds out the edge of the coat by utilizing the color difference, and the actual size between the edges is calculated first, and once the second user selects the target, the actual size can be displayed.
Furthermore, since the existing digital cameras have been converted from the fixed focal lens set to the varifocal lens set, the table 300b stored in the digital camera actually further contains a zooming segment 330. As shown in
The invention being thus described, it will be obvious that the same may be varied in many ways. Such variations are not to be regarded as a departure from the spirit and scope of the invention, and all such modifications as would be obvious to one skilled in the art are intended to be included within the scope of the following claims.
Number | Date | Country | Kind |
---|---|---|---|
095140450 | Nov 2006 | TW | national |