CN114554081A - Method and equipment for realizing camera preview and amplification of smart watch - Google Patents

Method and equipment for realizing camera preview and amplification of smart watch Download PDF

Info

Publication number
CN114554081A
CN114554081A CN202210058799.4A CN202210058799A CN114554081A CN 114554081 A CN114554081 A CN 114554081A CN 202210058799 A CN202210058799 A CN 202210058799A CN 114554081 A CN114554081 A CN 114554081A
Authority
CN
China
Prior art keywords
preview
height
width
scaletimes
camera
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210058799.4A
Other languages
Chinese (zh)
Inventor
黄伟健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Readboy Education Technology Co Ltd
Original Assignee
Readboy Education Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Readboy Education Technology Co Ltd filed Critical Readboy Education Technology Co Ltd
Priority to CN202210058799.4A priority Critical patent/CN114554081A/en
Publication of CN114554081A publication Critical patent/CN114554081A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/64Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)
  • Studio Devices (AREA)

Abstract

The invention discloses a method and equipment for realizing camera preview enlargement of an intelligent watch, which realize secondary enlargement of a drawing range of SurfaceView or TextureView rendering a preview picture through scaleX and scaleY of an attribute animation ObjectAnamator by a software means on the basis of the limitation of the original maximum focal length, wherein the attribute animation is View change in a real sense, not only is enlarged on preview, but also enlarged on data processing according to proportion, and can be well adapted to small-size screen equipment such as the intelligent watch and the like which wants to obtain large preview.

Description

Method and equipment for realizing camera preview and amplification of smart watch
Technical Field
The invention relates to the technical field of intelligent watches, in particular to a method and equipment for realizing camera preview and amplification of an intelligent watch.
Background
Along with the popularization of smart watch, more and more users use smart watch, and meanwhile wearable devices such as smart watch are more and more widely applied, for example, OCR recognition learning is carried out through camera scanning characters, words and the like. When characters needing to be scanned are small, a preview image often sees a large piece of characters, so that the desired content cannot be accurately scanned, at this time, the focal length needs to be enlarged, a larger picture and more accurate identification content are obtained, but due to the limitation of hardware such as limited focal length of a camera of the smart watch, even if the maximum focal length is set, the true desired content range cannot be obtained, and the user experience is influenced.
Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to provide a method and equipment for realizing camera preview amplification by an intelligent watch.
In order to achieve the purpose, the invention adopts the following technical scheme:
a method for realizing camera preview amplification of a smart watch comprises the following specific processes:
s1, acquiring a Camera object by calling a Camera starting method open of a Camera development API of the android system, and acquiring a maximum focal length by a getMaxZoom method of a Camera internal class Parameter, so as to set the maximum focal length of the Camera;
s2, acquiring a View object of a preview interface of a rendering camera, and realizing substantial magnification of the View by setting scaleX and scaleY of an attribute animation ObjectAnamator of the View, wherein the magnification times of the scaleX and scaleY are recorded as scaleTimes;
s3, after the Scale times is set, the preview image data acquired by the user can be correspondingly amplified; and (3) performing corresponding proportion clipping operation on OCR data required by a user according to the device screen size width and height and scaleTimes:
the method comprises the steps that the width of a screen is width, the height of the screen is height, the size of an original preview picture is width height, after scaleTimes are amplified, the size of the preview picture is changed into (width scaleTimes) ((height) scaleTimes), Bitmap data of the preview picture are obtained by converting a data array of the preview picture, data interception is carried out according to the magnification scale scaleTimes, size information of the left side, the upper side, the right side and the lower side of a part required by a user is intercepted, the size information of the left side, the upper side, the right side and the lower side of the part required by the user is ((width) scaleTimes-width)/2, (height) scaleTimes-height)/2, (width-width), (height) scales-height), and preview information of a real preview picture can be obtained through a method of obtaining and finally amplifying the preview picture by the weight and the preview picture.
The present invention provides a computer-readable storage medium having stored therein a computer program which, when executed by a processor, implements the above-described method.
The invention provides a smart watch, comprising a processor and a memory, wherein the memory is used for storing a computer program; the processor is configured to implement the above method when executing the computer program.
The invention has the beneficial effects that: according to the method, on the basis of the original maximum focal length limitation, the secondary amplification of the drawing range of the SurfaceView or TextureView rendering the preview picture is realized through the scaleX and scaleY of the attribute animation ObjectAnimator by a software means, the attribute animation is the View change in the real sense, not only is the preview amplified, but also the data processing can be amplified according to the proportion, and the method can be well adapted to small-size screen equipment such as an intelligent watch and the like which want to obtain the large preview.
Detailed Description
The present invention will be further described below, and it should be noted that the present embodiment is based on the technical solution, and a detailed implementation manner and a specific operation process are provided, but the protection scope of the present invention is not limited to the present embodiment.
The embodiment provides a method for realizing camera preview amplification of a smart watch, which specifically comprises the following processes:
s1, acquiring a Camera object by calling a Camera starting method open of a Camera development API of the android system, and acquiring a maximum focal length by a getMaxZoom method of a Camera internal class Parameter, so as to set the maximum focal length of the Camera;
s2, obtaining a View object of the preview interface of the rendering camera, and realizing the substantial magnification of the View by setting the scaleX and scaleY of the attribute animation ObjectAnamator of the View, wherein the magnification times of the scaleX and scaleY are recorded as scaleTimes. The larger the Scale Times is, the larger the preview picture seen by the user is, so that the requirement that the user needs a larger preview picture is met, and the method is particularly suitable for realizing the requirements of OCR for scanning small-area characters such as Chinese characters, words and the like;
specifically, the View is typically a SurfaceView or a TextureView. The attribute animation is an animation implementation mode which is externally provided by the android system and can change attributes such as the position and the size of View by continuously changing values.
S3, after the Scale times is set, the preview image data acquired by the user can be correspondingly amplified; and (3) performing corresponding proportion clipping operation on OCR data required by a user according to the device screen size width and height and scaleTimes:
the method comprises the steps that the width of a screen is width, the height of the screen is height, the size of an original preview picture is width height, after scaleTimes are amplified, the size of the preview picture is changed into (width scaleTimes) ((height) scaleTimes), Bitmap data of the preview picture are obtained by converting a data array of the preview picture, data interception is carried out according to the magnification scale scaleTimes, size information of the left side, the upper side, the right side and the lower side of a part required by a user is intercepted, the size information of the left side, the upper side, the right side and the lower side of the part required by the user is ((width) scaleTimes-width)/2, (height) scaleTimes-height)/2, (width-width), (height) scales-height), and preview information of a real preview picture can be obtained through a method of obtaining and finally amplifying the preview picture by the weight and the preview picture. The calculation is equivalent to taking the enlarged picture as a new coordinate system, and then the rectangular area range needing to be cut can be obtained according to the size information of the left, upper, right and lower four sides, so that the size range needed by the user can be obtained.
Various corresponding changes and modifications can be made by those skilled in the art based on the above technical solutions and concepts, and all such changes and modifications should be included in the protection scope of the present invention.

Claims (3)

1. A method for realizing camera preview amplification of an intelligent watch is characterized by comprising the following specific processes:
s1, acquiring a Camera object by calling a Camera starting method open of a Camera development API of the android system, and acquiring a maximum focal length by a getMaxZoom method of a Camera internal class Parameter, so as to set the maximum focal length of the Camera;
s2, acquiring a View object of a preview interface of a rendering camera, and realizing substantial magnification of the View by setting scaleX and scaleY of an attribute animation ObjectAnamator of the View, wherein the magnification times of the scaleX and scaleY are recorded as scaleTimes;
s3, after the Scale times is set, the preview image data acquired by the user can be correspondingly amplified; and (3) performing corresponding proportion clipping operation on OCR data required by a user according to the device screen size width and height and scaleTimes:
the method comprises the steps that the width of a screen is width, the height of the screen is height, the size of an original preview picture is width height, after scaleTimes are amplified, the size of the preview picture is changed into (width scaleTimes) ((height) scaleTimes), Bitmap data of the preview picture are obtained by converting a data array of the preview picture, data interception is carried out according to the magnification scale scaleTimes, size information of the left side, the upper side, the right side and the lower side of a part required by a user is intercepted, the size information of the left side, the upper side, the right side and the lower side of the part required by the user is ((width) scaleTimes-width)/2, (height) scaleTimes-height)/2, (width-width), (height) scales-height), and preview information of a real preview picture can be obtained through a method of obtaining and finally amplifying the preview picture by the weight and the preview picture.
2. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method of claim 1.
3. A smart watch comprising a processor and a memory, the memory for storing a computer program; the processor, when executing the computer program, implements the method of claim 1.
CN202210058799.4A 2022-01-17 2022-01-17 Method and equipment for realizing camera preview and amplification of smart watch Pending CN114554081A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210058799.4A CN114554081A (en) 2022-01-17 2022-01-17 Method and equipment for realizing camera preview and amplification of smart watch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210058799.4A CN114554081A (en) 2022-01-17 2022-01-17 Method and equipment for realizing camera preview and amplification of smart watch

Publications (1)

Publication Number Publication Date
CN114554081A true CN114554081A (en) 2022-05-27

Family

ID=81672320

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210058799.4A Pending CN114554081A (en) 2022-01-17 2022-01-17 Method and equipment for realizing camera preview and amplification of smart watch

Country Status (1)

Country Link
CN (1) CN114554081A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060017970A (en) * 2004-08-23 2006-02-28 주식회사 팬택 Method for preview display control in the camera phone
CN104702846A (en) * 2015-03-20 2015-06-10 惠州Tcl移动通信有限公司 Preview image processing method and system of MT (Mobile Terminal) camera
WO2016154806A1 (en) * 2015-03-27 2016-10-06 华为技术有限公司 Automatic zooming method and device
CN109089036A (en) * 2018-07-09 2018-12-25 奇酷互联网络科技(深圳)有限公司 Zoom processing method, device, readable storage medium storing program for executing and mobile terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060017970A (en) * 2004-08-23 2006-02-28 주식회사 팬택 Method for preview display control in the camera phone
CN104702846A (en) * 2015-03-20 2015-06-10 惠州Tcl移动通信有限公司 Preview image processing method and system of MT (Mobile Terminal) camera
WO2016154806A1 (en) * 2015-03-27 2016-10-06 华为技术有限公司 Automatic zooming method and device
CN109089036A (en) * 2018-07-09 2018-12-25 奇酷互联网络科技(深圳)有限公司 Zoom processing method, device, readable storage medium storing program for executing and mobile terminal

Similar Documents

Publication Publication Date Title
CN109493400B (en) Handwriting sample generation method, device, computer equipment and storage medium
CN109064525B (en) Picture format conversion method, device, equipment and storage medium
EP3163423A1 (en) Method and device for setting background of ui control and terminal
WO2021147221A1 (en) Text recognition method and apparatus, and electronic device and storage medium
CN107038199B (en) Drawing method and device
CN110909638B (en) Face recognition method and system based on ARM platform
CN108171231A (en) A kind of communication means and device based on image identification
CN111144407A (en) Target detection method, system, device and readable storage medium
CN113780297B (en) Image processing method, device, equipment and storage medium
CN111783384A (en) Method, device, server and storage medium for determining position on PDF document
CN111638849A (en) Screenshot method and device and electronic equipment
CN110990238A (en) Non-invasive visual test script automatic recording method based on video shooting
CN114554081A (en) Method and equipment for realizing camera preview and amplification of smart watch
CN116757886A (en) Data analysis method and analysis device
CN111078724A (en) Method, device and equipment for searching test questions in learning system and storage medium
CN110738126A (en) Lip shearing method, device and equipment based on coordinate transformation and storage medium
CN113656629A (en) Visual positioning method and device, electronic equipment and storage medium
CN111160265B (en) File conversion method and device, storage medium and electronic equipment
CN116645268A (en) Image processing method, device, electronic equipment and computer readable storage medium
CN114463336A (en) Cutting method and system for image and pixel level segmentation marking data thereof
CN102022984A (en) Image-technique-based artificial wetland plant growth information extracting method
CN112632934B (en) Method for restoring table picture into editable WORD file table based on proportion calculation
CN108519962B (en) Font display method and apparatus applied to android system, and terminal device
CN107733779B (en) Function expansion method and device based on contact persons
CN114764854A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination