CN105100616B - Image processing method and electronic equipment - Google Patents

Image processing method and electronic equipment Download PDF

Info

Publication number
CN105100616B
CN105100616B CN201510446459.9A CN201510446459A CN105100616B CN 105100616 B CN105100616 B CN 105100616B CN 201510446459 A CN201510446459 A CN 201510446459A CN 105100616 B CN105100616 B CN 105100616B
Authority
CN
China
Prior art keywords
image
scanned
size data
sub
visual angle
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.)
Active
Application number
CN201510446459.9A
Other languages
Chinese (zh)
Other versions
CN105100616A (en
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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201510446459.9A priority Critical patent/CN105100616B/en
Publication of CN105100616A publication Critical patent/CN105100616A/en
Application granted granted Critical
Publication of CN105100616B publication Critical patent/CN105100616B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention provides an image processing method and electronic equipment, which are used for solving the problem that the size of an image printed and displayed by the electronic equipment is not real. The method comprises the following steps: acquiring a first image through an image acquisition unit of the electronic equipment; extracting a sub-image corresponding to an object to be scanned in the first image, and determining original size data corresponding to the object to be scanned; processing the sub-image according to a preset rule according to the original size data to obtain a second image; and the corresponding size data of the object to be scanned in the second image is the same as the original size data.

Description

Image processing method and electronic equipment
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to an image processing method and an electronic device.
Background
With the continuous development of scientific technology, electronic technology has also been developed rapidly, and the performance and appearance of electronic equipment have all been promoted greatly. More and more things users can do with electronic devices, such as: a user may send a captured or scanned image to other users via a networked electronic device.
At present, people often need to obtain a scanned image with the size of a scanned object consistent with the original size through scanning in life, and then the scanned image can be printed, stored or sent.
However, in the absence of a scanner, if a user needs an image of an object, the user often takes a picture of the object by using a photographing function of an electronic device (such as a mobile phone), and prints the taken picture. However, since the size of an image captured by a camera is generally fixed, the size of a photographic subject displayed in a printed image is not real.
Disclosure of Invention
The embodiment of the invention provides an image processing method and electronic equipment, which are used for solving the problem that the size of an image printed and displayed by the electronic equipment is not real.
An image processing method comprising the steps of:
acquiring a first image through an image acquisition unit of the electronic equipment;
extracting a sub-image corresponding to an object to be scanned in the first image, and determining original size data corresponding to the object to be scanned;
processing the sub-image according to a preset rule according to the original size data to obtain a second image; and the corresponding size data of the object to be scanned in the second image is the same as the original size data.
Optionally, extracting a sub-image corresponding to the object to be scanned in the first image, and determining original size data corresponding to the object to be scanned, includes:
converting the first image into a normal visual angle image;
capturing the sub-image corresponding to the object to be scanned in the normal view angle image;
and determining the original size data corresponding to the object to be scanned.
Optionally, grabbing the sub-image corresponding to the object to be scanned in the normal view image includes:
determining edge information corresponding to the object to be scanned in the normal visual angle image;
and carrying out image segmentation on the normal visual angle image according to the edge information to obtain the sub-image.
Optionally, before grabbing the sub-image corresponding to the object to be scanned in the normal view image, the method further includes:
determining an included angle between the central axis of the object to be scanned and the central axis of the normal visual angle image; the central axis of the normal visual angle image is a central line in the normal visual angle image, which is perpendicular to the horizontal edge of the normal visual angle image, and the central axis of the object to be scanned is a central line which is perpendicular to a reference line in the object to be scanned;
based on the central point of the object to be scanned, rotating the object to be scanned to a target position in the normal visual angle image according to the included angle; and at the target position, the central axis of the object to be scanned is parallel to the central axis of the normal visual angle image, and the display direction of the object to be scanned is a positive direction.
Optionally, obtaining a second image corresponding to the sub-image according to the original size data includes:
obtaining a ratio between the size data of the sub-image and the original size data;
scaling the sub-image according to the determined proportion so that the size data of the scaled sub-image is the same as the original size data;
and taking the scaled sub-image as the second image.
An electronic device, comprising:
the image acquisition device is used for acquiring a first image containing an object to be scanned;
the processor is connected with the image collector and used for extracting the subimage corresponding to the object to be scanned from the first image, determining the original size data corresponding to the object to be scanned, and processing the subimage according to a preset rule according to the original size data to obtain a second image; and the corresponding size data of the object to be scanned in the second image is the same as the original size data.
Optionally, the processor is configured to:
converting the first image into a normal visual angle image;
capturing the sub-image corresponding to the object to be scanned in the normal view angle image;
and determining the original size data corresponding to the object to be scanned.
Optionally, the processor is configured to:
determining edge information corresponding to the object to be scanned in the normal visual angle image;
and carrying out image segmentation on the normal visual angle image according to the edge information to obtain the sub-image.
Optionally, the processor is further configured to:
before the sub-image corresponding to the object to be scanned is captured in the normal visual angle image, determining an included angle between a central axis of the object to be scanned and a central axis of the normal visual angle image; the central axis of the normal visual angle image is a central line in the normal visual angle image, which is perpendicular to the horizontal edge of the normal visual angle image, and the central axis of the object to be scanned is a central line which is perpendicular to a reference line in the object to be scanned;
based on the central point of the object to be scanned, rotating the object to be scanned to a target position in the normal visual angle image according to the included angle; and at the target position, the central axis of the object to be scanned is parallel to the central axis of the normal visual angle image, and the display direction of the object to be scanned is a positive direction.
Optionally, the processor is configured to:
obtaining a ratio between the size data of the sub-image and the original size data;
scaling the sub-image according to the determined proportion so that the size data of the scaled sub-image is the same as the original size data;
and taking the scaled sub-image as the second image.
An electronic device, comprising:
the acquisition module is used for acquiring a first image through an image acquisition unit of the electronic equipment;
the extraction module is used for extracting a sub-image corresponding to an object to be scanned in the first image and determining original size data corresponding to the object to be scanned;
the processing module is used for processing the subimage according to a preset rule according to the original size data to obtain a second image; and the corresponding size data of the object to be scanned in the second image is the same as the original size data.
In the embodiment of the present invention, since the first image acquired by the image acquisition unit of the electronic device includes the object to be scanned, the sub-image corresponding to the object to be scanned may be obtained, so as to determine the object to be scanned according to the sub-image, and further determine the original size data corresponding to the object to be scanned, where the original size data corresponding to the object to be scanned may refer to the real size data of the object to be scanned (for example, if the object to be scanned is a book, the original size data of the object to be scanned refers to the size data of the book), for example, the original size data of the object to be scanned may be determined in the pre-stored size data, and further, the second image corresponding to the sub-image may be obtained according to the original size data according to a preset rule (for example, scaling processing according to a scale), and the size data corresponding to the object to be scanned in the second image is made to be the same as the original size, in this way, the second image can be taken as a scanned image corresponding to the object to be scanned. Therefore, under the condition of no scanner, the image which is obtained by scanning the object to be scanned can be obtained, the obtained image can restore the real object to be scanned in size as much as possible, the image processing capacity of the electronic equipment is improved, and the user experience is also enhanced.
Drawings
FIG. 1 is a flow chart of an image processing method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a first image according to an embodiment of the present invention;
FIG. 3A is a flowchart of extracting sub-images according to an embodiment of the present invention;
FIG. 3B is a diagram illustrating an object to be scanned according to an embodiment of the present invention;
FIG. 3C is a schematic diagram of a normal viewing angle image of a first image according to an embodiment of the invention;
FIG. 4 is a main flowchart illustrating adjusting the display direction of an object to be scanned to a positive direction according to an embodiment of the present invention;
FIG. 5A is a schematic diagram of an object to be scanned and a central axis of a normal view image according to an embodiment of the present invention;
FIG. 5B is a diagram illustrating an object to be scanned in a forward direction according to an embodiment of the present invention;
FIG. 6 is a flow chart of obtaining a second image in an embodiment of the present invention;
FIG. 7 is a schematic diagram of obtaining a second image in an embodiment of the invention;
FIG. 8 is a schematic structural diagram of an electronic device according to an embodiment of the invention;
fig. 9 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides an image processing method and electronic equipment, wherein the method comprises the following steps: acquiring a first image through an image acquisition unit of the electronic equipment; extracting a sub-image corresponding to an object to be scanned in the first image, and determining original size data corresponding to the object to be scanned; processing the sub-image according to a preset rule according to the original size data to obtain a second image; and the corresponding size data of the object to be scanned in the second image is the same as the original size data.
In the embodiment of the present invention, since the first image acquired by the image acquisition unit of the electronic device includes the object to be scanned, the sub-image corresponding to the object to be scanned may be obtained, so as to determine the object to be scanned according to the sub-image, and further determine the original size data corresponding to the object to be scanned, where the original size data corresponding to the object to be scanned may refer to the real size data of the object to be scanned (for example, if the object to be scanned is a book, the original size data of the object to be scanned refers to the size data of the book), for example, the original size data of the object to be scanned may be determined in the pre-stored size data, and further, the second image corresponding to the sub-image may be obtained according to the original size data according to a preset rule (for example, scaling processing according to a scale), and the size data corresponding to the object to be scanned in the second image is made to be the same as the original size, in this way, the second image can be taken as a scanned image corresponding to the object to be scanned. Therefore, under the condition of no scanner, the image which is obtained by scanning the object to be scanned can be obtained, the obtained image can restore the real object to be scanned in size as much as possible, the image processing capacity of the electronic equipment is improved, and the user experience is also enhanced.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the embodiment of the present invention, the electronic device may be a PC (personal computer), a notebook, a PAD (tablet computer), a mobile phone, or other different devices, which is not limited in the present invention.
Optionally, in the embodiment of the present invention, the image capturing unit may refer to a capturing device, such as a camera, provided in the electronic device and used for capturing an image, or may also refer to a capturing device connected to the electronic device, such as a network monitoring camera installed indoors or outdoors.
Specifically, in the embodiment of the present invention, if the image acquisition unit is a camera, the image acquisition unit may specifically be a depth camera.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
As shown in fig. 1, the present invention provides an image processing method, including:
s11: the first image is acquired by an image acquisition unit of the electronic device.
In the embodiment of the invention, the first image is an image which is acquired by an image acquisition unit and contains an object to be scanned in the electronic equipment. Generally, the image captured by the image capturing unit in the electronic device may have a size, such as a size of a photograph captured by a camera of a mobile phone, which may be 1280 × 960, 240 × 320, etc.
Optionally, in this embodiment of the present invention, the first image may include one or more sub-images corresponding to the object to be scanned. If the user takes a contract document in close range, the contract document may occupy more area in the image, and the image may only include the sub-image of the contract document, that is, only include a sub-image corresponding to the object to be scanned, or, if the user takes the contract document in far range, the obtained image may include sub-images corresponding to other objects in addition to the sub-image of the contract document, for example, a sub-image of a desktop on which the contract document is placed, a sub-image of a pen close to the contract document, that is, a sub-image corresponding to a plurality of objects to be scanned, and so on.
In the embodiment of the present invention, a corresponding portion of an object to be scanned in an image is referred to as a sub-image of the object.
Optionally, in this embodiment of the present invention, the first image may be an image acquired by controlling the image acquisition unit when the electronic device receives an acquisition operation of a user. For example, a user can click a shooting button to control a camera of a mobile phone to shoot to obtain a picture.
S12: and extracting a sub-image corresponding to the object to be scanned in the first image, and determining original size data corresponding to the object to be scanned.
In the embodiment of the present invention, the object to be scanned may refer to an object corresponding to one sub-image in the first image, for example, the object to be scanned may be a resident identification card, a contract document, or the like.
If only one sub-image is included in the image, the sub-image can be directly extracted when being extracted; if the image includes a plurality of sub-images, when extracting the sub-images, the sub-image with the largest occupied area in the image may be extracted as the image corresponding to the object to be scanned, or the sub-image corresponding to the focal position of the image may be extracted as the image corresponding to the object to be scanned, which is not limited.
In practical applications, when a user acquires an image through an image acquisition unit of an electronic device, the acquired image may include sub-images of a plurality of objects due to limited acquisition conditions. For example, when the resident identification card placed on the desktop with the pattern is photographed, the photographed image may include the sub-image of the desktop with the pattern in addition to the sub-image of the resident identification card, and the sub-image of the desktop with the pattern may be regarded as the background image of the sub-image of the object to be scanned (i.e., the resident identification card). As shown in fig. 2, in the first image, numeral 101 represents a sub-image corresponding to the object to be scanned, and numeral 102 represents a background image.
Optionally, in the embodiment of the present invention, the original size data of the object to be scanned may be actual size data of a real object of the object to be scanned, such as a universal standard specification. The original size data of an object to be scanned may include size data of multiple dimensions, such as length, width, height, radian, and the like. For example, the original size data of the resident identification card may be the same as the general standard specification, and may include: length, width, corner arc, etc. For example, the original size data of the resident identification card is: length, width, 85.6mm, 54mm, and radius of corner arc, 3.18 mm.
In practical applications, when determining the original size data of the object to be scanned, the following two ways can be included, but not limited to.
The first method is as follows:
the electronic device may be pre-stored with N original size data corresponding to N objects to be scanned, so that a first object matched with the object to be scanned may be determined from the N objects to be scanned, and the first original size data corresponding to the first object is used as the original size data of the object to be scanned, where N is a positive integer.
Specifically, the N original size data stored in advance may correspond to relatively common scanned objects, such as a resident identification card, an a4 paper/B4 paper document, a vehicle driver's license, and the like. For example, the original size data corresponding to the pre-stored resident identification card is: length, width, 85.6mm, 54mm, radius of corner circular arc, 3.18mm, and corresponding original size data of a4 paper are: length, width, 210mm 297mm, the original dimensional data for B4 paper is: length, width, 25mm, 35.4mm, and so on.
For example, if it is determined that the object to be scanned matches a first object of the N objects to be scanned, where the first object is a resident identification card, it may be determined that the original size data of the object to be scanned is size data of the resident identification card.
In addition, if an object matching the object to be scanned cannot be determined from the N objects to be scanned, the size of the object to be scanned may be selected or set by the user.
For example, if the object to be scanned is a sheet of a4 paper including characters, the first image only includes a partial area of the sheet of a4 paper due to the close shooting distance, and the object to be scanned can only be determined to be a sheet file by recognition, but the size of the sheet of paper specifically corresponding thereto cannot be determined, that is, the object to be scanned cannot be determined to be a4 paper. At this time, the electronic device may output a prompt message to prompt the user to set the original size data of the object to be scanned, for example, the electronic device may provide the size data of one or more kinds of paper for the user to select from, or the user may input corresponding size data by himself, and the electronic device uses the size data selected or input by the user as the original size data of the object to be scanned.
The second method comprises the following steps:
if the image acquisition unit is a depth camera, a depth map of the first image can be obtained, and the original size data of the object to be scanned can be obtained according to the size data and the shooting distance of the first image. The specific calculation process is the same as the process of calculating the actual size data of the object in the image according to the depth map in the prior art, and the present invention is not specifically described herein.
Optionally, in this embodiment of the present invention, as shown in fig. 3A, S12 may include the following steps:
s201: and converting the first image into a normal visual angle image.
S202: and capturing a sub-image corresponding to the object to be scanned in the normal view angle image.
S203: and determining the original size data corresponding to the object to be scanned according to the sub-images.
The process of S201 may be implemented by an image conversion type application installed in the electronic device, that is, the first image is expanded in the direction of the normal vector corresponding to the first image by using the image conversion type application, so as to obtain a corresponding normal view image.
For example, in the first image shown in fig. 3B, numeral 10 is a sub-image of the object to be scanned (here, taking the contract document as an example, i.e., a4 paper), and the arrow symbol in the figure is the normal vector direction of the first image. When the first image is expanded according to the normal vector direction, as shown in fig. 3C, numeral 10 represents a sub-image corresponding to the object to be scanned.
By converting the first image into the normal visual angle image, the visual angle deviation of the sub-image corresponding to the object to be scanned, which is caused by the shooting visual angle, can be corrected, so that the sub-image corresponding to the object to be scanned has a normal display mode.
Optionally, in the embodiment of the present invention, after S201, as shown in fig. 4, the following process may be further included:
s2011: determining an included angle between a central axis of an object to be scanned and a central axis of the normal visual angle image; the central axis of the normal visual angle image is a central line which is vertical to the horizontal edge of the normal visual angle image in the normal visual angle image, and the central axis of the object to be scanned is a central line which is vertical to a horizontal line corresponding to the object to be scanned;
s2012: based on the central point of the object to be scanned, rotating the object to be scanned to a target position in the normal visual angle image according to the included angle; and at the target position, the central axis of the object to be scanned is parallel to the central axis of the normal visual angle image, and the display direction of the object to be scanned is a positive direction.
Specifically, when determining the central axis of the object to be scanned, the central axis may be specifically perpendicular to a reference line in the object to be scanned, and the reference line may be a reference edge in a regular shape corresponding to the object to be scanned. For example, a regular shape corresponding to the object to be scanned may be determined in the normal view image, such as a square, a rectangle, etc., and the reference line may be the edge closest to the horizontal plane in the regular shape.
For example, if the object to be scanned is a4 paper, and the corresponding regular shape is a rectangle, any one of the two shorter sides (corresponding to the width of the regular shape) in a4 may be used as the reference line, and is not limited. For example, if the object to be scanned is a resident identification card, a sub-image of the resident identification card in the converted normal view image may be in an inclined state with respect to the normal view image, and a direction of a reference line thereof is different from a direction of a horizontal line of the normal view image, and may be at a certain angle.
Of course, in the process of determining the reference line, if the object to be scanned is an irregularly-shaped object, the corresponding regular shape may be determined according to the original size data of the object to be scanned. For example, if the object to be scanned is a microphone with an irregular shape, the actual length of the microphone may be 21cm, and the maximum width of the microphone may be 4.7cm, the determined divided edge corresponding to the edge information may be an edge of the regular shape with a length and a width of 21cm and 4.7cm, and the shorter side of the regular shape may be used as a reference line.
Optionally, in the embodiment of the present invention, when the object to be scanned stands on the horizontal plane, a direction perpendicular to the horizontal plane may be used as the positive direction corresponding to the object to be scanned. Generally speaking, when the display direction of the object to be scanned is a positive direction, the display direction is more suitable for the viewing habit of the user.
For example, as shown in fig. 5A, the numeral 10 is a sub-image corresponding to an object to be scanned, a dashed line a represents a central axis of the normal perspective image, a dashed line b represents a central axis of the object to be scanned, a reference line of the object to be scanned is a shorter side in a regular shape corresponding to a contract document, the central axis is perpendicular to a direction of the reference line of the object to be scanned (a double arrow in the figure), and θ is an included angle between the central axis of the object to be scanned and the central axis of the normal perspective image.
Furthermore, the object to be scanned may be rotated according to the included angle θ, for example, the object to be scanned may be rotated by 30 ° or 45 ° clockwise, and as shown in fig. 5B, the sub-image corresponding to the rotated object to be scanned may be displayed in a positive direction.
In this embodiment of the present invention, S202 may specifically include: and determining edge information corresponding to the object to be scanned in the normal visual angle image, and performing image segmentation on the normal visual angle image according to the edge information to obtain a sub-image.
The edge information can be used for indicating a segmentation edge when the normal visual angle image is segmented, so that the electronic equipment can cut the normal visual angle image according to the segmentation edge.
In practical applications, the edge information can be obtained in many ways. For example, the edge information corresponding to the object to be scanned may be determined according to the grayscale image of the normal view image, for example, an area with a drastic grayscale change in the grayscale image may be determined as an edge corresponding to the object to be scanned, or a segmentation edge of the object to be scanned may also be determined by a method of performing edge detection in the normal view image, and then corresponding edge information is generated according to the determined segmentation edge, and so on, and the present invention does not limit the manner of obtaining the edge information. In general, the determined segmentation edge of the object to be scanned may be the same as its own edge.
For example, still referring to fig. 5B, if the segmentation information indicates that the segmentation edge of the object to be scanned (i.e., the contract document) is the edge of the object to be scanned, the normal view image may be subjected to image segmentation processing to obtain the sub-image corresponding to the contract document.
S13: processing the subimages according to a preset rule according to the original size data to obtain a second image; and the corresponding size data of the object to be scanned in the second image is the same as the original size data.
Because the second image comprises the subimage corresponding to the object to be scanned and the size data corresponding to the subimage corresponding to the object to be scanned is the same as the original size data, the second image can be used as the scanned image corresponding to the object to be scanned, so that the scanned image of the object to be scanned can be obtained without using a scanner, and the cost is low.
Preferably, the second image may include only one sub-image, i.e. the sub-image corresponding to the object to be scanned, so that the second image is closer to the image obtained by scanning the object to be scanned.
Alternatively, as shown in fig. 6, S13 may include the following processes:
s131: obtaining a ratio between the size data of the sub-image and the original size data;
s132: scaling the sub-image according to the determined proportion so that the size data of the scaled sub-image is the same as the original size data;
s133: and taking the scaled sub-image as a second image.
The size data of the sub-image may refer to size data of the sub-image corresponding to the object to be scanned in the normal view angle image. For example, if the size data of the normal view image is 17cm by 13cm, the size data of the sub-image of the object to be scanned (e.g., a4 paper) in the normal view image may be 4.2cm by 5.94 cm. Further, a ratio between the size data of the sub-image and the original size data of the object to be scanned may be determined. For example, if the original size data of the a4 paper is determined to be 210mm by 297mm, the ratio between the size data of the sub-image of the a4 paper and the original size data of the a4 paper is calculated to be, for example, 1:5, so that the sub-image can be scaled by the ratio to obtain the corresponding second image.
In the embodiment of the invention, the sub-images are processed according to the preset rules, namely: the sub-image is scaled according to the determined scale, and the specific process may be to convert the proportional relationship between the size data of the sub-image and the original size data into 1: 1, adjusting the size data of the sub-image corresponding to the object to be scanned into original size data, so that the sub-image with the original size data is closer to the actually scanned image. Fig. 7 is a schematic diagram of performing scaling processing on the sub-images according to a determined scale and obtaining a second image, and size data of an object to be scanned in the second image is original size data.
In practical applications, if the size of the sub-image is smaller than the original size of the object to be scanned, i.e. the ratio between the two is smaller than 1, the sub-image may be enlarged. For example, the determined ratio is 1:5, the sub-image may be enlarged by 5 times so that the enlarged sub-image has the original size data of the object to be scanned.
Alternatively, if the size of the sub-image is larger than the original size of the object to be scanned, the sub-image may be reduced according to the determined scale. For example, if the object to be scanned is a resident identification card, and the ratio of the size data of the corresponding sub-image to the original size data of the resident identification card is 2:1, the size data of the sub-image can be reduced to 0.5 times of the original size data, and a second image with the same size data as the original size data of the resident identification card is obtained.
Further, in the embodiment of the present invention, after the second image is obtained, the second image may be further stored according to a preset mode:
if the size data of the second image is determined not to exceed the preset size data of the electronic device, the second image can be directly stored according to the size data of the second image, otherwise, the second image can be compressed, and the compressed second image is stored, so that excessive storage resources of the electronic device are avoided being occupied.
Therefore, if the user needs to scan the object to be scanned, the object to be scanned can be obtained by printing the second image, the implementation process is rapid, and the efficiency is high.
As shown in fig. 8, based on the same inventive concept, the present invention also discloses an electronic device, which includes an image collector 11 and a processor 12.
Wherein the image collector 11 is used for collecting a first image containing a scanned object,
specifically, the image collector 11 may be a camera in an electronic device, such as a depth camera. Processor 12 is coupled to image collector 11, and processor 12 is configured to: extracting a subimage corresponding to the object to be scanned from the first image, determining original size data corresponding to the object to be scanned, and processing the subimage according to a preset rule according to the original size data to obtain a second image; and the corresponding size data of the object to be scanned in the second image is the same as the original size data.
In practical applications, the processor 12 is specifically configured to convert the first image into a normal viewing angle image; capturing the sub-image corresponding to the object to be scanned in the normal view angle image; and determining the original size data corresponding to the object to be scanned.
Optionally, in this embodiment of the present invention, the processor 12 is configured to: determining edge information corresponding to the object to be scanned in the normal visual angle image; and carrying out image segmentation on the normal visual angle image according to the edge information to obtain the sub-image.
Optionally, in this embodiment of the present invention, the processor 12 is further configured to:
before the sub-image corresponding to the object to be scanned is captured in the normal visual angle image, determining an included angle between a central axis of the object to be scanned and a central axis of the normal visual angle image; the central axis of the normal visual angle image is a central line in the normal visual angle image, which is perpendicular to the horizontal edge of the normal visual angle image, and the central axis of the object to be scanned is a central line which is perpendicular to a horizontal line corresponding to the object to be scanned;
based on the central point of the object to be scanned, rotating the object to be scanned to a target position in the normal visual angle image according to the included angle; and at the target position, the central axis of the object to be scanned is parallel to the central axis of the normal visual angle image, and the display direction of the object to be scanned is a positive direction.
Optionally, in this embodiment of the present invention, the processor 12 is configured to: obtaining a ratio between the size data of the sub-image and the original size data; and scaling the sub-image according to the determined proportion so that the size data of the scaled sub-image is the same as the original size data, and taking the scaled sub-image as the second image.
As shown in fig. 9, based on the same inventive concept, the present invention further provides an electronic device, which includes an acquisition module 301, an extraction module 302, and a processing module 303.
The acquisition module 301 is configured to acquire a first image through an image acquisition unit of the electronic device;
the extracting module 302 is configured to extract a sub-image corresponding to an object to be scanned in the first image, and determine original size data corresponding to the object to be scanned;
the processing module 303 is configured to process the sub-image according to a preset rule according to the original size data to obtain a second image; and the corresponding size data of the object to be scanned in the second image is the same as the original size data.
Optionally, in this embodiment of the present invention, the extraction module 302 is specifically configured to:
converting the first image into a normal visual angle image;
capturing the sub-image corresponding to the object to be scanned in the normal view angle image;
and determining the original size data corresponding to the object to be scanned.
Optionally, in this embodiment of the present invention, the extraction module 302 is specifically configured to:
determining edge information corresponding to the object to be scanned in the normal visual angle image;
and carrying out image segmentation on the normal visual angle image according to the edge information to obtain the sub-image.
Optionally, in this embodiment of the present invention, the electronic device may further include a determining module, configured to:
before the sub-image corresponding to the object to be scanned is captured in the normal visual angle image, determining an included angle between a central axis of the object to be scanned and a central axis of the normal visual angle image; the central axis of the normal visual angle image is a central line in the normal visual angle image, which is perpendicular to the horizontal edge of the normal visual angle image, and the central axis of the object to be scanned is a central line which is perpendicular to a reference line in the object to be scanned; and
based on the central point of the object to be scanned, rotating the object to be scanned to a target position in the normal visual angle image according to the included angle; and at the target position, the central axis of the object to be scanned is parallel to the central axis of the normal visual angle image, and the display direction of the object to be scanned is a positive direction.
Optionally, in this embodiment of the present invention, the processing module 303 may specifically be configured to:
obtaining a ratio between the size data of the sub-image and the original size data;
scaling the sub-image according to the determined proportion so that the size data of the scaled sub-image is the same as the original size data;
and taking the scaled sub-image as the second image.
Specifically, the computer program instructions corresponding to the image processing method in the embodiment of the present application may be stored on a storage medium such as an optical disc, a hard disc, a usb disk, or the like, and when the computer program instructions corresponding to the image processing method in the storage medium are read or executed by an electronic device, the method includes the following steps:
acquiring a first image through an image acquisition unit of the electronic equipment;
extracting a sub-image corresponding to an object to be scanned in the first image, and determining original size data corresponding to the object to be scanned;
processing the sub-image according to a preset rule according to the original size data to obtain a second image; and the corresponding size data of the object to be scanned in the second image is the same as the original size data.
Optionally, the step of storing in the storage medium: extracting a sub-image corresponding to an object to be scanned in the first image, and determining original size data corresponding to the object to be scanned, wherein the corresponding computer instructions comprise the following steps in a specific executed process:
converting the first image into a normal visual angle image;
capturing the sub-image corresponding to the object to be scanned in the normal view angle image;
and determining the original size data corresponding to the object to be scanned.
Optionally, the step of storing in the storage medium: capturing the sub-image corresponding to the object to be scanned in the normal view image, wherein the corresponding computer instruction comprises the following steps in the specific executed process:
determining edge information corresponding to the object to be scanned in the normal visual angle image;
and carrying out image segmentation on the normal visual angle image according to the edge information to obtain the sub-image.
Optionally, the storage medium further stores other computer instructions, and the computer instructions perform the following steps: the instruction for grabbing the sub-image corresponding to the object to be scanned in the normal view angle image is executed before execution, and the instruction for grabbing the sub-image corresponding to the object to be scanned in the normal view angle image comprises the following steps:
determining an included angle between the central axis of the object to be scanned and the central axis of the normal visual angle image; the central axis of the normal visual angle image is a central line in the normal visual angle image, which is perpendicular to the horizontal edge of the normal visual angle image, and the central axis of the object to be scanned is a central line which is perpendicular to a reference line in the object to be scanned;
based on the central point of the object to be scanned, rotating the object to be scanned to a target position in the normal visual angle image according to the included angle; and at the target position, the central axis of the object to be scanned is parallel to the central axis of the normal visual angle image, and the display direction of the object to be scanned is a positive direction.
Optionally, the step of storing in the storage medium: processing the sub-image according to a preset rule according to the original size data to obtain a second image, wherein the corresponding computer instruction comprises the following steps in the specific executed process:
obtaining a ratio between the size data of the sub-image and the original size data;
scaling the sub-image according to the determined proportion so that the size data of the scaled sub-image is the same as the original size data;
and taking the scaled sub-image as the second image.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (7)

1. A method of image processing, the method comprising:
acquiring a first image through an image acquisition unit of the electronic equipment;
converting the first image into a normal visual angle image;
capturing a sub-image corresponding to an object to be scanned in the normal visual angle image;
determining original size data corresponding to the object to be scanned based on pre-stored size data,
processing the sub-image according to a preset rule according to the original size data to obtain a second image; wherein the corresponding size data of the object to be scanned in the second image is the same as the original size data,
before the capturing the sub-image corresponding to the object to be scanned in the normal view angle image, the method further includes:
determining an included angle between the central axis of the object to be scanned and the central axis of the normal visual angle image; the central axis of the normal visual angle image is a central line in the normal visual angle image, which is perpendicular to the horizontal edge of the normal visual angle image, and the central axis of the object to be scanned is a central line which is perpendicular to a reference line in the object to be scanned;
based on the central point of the object to be scanned, rotating the object to be scanned to a target position in the normal visual angle image according to the included angle; and at the target position, the central axis of the object to be scanned is parallel to the central axis of the normal visual angle image, and the display direction of the object to be scanned is a positive direction.
2. The method of claim 1, wherein grabbing the sub-image corresponding to the object to be scanned in the normal view image comprises:
determining edge information corresponding to the object to be scanned in the normal visual angle image;
and carrying out image segmentation on the normal visual angle image according to the edge information to obtain the sub-image.
3. The method of claim 1, wherein processing the sub-image according to a predetermined rule based on the raw size data to obtain a second image comprises:
obtaining a ratio between the size data of the sub-image and the original size data;
scaling the sub-image according to the determined proportion so that the size data of the scaled sub-image is the same as the original size data;
and taking the scaled sub-image as the second image.
4. An electronic device, comprising:
the image acquisition device is used for acquiring a first image containing an object to be scanned;
a processor connected with the image collector and used for converting the first image into a normal visual angle image and capturing a sub-image corresponding to the object to be scanned in the normal visual angle image,
determining original size data corresponding to the object to be scanned based on prestored size data, and processing the subimage according to a preset rule according to the original size data to obtain a second image; wherein the corresponding size data of the object to be scanned in the second image is the same as the original size data,
the processor is further configured to: before the sub-image corresponding to the object to be scanned is captured in the normal visual angle image, determining an included angle between a central axis of the object to be scanned and a central axis of the normal visual angle image; the central axis of the normal visual angle image is a central line in the normal visual angle image, which is perpendicular to the horizontal edge of the normal visual angle image, and the central axis of the object to be scanned is a central line which is perpendicular to a horizontal line corresponding to the object to be scanned; based on the central point of the object to be scanned, rotating the object to be scanned to a target position in the normal visual angle image according to the included angle; and at the target position, the central axis of the object to be scanned is parallel to the central axis of the normal visual angle image, and the display direction of the object to be scanned is a positive direction.
5. The electronic device of claim 4, wherein the processor is to:
determining edge information corresponding to the object to be scanned in the normal visual angle image;
and carrying out image segmentation on the normal visual angle image according to the edge information to obtain the sub-image.
6. The electronic device of claim 4, wherein the processor is to:
obtaining a ratio between the size data of the sub-image and the original size data;
scaling the sub-image according to the determined proportion so that the size data of the scaled sub-image is the same as the original size data;
and taking the scaled sub-image as the second image.
7. An electronic device, comprising:
the acquisition module is used for acquiring a first image through an image acquisition unit of the electronic equipment;
the extraction module is used for converting the first image into a normal visual angle image, capturing a sub-image corresponding to the object to be scanned in the normal visual angle image, and determining original size data corresponding to the object to be scanned based on pre-stored size data;
the processing module is used for processing the subimage according to a preset rule according to the original size data to obtain a second image; wherein the corresponding size data of the object to be scanned in the second image is the same as the original size data, an
The determining module is used for determining an included angle between a central axis of the object to be scanned and a central axis of the normal visual angle image before the sub-image corresponding to the object to be scanned is captured in the normal visual angle image; the central axis of the normal visual angle image is a central line in the normal visual angle image, which is perpendicular to the horizontal edge of the normal visual angle image, and the central axis of the object to be scanned is a central line which is perpendicular to a horizontal line corresponding to the object to be scanned; based on the central point of the object to be scanned, rotating the object to be scanned to a target position in the normal visual angle image according to the included angle; and at the target position, the central axis of the object to be scanned is parallel to the central axis of the normal visual angle image, and the display direction of the object to be scanned is a positive direction.
CN201510446459.9A 2015-07-27 2015-07-27 Image processing method and electronic equipment Active CN105100616B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510446459.9A CN105100616B (en) 2015-07-27 2015-07-27 Image processing method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510446459.9A CN105100616B (en) 2015-07-27 2015-07-27 Image processing method and electronic equipment

Publications (2)

Publication Number Publication Date
CN105100616A CN105100616A (en) 2015-11-25
CN105100616B true CN105100616B (en) 2021-02-19

Family

ID=54580057

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510446459.9A Active CN105100616B (en) 2015-07-27 2015-07-27 Image processing method and electronic equipment

Country Status (1)

Country Link
CN (1) CN105100616B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106997579B (en) * 2016-01-26 2020-01-03 华为技术有限公司 Image splicing method and device
CN106126133B (en) * 2016-06-23 2019-06-25 联想(北京)有限公司 A kind of Method of printing, printing device and electronic device
CN109035266B (en) * 2017-06-08 2022-11-15 杭州睿沃科技有限公司 Method for finishing portable scanning of identity card by using common camera

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101262548A (en) * 2007-03-09 2008-09-10 株式会社尼康 Image processing method
CN104378620A (en) * 2014-11-24 2015-02-25 联想(北京)有限公司 Image processing method and electronic device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100739173B1 (en) * 2005-03-16 2007-07-13 엘지전자 주식회사 Methode and apparutus for creating pictures by camera built-in terminal engaged
KR100863700B1 (en) * 2008-02-18 2008-10-15 에스엔유 프리시젼 주식회사 Vision inspection system and method for inspecting workpiece using the same
JP5641718B2 (en) * 2008-09-16 2014-12-17 キヤノン株式会社 Shooting lens
JP2010268441A (en) * 2009-04-16 2010-11-25 Sanyo Electric Co Ltd Image processor, imaging device, and image reproducing device
US8633993B2 (en) * 2009-04-30 2014-01-21 Hoya Corporation Flexible wiring board mounting structure of an image shake correcting apparatus
JP2013055424A (en) * 2011-09-01 2013-03-21 Sony Corp Photographing device, pattern detection device, and electronic apparatus
JP2014068333A (en) * 2012-09-05 2014-04-17 Casio Comput Co Ltd Printing control apparatus, printing control method, and program
TWI553544B (en) * 2013-02-27 2016-10-11 緯創資通股份有限公司 Electronic device and image adjusting method
CN104717425A (en) * 2014-12-30 2015-06-17 上海孩子国科教设备有限公司 Data adjustment method, client side and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101262548A (en) * 2007-03-09 2008-09-10 株式会社尼康 Image processing method
CN104378620A (en) * 2014-11-24 2015-02-25 联想(北京)有限公司 Image processing method and electronic device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
虹膜图像采集技术及应用;邢文元;《中国优秀硕士学位论文全文数据库信息科技辑》;20130415;全文 *

Also Published As

Publication number Publication date
CN105100616A (en) 2015-11-25

Similar Documents

Publication Publication Date Title
EP2650821B1 (en) Text image trimming method
RU2631765C1 (en) Method and system of correcting perspective distortions in images occupying double-page spread
US10452953B2 (en) Image processing device, image processing method, program, and information recording medium
US10303969B2 (en) Pose detection using depth camera
JP6323437B2 (en) 10-finger fingerprint card input device, 10-finger fingerprint card input method, and storage medium
EP3783524A1 (en) Authentication method and apparatus, and electronic device, computer program, and storage medium
JP2014195148A (en) Image processing apparatus, region determination method, and computer program
KR20130066819A (en) Apparus and method for character recognition based on photograph image
CN105100616B (en) Image processing method and electronic equipment
WO2018103450A1 (en) Image recognition-based communication method and device
JP2019012361A (en) Information processor, program, and method for information processing
JP6739937B2 (en) Information processing apparatus, control method of information processing apparatus, and program
CN108650431B (en) Shooting control method and device and electronic equipment
KR20230017774A (en) Information processing device, information processing method, and program
JP6669390B2 (en) Information processing apparatus, information processing method, and program
US20210281742A1 (en) Document detections from video images
CN113255629B (en) Document processing method and device, electronic equipment and computer readable storage medium
CN102843479A (en) File scanning method, file scanning device and portable electronic device
JP6540597B2 (en) INFORMATION PROCESSING APPARATUS, INFORMATION PROCESSING METHOD, AND PROGRAM
US11557108B2 (en) Polygon detection device, polygon detection method, and polygon detection program
JP6598402B1 (en) Receipt and other form image automatic acquisition / reading method, program, and portable terminal device
US8502873B2 (en) Method for determining clear image using an image pickup device
JP4796165B2 (en) Image processing device
JP6639257B2 (en) Information processing apparatus and control method therefor
JP2020091748A (en) Terminal device, program, and image management method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant