Imaging image self-adaptive amplification method and device, camera host and endoscope equipment

By determining the fitted circle and key point coordinates of the imaging screen in the endoscopic device and filtering the target magnification, adaptive amplification of the imaging screen is achieved, solving the problems of cumbersome operation and poor user experience caused by manual adjustment.

CN119967287APending Publication Date: 2025-05-09CHONGQING XISHAN SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510042793.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

In an endoscope device, manually adjusting it to achieve focus amplification of the imaging screen after external optical mirror, resulting in cumbersome operation and poor user experience.

Method used

When acquiring the imaging screen, determine the picture fit circle and key point coordinates, and filter the target magnification, to achieve adaptive magnification of the imaging screen.

Benefits of technology

Simplifies the operation process, improves the user experience, and avoids the tedious process of manual adjustment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119967287A_ABST
    Figure CN119967287A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image display, and discloses an imaging image adaptive amplification method and device, a camera host and endoscope equipment, and the method comprises the steps: when an imaging image is obtained, determining an image fitting circle of an effective image in the imaging image, the imaging image being an image shot by a camera connected with an optical sight glass; obtaining key point coordinates of the imaging picture under each preset magnification factor, and screening from each preset magnification factor based on the picture fitting circle and each key point coordinate to obtain a target magnification factor; and magnifying the imaging picture according to the target magnification factor, and displaying the magnified imaging picture. Compared with an existing method of realizing amplification through manual adjustment, the method can realize self-adaptive amplification, so that the operation is simplified, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of picture display technology, and in particular to a method and device for adaptively magnifying an imaging picture, a camera host and an endoscope device. Background Art

[0002] Currently, during surgical operations, medical staff generally use endoscopic equipment to observe lesions inside the human body for subsequent diagnosis.

[0003] Due to the different structures of different lesion sites, an optical viewfinder (such as an arthroscope, hysteroscope, laparoscope, etc.) is usually connected to the camera of the endoscope device for further observation. However, the addition of an optical viewfinder will cause the imaging picture displayed on the monitor of the endoscope device to change, so the imaging picture needs to be focused and magnified. The existing focus and magnification are generally achieved through manual adjustment, which makes the operation more cumbersome and the user experience poor. Summary of the invention

[0004] The main purpose of the present invention is to provide an imaging picture adaptive magnification method, device, camera host and endoscope equipment, aiming to solve the technical problem that after an optical mirror is connected to the camera of the endoscope equipment, manual adjustment is required to achieve the focus and magnification of the imaging picture, resulting in cumbersome operation and poor user experience.

[0005] To achieve the above object, an embodiment of the present invention provides an imaging picture adaptive magnification method, the method comprising:

[0006] When an imaging picture is acquired, a picture fitting circle of a valid picture in the imaging picture is determined, wherein the imaging picture is a picture taken by a camera connected to an optical viewfinder;

[0007] Acquire the key point coordinates of the imaging picture at each preset magnification, and select and obtain the target magnification from each preset magnification based on the picture fitting circle and the key point coordinates;

[0008] The imaging picture is enlarged according to the target magnification, and the enlarged imaging picture is displayed.

[0009] In one embodiment, the step of selecting and obtaining a target magnification from the preset magnifications based on the picture fitting circle and the coordinates of each key point includes:

[0010] From each preset magnification factor, in order from small to large, it is determined whether the coordinates of the key points of the imaging picture at each preset magnification factor are located within the picture fitting circle;

[0011] When the first determination is yes, the preset magnification factor is used as the target magnification factor.

[0012] In one embodiment, the step of determining a picture fitting circle of a valid picture in the imaging picture includes:

[0013] Determining a picture boundary point of a valid picture in the imaging picture based on a pixel brightness value of each picture pixel in the imaging picture;

[0014] Acquire a reference coordinate line, and determine a reference coordinate point according to the reference coordinate line and the pixel brightness value of each pixel of the picture;

[0015] Determine the center of the effective picture based on the reference coordinate point and the picture boundary point;

[0016] The target picture radius is determined according to the picture circle center and the picture boundary point, and the picture circle center and the target picture radius are fitted to obtain a picture fitting circle of the effective picture.

[0017] In one embodiment, the step of determining the radius of the target screen according to the screen center and the screen boundary points includes:

[0018] Determine an initial screen radius based on the screen center and the screen boundary point, and fit the screen center and the initial screen radius to obtain an initial fitting circle;

[0019] Determine the pixel brightness value of each outer-circle pixel in the outer-circle picture according to the imaging picture and the initial fitting circle;

[0020] Acquire the total number of pixels of the imaging picture, and determine the first number of pixels whose pixel brightness values ​​of the pixels outside the circle are higher than a first preset brightness threshold;

[0021] A first pixel ratio is determined according to the first pixel quantity and the total number of pixels, and the initial picture radius is adjusted according to the first pixel ratio to obtain a target picture radius.

[0022] In one embodiment, the step of magnifying the imaging picture according to the target magnification comprises:

[0023] Determining an initial picture size of the imaging picture, and enlarging the initial picture size according to the target magnification to obtain a target picture size;

[0024] Determine a target pixel in the enlarged imaging picture based on the target picture size, and determine a source pixel of the target pixel in the imaging picture based on the target magnification;

[0025] The imaging picture is enlarged according to the pixel coordinates of the source pixel.

[0026] In one embodiment, the step of enlarging the imaged picture according to the pixel coordinates of the source pixel comprises:

[0027] Selecting corresponding neighboring pixels from the imaging picture based on the pixel coordinates of the source pixel;

[0028] Determine pixel weights of the neighboring pixels according to pixel coordinates of the neighboring pixels;

[0029] The imaging picture is enlarged based on the pixel weight and the pixel coordinates of the neighboring pixels.

[0030] In one embodiment, when acquiring an imaging picture, the step of determining a picture fitting circle of a valid picture in the imaging picture includes:

[0031] When an imaging picture is acquired, a pixel brightness value of each picture pixel in the imaging picture is determined;

[0032] Acquire the total number of pixels of the imaging picture, and determine the number of second pixels whose pixel brightness values ​​of the picture pixels are lower than a second preset brightness threshold;

[0033] A second pixel ratio is determined according to the second pixel quantity and the total number of pixels, and when the second pixel ratio is higher than a preset ratio threshold, a picture fitting circle of a valid picture in the imaging picture is determined.

[0034] In addition, to achieve the above-mentioned purpose, an embodiment of the present invention further provides an imaging picture adaptive magnification device, the device comprising:

[0035] A picture acquisition module, used for determining a picture fitting circle of a valid picture in an image picture when an image picture is acquired, wherein the image picture is a picture taken by a camera connected to an optical viewfinder;

[0036] A magnification determination module, used to obtain the key point coordinates of the imaging picture at each preset magnification, and select a target magnification from each preset magnification based on the picture fitting circle and the key point coordinates;

[0037] The image magnification module is used to magnify the imaging image according to the target magnification factor and display the magnified imaging image.

[0038] In one embodiment, the magnification determination module is also used to determine whether the coordinates of the key points of the imaging picture at each preset magnification are located within the picture fitting circle from each preset magnification in order from small to large; when the first judgment is yes, the preset magnification is used as the target magnification.

[0039] In one embodiment, the picture acquisition module is also used to determine the picture boundary points of the effective picture in the imaging picture based on the pixel brightness value of each picture pixel in the imaging picture; obtain a reference coordinate line, and determine the reference coordinate point according to the reference coordinate line and the pixel brightness value of each picture pixel; determine the picture center of the effective picture based on the reference coordinate point and the picture boundary point; determine the target picture radius according to the picture center and the picture boundary point, and fit the picture center and the target picture radius to obtain the picture fitting circle of the effective picture.

[0040] In one embodiment, the picture acquisition module is also used to determine the initial picture radius based on the picture center and the picture boundary point, and fit the picture center and the initial picture radius to obtain an initial fitting circle; determine the pixel brightness value of each out-of-circle pixel in the out-of-circle picture according to the imaging picture and the initial fitting circle; obtain the total number of pixels in the imaging picture, and determine the first number of pixels whose pixel brightness values ​​of the out-of-circle pixels are higher than a first preset brightness threshold; determine a first pixel ratio according to the first pixel number and the total number of pixels, and adjust the initial picture radius according to the first pixel ratio to obtain a target picture radius.

[0041] In one embodiment, the image magnification module is further used to determine the initial image size of the imaging image, and magnify the initial image size according to the target magnification factor to obtain the target image size; determine the target pixel in the enlarged imaging image based on the target image size, and determine the source pixel of the target pixel in the imaging image based on the target magnification factor; and magnify the imaging image according to the pixel coordinates of the source pixel.

[0042] In one embodiment, the image magnification module is further used to select corresponding neighboring pixels from the imaging image based on the pixel coordinates of the source pixel; determine the pixel weights of the neighboring pixels according to the pixel coordinates of the neighboring pixels; and magnify the imaging image based on the pixel weights and the pixel coordinates of the neighboring pixels.

[0043] In one embodiment, the picture acquisition module is used to determine the pixel brightness value of each picture pixel in the imaging picture when the imaging picture is acquired; obtain the total number of pixels of the imaging picture, and determine the second number of pixels whose pixel brightness value of the picture pixels is lower than a second preset brightness threshold; determine the second pixel ratio based on the second pixel number and the total number of pixels, and when the second pixel ratio is higher than the preset ratio threshold, determine the picture fitting circle of the effective picture in the imaging picture.

[0044] In addition, to achieve the above purpose, an embodiment of the present invention further proposes a storage medium, on which an imaging picture adaptive magnification program is stored, and when the imaging picture adaptive magnification program is executed by a processor, the steps of the imaging picture adaptive magnification method described above are implemented.

[0045] In addition, to achieve the above-mentioned purpose, an embodiment of the present invention further proposes a camera host, which includes: a memory, a processor, and an imaging picture adaptive magnification program stored in the memory and executable on the processor, and when the imaging picture adaptive magnification program is executed by the processor, the steps of the imaging picture adaptive magnification method described above are implemented.

[0046] In addition, to achieve the above-mentioned purpose, an embodiment of the present invention also proposes an endoscope device, which includes: an optical viewfinder, a camera, a monitor and a camera host as described above, wherein the optical viewfinder is connected to the camera, the camera is connected to the camera host, and the camera host is connected to the monitor.

[0047] The embodiment of the present invention provides an imaging picture adaptive magnification method, device, camera host and endoscope equipment, the method comprising: when acquiring an imaging picture, determining the picture fitting circle of the effective picture in the imaging picture, the imaging picture is the picture captured by a camera connected to an optical viewfinder; acquiring the key point coordinates of the imaging picture at each preset magnification, and selecting the target magnification from each preset magnification based on the picture fitting circle and each key point coordinate; magnifying the imaging picture according to the target magnification, and displaying the magnified imaging picture. Because the present invention can first determine the picture fitting circle of the effective picture when acquiring the imaging picture, and acquire the key point coordinates of the imaging picture at each preset magnification, and select the target magnification from each preset magnification based on the key point coordinates and the picture fitting circle to magnify the imaging picture, thereby realizing adaptive magnification. Compared with the existing method that requires manual adjustment to realize magnification, the present invention can realize adaptive magnification, thereby simplifying the operation and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0050] Figure 1 A schematic diagram of the camera host structure of the hardware operating environment involved in the embodiment of the present invention;

[0051] Figure 2 It is a schematic diagram of the flow chart of the first embodiment of the imaging picture adaptive magnification method of the present invention;

[0052] Figure 3 A schematic diagram of an imaging picture in a first embodiment of the imaging picture adaptive magnification method of the present invention;

[0053] Figure 4 The brightness histograms of the connected and unconnected images in the first embodiment of the imaging picture adaptive magnification method of the present invention;

[0054] Figure 5 It is a schematic diagram of the overall flow of the first embodiment of the imaging picture adaptive magnification method of the present invention;

[0055] Figure 6 Schematic diagram of key points at various preset magnifications in the first embodiment of the imaging picture adaptive magnification method of the present invention;

[0056] Figure 7 Schematic diagram of key point coordinates at various preset magnifications in the first embodiment of the imaging picture adaptive magnification method of the present invention;

[0057] Figure 8 A schematic diagram showing the selection of three key points in the first embodiment of the imaging picture adaptive magnification method of the present invention;

[0058] Fig. 9 Schematic diagram of another key point at each preset magnification factor in the first embodiment of the imaging picture adaptive magnification method of the present invention;

[0059] Fig.10 A schematic diagram of another key point coordinate at each preset magnification factor in the first embodiment of the imaging picture adaptive magnification method of the present invention;

[0060] Fig.11 A schematic diagram of a flow chart of a second embodiment of the imaging picture adaptive magnification method of the present invention;

[0061] Fig.12 It is a schematic diagram of a picture fitting circle in the second embodiment of the imaging picture adaptive magnification method of the present invention;

[0062] Fig.13 It is a schematic diagram of the process of fitting a circle to an image in the second embodiment of the imaging image adaptive magnification method of the present invention;

[0063] Fig.14 A schematic diagram of a process for determining a minimum inscribed circle in a second embodiment of the imaging picture adaptive magnification method of the present invention;

[0064] Fig.15 A schematic diagram of a flow chart of a third embodiment of the imaging picture adaptive magnification method of the present invention;

[0065] Fig.16 It is a structural block diagram of the first embodiment of the imaging picture adaptive magnification device of the present invention.

[0066] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0067] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present invention and are not used to limit the present invention.

[0068] Reference Figure 1 , Figure 1 The schematic diagram of the camera host structure of the hardware operating environment involved in the embodiment of the present invention is shown in FIG.

[0069] like Figure 1 As shown, the camera host may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include an interface for connecting a display screen (Display), and the user interface 1003 may also include a standard wired interface and a wireless interface. The wired interface of the user interface 1003 may be a USB interface in the present invention. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) or a stable memory (Non-volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0070] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the camera host, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0071] like Figure 1 As shown, the memory 1005 identified as a computer storage medium may include an operating system, a network communication module, a user interface module, and an imaging picture adaptive magnification program.

[0072] exist Figure 1 In the camera host shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the user device; the camera host calls the imaging picture adaptive magnification program stored in the memory 1005 through the processor 1001, and executes the imaging picture adaptive magnification method provided in the embodiment of the present invention.

[0073] It should be noted that, currently, during surgical operations, medical staff generally use endoscopic equipment to observe lesions inside the human body for subsequent diagnosis.

[0074] Due to the different structures of different lesion sites, an optical viewfinder (such as an arthroscope, hysteroscope, laparoscope, etc.) is usually connected to the camera of the endoscope device for further observation. However, the addition of an optical viewfinder will cause the imaging picture displayed on the monitor of the endoscope device to change, so the imaging picture needs to be focused and magnified. The existing focus and magnification are generally achieved through manual adjustment, which makes the operation more cumbersome and the user experience poor.

[0075] Therefore, in order to solve the above defects, this embodiment provides an imaging picture adaptive magnification method. When an imaging picture is obtained, the picture fitting circle of the effective picture can be determined first, and the key point coordinates of the imaging picture at each preset magnification can be obtained. Based on the key point coordinates and the picture fitting circle, the target magnification is selected from each preset magnification to magnify the imaging picture, thereby achieving adaptive magnification. Compared with the existing method that requires manual adjustment to achieve magnification, this embodiment can achieve adaptive magnification, thereby simplifying the operation and improving the user experience.

[0076] For ease of understanding, the following combination Figures 2 to 16 The imaging picture adaptive magnification method provided by the embodiment of the present invention is specifically introduced.

[0077] Reference Figure 2 , Figure 2FIG. 1 is a flow chart of a first embodiment of a method for adaptively magnifying an image frame according to the present invention. The first embodiment of a method for adaptively magnifying an image frame according to the present invention is provided. Figure 2 As shown, in this embodiment, the specific method includes:

[0078] Step S10: when an imaging picture is acquired, a picture fitting circle of a valid picture in the imaging picture is determined, and the imaging picture is a picture taken by a camera connected to an optical viewfinder.

[0079] It can be understood that the method of this embodiment can be applied on a device that receives images for processing and then sends them to a display screen for display. Specifically, it can be applied to the camera host of the above-mentioned endoscope device, and then the executor of the embodiment of this method can be the above-mentioned camera host. The following takes the camera host as an example to illustrate this embodiment and the following embodiments.

[0080] It should be understood that, in this embodiment, the endoscope device may include: a camera, a monitor and a camera host, the camera host may be connected to the camera for shooting pictures and the monitor for displaying the shooting pictures respectively, the camera is also plugged with an optical mirror, in actual use, the medical staff can place the camera in a suitable position and shoot the patient's lesion site, and transmit the shot picture to the monitor for display so that the medical staff can observe; at the same time, due to the different structures of different lesion sites, in order to facilitate observation, the types of plugged optical mirrors are different, and the optical mirror in this embodiment can be any type of optical mirror, such as the above-mentioned arthroscopy, hysteroscope, laparoscope, etc., and this embodiment does not limit this. Therefore, in this embodiment, the above-mentioned imaging picture can be the picture obtained by the camera after being connected with the optical mirror.

[0081] It should also be understood that the effective picture can be a picture taken by an optical viewer. The picture fitting circle can be a circle formed by the outer contour of the effective picture. Figure 3 To explain, Figure 3 FIG. 1 is a schematic diagram of an imaging picture in the first embodiment of the imaging picture adaptive magnification method of the present invention. Figure 3 As shown in FIG. 1 , when the lens is connected to the optical mirror, the field of view will change. Therefore, compared with the case where the optical mirror is not connected, since the lens tube of the optical mirror is cylindrical, the image captured by part of the lens will appear on the display screen (i.e. Figure 3 The image captured in the image, i.e. the above-mentioned image) is blocked by the optical mirror (i.e. Figure 3 The black part in the middle can be recorded as a non-effective picture), and only part of the image in the middle area can be displayed (i.e. Figure 3The effective picture is the middle white part), the picture corresponding to the middle area can be used as the above-mentioned effective picture, and the shooting part of the optical viewfinder can generally be circular, so the outer contour formed by the effective picture can be used as the above-mentioned picture fitting circle.

[0082] It should be noted that in order for the above-mentioned camera host to zoom in only when there is a need for zooming in, in the present embodiment, a zoom zoom function button may be set on the above-mentioned camera host; when the camera host is running, if the user has a need for zooming in, the button may be pressed, and after the camera host detects that the button has been pressed, the method provided in the present embodiment may be started; when the button is not detected to be pressed, the non-magnified picture may be displayed, that is, the above-mentioned imaging picture may be directly displayed, that is, the captured picture may be displayed.

[0083] In actual use, after the camera host obtains the imaging picture, it can first determine whether there is a need for zooming in, and if there is a need for zooming in, determine the effective picture in the imaging picture based on the imaging picture, and then determine the picture fitting circle of the effective picture.

[0084] Furthermore, considering that when the lens is not connected to the optical lens, if the zoom function is pressed, the displayed imaging picture may change from clear to blurred, affecting the user's observation. Therefore, this embodiment can detect whether the lens is connected to the optical lens before zooming in, and perform subsequent operations when it is detected that the lens is connected. The specific process is the above step S10, including:

[0085] Step S11: when an imaging picture is acquired, determining the pixel brightness value of each picture pixel in the imaging picture;

[0086] Step S12: Acquire the total number of pixels of the imaging picture, and determine the second number of pixels whose pixel brightness values ​​of the picture pixels are lower than a second preset brightness threshold.

[0087] It is understandable that the above picture pixels may be pixels in the imaging picture, the above pixel brightness values ​​may be brightness values ​​corresponding to each picture pixel in the imaging picture, and the above total number of pixels may be the total number of picture pixels contained in the imaging picture.

[0088] It is also understandable that the second preset brightness threshold may be a brightness threshold for determining whether to connect the optical mirror. Figure 3 As shown in the figure, after the optical mirror is connected, there may be black parts around the image, that is, the brightness histogram of the image will change. Figure 4 , Figure 4 The brightness histograms of the connected and unconnected images in the first embodiment of the imaging image adaptive magnification method of the present invention are shown in FIG. 1 , where the horizontal axis is the brightness value and the vertical axis is the number of pixels. Figure 4(a) is the brightness histogram without optical mirror. Figure 4 (b) is the brightness histogram of the optical mirror; Figure 4 It is not difficult to see that when the optical viewfinder is not connected, the number of pixels with a brightness value of 0 (ie, black) is relatively small, and when the optical viewfinder is connected, the number of pixels with a brightness value of 0 is relatively large.

[0089] Therefore, in this embodiment, the second preset brightness threshold can be set to 10. In actual use, after acquiring the imaging picture, the camera host can first determine the pixel brightness value of each picture pixel in the imaging picture, then obtain the total number of pixels contained in the imaging picture, and count the number of picture pixels with pixel brightness values ​​lower than 10 as the second pixel number.

[0090] Step S13: determining a second pixel ratio according to the second pixel quantity and the total number of pixels, and determining a picture fitting circle of a valid picture in the imaging picture when the second pixel ratio is higher than a preset ratio threshold.

[0091] It should be understood that the above-mentioned preset proportion threshold value can be a threshold value used to determine whether to connect the optical viewfinder. The specific threshold value can be set according to the actual situation, and this embodiment does not limit this.

[0092] Reference Figure 5 , Figure 5 FIG. 1 is a schematic diagram of the overall flow of the first embodiment of the imaging picture adaptive magnification method of the present invention; in actual use, after the imaging picture is acquired (ie Figure 5 The camera host obtains the second pixel number, and then divides the second pixel number by the total number of pixels to obtain the proportion of picture pixels with pixel brightness values ​​lower than 10 to all picture pixels as the second pixel proportion, and compares the second pixel proportion with a preset proportion threshold (i.e. Figure 5 When the second pixel ratio is not higher than the preset ratio threshold, it indicates that the number of black parts in the image is small, and the camera host can determine that the optical viewfinder is not connected, and prompt "zoom condition is not met" (i.e. Figure 5 When the second pixel ratio is higher than the preset ratio threshold, it indicates that there are many black parts in the image, and the camera host can determine that the optical mirror is connected, and continue to perform the subsequent steps, that is, to determine the image fitting circle of the effective image in the image (i.e. Figure 5 Find the center of the circle).

[0093] Step S20: acquiring the key point coordinates of the imaging picture at each preset magnification, and selecting a target magnification from each preset magnification based on the picture fitting circle and the key point coordinates.

[0094] It should be noted that the above-mentioned preset magnification may be a magnification for zoom magnification. In this embodiment, a number of different preset magnifications may be set, and the specific number and corresponding magnifications may be set according to actual conditions, and this embodiment does not limit this. For the convenience of subsequent description, this embodiment uses 5 different preset magnifications for description, which may be 1.2 times, 1.4 times, 1.6 times, 1.8 times, and 2.0 times, respectively. And the 5 preset magnifications may be recorded as 5 different magnification levels, 1.2 times, 1.4 times, 1.6 times, 1.8 times, and 2.0 times, corresponding to level 1, level 2, level 3, level 4, and level 5, respectively.

[0095] It should also be noted that the key points can be points that ensure that the imaged picture after being magnified according to the preset magnification is within the picture fitting circle; the key point coordinates can be coordinates corresponding to the key points. The key point coordinates can be pre-set according to the corresponding preset magnification, and then the 5 preset magnifications in this embodiment correspond to 5 groups of key points respectively, and the number of key points in each group can be set according to the actual situation.

[0096] It should be emphasized that, since the image displayed in the end is a rectangle, when selecting key points in this embodiment, the points that can make the rectangle of the enlarged image be within the fitting circle of the image under the preset magnification can be selected. Therefore, the number of key points can generally be no less than three, and of course can be more. And the selection requirement of each key point can be located on the boundary or vertex of the image under the preset magnification.

[0097] As an implementation method, this embodiment uses four key points for illustration. Considering that the imaging screen finally displayed in this embodiment is a rectangle, in order to ensure that the imaging screen is in the screen fitting circle, the four vertices in the rectangle under the corresponding preset magnification can be used as the above key points. For ease of understanding, refer to Figure 6 , Figure 6 Schematic diagram of key points at various preset magnifications in the first embodiment of the imaging picture adaptive magnification method of the present invention; Figure 6 As shown, a1, b1, c1 and d1 are the four vertices of the imaging picture when magnified 1.2 times as the key points, a2, b2, c2 and d2 are the four vertices of the imaging picture when magnified 1.4 times as the key points, a3, b3, c3 and d3 are the four vertices of the imaging picture when magnified 1.6 times as the key points, a4, b4, c4 and d4 are the four vertices of the imaging picture when magnified 1.8 times as the key points, a5, b5, c5 and d5 are the four vertices of the imaging picture when magnified 2.0 times as the key points.

[0098] After determining the key points at each preset magnification, the coordinates and magnification levels corresponding to each key point can be stored. Figure 7 , Figure 7 Schematic diagram of key point coordinates at various preset magnifications in the first embodiment of the imaging picture adaptive magnification method of the present invention; Figure 7 As shown, at the first level, the coordinates of a1, b1, c1 and d1 are [73, 129], [2088, 129], [73, 3712] and [2088, 3712] respectively; at the second level, the coordinates of a2, b2, c2 and d2 are [145, 257], [2016, 257], [145, 3584] and [2016, 3584] respectively; at the third level, the coordinates of a3, b3, c3 and d3 are [217, 385], [217, 385], [217, 385], [217, 385] respectively. [1944, 385], [217, 3456] and [1944, 3456]; at the 4th level, the coordinates of a4, b4, c4 and d4 are [289, 513], [1872, 513], [289, 3328] and [1872, 3328] respectively; at the 5th level, the coordinates of a5, b5, c5 and d5 are [361, 641], [1800, 641], [361, 3200] and [1800, 3200] respectively.

[0099] It is understandable that the target magnification may be a magnification adapted under the optical lens. In a specific implementation, after the camera host determines the picture fitting circle of the effective picture, it can obtain the pre-stored key point coordinates at each preset magnification, and select a suitable preset magnification from each preset magnification based on the picture fitting circle and the key point coordinates as the target magnification.

[0100] Furthermore, in order to select the adapted target magnification, in this embodiment, the step of selecting and obtaining the target magnification from the preset magnifications based on the picture fitting circle and the coordinates of each key point includes:

[0101] Step S21: judging in order from the preset magnifications in ascending order whether the coordinates of the key points of the imaging picture at each preset magnification are located within the picture fitting circle;

[0102] Step S22: When the first determination is yes, the preset magnification factor is used as the target magnification factor.

[0103] In actual use, when the camera host obtains the picture fitting circle, it can fit the circle formula of the picture fitting circle according to the center and radius of the picture fitting circle, as shown in the following formula 1:

[0104] (xRx ) 2 +(yR y ) 2 =R 2 Formula 1;

[0105] Where R x is the x-axis coordinate of the center of the circle fitted on the screen, R y is the y-axis coordinate of the center of the screen fitting circle, and R is the radius of the screen fitting circle.

[0106] After obtaining the circle formula of the picture fitting circle, the camera host can first sort the preset magnifications in order from small to large, that is, from 1.2 times to 2.0 times. After the sorting is completed, it can be judged in order from small to large according to the sorting order whether the key point coordinates under the preset magnification are all within the above picture fitting circle, which can be specifically implemented by the following formula 2, that is:

[0107] (x′-R x ) 2 +(y′-R y ) 2 ≤R 2 Formula 2;

[0108] Wherein x′ is the x-axis coordinate of the key point coordinate at the preset magnification, and y′ is the y-axis coordinate of the key point coordinate at the preset magnification.

[0109] If at least one of the key point coordinates does not satisfy the above formula 2, that is, at least one is not in the picture fitting circle, it can be shown that the imaged picture under the preset magnification is not completely in the picture fitting circle, which is not conducive to user observation, and then the next preset magnification is subjected to the above judgment until the four key point coordinates under a preset magnification satisfy the above formula 2 for the first time, that is, the four key point coordinates are all in the picture fitting circle, which indicates that the imaged picture under the preset magnification is completely in the picture fitting circle, and the preset magnification is more appropriate. Therefore, the current preset magnification can be used as the above target magnification (i.e. Figure 5 Select the appropriate zoom level to achieve full screen).

[0110] For example, if we continue to explain based on the above five preset magnification factors, the camera host can substitute the key point coordinates corresponding to 1.2 times into the above formula 2 in order from small to large to determine whether it is satisfied; if not, substitute the key point coordinates corresponding to 1.4 times into the above formula 2 to determine whether it is satisfied, until it is satisfied for the first time, and then use the satisfied preset magnification as the above target magnification.

[0111] Those skilled in the art should understand that for an effective image of the same quality, when a rectangular screenshot is taken and then enlarged to full screen, the larger the magnification, the lower the image clarity. Therefore, in order to ensure the best clarity, the above embodiment is judged in the order of magnification from small to large.

[0112] As another implementation, refer to Figure 8 , Figure 8 This is a schematic diagram of selecting three key points in the first embodiment of the imaging picture adaptive magnification method of the present invention. Figure 8 As shown, the four key points described above can correspond to Figure 8 If the number of key points selected is three, the three key points can be two vertices in the rectangle at the preset magnification and the points on the opposite side of the side where the two vertices are located. Figure 8 In the picture captured in the image above, vertex a and vertex b are taken as two key points, and the third key point is recorded as e. Then e can be any point on the opposite side cd of the side ab where vertex a and vertex b are located, and can be at vertex c, vertex d, or any point between cd. This embodiment does not limit this. Similarly, if vertex a and vertex c are selected as two key points, the third key point can be any point on bd.

[0113] For the convenience of subsequent description, this embodiment uses vertex a, vertex b and the midpoint e on the edge cd as the above key points for description. Fig. 9 , Fig. 9 Schematic diagram of another key point at each preset magnification factor in the first embodiment of the imaging picture adaptive magnification method of the present invention; Fig. 9 As shown, a1, b1 and e1 are the key points of the imaging picture when magnified 1.2 times, a2, b2 and e2 are the key points of the imaging picture when magnified 1.4 times, a3, b3 and e3 are the key points of the imaging picture when magnified 1.6 times, a4, b4 and e4 are the key points of the imaging picture when magnified 1.8 times, and a5, b5 and e5 are the key points of the imaging picture when magnified 2.0 times.

[0114] After determining the key points at each preset magnification, the coordinates and magnification levels corresponding to each key point can be stored. Fig.10 , Fig.10 Schematic diagram of another key point coordinates at each preset magnification in the first embodiment of the imaging picture adaptive magnification method of the present invention; Fig.10As shown, at the first level, the coordinates of a1, b1 and e1 are [73, 129], [2088, 129] and [1080, 3712] respectively; at the second level, the coordinates of a2, b2 and e2 are [145, 257], [2016, 257] and [1080, 3584] respectively; at the third level, the coordinates of a3, b3 and e3 are [217, 385], [1944, 385] and [1080, 3456] respectively; at the fourth level, the coordinates of a4, b4 and e4 are [289, 513], [1872, 513] and [1080, 3328] respectively; at the fifth level, the coordinates of a5, b5 and e5 are [361, 641], [1800, 641] and [1080, 3200] respectively.

[0115] After determining the coordinates of each key point, they can also be sorted in ascending order in accordance with the coordinates of the above four key points, and then the three key point coordinates under the preset magnification are checked in descending order to determine whether they are all within the picture fitting circle, so as to determine the target magnification. This process is consistent with the process of the above four key point coordinates, and this embodiment will not be described in detail.

[0116] Step S30: Enlarging the imaging picture according to the target magnification, and displaying the enlarged imaging picture.

[0117] After determining the target magnification, the camera host can magnify the image according to the target magnification, and display the magnified image through the display screen. Thus, adaptive magnification is completed. The final effect is that the magnified image is a rectangular image and is fully displayed on the monitor screen.

[0118] When the camera host of this embodiment obtains an image, it can first determine the image fitting circle of the effective image, and obtain the key point coordinates of the image at each preset magnification, and select the target magnification from each preset magnification based on the key point coordinates and the image fitting circle to magnify the image, thereby realizing adaptive magnification. Compared with the existing method that requires manual adjustment to realize magnification, this embodiment can realize adaptive magnification, thereby simplifying the operation and improving the user experience.

[0119] Reference Fig.11 , Fig.11 1 is a flow chart of a second embodiment of an imaging picture adaptive magnification method according to the present invention. Based on the above first embodiment, a second embodiment of an imaging picture adaptive magnification method according to the present invention is proposed.

[0120] like Fig.11As shown, in order to obtain the above-mentioned picture fitting circle, in this embodiment, the step of determining the picture fitting circle of the effective picture in the imaging picture includes:

[0121] Step S131: determining a picture boundary point of a valid picture in the imaging picture based on the pixel brightness value of each picture pixel in the imaging picture;

[0122] Step S132: Acquire a reference coordinate line, and determine a reference coordinate point according to the reference coordinate line and the pixel brightness value of each pixel in the picture.

[0123] It should be noted that the above-mentioned picture boundary point can be a boundary point between a valid picture and an invalid picture in the imaging picture, which can be determined by detecting whether the pixel brightness value of the picture pixel changes suddenly. The position of the picture boundary point is not fixed, and it is sufficient to distinguish between a valid picture and an invalid picture. The above-mentioned reference coordinate line can be a straight line used to determine the center of the picture circle, and the reference coordinate line can be preset. The above-mentioned reference coordinate point can be a point on the reference coordinate line that intersects with the valid picture.

[0124] For ease of understanding, refer to Fig.12 as well as Fig.13 To explain, Fig.12 This is a schematic diagram of a picture fitting circle in the second embodiment of the imaging picture adaptive magnification method of the present invention. Fig.13 FIG. 1 is a flow chart of a picture fitting circle in the second embodiment of the imaging picture adaptive magnification method of the present invention. Fig.12 and Fig.13 As shown, the camera host may first scan the imaging picture column by column in a certain order (e.g., from the upper left to the lower right order). It should be emphasized that the imaging picture at this time may be an imaging picture that has completed conventional processing such as black level and denoising. Then, according to the scanning result, the imaging picture is compared with the original picture without the optical viewfinder connected, and the picture pixels whose pixel brightness values ​​suddenly change before and after the optical viewfinder is connected are determined. Specifically, it may be determined that a sudden change occurs when the difference between the pixel brightness values ​​when the optical viewfinder is not connected and when the optical viewfinder is connected reaches a preset sudden change threshold.

[0125] After the above comparison, the image pixels that have undergone mutation and the image pixels that have not undergone mutation in the imaging image can be obtained, and then the points corresponding to the image pixels that have not undergone mutation and are adjacent to the image pixels that have undergone mutation are selected as the above image boundary points. In this embodiment, since the order is from the upper left to the lower right, the first point corresponding to the image pixel that has not undergone mutation and is adjacent to the image pixel that has undergone mutation can be used as the above image boundary point, that is, Fig.12 Point A (i.e. Fig.13 Under the microscope, determine the upper vertex of the circular image, i.e. point A);

[0126] Then, the straight line corresponding to the fixed number of lines in the imaging image is used as the above-mentioned reference coordinate line (i.e. Fig.12 BC line), for example, if the image resolution in this embodiment is 4K, the fixed number of lines can be set to 1080 lines. Of course, it can also be other fixed numbers, which are not limited in this embodiment. Then, the point corresponding to the picture pixel that has not undergone a sudden change on the reference coordinate line and is adjacent to the picture pixel that has undergone a sudden change is used as the above-mentioned reference coordinate point, that is, Fig.12 Point B and point C (i.e. Fig.13 Select the fixed image horizontal coordinate and determine the auxiliary points B and C).

[0127] Step S133: determining the center of the effective picture based on the reference coordinate point and the picture boundary point.

[0128] Continue as Fig.12 As shown in the figure, after determining the reference coordinate points B and C, we can draw straight lines AB and AC respectively, and calculate the corresponding straight line expressions (i.e. Fig.13 In the equation, A, B, A, C are taken as straight lines, and the straight line expressions of straight lines AB and AC are calculated respectively). Specifically, their slopes can be calculated respectively. If the slope of straight line AB is recorded as K1 and the slope of straight line AC is recorded as K2, the slope calculation process can be realized by the following formula 3, that is:

[0129]

[0130] When determining the slope K1 of line AB, x 1 is the x-axis coordinate of point A, y 1 is the y-axis coordinate of point A, x 2 is the x-axis coordinate of point B, y 2 is the y-axis coordinate of point B; when determining the slope K2 of line AC, x 1 is the x-axis coordinate of point A, y 1 is the y-axis coordinate of point A, x 2 is the x-axis coordinate of point C, y 2 is the y-axis coordinate of point C;

[0131] After obtaining the slope K1 of line AB and the slope K2 of line AC, the linear expression y of line AB can be obtained: AB =K1+b1, the linear expression y of the straight line AC AC = K2 + b2, then determine the corresponding straight line equation of the perpendicular bisector based on each straight line expression. The midpoint B1 of line AB and the midpoint C1 of line AC are known. If the perpendicular bisector of line AB is denoted as LB1, then the straight line expression of LB1 is y LB1=-1 / K1*x+b3, if the perpendicular bisector of line AC is denoted as LC1, then the linear expression of LC1 is y LC1 =-1 / K2*x+b4 (i.e. Fig.13 The equation of the perpendicular bisector LB1 of AB is: LB1 =-1 / K1*x+b3, the equation of the perpendicular bisector LC1 of AC is: LC1 =-1 / K2*x+b4);

[0132] After obtaining the perpendicular bisector LB1 and LC1, LB1 and LC1 are combined, and the intersection of the two perpendicular bisectors is used as the center of the effective picture, that is, Fig.12 The center of the circle (x, y) (i.e. Figure 5 Find the center of the circle, Fig.13 The straight lines LB1 and LC1 must intersect, and by combining them we can get the estimated center of the circle (x, y).

[0133] It should be emphasized that in order to ensure the accuracy of the center of the picture, the camera host of this embodiment can repeatedly perform the above steps S131 to S133 several times (for example, three times), and take the average value, and use the average value as the center of the picture of the effective picture (i.e. Fig.13 Repeat three times and take the average to get the exact coordinates of the circle center (x, y).

[0134] Step S134: determining a target picture radius according to the picture center and the picture boundary points, and fitting the picture center and the target picture radius to obtain a picture fitting circle of the effective picture.

[0135] It is understandable that the target screen radius may be the radius of the screen fitting circle. In actual use, the camera host may use the distance between the screen center and the screen boundary point A as the target radius, fit the screen center and the target screen radius, and use the fitted circle as the screen fitting circle of the effective screen.

[0136] Furthermore, considering that if the effective picture is not a standard circle, using the distance between the picture boundary point and the picture center as the target radius may result in poor accuracy of the obtained picture fitting circle, so it is necessary to adjust the radius to find the minimum inscribed circle. In this embodiment, the step of determining the target picture radius according to the picture center and the picture boundary point includes:

[0137] Step S1341: determining an initial screen radius based on the screen center and the screen boundary points, and fitting the screen center and the initial screen radius to obtain an initial fitting circle.

[0138] For ease of understanding, refer to Fig.14 To explain, Fig.14 This is a schematic diagram of the process of determining the minimum inscribed circle in the second embodiment of the imaging picture adaptive magnification method of the present invention; Fig.14 As shown, the camera host can use the distance between the center of the picture and the boundary point of the picture as the initial picture radius, recorded as R', and fit the initial picture radius and the center of the picture to obtain a circle as the initial fitting circle (i.e. Fig.14 Draw a circle with the distance from the center of the circle to point A as the initial radius R').

[0139] Step S1342: Determine the pixel brightness value of each outer-circle pixel in the outer-circle picture according to the imaging picture and the initial fitting circle.

[0140] It is understandable that the above-mentioned out-of-circle picture may be a picture other than the effective picture in the imaging picture, that is, the above-mentioned ineffective picture.

[0141] In actual use, after the camera host obtains the initial fitting circle, the image frame can be subtracted from the image frame within the initial fitting circle to obtain the image outside the circle, and the pixel brightness value of each pixel in the image outside the circle can be determined.

[0142] Step S1343: acquiring the total number of pixels of the imaging picture, and determining the first number of pixels whose pixel brightness values ​​of the pixels outside the circle are higher than a first preset brightness threshold;

[0143] Step S1344: determining a first pixel ratio according to the first number of pixels and the total number of pixels, and adjusting the initial picture radius according to the first pixel ratio to obtain a target picture radius.

[0144] It should be understood that the first preset brightness threshold may be a brightness threshold for determining whether a picture exists. In this embodiment, the first preset brightness threshold may be set to 10 for illustration. Furthermore, in actual use, after the camera host obtains the pixel brightness value of each pixel in the outer circle picture, the number of pixels in the outer circle picture with a pixel brightness value higher than 10 may be counted as the first pixel number (i.e. Fig.14 The circular area was subtracted from the endoscopic image and statistically analyzed).

[0145] Then, the first number of pixels is divided by the total number of pixels to obtain the ratio of pixels in the outer circle to the entire imaging picture, which is used as the first pixel ratio, and it is determined whether the first pixel ratio is within the preset pixel ratio range. In this embodiment, the preset pixel ratio range can be set to [2% to 5%] (i.e. Fig.14(signal area - fitting area) ∈ [2% ~ 5%]); if it is, it can be explained that the circle formed by the initial screen radius at this time can be the minimum inscribed circle, and then the initial screen radius is used as the above target screen radius (i.e. Figure 5 Find the minimum radius in Fig.14 Output the minimum inscribed circle radius R); if it is not, it can be explained that the circle formed by the initial screen radius at this time is not the minimum inscribed circle, and then the initial screen radius can be adjusted, specifically according to the preset adjustment step size. In this embodiment, the preset adjustment step size can be set to 5, that is, when it is detected that the first pixel ratio is lower than 2%, the initial screen radius is reduced by 5 and then the first pixel ratio is obtained for judgment; when the first pixel ratio is higher than 5%, the initial screen radius is increased by 5 and then the first pixel ratio is obtained for judgment (that is, Fig.14 Middle radius R'±5) until [2%~5%] is met.

[0146] It should also be emphasized that after determining the target screen radius, in order to ensure that the zoom magnification condition can be met, the camera host in this embodiment may also first determine the center distance between the center of the screen and the center position of the imaging screen, and determine whether the center distance and the target screen radius both meet the preset zoom condition. The preset zoom condition can be set according to the actual situation. If the imaging screen is 4K resolution and the center position coordinates are (1080, 1920), the preset zoom condition can be set to a center distance less than 300 and a target screen radius greater than 1035 in this embodiment; if the center distance is less than 300 and the target screen radius is greater than 1035, it can be determined that both are met, and then the subsequent step of fitting the center of the screen and the target screen radius is performed; if at least one item is not met, the subsequent steps are not performed, and a prompt "zoom condition not met" (i.e. Figure 5 whether the zoom condition is met).

[0147] Reference Fig.15 , Fig.15 1 is a flow chart of a third embodiment of the imaging picture adaptive magnification method of the present invention. Based on the above embodiments, a third embodiment of the imaging picture adaptive magnification method of the present invention is proposed.

[0148] In order to achieve amplification, Fig.15 As shown, in this embodiment, the step of magnifying the imaging picture according to the target magnification includes:

[0149] Step S31: determining the initial picture size of the imaging picture, and enlarging the initial picture size according to the target magnification to obtain the target picture size;

[0150] Step S32: determining a target pixel in the magnified imaging picture based on the target picture size, and determining a source pixel of the target pixel in the imaging picture based on the target magnification.

[0151] It should be noted that the above-mentioned initial screen size may be the size corresponding to the imaging screen. If the size of the imaging screen is recorded as W×H in this embodiment, where W is the width of the imaging screen, H is the height of the imaging screen, and the target magnification is recorded as L, then the target screen size obtained by magnifying the initial screen size is L×W×H.

[0152] It is understandable that the target pixel is a pixel in the image after the enlargement, and the source pixel can be a pixel at the position corresponding to the target pixel when the image is not enlarged. For the convenience of subsequent description, in this embodiment, the coordinates of the target pixel can be marked as (x', y'), and the coordinates of the corresponding source pixel can be marked as (x, y).

[0153] In actual use, the above-mentioned camera host can first determine the initial screen size W×H of the imaging screen, and obtain the target screen size L×W×H based on the target magnification factor L; after obtaining the target screen size, each target pixel (x', y') in the enlarged imaging screen can be determined based on the target screen size, and the source pixel (x, y) corresponding to each target pixel (x', y') in the unamplified imaging screen can be determined.

[0154] Step S33: Enlarging the imaging picture according to the pixel coordinates of the source pixel.

[0155] After obtaining the source pixel (x, y) corresponding to each target pixel (x', y') in the unmagnified imaging picture, the camera host can magnify the imaging picture according to the pixel coordinates (x, y) of each source pixel.

[0156] In this embodiment, in order to achieve amplification, the above step S33 includes:

[0157] Step S331: Selecting corresponding neighboring pixels from the imaging picture based on the pixel coordinates of the source pixel.

[0158] It should be understood that the above-mentioned neighboring pixels may be pixels within a preset range of source pixels, and the specific preset range may be set according to actual conditions. In this embodiment, the corresponding neighboring pixels may be determined according to the pixel positions of each source pixel, and each source pixel may correspond to four neighboring pixels, and of course, other numbers may be used. In this embodiment, four are used for illustration, and the pixel positions of the four neighboring pixels of the source pixel (x, y) are respectively recorded as the first neighboring pixel (x1, y1), the second neighboring pixel (x2, y1), the third neighboring pixel (x1, y2) and the fourth neighboring pixel (x2, y2); wherein x1=|x|, y1=|y|, x2=x1+1, y2=y1+1.

[0159] Step S332: determining the pixel weight of the neighboring pixel according to the pixel coordinates of the neighboring pixel;

[0160] Step S333: Enlarging the imaging picture based on the pixel weight and the pixel coordinates of the neighboring pixels.

[0161] It should also be understood that the above pixel weights may be the weights of each neighboring pixel. In actual use, when the above camera host obtains the pixel positions (x1, y1), (x2, y1), (x1, y2) and (x2, y2) of the four neighboring pixels of the pixel position (x, y) of the source pixel, the weights corresponding to each neighboring pixel can be calculated based on the pixel position (x, y) of the source pixel and the pixel positions (x1, y1), (x2, y1), (x1, y2) and (x2, y2) of the four neighboring pixels, wherein the pixel weight of the first neighboring pixel is recorded as w1, the pixel weight of the second neighboring pixel is recorded as w2, the pixel weight of the third neighboring pixel is recorded as w3, and the pixel weight of the fourth neighboring pixel is recorded as w4, then w1 = (x2-x)(y2-y), w2 = (x-x1)(y2-y), w3 = (x2-x)(y-y1), w4 = (x-x1)(y-y1).

[0162] After obtaining the pixel weights corresponding to each neighboring pixel, the image can be enlarged based on the pixel weights and the pixel coordinates of each neighboring pixel, and the target pixel (x', y') = w1(x1, y1) + w2(x2, y1) + w3(x1, y2) + w4(x2, y2). Then, by enlarging each source pixel in the above manner, the corresponding target pixel can be obtained. After obtaining all the target pixels, the enlarged image can be obtained.

[0163] In addition, an embodiment of the present invention further provides a storage medium, on which an imaging picture adaptive magnification program is stored. When the imaging picture adaptive magnification program is executed by a processor, the steps of the imaging picture adaptive magnification method described above are implemented.

[0164] In addition, refer to Fig.16 , Fig.16 FIG. 1 is a structural block diagram of a first embodiment of an imaging picture adaptive magnification device according to the present invention; Fig.16 As shown, the embodiment of the present invention further provides an imaging picture adaptive magnification device, the device comprising:

[0165] The picture acquisition module 131 is used to determine the picture fitting circle of the effective picture in the imaging picture when the imaging picture is acquired, and the imaging picture is the picture taken by the camera connected to the optical mirror;

[0166] A magnification determination module 132 is used to obtain the key point coordinates of the imaging picture at each preset magnification, and select a target magnification from each preset magnification based on the picture fitting circle and the key point coordinates;

[0167] The image magnification module 133 is used to magnify the imaging image according to the target magnification factor and display the magnified imaging image.

[0168] When receiving an image, the camera host of the embodiment can first determine the image fitting circle of the effective image, obtain the key point coordinates of the image at each preset magnification, and select the target magnification from each preset magnification based on the key point coordinates and the image fitting circle to magnify the image, thereby achieving adaptive magnification. Compared with the existing method that requires manual adjustment to achieve magnification, the embodiment can achieve adaptive magnification, thereby simplifying the operation and improving the user experience.

[0169] As an implementation mode, the picture acquisition module 131 is also used to determine the pixel brightness value of each picture pixel in the imaging picture when the imaging picture is acquired; obtain the total number of pixels of the imaging picture, and determine the second number of pixels whose pixel brightness value of the picture pixels is lower than a second preset brightness threshold; determine the second pixel ratio according to the second pixel number and the total number of pixels, and when the second pixel ratio is higher than the preset ratio threshold, determine the picture fitting circle of the effective picture in the imaging picture.

[0170] As an implementation mode, the magnification determination module 132 is also used to determine, in order from small to large, from each preset magnification, whether the coordinates of the key points of the imaging picture at each preset magnification are located within the picture fitting circle; when the first judgment is yes, the preset magnification is used as the target magnification.

[0171] Based on the above-mentioned first embodiment of the imaging picture adaptive magnification device of the present invention, a second embodiment of the imaging picture adaptive magnification device of the present invention is proposed.

[0172] In this embodiment, the picture acquisition module 131 is also used to determine the picture boundary points of the effective picture in the imaging picture based on the pixel brightness value of each picture pixel in the imaging picture; obtain the reference coordinate line, and determine the reference coordinate point according to the reference coordinate line and the pixel brightness value of each picture pixel; determine the picture center of the effective picture based on the reference coordinate point and the picture boundary point; determine the target picture radius according to the picture center and the picture boundary point, and fit the picture center and the target picture radius to obtain the picture fitting circle of the effective picture.

[0173] As an implementation mode, the picture acquisition module 131 is also used to determine the initial picture radius based on the picture center and the picture boundary point, and fit the picture center and the initial picture radius to obtain an initial fitting circle; determine the pixel brightness value of each out-of-circle pixel in the out-of-circle picture according to the imaging picture and the initial fitting circle; obtain the total number of pixels of the imaging picture, and determine the first number of pixels whose pixel brightness values ​​of the out-of-circle pixels are higher than a first preset brightness threshold; determine a first pixel ratio according to the first pixel number and the total number of pixels, and adjust the initial picture radius according to the first pixel ratio to obtain a target picture radius.

[0174] Based on the above-mentioned embodiments of the imaging picture adaptive magnification device of the present invention, a third embodiment of the imaging picture adaptive magnification device of the present invention is proposed.

[0175] In this embodiment, the picture magnification module 133 is also used to determine the initial picture size of the imaging picture, and magnify the initial picture size according to the target magnification factor to obtain the target picture size; determine the target pixel in the enlarged imaging picture based on the target picture size, and determine the source pixel of the target pixel in the imaging picture based on the target magnification factor; and magnify the imaging picture according to the pixel coordinates of the source pixel.

[0176] As an embodiment, the image magnification module 133 is also used to select corresponding neighboring pixels from the imaging image based on the pixel coordinates of the source pixel; determine the pixel weights of the neighboring pixels according to the pixel coordinates of the neighboring pixels; and magnify the imaging image based on the pixel weights and the pixel coordinates of the neighboring pixels.

[0177] Other embodiments or specific implementations of the imaging picture adaptive magnification device of the present invention can refer to the above-mentioned method embodiments, which will not be described in detail here.

[0178] In addition, to achieve the above purpose, an embodiment of the present invention further provides a storage medium, on which an imaging picture adaptive magnification program is stored, and when the imaging picture adaptive magnification program is executed by a processor, the steps of the imaging picture adaptive magnification method described above are implemented.

[0179] In addition, to achieve the above-mentioned purpose, an embodiment of the present invention also provides an endoscope device, which includes: an optical viewfinder, a camera, a monitor and a camera host as described above, wherein the optical viewfinder is connected to the camera, the camera is connected to the camera host, and the camera host is connected to the monitor.

[0180] It should be noted that the optical viewing mirror can be plugged into the above-mentioned camera, and the above-mentioned camera host is electrically connected to the camera and the monitor respectively.

[0181] In actual use, medical staff can place the camera at a suitable position and take pictures of the patient's lesion area, transmit the captured images to the camera host for processing, and then display them on the monitor for medical staff to observe.

[0182] Other embodiments or specific implementations of the endoscope device of the present invention can refer to the above-mentioned method embodiments and will not be described in detail here.

[0183] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0184] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0185] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0186] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for adaptively magnifying an image, characterized in that: The method comprises: When an imaging picture is acquired, a picture fitting circle of a valid picture in the imaging picture is determined, wherein the imaging picture is a picture taken by a camera connected to an optical viewfinder; Acquire the key point coordinates of the imaging picture at each preset magnification, and select and obtain the target magnification from each preset magnification based on the picture fitting circle and the key point coordinates; The imaging picture is enlarged according to the target magnification, and the enlarged imaging picture is displayed.

2. The method according to claim 1, characterized in that The step of selecting and obtaining a target magnification from the preset magnifications based on the picture fitting circle and the coordinates of each key point includes: From each preset magnification factor, in order from small to large, it is determined whether the coordinates of the key points of the imaging picture at each preset magnification factor are located within the picture fitting circle; When the first determination is yes, the preset magnification factor is used as the target magnification factor.

3. The method according to claim 1, characterized in that The step of determining a picture fitting circle of a valid picture in the imaging picture comprises: Determining a picture boundary point of a valid picture in the imaging picture based on a pixel brightness value of each picture pixel in the imaging picture; Acquire a reference coordinate line, and determine a reference coordinate point according to the reference coordinate line and the pixel brightness value of each pixel of the picture; Determine the center of the effective picture based on the reference coordinate point and the picture boundary point; The target picture radius is determined according to the picture circle center and the picture boundary point, and the picture circle center and the target picture radius are fitted to obtain a picture fitting circle of the effective picture.

4. The method according to claim 3, characterized in that The step of determining the radius of the target picture according to the picture center and the picture boundary point comprises: Determine an initial screen radius based on the screen center and the screen boundary point, and fit the screen center and the initial screen radius to obtain an initial fitting circle; Determine the pixel brightness value of each outer-circle pixel in the outer-circle picture according to the imaging picture and the initial fitting circle; Acquire the total number of pixels of the imaging picture, and determine the first number of pixels whose pixel brightness values ​​of the pixels outside the circle are higher than a first preset brightness threshold; A first pixel ratio is determined according to the first pixel quantity and the total number of pixels, and the initial picture radius is adjusted according to the first pixel ratio to obtain a target picture radius.

5. The method according to claim 1, characterized in that The step of magnifying the imaging picture according to the target magnification comprises: Determining an initial picture size of the imaging picture, and enlarging the initial picture size according to the target magnification to obtain a target picture size; Determine a target pixel in the enlarged imaging picture based on the target picture size, and determine a source pixel of the target pixel in the imaging picture based on the target magnification; The imaging picture is enlarged according to the pixel coordinates of the source pixel.

6. The method according to claim 5, characterized in that The step of enlarging the imaging picture according to the pixel coordinates of the source pixel comprises: Selecting corresponding neighboring pixels from the imaging picture based on the pixel coordinates of the source pixel; Determine pixel weights of the neighboring pixels according to pixel coordinates of the neighboring pixels; The imaging picture is enlarged based on the pixel weight and the pixel coordinates of the neighboring pixels.

7. The method according to any one of claims 1 to 6, characterized in that The step of determining a picture fitting circle of a valid picture in the imaging picture when the imaging picture is acquired comprises: When an imaging picture is acquired, a pixel brightness value of each picture pixel in the imaging picture is determined; Acquire the total number of pixels of the imaging picture, and determine the number of second pixels whose pixel brightness values ​​of the picture pixels are lower than a second preset brightness threshold; A second pixel ratio is determined according to the second pixel quantity and the total number of pixels, and when the second pixel ratio is higher than a preset ratio threshold, a picture fitting circle of a valid picture in the imaging picture is determined.

8. An imaging picture adaptive magnification device, characterized in that: The device comprises: A picture acquisition module, used for determining a picture fitting circle of a valid picture in an image picture when an image picture is acquired, wherein the image picture is a picture taken by a camera connected to an optical viewfinder; A magnification determination module, used to obtain the key point coordinates of the imaging picture at each preset magnification, and select a target magnification from each preset magnification based on the picture fitting circle and the key point coordinates; The image magnification module is used to magnify the imaging image according to the target magnification factor and display the magnified imaging image.

9. A camera host, characterized in that: The camera host includes: a memory, a processor, and an imaging picture adaptive magnification program stored in the memory and executable on the processor. When the imaging picture adaptive magnification program is executed by the processor, the steps of the imaging picture adaptive magnification method as described in any one of claims 1 to 7 are implemented.

10. An endoscope device, characterized in that: The endoscope device comprises: an optical viewer, a camera head, a monitor and a camera host as described in claim 9, wherein the optical viewer is connected to the camera head, the camera head is connected to the camera host, and the camera host is connected to the monitor.