Image acquisition method and apparatus, electronic device, computer-readable storage medium

By acquiring the current control values ​​of the camera module and the correspondence between preset control values ​​and pixel positions, the preview image is cropped to maintain a constant field of view, thus solving the problem of inconsistent target object size caused by changes in the distance between the lens and the image sensor, and improving the shooting experience.

CN116132789BActive Publication Date: 2026-01-02BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111354023.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-11
Publication Date
2026-01-02
Estimated Expiration
2041-11-11

AI Technical Summary

Technical Problem

When capturing images, changes in the distance between the lens and the image sensor can cause inconsistent sizes of target objects in the preview image, affecting the shooting experience.

Method used

By acquiring the current control values ​​of the camera module and the correspondence between preset control values ​​and pixel positions, the preview image is cropped to keep the field of view unchanged, thereby acquiring the target image with varying sharpness.

Benefits of technology

Maintaining the image size during focusing enhances the shooting experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116132789B_ABST
    Figure CN116132789B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an image acquisition method and device, electronic equipment and computer readable storage medium. The method comprises: in response to the camera module completing focusing, controlling the camera module to acquire a preview image and to acquire a current control amount of the camera module; based on a preset control amount and a corresponding relationship of pixel positions of to-be-cropped pixels, acquiring a target position of a to-be-cropped pixel corresponding to the current control amount; acquiring a remaining image after pixel cropping of the target position in the preview image, and taking the remaining image as a target image of this time of shooting. In this embodiment, by cropping the image, the effect that the field of view does not change, that is, the image size does not change, and only the definition changes during focusing can be achieved, so that the influence of focusing on the field of view can be eliminated, and the shooting experience can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of control technology, and in particular to an image acquisition method and apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] With the widespread use of electronic devices, more and more users are using the cameras on their devices to take pictures. In practical applications, focusing is required to obtain high-quality images when taking pictures. During the focusing process, a motor drives the lens in the camera, causing the distance between the lens and the image sensor (i.e., the image distance) to change accordingly. See also Figure 1 ,exist Figure 1 In the right image, the image distance is relatively small while the field of view (FOV) is large, resulting in a smaller target object in the preview image; Figure 1 In the left image, the image distance is relatively large while the field of view (FOV) is small, resulting in a larger target object in the preview image. This can lead to discrepancies in target object size between the preview and the target object during focusing, negatively impacting the shooting experience. Summary of the Invention

[0003] This disclosure provides an image acquisition method and apparatus, an electronic device, and a computer-readable storage medium to address the shortcomings of related technologies.

[0004] According to a first aspect of the present disclosure, an image acquisition method is provided, applied to an electronic device, the electronic device including a camera module; the method includes:

[0005] In response to the camera module completing focus, control the camera module to acquire a preview image and acquire the current control quantity of the camera module;

[0006] Based on the preset correspondence between the control quantity and the pixel position of the pixel to be cropped, the target position of the pixel to be cropped corresponding to the current control quantity is obtained;

[0007] Obtain the remaining image after cropping the pixels at the target location in the preview image, and use the remaining image as the target image for this capture.

[0008] In one embodiment, obtaining the remaining image after cropping pixels at the target location in the preview image, and using the remaining image as the target image for this capture, includes:

[0009] The target location is sent to the camera module, so that the camera module can crop the preview image based on the target location and output the remaining image;

[0010] The remaining image is acquired and used as the target image.

[0011] In an embodiment, the method further comprises the steps of: obtaining a remaining image after cropping the pixels at the target position in the preview image, and taking the remaining image as a target image for the current shooting.

[0012] obtaining a preview image output by the camera module;

[0013] cropping the pixels at the target position in the preview image to obtain a remaining image, and taking the remaining image as a target image for the current shooting.

[0014] In an embodiment, the method further comprises the steps of: obtaining a preset correspondence between a control amount and a pixel position of a pixel to be cropped, comprising:

[0015] moving a lens of the camera module to a first position to obtain a first image and a control amount corresponding to the first image; the lens has a maximum field of view when located at the first position;

[0016] moving the lens of the camera module to an intermediate position between the first position and a second position and the second position to obtain a plurality of second images and a control amount corresponding to each second image;

[0017] aligning each second image with the first image respectively to determine a pixel position of a pixel to be cropped in the second image under the preset field of view;

[0018] establishing a correspondence between the pixel position and the corresponding control amount for the first image and each second image to obtain a preset correspondence between a control amount and a pixel position of a pixel to be cropped.

[0019] Optionally, the step of aligning each second image with the first image respectively to determine a pixel position of a pixel to be cropped in the second image under the preset field of view, comprises:

[0020] obtaining a candidate corner point in each second image and the first image respectively, and taking a corner point existing in both the first image and the second image as a target corner point;

[0021] obtaining a first distance between any two target corner points in the first image, and obtaining a second distance between the same target corner points in the second image;

[0022] obtaining a ratio of the first distance and the second distance;

[0023] obtaining a third distance from the two target corner points to an edge of the first image;

[0024] calculating a quotient of the third distance and the ratio, and taking the quotient as a distance from the two target corner points to a position to be cropped in the second image.

[0025] obtaining pixels and pixel positions between the to-be-cut position and edges of the second image, to obtain pixel positions of to-be-cut pixels of the second image under the preset field of view angle.

[0026] In an embodiment, the method further includes:

[0027] displaying the target image after adjusting the size of the target image to the same size as the display screen of the electronic device.

[0028] According to a second aspect of the embodiments of the present disclosure, an image acquisition apparatus is provided, applied to an electronic device, the electronic device including a camera module; the apparatus includes:

[0029] a current control amount acquisition module, configured to control the camera module to acquire a preview image and acquire a current control amount of the camera module in response to the camera module completing focusing;

[0030] a target position acquisition module, configured to acquire a target position of to-be-cut pixels corresponding to the current control amount based on a preset correspondence between control amounts and pixel positions of to-be-cut pixels;

[0031] a target image acquisition module, configured to acquire a remaining image after cutting pixels of the target position in the preview image, and take the remaining image as a target image of this time of shooting.

[0032] In an embodiment, the target image acquisition module includes:

[0033] a target position sending unit, configured to send the target position to the camera module, so that the camera module outputs a remaining image after cutting the preview image based on the target position;

[0034] a target image acquisition unit, configured to acquire the remaining image and take the remaining image as the target image.

[0035] In an embodiment, the target image acquisition module includes:

[0036] a preview image acquisition unit, configured to acquire a preview image output by the camera module;

[0037] a target image acquisition unit, configured to acquire a remaining image after cutting pixels of the target position in the preview image, and take the remaining image as a target image of this time of shooting.

[0038] In an embodiment, the apparatus further includes a correspondence acquisition module, the correspondence acquisition module including:

[0039] The first image acquisition unit is configured to move a lens of the camera module to a first position, acquire a first image and a control amount corresponding to the first image, and the field of view of the camera module is the largest when the lens is at the first position.

[0040] The second image acquisition unit is configured to move the lens of the camera module to an intermediate position between the first position and a second position and the second position, acquire a plurality of second images and a control amount corresponding to each second image.

[0041] The pixel position determination unit is configured to align each second image and the first image respectively, and determine a pixel position of a pixel to be cropped in the second image under the preset field of view.

[0042] The corresponding relationship acquisition unit is configured to establish a corresponding relationship between the pixel position and the corresponding control amount for the first image and each second image, and obtain a preset corresponding relationship between the control amount and the pixel position of the pixel to be cropped.

[0043] Optionally, the pixel position determination unit comprises:

[0044] The target corner point acquisition subunit is configured to acquire candidate corner points in each second image and the first image respectively, and take a corner point existing in the first image and the second image simultaneously as a target corner point.

[0045] The second distance acquisition subunit is configured to acquire a first distance between any two target corner points in the first image, and acquire a second distance between the same target corner points in the second image.

[0046] The distance ratio acquisition subunit is configured to acquire a ratio of the first distance and the second distance.

[0047] The third distance acquisition subunit is configured to acquire a third distance from the two target corner points to an edge of the first image.

[0048] The cropping position calculation subunit is configured to calculate a quotient value of the third distance and the ratio, and take the quotient value as a distance from the two target corner points to a to-be-cropped position in the second image.

[0049] The pixel position acquisition subunit is configured to acquire a pixel and a pixel position between the to-be-cropped position and an edge of the second image, and obtain the pixel position of the pixel to be cropped in the second image under the preset field of view.

[0050] In an embodiment, the device further comprises:

[0051] The target image display module is configured to display the target image after adjusting the size of the target image to the same size as the display screen of the electronic device.

[0052] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, comprising:

[0053] a processor;

[0054] a memory for storing a computer program executable by the processor;

[0055] The processor is configured to execute the computer program in the memory to implement the method as described above.

[0056] According to a fourth aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, which can implement the method as described above when the executable computer program in the storage medium is executed by a processor.

[0057] The technical solutions provided by the embodiments of the present disclosure can include the following beneficial effects:

[0058] As can be seen from the above embodiments, the scheme provided by the embodiments of the present disclosure can control the camera module to acquire a preview image and acquire a current control amount of the camera module in response to the camera module completing focusing; then, based on a preset correspondence between the control amount and a pixel position of a to-be-cut pixel, a target position of the to-be-cut pixel corresponding to the current control amount is acquired; thereafter, a remaining image after pixel cutting of the target position in the preview image is acquired, and the remaining image is taken as a target image of this time of shooting. In this embodiment, by cutting the image, the effect of the field of view not changing, i.e., the image size not changing, but the definition changing, during focusing can be achieved, so that the influence of focusing on the field of view can be eliminated, and the shooting experience can be improved.

[0059] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0060] The accompanying drawings, which are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure.

[0061] Figure 1 is a schematic diagram of the effect in the related art.

[0062] Figure 2 is a schematic diagram of the movement effect of a lens in the related art.

[0063] Figure 3 is a flowchart of an image acquisition method according to an exemplary embodiment.

[0064] Figure 4 is a flowchart of acquiring a correspondence between a control amount and a pixel position according to an example embodiment.

[0065] Figure 5 is a flowchart of acquiring a pixel position of a pixel to be cut according to an example embodiment.

[0066] Figure 6 is a schematic diagram of a first distance and a second distance according to an example embodiment.

[0067] Figure 7 is a schematic diagram of a third distance according to an example embodiment.

[0068] Figure 8 is a schematic diagram of an effect of a cutting position according to an example embodiment.

[0069] Figure 9 is a flowchart of cutting a preview image according to an example embodiment.

[0070] Figure 10 is a flowchart of cutting a preview image according to another example embodiment.

[0071] Figure 11 is a schematic diagram of an effect of an enlarged target image according to an example embodiment.

[0072] Figure 12 is a block diagram of an image acquisition apparatus according to an example embodiment.

[0073] Figure 13 is a block diagram of an electronic device according to an example embodiment. DETAILED DESCRIPTION

[0074] The example embodiments will be described in detail below with reference to the accompanying drawings. Wherever possible, the same reference numbers will be used throughout the drawings to refer to the same or like elements. The following description of example embodiments is not representative of all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus consistent with some aspects of the present disclosure as detailed in the appended claims. It is to be understood that the features of the following embodiments and implementations can be combined with each other, if not contradictory.

[0075] In practical applications, the electronic device includes a camera module, and the camera module includes an image sensor, a lens, and a motor for adjusting a position of the lens. Thus, the position of the lens can be adjusted by controlling the motor. In practical applications, the lens can be moved within a certain range, such as Figure 2The first position P1 and the second position P2 are shown. The first position P1 is the position where the distance between the lens and the image sensor (i.e., the image distance) is the smallest, and the field of view of the camera module is the largest, and the object in the corresponding image is the smallest. The second position P2 is the position where the distance between the lens and the image sensor (i.e., the image distance) is the largest, and the field of view of the camera module is the smallest, and the object in the corresponding image is the largest. During the focusing process of the photographed image, the field of view changes when the lens is at different positions, which causes a certain object in the image to change, affecting the shooting experience. To solve the above technical problem, the embodiment of the present disclosure provides an image acquisition method, Figure 3 is a flowchart of an image acquisition method according to an exemplary embodiment. Referring to Figure 3 , an image acquisition method includes steps 31-33.

[0076] In step 31, in response to the camera module completing focusing, the camera module is controlled to acquire a preview image and acquire a current control amount of the camera module.

[0077] In this embodiment, after the camera module is turned on, the camera module will respond to the user's focusing operation, and the processor in the electronic device will send a control instruction to the camera module. The camera module can control the motor to work in response to the control instruction, and the motor will drive the lens to move, thereby adjusting the focal length of the lens to complete focusing. Alternatively, after the camera module is turned on, the processor can acquire the working mode (such as aperture priority mode, shutter priority mode, full-automatic mode, etc.) of the camera module, acquire a preview image in this working mode, and identify the sharpness of the preview image. When the sharpness is less than the sharpness threshold, the processor can control the camera module to focus. The above steps are repeatedly executed until the sharpness of the preview image is greater than or equal to the sharpness threshold, and the focusing is stopped.

[0078] After focusing is completed, the processor can acquire the control amount corresponding to the control instruction. Moreover, the processor can control the camera module to acquire a preview image.

[0079] In step 32, based on a preset correspondence between the control amount and the pixel position of the to-be-cropped pixel, a target position of the to-be-cropped pixel corresponding to the current control amount is acquired.

[0080] In this embodiment, the electronic device can store a preset correspondence between the control amount and the pixel position of the to-be-cropped pixel, wherein the control amount refers to the value corresponding to the control instruction sent by the processor when controlling the motor in the camera module to drive the lens, such as the driving voltage or the driving current. The above correspondence can be acquired by the following method, referring to Figure 4 , including steps 41-44.

[0081] In step 41, the electronic device can move the lens of the camera module to the first position, obtain a first image and a control amount corresponding to the first image; wherein the field of view of the camera module is the largest when the lens is at the first position.

[0082] In an example, the user can manually operate the control button, sliding bar or knob of the lens, and the electronic device can generate a control signal (including a control amount) and send it to the camera module after detecting the operation. The motor in the camera module can drive the lens to move towards the image sensor in response to the control signal and finally move to the first position. Then, the electronic device can control the camera module to capture an image, i.e., obtain the first image. Here, the first image is referred to in order to distinguish from the second image. In addition, the processor can also obtain the control amount at the first position, i.e., the control amount corresponding to the first image.

[0083] It can be understood that the control amount of the first position of the camera module is determined after the manufacturing is completed. At this time, the processor can determine the control amount after controlling the lens of the camera module to reach the first position, so as to obtain the control amount of the lens of the camera module, i.e., the control amount corresponding to the first image.

[0084] In step 42, the electronic device can move the lens of the camera module to an intermediate position between the first position and the second position and the second position, obtain a plurality of second images and a control amount corresponding to each second image.

[0085] After obtaining the first image, the electronic device can move the lens from the first position according to the user's operation, to any intermediate position between the first position and the second position, and to the second position. At each of the intermediate position and the second position, the processor can control the camera module to capture an image, i.e., a second image. It can be understood that for the camera module, the control amount corresponding to each position of the lens is determined, i.e., the control amount corresponding to each second image is obtained.

[0086] It should be noted that, Figure 4 The embodiments shown in the examples show a scheme of moving the lens from the first position to the second position to obtain the first image and the second image. In actual application, the first image and the second image can also be obtained by moving the lens from the second position to the first position. Since the first image and the second image do not have a time sequence relationship in use, the order of step 41 and step 42 is not limited.

[0087] In step 43, the electronic device can align each of the second images and the first image respectively, and determine the pixel position of the to-be-cut pixel of the second image under the preset field of view.

[0088] The size or number of the objects in the field of view can change for the purpose of focusing, but a part of the object will always remain in the field of view only in size. If one image is captured before and after focusing or during the focusing process, there will be the same or similar features (such as corners, edges, etc.) in the two images.

[0089] Based on this, the second image can be determined in the first image as a reference image to cut the pixel, see Figure 5 , including steps 51-56. In step 51, the processor can acquire candidate corners in each second image and the first image, and the corners existing in the first image and the second image at the same time are taken as target corners, as shown in Figure 6 The target corners can be acquired by using a corner detection algorithm (such as Harris corner detection algorithm, Shi-Tomasi corner detection algorithm, FAST feature point detection algorithm, SIFT algorithm or SUR algorithm), and the specific scheme can refer to the processing scheme of the above algorithms, which will not be repeated here.

[0090] In step 52, the processor can acquire the first distance between any two target corners in the first image, and acquire the second distance between the same target corners in the second image. After determining the target corners, the processor can select any two target corners from the first image, and calculate the distance of the two target corners, that is, the first distance, wherein the calculation method of the first distance can refer to the Euclidean distance, which will not be repeated here. Then, the processor calculates the distance of the same two target corners in the second image, that is, the second distance. The first distance and the second distance can refer to d1 and d2 shown in Figure 6 .

[0091] In step 53, the processor can acquire the ratio of the first distance and the second distance. Since the focusing process makes the distance of the two target corners larger, the first distance changes to the second distance, and at this time, the ratio of the second distance to the first distance can be calculated, so as to determine the change multiple of the distance of the two target corners, or the change multiple of the object in the second image to the same object in the first image.

[0092] In step 54, the processor can acquire the third distance from the two target corners to the edge of the first image. After the processor acquires the target corners, the distance from each target corner to the edge of the first image, that is, the third distance, can be acquired, as shown in d31-d34. Figure 7 .

[0093] In step 55, the processor can calculate the quotient of the third distance and the ratio, and take the quotient as the distance from the two target corner points in the second image to the cutting position. See Figure 8 The cutting position is the mapping position L of the edge of the remaining image F21 after the second image F2 is cropped based on the cutting position and then reduced by the ratio and aligned with the target corner points in the first image F1.

[0094] In step 56, the processor can obtain the pixels and pixel positions between the cutting position and the edge of the second image, and obtain the pixel positions of the cutting pixels of the second image under the preset field of view angle.

[0095] In step 44, the electronic device can establish the correspondence between the pixel positions and the corresponding control amounts for the first image and each of the second images, and obtain the correspondence between the preset control amounts and the pixel positions of the cutting pixels. After determining the pixel positions of the cutting pixels and the corresponding control amounts of the first image and each of the second images, the processor can one-to-one map the pixel positions of the cutting pixels and the pixels, establish the correspondence between the pixel positions and the corresponding control amounts, and store them in a designated location (such as a local memory or a cache, etc.).

[0096] In the embodiment, after obtaining the current pixel, the processor can obtain the target position corresponding to the current control amount based on the correspondence between the preset control amounts and the pixel positions of the cutting pixels.

[0097] In step 33, the remaining image after the pixel cutting of the target position in the preview image is obtained, and the remaining image is taken as the target image of this time of shooting.

[0098] In the embodiment, the processor can obtain the remaining image after the pixel cutting of the target position in the preview image, and take the remaining image as the target image of this time of shooting. The cutting pixels are located in Figure 8 the shadow area.

[0099] In an example, the cutting process can be implemented in the image sensor, see Figure 9 , including steps 91 and 92. In step 91, the processor can send the target position to the camera module, so that the camera module outputs the remaining image after cutting the preview image based on the target position. In step 92, the processor can communicate with the camera module to obtain the remaining image and take the remaining image as the target image. In this way, the processing process is implemented in the image sensor, and the image sensor can only output the data of the remaining image, which has a small amount of processing data and is efficient.

[0100] In another example, the cutting process can be implemented by the processor, see Figure 10, including step 101 and step 102. In step 101, the processor can acquire a preview image output by the camera module. In step 102, the processor can obtain a remaining image after cutting the pixels at the target position in the preview image, and take the remaining image as the target image for this time of shooting. In this way, in the present example, only the software program needs to be adjusted to process each preview image, and the design is simple and easy to maintain.

[0101] In another embodiment, referring to Figure 11 After obtaining the target image F21, the processor can enlarge the target image F21 to the size of the first image F1, that is, the image F, and output to the display screen for display.

[0102] So far, the scheme provided by the embodiments of the present disclosure can respond to the completion of focusing of the camera module, control the camera module to acquire a preview image and acquire a current control amount of the camera module; then, based on a preset correspondence between the control amount and the pixel position of the to-be-cut pixels, a target position of the to-be-cut pixels corresponding to the current control amount is obtained; then, a remaining image after cutting the pixels at the target position in the preview image is obtained, and the remaining image is taken as a target image for this time of shooting. In the present embodiment, by cutting the image, the effect of unchanged field of view angle, that is, unchanged image size, and changed definition during focusing can be achieved, so that the influence of focusing on the field of view angle can be eliminated, and the shooting experience can be improved.

[0103] On the basis of the above-mentioned image acquisition method, the embodiments of the present disclosure further disclose an image acquisition device applied to an electronic device, wherein the electronic device comprises a camera module; referring to Figure 12 , the device comprises:

[0104] The current control amount acquisition module 121 is configured to respond to the completion of focusing of the camera module, control the camera module to acquire a preview image and acquire a current control amount of the camera module.

[0105] The target position acquisition module 122 is configured to acquire a target position of to-be-cut pixels corresponding to the current control amount based on a preset correspondence between the control amount and the pixel position of the to-be-cut pixels.

[0106] The target image acquisition module 123 is configured to acquire a remaining image after cutting the pixels at the target position in the preview image, and take the remaining image as a target image for this time of shooting.

[0107] In an embodiment, the target image acquisition module comprises:

[0108] The target position sending unit is configured to send the target position to the camera module, so that the camera module outputs a remaining image after cutting the preview image based on the target position.

[0109] a target image acquisition unit, configured to acquire a remaining image and take the remaining image as the target image.

[0110] In an embodiment, the target image acquisition module comprises:

[0111] a preview image acquisition unit, configured to acquire a preview image output by the camera module;

[0112] a target image acquisition unit, configured to cut pixels in the preview image located at the target position to obtain a remaining image, and take the remaining image as the target image of this time of shooting.

[0113] In an embodiment, the apparatus further comprises a correspondence acquisition module, which comprises:

[0114] a first image acquisition unit, configured to move a lens of the camera module to a first position, acquire a first image and a control amount corresponding to the first image; the lens has a maximum field of view angle when located at the first position;

[0115] a second image acquisition unit, configured to move the lens of the camera module to an intermediate position between the first position and a second position and the second position, acquire a plurality of second images and a control amount corresponding to each second image;

[0116] a pixel position determination unit, configured to respectively align each second image and the first image, and determine a pixel position of a pixel to be cut in the second image under the preset field of view angle;

[0117] a correspondence acquisition unit, configured to, for the first image and each second image, establish a correspondence between the pixel position and the corresponding control amount, and obtain a preset correspondence between the control amount and the pixel position of the pixel to be cut.

[0118] In an embodiment, the pixel position determination unit comprises:

[0119] a target corner point acquisition subunit, configured to respectively acquire candidate corner points in each second image and the first image, and take a corner point existing in both the first image and the second image as a target corner point;

[0120] a second distance acquisition subunit, configured to acquire a first distance between any two target corner points in the first image, and acquire a second distance between the same target corner points in the second image;

[0121] a distance ratio acquisition subunit, configured to acquire a ratio of the first distance to the second distance;

[0122] a third distance obtaining sub-unit, configured to obtain a third distance from the two target corner points in the first image to an edge of the first image;

[0123] a cutting position calculating sub-unit, configured to calculate a quotient value of the third distance and the ratio, and take the quotient value as a distance from the two target corner points in the second image to a cutting position to be cut;

[0124] a pixel position obtaining sub-unit, configured to obtain pixels and pixel positions between the cutting position to be cut and an edge of the second image, to obtain pixel positions of pixels to be cut in the second image under the preset field of view angle.

[0125] In an embodiment, the apparatus further comprises:

[0126] a target image displaying module, configured to display the target image after adjusting the size of the target image to the same size as the display screen of the electronic device.

[0127] It should be noted that the apparatus and device shown in the embodiment and the content of the method embodiment are matched, and the content of the above-mentioned method embodiment can be referred to, which will not be repeated here.

[0128] Figure 13 is a block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 1300 can be a smartphone, a computer, a digital broadcast terminal, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0129] Referring to Figure 13 , the electronic device 1300 can include one or more of the following components: a processing component 1302, a memory 1304, a power supply component 1306, a multimedia component 1308, an audio component 1310, an input / output (I / O) interface 1312, a sensor component 1314, a communication component 1316, and an image acquisition component 1318.

[0130] The processing component 1302 usually controls the overall operation of the electronic device 1300, such as operations associated with display, telephone call, data communication, camera operation and recording operation. The processing component 1302 can include one or more processors 1320 to execute computer programs. In addition, the processing component 1302 can include one or more modules to facilitate interaction between the processing component 1302 and other components. For example, the processing component 1302 can include a multimedia module to facilitate interaction between the multimedia component 1308 and the processing component 1302.

[0131] The memory 1304 is configured to store various types of data to support operations of the electronic device 1300. Examples of such data include computer programs for operating any applications or methods on the electronic device 1300, contact data, phonebook data, messages, pictures, videos, and the like. The memory 1304 can be implemented by any type of volatile or nonvolatile memory, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk or a optical disk.

[0132] The power component 1306 provides power for various components of the electronic device 1300. The power component 1306 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 1300. The power component 1306 can include a power chip, and a controller can communicate with the power chip to control the power chip to turn on or off a switching device to supply or not supply power from a battery to a main board circuit.

[0133] The multimedia component 1308 includes a screen providing an output interface between the electronic device 1300 and a target object. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes the touch panel, the screen can be implemented as a touch screen to receive input information from a user. The touch panel includes one or more touch sensors to sense a touch, a slide, and a gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or a sliding action, but also detect duration and pressure related to the touching or sliding action.

[0134] The audio component 1310 is configured to output and / or input audio file information. For example, the audio component 1310 includes a microphone (MIC) configured to receive external audio file information when the electronic device 1300 is in an operating mode such as a call mode, a recording mode, and a voice recognition mode. The received audio file information can be further stored in the memory 1304 or transmitted via the communication component 1316. In some embodiments, the audio component 1310 also includes a speaker for outputting audio file information.

[0135] The I / O interface 1312 provides an interface between the processing component 1302 and peripheral interface modules, which can be a keyboard, a click wheel, a button, and the like.

[0136] The sensor component 1314 includes one or more sensors to provide the electronic device 1300 with various status assessments. For example, the sensor component 1314 can detect an open / closed position of the electronic device 1300, relative positioning of components, such as a display screen and a keypad of the electronic device 1300, a change in position of the electronic device 1300 or a component, presence or absence of a target object in contact with the electronic device 1300, orientation or acceleration / deceleration of the electronic device 1300, and a change in temperature of the electronic device 1300. In an example embodiment, the sensor component 1314 can include a magnetic force sensor, a gyroscope, and a magnetic field sensor including at least one of a Hall sensor, a thin-film magnetoresistive sensor, and a magnetic liquid acceleration sensor.

[0137] The communication component 1316 is configured to facilitate wired or wireless communication between the electronic device 1300 and other devices. The electronic device 1300 can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof, In an example embodiment, the communication component 1316 receives broadcast information or broadcast-related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component 1316 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra-WideBand (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0138] In an example embodiment, the electronic device 1300 can be implemented using one or more application-specific integrated circuits (ASICs), digital information processors (DSPs), digital information processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements.

[0139] In an example embodiment, a computer-readable storage medium, such as the memory 704 including instructions, is also provided, and the executable computer program described above can be executed by the processor. The readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0140] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features disclosed herein. It is intended that the disclosure be construed as including any variations, uses or adaptations of the specific embodiments following, including equivalents thereof within the scope of the disclosure and the general principles defining the disclosure. The specification and examples given are considered exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.

[0141] It is to be understood that the disclosure is not limited to the precise structures herein described and illustrated in the drawings, and that various modifications and changes can be made without departing from its scope. The scope of the disclosure is limited only by the claims that follow.

Claims

1. An image acquisition method, characterized in that, The method is applied to an electronic device, and the electronic device comprises a camera module and a processor. In response to the camera module completing focusing, the camera module is controlled to acquire a preview image and acquire a current control amount of the camera module; Based on a preset correspondence between a control amount and a pixel position of a pixel to be cropped, a target position of the pixel to be cropped corresponding to the current control amount is acquired; the preset correspondence between the control amount and the pixel position of the pixel to be cropped comprises a correspondence between each control amount and a pixel position of a pixel to be cropped; the control amount refers to a value corresponding to a control instruction sent by the processor when the processor controls a motor in the camera module to drive a lens; A remaining image after pixel cropping of the target position in the preview image is acquired, and the remaining image is taken as a target image of this time of shooting.

2. The method of claim 1, wherein, The method further comprises the step of acquiring the preset correspondence between the control amount and the pixel position of the pixel to be cropped, and the step comprises: The lens of the camera module is moved to a first position, a first image and a control amount corresponding to the first image are acquired; when the lens is located at the first position, a field of view angle of the camera module is maximum; The lens of the camera module is moved to an intermediate position between the first position and a second position and the second position, a plurality of second images and a control amount corresponding to each second image are acquired; 3. The method of claim 1, wherein, Each second image and the first image are aligned respectively, and a pixel position of a pixel to be cropped in the second image under a preset field of view angle is determined; For the first image and each second image, a correspondence between the pixel position and the corresponding control amount is established, and the preset correspondence between the control amount and the pixel position of the pixel to be cropped is obtained. The method further comprises the step of acquiring the preset correspondence between the control amount and the pixel position of the pixel to be cropped, and the step comprises:

4. The method of claim 1, wherein, Candidate corner points in each second image and the first image are acquired respectively, and a corner point existing in the first image and the second image simultaneously is taken as a target corner point; A first distance between any two target corner points in the first image is acquired, and a second distance between the same target corner points in the second image is acquired; A ratio of the first distance and the second distance is acquired; A third distance from the two target corner points in the first image to an edge of the first image is acquired; A third distance from the two target corner points in the first image to an edge of the first image is acquired; 5. The method of claim 4, wherein, ​ ​ ​ ​ ​ Calculating a quotient value of the third distance and the ratio, and taking the quotient value as a distance from the two target corner points in the second image to a position to be cut; Obtaining pixels and pixel positions between the position to be cut and an edge of the second image, to obtain pixel positions of pixels to be cut in the second image under the preset field of view angle.

6. The method of claim 1, wherein, The method further comprises: Displaying the target image after adjusting the size of the target image to the same size as the display screen of the electronic device.

7. An image acquisition device, characterized in that The electronic device comprises a camera module and a processor; and the device comprises: A current control amount obtaining module, configured to control the camera module to obtain a preview image and obtain a current control amount of the camera module in response to the camera module completing focusing; A target position obtaining module, configured to obtain a target position of pixels to be cut corresponding to the current control amount based on a preset correspondence between control amounts and pixel positions of pixels to be cut; the preset correspondence between control amounts and pixel positions of pixels to be cut comprises a correspondence between each control amount and a pixel position of pixels to be cut; the control amount refers to a value corresponding to a control instruction sent by the processor when controlling a motor driving lens in the camera module; A target image obtaining module, configured to obtain a remaining image after cutting pixels in the target position in the preview image, and take the remaining image as a target image for this time of shooting.

8. The apparatus of claim 7, wherein, The target image obtaining module comprises: A target position sending unit, configured to send the target position to the camera module, so that the camera module outputs a remaining image after cutting the preview image based on the target position; A target image obtaining unit, configured to obtain the remaining image and take the remaining image as the target image.

9. The apparatus of claim 7, wherein, The target image obtaining module comprises: A preview image obtaining unit, configured to obtain a preview image output by the camera module; A target image obtaining unit, configured to obtain a remaining image after cutting pixels in the target position in the preview image, and take the remaining image as a target image for this time of shooting.

10. The apparatus of claim 7, wherein, The device further comprises a correspondence obtaining module, and the correspondence obtaining module comprises: A first image obtaining unit, configured to move a lens of the camera module to a first position, and obtain a first image and a control amount corresponding to the first image; the field of view angle of the camera module is maximum when the lens is at the first position; A second image obtaining unit, configured to move the lens of the camera module to an intermediate position between the first position and a second position and the second position, and obtain a plurality of second images and a control amount corresponding to each second image; A pixel position determining unit, configured to align each second image and the first image respectively, and determine pixel positions of pixels to be cut in the second image under a preset field of view angle; A correspondence obtaining unit, configured to establish a correspondence between the pixel positions and the corresponding control amounts for the first image and each second image, to obtain the preset correspondence between control amounts and pixel positions of pixels to be cut.

11. The apparatus of claim 10, wherein, The pixel position determining unit comprises: The target corner point acquisition subunit is configured to acquire candidate corner points in each of the second image and the first image respectively, and to acquire as target corner points the corner points existing in both the first image and the second image simultaneously. The second distance acquisition subunit is configured to acquire a first distance between any two target corner points in the first image, and to acquire a second distance between the same target corner points in the second image. The distance ratio acquisition subunit is configured to acquire a ratio of the first distance and the second distance. The third distance acquisition subunit is configured to acquire a third distance from the two target corner points to an edge of the first image. The cutting position calculation subunit is configured to calculate a quotient value of the third distance and the ratio, and to acquire the quotient value as a distance from the two target corner points to a to-be-cut position in the second image. The pixel position acquisition subunit is configured to acquire pixels and pixel positions between the to-be-cut position and an edge of the second image, and to obtain pixel positions of to-be-cut pixels of the second image under the preset field of view angle.

12. The apparatus of claim 7, wherein, The device further comprises: The target image display module is configured to display the target image after adjusting the size of the target image to the same size as the display screen of the electronic device.

13. An electronic device, comprising: It comprises: a processor; a memory for storing a computer program executable by the processor; wherein the processor is configured to execute the computer program in the memory to implement the method of any one of claims 1-6.

14. A computer-readable storage medium, characterized in that, When the executable computer program in the storage medium is executed by the processor, the method of any one of claims 1-6 can be implemented.

Citation Information

Patent Citations

  • Control method, control device and electronic device

    CN105657274A