CN110865785A - Method and device for acquiring pixel size and electronic equipment - Google Patents
Method and device for acquiring pixel size and electronic equipment Download PDFInfo
- Publication number
- CN110865785A CN110865785A CN201911154362.5A CN201911154362A CN110865785A CN 110865785 A CN110865785 A CN 110865785A CN 201911154362 A CN201911154362 A CN 201911154362A CN 110865785 A CN110865785 A CN 110865785A
- Authority
- CN
- China
- Prior art keywords
- pixel
- screen
- detected
- distance
- target points
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 230000004044 response Effects 0.000 claims description 10
- 238000004364 calculation method Methods 0.000 claims description 9
- 230000001915 proofreading effect Effects 0.000 claims description 8
- 238000004590 computer program Methods 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 11
- 230000018109 developmental process Effects 0.000 description 10
- 238000004891 communication Methods 0.000 description 4
- 238000012937 correction Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 229910003460 diamond Inorganic materials 0.000 description 1
- 239000010432 diamond Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/14—Digital output to display device ; Cooperation and interconnection of the display device with other functional units
- G06F3/1407—General aspects irrespective of display type, e.g. determination of decimal point position, display with fixed or driving decimal point, suppression of non-significant zeros
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09G—ARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
- G09G3/00—Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes
- G09G3/006—Electronic inspection or testing of displays and display drivers, e.g. of LED or LCD displays
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- General Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- User Interface Of Digital Computer (AREA)
- Position Input By Displaying (AREA)
Abstract
The invention provides a method and a device for acquiring pixel size and electronic equipment, wherein the method comprises the following steps: responding to the operation aiming at the screen to be detected, and acquiring a preset distance between a pixel position corresponding to the target point and the target point; wherein the target points comprise at least two; calculating to obtain the pixel distance between the target points according to the pixel positions of the target points; and determining the pixel size of the screen to be detected according to the preset distance and the pixel distance between the target points. The method can solve the problem that parameters such as the pixel size of the screen of the intelligent device cannot be acquired in part of software development.
Description
Technical Field
The invention relates to the technical field of software development, in particular to a method and a device for acquiring a pixel size and electronic equipment.
Background
In some application scenarios, parameters such as the screen pixel size of the smart device and the number of Pixels Per Inch (PPI) of the screen are required to be used. However, in some software developments, such as WeChat applet development, parameters such as the pixel size of the smart device screen cannot be read by the platform software, and cannot be calculated by reading limited smart device screen parameters.
Disclosure of Invention
In view of the above, the present invention provides a method and an apparatus for obtaining a pixel size, and an electronic device, so as to solve the problem that parameters such as the pixel size of a smart device screen cannot be obtained in part of software development.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides a method for obtaining a pixel size, including: responding to the operation aiming at the screen to be detected, and acquiring a preset distance between a pixel position corresponding to the target point and the target point; wherein the target points comprise at least two; calculating to obtain the pixel distance between the target points according to the pixel positions of the target points; and determining the pixel size of the screen to be detected according to the preset distance and the pixel distance between the target points.
In one embodiment, the operation on the screen to be detected comprises a sliding operation and/or a contact operation.
In one embodiment, the operation includes a sliding operation, and the step of acquiring a preset distance between a pixel position corresponding to the target point and the target point in response to the operation on the screen to be detected includes: responding to the sliding operation aiming at the screen to be detected, acquiring a sliding track corresponding to the sliding operation, and determining a starting point and an end point of the sliding track as target points; wherein the length of the sliding track is a preset distance; and acquiring the pixel position corresponding to the target point.
In one embodiment, the operation includes a touch operation, and the step of acquiring a preset distance between a pixel position corresponding to the target point and the target point in response to the operation on the screen to be detected includes: responding to the contact operation of equipment with a contact point for a screen to be detected, and determining the contact point of the equipment as a target point; the distance between every two contacts is a preset distance; and acquiring the pixel position corresponding to the target point.
In one embodiment, the operation includes a sliding operation and a contact operation, and the step of acquiring a preset distance between a pixel position corresponding to the target point and the target point in response to the operation on the screen to be detected includes: responding to the contact operation of a preset reference object to a preset proofreading area in the screen to be detected; wherein the size of the preset reference object is a preset distance; responding to sliding operation aiming at a preset mark in a screen to be detected, and adjusting the boundary of the proofreading area to be superposed with the boundary of a preset reference object; determining two points which are positioned at the boundary of the calibration area and have a connection distance of a preset distance as a group of target points; pixel positions of at least one set of target points are acquired.
In one embodiment, the step of determining the pixel size of the screen to be detected according to the preset distance between the target points and the pixel distance includes: calculating the pixel size of the screen to be detected according to the following formula:
wherein d represents a preset distance between target points; p represents a pixel distance; n represents the number of samples of the preset distance.
In one embodiment, the method further comprises: calculating to obtain the pixel number of unit inch and the screen size of the screen to be detected according to the obtained pixel size and the prestored logic pixel and pixel ratio of the screen to be detected;
wherein, the calculation formula of the pixel number of the unit inch is as follows:
wherein PPI represents the number of pixels per inch; s represents a pixel size;
the screen size is calculated as:
wherein L represents a screen size; w represents a logical pixel of the width of the screen to be detected; h represents a logical pixel of the height of the screen to be detected; dpr denotes the pixel ratio.
In a second aspect, an embodiment of the present invention provides a device for obtaining a pixel size, including: the information acquisition module is used for responding to the operation aiming at the screen to be detected and acquiring the pixel position corresponding to the target point and the preset distance between the target point; wherein the target points comprise at least two; the pixel distance calculation module is used for calculating the pixel distance between the target points according to the pixel positions of the target points; and the pixel size calculation module is used for determining the pixel size of the screen to be detected according to the preset distance and the pixel distance between the target points.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory; the memory has stored thereon a computer program which, when executed by the processor, performs the method of any one of the aspects as provided in the first aspect.
In a fourth aspect, an embodiment of the present invention provides a storage medium for storing computer software instructions for use in any one of the methods provided in the first aspect.
The embodiment of the invention provides a pixel size obtaining method, a pixel size obtaining device and electronic equipment, which can respond to the operation of a screen to be detected to determine at least two target points, obtain the pixel positions corresponding to the target points and the preset distance between the target points, and calculate the pixel distance between the target points according to the pixel positions of the target points; and determining the pixel size of the screen to be detected according to the preset distance and the pixel distance between the target points. According to the method for acquiring the pixel size, the pixel size of the screen to be detected can be calculated by determining the target points (at least two) in response to the operation on the screen to be detected, so that the problems that parameters such as the pixel size of the screen of the intelligent equipment cannot be read through platform software and the parameters cannot be calculated through reading limited parameters of the screen of the intelligent equipment in part of software development are effectively solved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a method for obtaining a pixel size according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a user feedback interface according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a calibration distance provided by an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating the distribution of calibration regions and sliding cursors according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a pixel size obtaining apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent 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.
At present, in part of software development, parameters such as pixel size of a screen of a smart device cannot be read through platform software, and the parameters cannot be calculated by reading limited parameters of the screen of the smart device, such as WeChat applet development and the like. These factors severely restrict the use of application software that has a high dependency on parameters such as the screen pixel size and the PPI of the smart device.
Based on this, the method and the device for obtaining the pixel size and the electronic device provided by the embodiments of the present invention can effectively solve the problem that parameters such as the pixel size of the screen of the intelligent device cannot be read through platform software in part of software development, and the parameters cannot be calculated by reading limited parameters of the screen of the intelligent device.
To facilitate understanding of the present embodiment, first, a detailed description is given of a pixel size obtaining method disclosed in the embodiment of the present invention, referring to a flowchart of the pixel size obtaining method shown in fig. 1, where the method may be executed by an electronic device and mainly includes the following steps S101 to S103:
step S101: and responding to the operation aiming at the screen to be detected, and acquiring a preset distance between the pixel position corresponding to the target point and the target point.
The operation for the screen to be detected may be a sliding operation and/or a contact operation, the target point (the number of the target points is at least two) is determined through the sliding operation and/or the contact operation, the sliding operation may be a user sliding the distance identifier on the screen by a specified distance (that is, a preset distance), and a starting point and an end point of the distance identifier are the target points; the contact operation may be to contact a device with a contact with the screen, determine the contact in contact with the screen as a target point, and set a distance between every two contacts as a preset distance; the contact operation can also be that a reference object with a known size is contacted with a calibration area in the screen, and a point on the boundary is determined as a target point; the acquired pixel position of the target point may be a pixel coordinate.
Step S102: and calculating to obtain the pixel distance between the target points according to the pixel positions of the target points.
Specifically, the pixel distance between the target points can be calculated according to the following formula:
wherein ,andrespectively represent target points l0And target point l1The pixel position of (a); p is a radical oflRepresenting the target point l0And the target point l1Pixel distance in between.
Step S103: and determining the pixel size of the screen to be detected according to the preset distance and the pixel distance between the target points.
Specifically, the pixel size of the screen to be detected is calculated according to the following formula:
wherein d represents a preset distance between target points; p represents a pixel distance; n represents the number of samples of the preset distance.
The embodiment of the invention provides a pixel size obtaining method, which can respond to the operation aiming at a screen to be detected to determine at least two target points, obtain the pixel positions corresponding to the target points and the preset distance between the target points, and calculate the pixel distance between the target points according to the pixel positions of the target points; and determining the pixel size of the screen to be detected according to the preset distance and the pixel distance between the target points. According to the method for acquiring the pixel size, the pixel size of the screen to be detected can be calculated by determining the target points (at least two) in response to the operation on the screen to be detected, so that the problems that parameters such as the pixel size of the screen of the intelligent equipment cannot be read through platform software and the parameters cannot be calculated through reading limited parameters of the screen of the intelligent equipment in part of software development are effectively solved.
Considering that the operation for the screen to be detected includes many modes (i.e., the modes for acquiring the target point are various), specific embodiments of the pixel size acquisition method are given below for different operation modes, respectively.
The step of determining the pixel size of the screen when the operation on the screen to be detected is a sliding operation mainly comprises the following steps a1 to a 4:
step a 1: and responding to the sliding operation aiming at the screen to be detected, acquiring a sliding track corresponding to the sliding operation, and determining a starting point and an end point of the sliding track as target points.
In a specific embodiment, a user feedback interface may be provided on the screen, and referring to the schematic diagram of a user feedback interface shown in fig. 2, the diagram includes three cases (a), (b), and (c), wherein F, F1 and F2 are illustrated as distance identifiers, 0 is a specified origin, and the distance identifiers may also be regarded as determined target points, and the distance, i.e. the distance between the origin 0 and F or between F1 and F2, is a specified distance (i.e. a preset distance). The sliding operation for the screen to be detected may be sliding from the position of the origin 0 to the position of the distance indicator F, as shown in part (a) in fig. 2 and part (c) in fig. 2, or sliding from the position of the distance indicator F1 to the position of the distance indicator F2, as shown in part (b) in fig. 2, where the sliding direction may be sliding left and right as shown in fig. 2, or sliding up and down, or any other direction, and is not limited herein.
Specific examples are as follows: assume that the screen prompts the user to specify a specified distance D (i.e., a preset distance, i.e., the length of the sliding trajectory), such as D ═ 4 cm; with the aid of external absolute size references, such as a ruler, hardware marked with size scales, and the like, a reference object is pressed close to the screen to measure the length of the sliding track, see a schematic diagram of a calibration distance shown in fig. 3, a sliding distance mark F ensures that the distance between the distance mark F and the origin 0 is a specified distance D, and the origin 0 and the distance mark F are determined as target points (i.e., the starting point and the end point of the sliding track).
Step a 2: and acquiring the pixel position corresponding to the target point.
Specifically, the pixel positions of the origin 0 and the distance mark F can be recorded by software, and the coordinates thereof are (x) respectively0,y0) and (xF,yF)。
Step a 3: and calculating to obtain the pixel distance between the target points according to the pixel positions of the target points.
Specifically, the pixel distance between the target points can be calculated according to the following formula:
wherein ,(x0,y0) and (xF,yF) Pixel positions of the target point 0 and the target point F are respectively represented; p represents the pixel distance between the target point 0 and the target point F.
Step a 4: and determining the pixel size of the screen to be detected according to the preset distance and the pixel distance between the target points.
Specifically, the pixel size of the screen to be detected is calculated according to the following formula:
wherein D represents a specified distance; p represents a pixel distance.
(II) when the operation aiming at the screen to be detected is a contact operation, the step of determining the pixel size of the screen mainly comprises the following steps b1 to b 4:
step b 1: and determining the contact point of the equipment as a target point in response to the contact operation of the equipment with the contact point on the screen to be detected.
In one embodiment, the touch point is a finger-like device that can be sensed by the touch screen. Specifically, an interface for sensing M contacts is provided on a screen, a device provided with the M contacts is contacted with the screen, the distribution of the contacts can be random, and the device can be taken away to leave the screen after the screen senses the contact of the contacts, and can also be kept in a contact state with the screen; and determining the contact point contacted with the screen as a target point.
Further, the distance between M contacts of the recording tape { d }0,…,dl,…,dN-1The distance between two points can be randomly selected to record the distance between the two points, and if the distance between any two points is a sample, N refers to the number of the samples, and the maximum value of N is the preset distanceThat is, the maximum combination number of two points is arbitrarily selected by M points in the permutation and combination algorithm. Theoretically, the larger N is, the smaller the calculation error is, but for the value of N, the requirements of complexity and actual precision, cost factors, and the like need to be considered, so that the specific analysis is performed according to specific situations, and no specific limitation is made here.
Step b 2: and acquiring the pixel position corresponding to the target point.
Specifically, the pixel positions corresponding to the M contacts can be recorded by software, and the coordinates are { (x)0,y0),…,(xM-1,yM-1)}。
Step b 3: and calculating to obtain the pixel distance between the target points according to the pixel positions of the target points.
Specifically, the pixel distance { p between the target points can be calculated according to the formula (1)0,…,pl,…,pN-1},l∈[0,N-1]。
Step b 4: and determining the pixel size of the screen to be detected according to the preset distance and the pixel distance between the target points.
Specifically, the pixel size of the screen to be detected is calculated according to the formula (2).
(III) when the operation aiming at the screen to be detected is a sliding operation and a contact operation, the step of determining the pixel size of the screen mainly comprises the following steps c1 to c 6:
step c 1: and responding to the contact operation of the preset reference object aiming at the preset proofreading area in the screen to be detected.
In a specific embodiment, a calibration region and a sliding cursor F capable of adjusting the size of the calibration region can be provided on the screen, see a distribution diagram of the calibration region and the sliding cursor shown in fig. 4, which illustrates that the calibration region is a circle. The shape of the calibration area may be varied, such as rectangular, square, diamond, oval, rectangular with rounded corners, etc., without limitation.
Further, the preset reference object is contacted with the screen, namely the preset reference object is attached to the screen, the shape of the reference object is kept consistent with that of the correction area, and the center of the preset reference object is kept coincident with that of the correction area. The size of the predetermined reference object is known, and a circular reference object is taken as an example, that is, the diameter D of the circular reference object is known, and the size of the predetermined reference object is the predetermined distance.
Step c 2: and responding to the sliding operation aiming at the preset mark in the screen to be detected, and adjusting the boundary of the proofreading area to be coincident with the boundary of the preset reference object.
Specifically, the vernier F is slid to adjust the size of the calibration area, so as to ensure that the boundary of the calibration area coincides with the peripheral boundary of the preset reference.
Step c 3: and determining two points which are positioned at the boundary of the calibration area and have the connection distance of a preset distance as a group of target points.
Specifically, a plurality of groups of points with known sizes (that is, the distance between the two points is a preset distance) on the boundary of the calibration area are obtained as target points, and taking a circular calibration area as an example, the two points which are located on the boundary of the calibration area and are connected through the center of a circle can be read through software to serve as a group of target points.
Step c 4: pixel positions of at least one set of target points are acquired.
Specifically, the pixel positions of at least one group of target points can be recorded by software, and are recorded as:
step c 5: and calculating to obtain the pixel distance between the target points according to the pixel positions of the target points.
Specifically, the pixel distance between the target points can be calculated according to the following formula:
wherein ,andrespectively representing the pixel positions of the nth group of target points; p is a radical ofnRepresenting the pixel distance between the nth set of target points.
Step c 6: and determining the pixel size of the screen to be detected according to the preset distance and the pixel distance between the target points.
Specifically, the pixel size of the screen to be detected can be calculated according to the following formula:
wherein ,dnRepresenting a preset distance between the nth set of target points.
Further, taking a circular reference object with a diameter D as an example, the pixel size of the screen to be detected can be calculated according to the following formula:
after the pixel size of the screen is obtained through calculation, further, the embodiment of the present invention further provides a method for calculating the pixel count per inch and the screen size, and specifically, the pixel count per inch may be calculated according to the obtained pixel size according to the following formula:
wherein PPI represents the number of pixels per inch; s represents a pixel size; 1 inch to 2.54 cm.
Further, the pre-stored logic pixels and pixel ratios of the width W and the height H of the screen to be detected can be read by software, and the screen size is calculated according to the following formula, wherein the unit is inch:
wherein L represents a screen size; dpr denotes the pixel ratio.
As to the method for obtaining the pixel size provided in the foregoing embodiment, an embodiment of the present invention further provides a device for obtaining the pixel size, and referring to a schematic structural diagram of the device for obtaining the pixel size shown in fig. 5, the device may include the following components:
an information obtaining module 501, configured to obtain, in response to an operation on a screen to be detected, a preset distance between a pixel position corresponding to a target point and the target point; wherein the target points comprise at least two;
a pixel distance calculating module 502, configured to calculate a pixel distance between the target points according to pixel positions of the target points;
the pixel size calculating module 503 is configured to determine the pixel size of the screen to be detected according to the preset distance between the target points and the pixel distance.
The embodiment of the invention provides a pixel size obtaining device, which can respond to the operation of a screen to be detected to determine at least two target points, obtain the pixel positions corresponding to the target points and the preset distance between the target points, and calculate the pixel distance between the target points according to the pixel positions of the target points; and determining the pixel size of the screen to be detected according to the preset distance and the pixel distance between the target points. The device for acquiring the pixel size can determine the target points (at least two target points) by responding to the operation of the screen to be detected, and then calculate the pixel size of the screen to be detected, so that the problems that parameters such as the pixel size of the screen of the intelligent equipment cannot be read through platform software and the parameters cannot be calculated through reading limited parameters of the screen of the intelligent equipment in part of software development are effectively solved.
In an embodiment, the information obtaining module 501 is further configured to: responding to the sliding operation aiming at the screen to be detected, acquiring a sliding track corresponding to the sliding operation, and determining a starting point and an end point of the sliding track as target points; wherein the length of the sliding track is a preset distance; and acquiring the pixel position corresponding to the target point.
In an embodiment, the information obtaining module 501 is further configured to: responding to the contact operation of equipment with a contact point for a screen to be detected, and determining the contact point of the equipment as a target point; the distance between every two contacts is a preset distance; and acquiring the pixel position corresponding to the target point.
In an embodiment, the information obtaining module 501 is further configured to: responding to the contact operation of a preset reference object to a preset proofreading area in the screen to be detected; wherein the size of the preset reference object is a preset distance; responding to sliding operation aiming at a preset mark in a screen to be detected, and adjusting the boundary of the proofreading area to be superposed with the boundary of a preset reference object; determining two points which are positioned at the boundary of the calibration area and have a connection distance of a preset distance as a group of target points; pixel positions of at least one set of target points are acquired.
In an embodiment, the device for obtaining the pixel size further includes a screen size calculating module, configured to calculate, according to the obtained pixel size and a pre-stored logical pixel and pixel ratio of the screen to be detected, a pixel count and a screen size of a unit inch of the screen to be detected.
The device provided by the embodiment of the present invention has the same implementation principle and technical effect as the method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the method embodiments without reference to the device embodiments.
The embodiment of the invention also provides electronic equipment, which specifically comprises a processor and a storage device; the storage means has stored thereon a computer program which, when executed by the processor, performs the method of any of the above described embodiments.
Fig. 6 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present invention, where the electronic device 100 includes: a processor 60, a memory 61, a bus 62 and a communication interface 63, wherein the processor 60, the communication interface 63 and the memory 61 are connected through the bus 62; the processor 60 is arranged to execute executable modules, such as computer programs, stored in the memory 61.
The Memory 61 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 63 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used.
The bus 62 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
The memory 61 is used for storing a program, the processor 60 executes the program after receiving an execution instruction, and the method executed by the apparatus defined by the flow process disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 60, or implemented by the processor 60.
The processor 60 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 60. The Processor 60 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory 61, and the processor 60 reads the information in the memory 61 and, in combination with its hardware, performs the steps of the above method.
The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the foregoing method embodiment, which is not described herein again.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A method for obtaining a pixel size, comprising:
responding to the operation aiming at the screen to be detected, and acquiring a preset distance between a pixel position corresponding to a target point and the target point; wherein the target points include at least two;
calculating to obtain the pixel distance between the target points according to the pixel positions of the target points;
and determining the pixel size of the screen to be detected according to the preset distance and the pixel distance between the target points.
2. The method for acquiring the pixel size according to claim 1, wherein the operation on the screen to be detected comprises a sliding operation and/or a contact operation.
3. The method according to claim 2, wherein the operation includes a sliding operation, and the step of acquiring the preset distance between the pixel position corresponding to the target point and the target point in response to the operation on the screen to be detected includes:
responding to the sliding operation aiming at the screen to be detected, acquiring a sliding track corresponding to the sliding operation, and determining a starting point and an end point of the sliding track as the target points; the length of the sliding track is the preset distance;
and acquiring the pixel position corresponding to the target point.
4. The method according to claim 2, wherein the operation includes a touch operation, and the step of acquiring the preset distance between the pixel position corresponding to the target point and the target point in response to the operation on the screen to be detected includes:
responding to the contact operation of equipment with a contact point on a screen to be detected, and determining the contact point of the equipment as a target point; the distance between every two contacts is the preset distance;
and acquiring the pixel position corresponding to the target point.
5. The method according to claim 2, wherein the operations include a sliding operation and a contact operation, and the step of acquiring the preset distance between the pixel position corresponding to the target point and the target point in response to the operation on the screen to be detected includes:
responding to the contact operation of a preset reference object to a preset proofreading area in the screen to be detected; wherein the size of the preset reference object is the preset distance;
responding to sliding operation aiming at a preset mark in a screen to be detected, and adjusting the boundary of the proofreading area to be superposed with the boundary of the preset reference object;
determining two points which are positioned at the boundary of the calibration area and have a connection distance of a preset distance as a group of target points;
and acquiring pixel positions of at least one group of target points.
6. The method for obtaining the pixel size according to claim 1, wherein the step of determining the pixel size of the screen to be detected according to the preset distance and the pixel distance between the target points comprises:
calculating the pixel size of the screen to be detected according to the following formula:
wherein d represents a preset distance between the target points; p represents the pixel distance; n represents the number of samples of the preset distance.
7. The method for obtaining the pixel size according to claim 1, further comprising:
calculating to obtain the pixel number of the unit inch of the screen to be detected and the screen size according to the obtained pixel size and the prestored logic pixel and pixel ratio of the screen to be detected;
wherein, the calculation formula of the pixel number of the unit inch is as follows:
wherein PPI represents the number of pixels per inch; s represents the pixel size;
the calculation formula of the screen size is as follows:
wherein L represents the screen size; w represents a logical pixel of the width of the screen to be detected; h represents a logical pixel of the height of the screen to be detected; dpr represents the pixel ratio.
8. An apparatus for obtaining a pixel size, comprising:
the information acquisition module is used for responding to the operation aiming at the screen to be detected and acquiring the preset distance between the pixel position corresponding to the target point and the target point; wherein the target points include at least two;
the pixel distance calculation module is used for calculating the pixel distance between the target points according to the pixel positions of the target points;
and the pixel size calculation module is used for determining the pixel size of the screen to be detected according to the preset distance and the pixel distance between the target points.
9. An electronic device comprising a processor and a memory;
the memory has stored thereon a computer program which, when executed by the processor, performs the method of any of claims 1 to 7.
10. A storage medium for storing a computer program for use in the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911154362.5A CN110865785B (en) | 2019-11-21 | 2019-11-21 | Pixel size acquisition method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911154362.5A CN110865785B (en) | 2019-11-21 | 2019-11-21 | Pixel size acquisition method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110865785A true CN110865785A (en) | 2020-03-06 |
CN110865785B CN110865785B (en) | 2023-10-13 |
Family
ID=69656430
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911154362.5A Active CN110865785B (en) | 2019-11-21 | 2019-11-21 | Pixel size acquisition method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110865785B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113050113A (en) * | 2021-03-10 | 2021-06-29 | 广州南方卫星导航仪器有限公司 | Laser point positioning method and device |
WO2021253548A1 (en) * | 2020-06-15 | 2021-12-23 | 深圳市华星光电半导体显示技术有限公司 | Pixel design method, pixel design apparatus and electronic device |
CN117912383A (en) * | 2024-03-20 | 2024-04-19 | 四川启睿克科技有限公司 | Method for testing brightness uniformity of flat panel display equipment |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090046079A1 (en) * | 2007-08-15 | 2009-02-19 | International Business Machines Corporation | Correcting Coordinates on Touch Panel to True Display Coordinates |
US20090109195A1 (en) * | 2007-10-26 | 2009-04-30 | Kent Joel C | Method and apparatus for laplace constrained touchscreen calibration |
KR20120075054A (en) * | 2010-12-28 | 2012-07-06 | 주식회사 케이티 | Mobile terminal and method for controlling screen display thereof |
CN103472953A (en) * | 2013-09-25 | 2013-12-25 | 成都吉锐触摸技术股份有限公司 | Calibration method of touch display screen |
CN103488368A (en) * | 2013-10-16 | 2014-01-01 | 深圳市开立科技有限公司 | Screen calibrating method and device for touch screen in Android system |
US20140362211A1 (en) * | 2013-03-28 | 2014-12-11 | Kabushiki Kaisha Toshiba | Mobile terminal device, display control method, and computer program product |
CN104820523A (en) * | 2015-05-19 | 2015-08-05 | 京东方科技集团股份有限公司 | Method and device for realizing touch control |
US20150229902A1 (en) * | 2013-12-24 | 2015-08-13 | Intel Corporation | Techniques for stereo three dimensional video processing |
US20160284058A1 (en) * | 2015-03-26 | 2016-09-29 | Pht Corporation | System, method and apparatus for displaying a non-biasing and self-adjusting visual analog scale on a computing device |
US20170006184A1 (en) * | 2013-12-20 | 2017-01-05 | Hewlett-Packard Development Company, L.P. | Determining image rescale factors |
CA2959820A1 (en) * | 2017-03-03 | 2018-09-03 | Evolution Optiks Limited | Vision correction system and method, and light field display and barrier therefor |
CN109189533A (en) * | 2018-08-29 | 2019-01-11 | 万帮充电设备有限公司 | A kind of screen size adaptation method and system |
CN109478088A (en) * | 2016-07-21 | 2019-03-15 | 视觉应用解决方案有限公司 | It is a kind of to prevent by electronic curtain equipment closely using the system and method for causing vision to be degenerated |
-
2019
- 2019-11-21 CN CN201911154362.5A patent/CN110865785B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090046079A1 (en) * | 2007-08-15 | 2009-02-19 | International Business Machines Corporation | Correcting Coordinates on Touch Panel to True Display Coordinates |
US20090109195A1 (en) * | 2007-10-26 | 2009-04-30 | Kent Joel C | Method and apparatus for laplace constrained touchscreen calibration |
KR20120075054A (en) * | 2010-12-28 | 2012-07-06 | 주식회사 케이티 | Mobile terminal and method for controlling screen display thereof |
US20140362211A1 (en) * | 2013-03-28 | 2014-12-11 | Kabushiki Kaisha Toshiba | Mobile terminal device, display control method, and computer program product |
CN103472953A (en) * | 2013-09-25 | 2013-12-25 | 成都吉锐触摸技术股份有限公司 | Calibration method of touch display screen |
CN103488368A (en) * | 2013-10-16 | 2014-01-01 | 深圳市开立科技有限公司 | Screen calibrating method and device for touch screen in Android system |
US20170006184A1 (en) * | 2013-12-20 | 2017-01-05 | Hewlett-Packard Development Company, L.P. | Determining image rescale factors |
US20150229902A1 (en) * | 2013-12-24 | 2015-08-13 | Intel Corporation | Techniques for stereo three dimensional video processing |
US20160284058A1 (en) * | 2015-03-26 | 2016-09-29 | Pht Corporation | System, method and apparatus for displaying a non-biasing and self-adjusting visual analog scale on a computing device |
CN104820523A (en) * | 2015-05-19 | 2015-08-05 | 京东方科技集团股份有限公司 | Method and device for realizing touch control |
CN109478088A (en) * | 2016-07-21 | 2019-03-15 | 视觉应用解决方案有限公司 | It is a kind of to prevent by electronic curtain equipment closely using the system and method for causing vision to be degenerated |
CA2959820A1 (en) * | 2017-03-03 | 2018-09-03 | Evolution Optiks Limited | Vision correction system and method, and light field display and barrier therefor |
CN109189533A (en) * | 2018-08-29 | 2019-01-11 | 万帮充电设备有限公司 | A kind of screen size adaptation method and system |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021253548A1 (en) * | 2020-06-15 | 2021-12-23 | 深圳市华星光电半导体显示技术有限公司 | Pixel design method, pixel design apparatus and electronic device |
US11880641B2 (en) | 2020-06-15 | 2024-01-23 | Shenzhen China Star Optoelectronics Semiconductor Display Technology Co., Ltd. | Pixel design method, pixel design device, and electronic equipment |
CN113050113A (en) * | 2021-03-10 | 2021-06-29 | 广州南方卫星导航仪器有限公司 | Laser point positioning method and device |
CN113050113B (en) * | 2021-03-10 | 2023-08-01 | 广州南方卫星导航仪器有限公司 | Laser spot positioning method and device |
CN117912383A (en) * | 2024-03-20 | 2024-04-19 | 四川启睿克科技有限公司 | Method for testing brightness uniformity of flat panel display equipment |
CN117912383B (en) * | 2024-03-20 | 2024-05-31 | 四川启睿克科技有限公司 | Method for testing brightness uniformity of flat panel display equipment |
Also Published As
Publication number | Publication date |
---|---|
CN110865785B (en) | 2023-10-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109189682B (en) | Script recording method and device | |
CN110865785A (en) | Method and device for acquiring pixel size and electronic equipment | |
CN107274442B (en) | Image identification method and device | |
CN112199268B (en) | Software compatibility testing method and electronic equipment | |
CN110796095B (en) | Instrument template establishing method, terminal equipment and computer storage medium | |
CN115357155A (en) | Window identification method, device, equipment and computer readable storage medium | |
US20180107875A1 (en) | Visual positioning apparatus, method, and non-transitory computer readable storage medium thereof | |
CN109145987B (en) | Model generation method and device | |
CN112181479A (en) | Method and device for determining difference between code file versions and electronic equipment | |
CN109145821B (en) | Method and device for positioning pupil image in human eye image | |
CN116524477A (en) | Method and system for identifying detection result of detection box | |
CN116152816A (en) | Method and device for identifying closed area, electronic equipment and storage medium | |
CN115452101A (en) | Instrument verification method, device, equipment and medium | |
CN114035706B (en) | Analysis method, device, equipment and storage medium for touch screen finger characteristics | |
CN113496134A (en) | Two-dimensional code positioning method, device, equipment and storage medium | |
CN108664194A (en) | Display methods and device | |
CN112698877B (en) | Data processing method and system | |
CN107092702B (en) | Geographic information element position comparison checking method and device based on overlapping proportion | |
CN113343797A (en) | Information extraction method and device, terminal equipment and computer readable storage medium | |
CN107831935B (en) | Touch point trajectory tracking method and device based on fitting and intelligent equipment | |
CN112906681A (en) | Meter reading method and device, electronic equipment and storage medium | |
CN109324797B (en) | Desktop icon generation method, computer readable storage medium and terminal equipment | |
CN117171277B (en) | Method, system, equipment and medium for loading marks of electronic map | |
CN109471987A (en) | Thermodynamic chart processing method, device and electronic equipment | |
CN112711965B (en) | Drawing recognition method, device and equipment |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |