Method for directly calling native technology of material high-speed photographic apparatus by B / S (Browser / Server) architecture service system
The B/S architecture business system directly calls the material high-photometer native technology, uses browser process communication and WebRTC technology to perform image processing, solves the secondary operation problem of physical material photography upload, realizes intelligent deviation correction and cropping, and improves image quality and processing efficiency.
Patent Information
- Application Number
- CN202510289110.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-07-11
AI Technical Summary
现有技术在医疗和政务服务领域中,实体材料的拍照上传需要二次操作,且无法实现智能纠偏和裁剪,导致操作繁琐且图像质量不佳。
The B/S architecture business system directly calls the material high-photometer native technology, uses the browser's process communication and WebRTC technology to preview and process images, combines canvas technology and C++ algorithm to achieve bias correction and cropping, and directly saves the image to the local terminal.
It realizes intelligent deviation correction and cropping functions without secondary uploading, improves image quality, reduces operation steps, and improves image processing efficiency.
Smart Images

Figure CN120295624A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photo processing, and particularly to a method for directly invoking the native technology of a material high-speed camera by a B / S architecture business system. Background Art
[0002] In fields such as medical services and government services, there is usually a need to take pictures of physical materials, paper materials, original ID cards, etc. and upload them to the business system. Currently, there are quite a few solutions based on desktop applications. Manufacturers of various cameras and material high-speed cameras will provide relevant desktop application programs, which can save the captured materials to the local terminal and support functions such as rectification and cropping. The disadvantage of the solution based on desktop application programs is that it often only provides the function of taking pictures of materials, and the captured image data will finally be saved on the local terminal. Due to the lack of the ability to connect to the B / S architecture business system, it cannot be directly uploaded to the business system, resulting in the need for manual secondary operation to upload it to the corresponding business system; while the images taken directly using a webcam solve the problem of secondary upload, but the disadvantage is that the image cannot be rectified and cropped through the native algorithm, resulting in large useless areas in the captured materials, which brings difficulties in subsequent viewing.
[0003] Based on the above problems, there is an urgent need for a method that can realize no secondary upload when completing data shooting and can realize intelligent rectification and cropping. Summary of the Invention
[0004] In view of the relatively troublesome need for secondary upload of photos in the current photo-taking system and the lack of support for corresponding intelligent rectification and cutting functions, the present application provides a method for directly invoking the native technology of a material high-speed camera by a B / S architecture business system to solve the above problems.
[0005] To achieve the above object, the present invention is realized through the following technical solutions: The embodiment of the present application discloses a method for directly invoking the native technology of a material high-speed camera by a B / S architecture business system, which is characterized by including: S1: Compile the application interface of the material high-speed camera, and organize different types of function buttons and the video preview screen of the material high-speed camera; S2: Capture and preview the video screen of the material high-speed camera on the local terminal, and capture a frame of the video screen within a certain time and store it as a base64 image; S3: Use the process communication technology of the browser device to transfer the captured base64 video frame to the application process enabled by the nodejs development language; S4: Return the obtained rectangular coordinates to the process where the preview screen is located through the process communication technology in the original way; S5: When the user clicks the photo-taking button, perform final recognition and processing on the image; S6: After obtaining the recognized and processed material image, perform secondary editing and processing on the material, including correcting cropping and rotation again; use the technology of the Node.js development language through button operations to save the image to the local terminal.
[0006] Preferably, the application interface of the compiled material high-speed camera is implemented using HTML + JavaScript + CSS front-end development language technology.
[0007] More preferably, the capture and preview of the video screen of the material high-speed camera of the local terminal are implemented using the JavaScript development language and the WebRTC technology of the browser, and S2 can also use functions such as zooming in, zooming out, and rotating to preprocess the screen and image.
[0008] More preferably, the application process enabled by the Node.js development language performs recognition and processing on the image through the bridge between the Node.js and C++ development languages, and finally obtains the rectangular coordinates of a material screen in the video screen.
[0009] More preferably, S4 uses the canvas drawing board technology of the browser to perform algorithm processing on the returned coordinates and draw a red frame, which can realize real-time frame selection and capture of the material on the preview screen of the material high-speed camera.
[0010] More preferably, use the cropping technology of the canvas technology and the coordinates obtained by the C++ algorithm recognition to perform cropping processing, and finally obtain an image with only the material screen after rectification and cropping, which realizes the rectification and cropping function of paper materials.
[0011] More preferably, it also includes the basic process of the material high-speed camera tool, and the basic process of the material high-speed camera tool includes: S101: Click the button to open the tool, start previewing the screen and taking pictures; S102: Judge whether rectification and cropping are required. If so, automatically recognize and cut the material image; otherwise, organize the material photos; S103: Judge whether the photo needs to be edited. If so, edit the photo. If not, extract the final material photo and judge whether to select to save a PDF file or a picture file.
[0012] More preferably, it also includes the interface mode process of the material high-speed camera, and the interface mode process of the material high-speed camera includes: S111: The business system opens the material high-speed camera by calling the interface and judges whether rectification and cropping are required; S112: If yes, the material image is automatically recognized and photographed, and the material photo is corrected and cropped; if no, the material photo is photographed and sorted; S113: Determine whether the photo needs to be edited. If yes, edit the photo; if no, save the final material photo. When the number of photos required is greater than 1, take photos again. S114: Select the interface to return the base64 of the PDF file or the interface to return the base64 list of the image file.
[0013] Beneficial effects:
[0014] This application uses the browser WebRTC technology as the basis for the screen preview of the material high-speed scanner. By injecting native interfaces into the browser page, it achieves the effect of opening up the business system to call native capabilities, so that the browser-based business system can directly use the material high-speed scanner to preview the screen, correct the deviation and crop, edit the preview, and save the captured screen to the local terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 This is a flowchart of the method for the B / S architecture business system to directly call the native technology of the material high-speed scanner; Figure 2 The basic flow chart of the Gaopaiyi tool for this application material; Figure 3 This is the flow chart of the high-speed scanner interface mode for this application material.
[0017] In the figure: DETAILED DESCRIPTION
[0018] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0019] It should be understood that when used in the specification of this application and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.
[0020] Please refer to Figures 1 - 3 , such as the original photographing system. The disadvantage of the solution based on desktop applications is that it often only provides the function of photographing materials. The image data captured and saved will finally be saved on the local terminal, resulting in the need for manual secondary operations to upload it to the corresponding business system. The method for directly invoking the native technology of the material high-speed scanner in the B / S architecture business system disclosed in the embodiments of this application is characterized by including: S1: Compile the application interface of the material high-speed scanner, and organize different types of function buttons and the video preview screen of the material high-speed scanner; S2: Capture and preview the video screen of the material high-speed scanner camera on the local terminal, and capture a frame of the video screen within a certain period of time and store it as a base64 image; S3: Use the process communication technology of the browser device to transfer the captured base64 video frame to the application process enabled by the nodejs development language; S4: Return the obtained rectangular coordinates back to the process where the preview screen is located through the process communication technology; S5: When the user clicks the photographing button, perform final recognition and processing on the image; S6: After obtaining the recognized and processed material image, perform secondary editing processing on the material, including re-correcting cropping and rotation; use the technology of the nodejs development language to save the image to the local terminal through button operations. When docking and developing using the interface of the B / S architecture business system, through button operations, the base64 format data of the material image can also be directly returned to the business system interface through the process communication technology of the browser, eliminating the trouble of secondary uploading of local files.
[0021] The compilation of the application interface of the material high-speed scanner is implemented using the HTML+JavaScript+CSS front-end development language technology.
[0022] This application supports functions such as zooming in, zooming out, rotating, and dynamically switching cameras for screen preview, providing more basic capabilities for the material high-speed document scanner. The screen preview extends the item boundary recognition and selection functions. By scheduling the technology of the native image algorithm, it identifies and obtains the positions of items in the screen for real-time and dynamic selection. The rectification and cropping function uses the obtained positions of items in the screen through algorithm calculation to accurately crop the screen area of the item. The image editing function can perform secondary adjustment and editing on the captured image and finally present a more perfect state. The material image is saved as a picture or PDF; the image is directly saved to the local terminal in the form of a picture or PDF for the operator to file or reuse. The present invention provides a JavaScript native API interface for the browser container device. The business system with a B / S architecture can directly use the extended functions of this material high-speed document scanner through the interface to capture materials, and finally return the cropped and edited image data to the business system for direct use, eliminating the operation of secondary selection of local terminal file upload.
[0023] It is worth mentioning that this application breaks through the browser security technology barrier between the material high-speed document scanner and the B / S architecture business system, enabling the business system to directly call and use the native capabilities of the material high-speed document scanner through the external development interface, so that the operator can directly upload the captured material image to the corresponding business system through the capabilities of the present invention; at the same time, using the rectification and cropping capabilities provided by the present invention can reduce the operator's editing of the obtained material image, accurately and quickly obtain the core image content, and reduce the problem of excessive image blank space.
[0024] The capture and preview of the video screen of the material high-speed document scanner's camera on the local terminal are implemented using the JavaScript development language and the WebRTC technology of the browser. The S2 can also use the zoom in, zoom out, and rotate functions to preprocess the screen and image.
[0025] The application process enabled by the nodejs development language performs image recognition and processing through the bridge between nodejs and the C++ development language, and finally obtains the rectangular coordinates of a material screen in the video screen.
[0026] The S4 uses the canvas drawing board technology of the browser to perform algorithm processing on the returned coordinates and draw a red frame, enabling real-time selection and capture of materials on the preview screen of the material high-speed document scanner.
[0027] Using the cropping technology of the canvas technology and the coordinates obtained by C++ algorithm recognition for cropping processing, an image with only the material screen after rectification and cropping is finally obtained, which realizes the rectification and cropping function of paper materials.
[0028] It also includes the basic process of the material high-speed document scanner tool, and the basic process of the material high-speed document scanner tool includes: S101: Click the button to open the tool, start previewing the screen and taking pictures; S102: Determine whether rectification and cropping are required. If so, automatically identify and crop the material image; otherwise, organize the material photos; S103: Determine whether the photo needs to be edited. If so, edit the photo. If not, extract the final material photo and determine whether to save it as a PDF file or a picture file.
[0029] It is worth mentioning that when the taken photo is not appropriate, it can be retaken and processed.
[0030] It also includes the interface mode process of the material high-speed document scanner, and the interface mode process of the material high-speed document scanner includes: S111: The business system opens the material high-speed document scanner by calling the interface and determines whether rectification and cropping are required; S112: If so, automatically identify the material image and take pictures of the rectified and cropped material photos; if not, take pictures and organize the material photos; S113: Determine whether the photo needs to be edited. If so, edit the photo. If not, save the final material photo. When the number of required photos is greater than 1, take pictures again; S114: Select the base64 of the PDF file returned by the interface or the list of base64 of the image files returned by the interface.
[0031] In the above embodiments, the device components involved are all conventional device components unless otherwise specified, and the connection methods and control methods involved are all conventional connection methods and control methods unless otherwise specified.
[0032] The above has described the present invention in detail in conjunction with the embodiments. However, those skilled in the art can understand that without departing from the purpose of the present invention, various specific parameters in the above embodiments can be changed to form multiple specific embodiments, which are all within the common change range of the present invention and will not be elaborated herein one by one.
Claims
1. Method for directly invoking the native technology of a material high-speed scanner in a B / S architecture business system, characterized in that, Including: S1: Compile the application interface of the material high-speed camera, organize different types of function buttons and the video preview screen of the material high-speed camera; S2: Capture and preview the video screen of the material high-speed camera on the local terminal, and capture one frame of the video screen within a certain period of time and store it as a base64 image; S3: Use the process communication technology of the browser device to transfer the captured base64 video frame to the application process enabled by the Node.js development language; S4: Return the obtained rectangular coordinates back to the process where the preview screen is located through the process communication technology; S5: When the user clicks the photo-taking button, perform final recognition and processing on the image; S6: After obtaining the recognized and processed material image, perform secondary editing on the material, including re-correcting cropping and rotation; Save the image to the local terminal through button operations using the technology of the Node.js development language.
2. The method for directly invoking the native technology of a material high-speed document scanner in the B / S architecture business system according to claim 1, characterized in that, The compilation of the application interface of the material high-speed camera is realized by using the HTML+JavaScript+CSS front-end development language technology.
3. The method for directly invoking the native technology of a material high-speed scanner in the B / S architecture business system according to claim 1, wherein The capture and preview of the video screen of the material high-speed camera on the local terminal are realized by using the JavaScript development language and the WebRTC technology of the browser. In S2, functions such as zooming in, zooming out, and rotating can also be used to preprocess the screen and image.
4. The method for directly invoking the native technology of a material high-speed scanner in a B / S architecture business system according to claim 1, wherein The application process enabled by the Node.js development language performs recognition and processing on the image through the bridge between Node.js and the C++ development language, and finally obtains the rectangular coordinates of a material screen in the video screen.
5. The method for directly invoking the native technology of a material high-speed scanner in a B / S architecture business system according to claim 1, characterized in that, In S4, by using the canvas drawing board technology of the browser, algorithm processing is performed on the returned coordinates and a red frame is drawn, which can realize real-time frame selection and capture of materials on the preview screen of the material high-speed camera.
6. The method for directly invoking the native technology of a material high-speed scanner in a B / S architecture business system according to claim 1, wherein Use the cropping technology of the canvas technology and the coordinates obtained by the C++ algorithm recognition for cropping processing, and finally obtain an image with only the material screen after rectification and cropping, which realizes the rectification and cropping function of paper materials.
7. The method for directly invoking the native technology of a material high-speed scanner in a B / S architecture business system according to claim 1, characterized in that, It also includes the basic process of the material high-speed camera tool, and the basic process of the material high-speed camera tool includes: S101: Click the button to open the tool, start the screen preview and take pictures; S102: Judge whether rectification and cropping are required. If so, automatically recognize and cut the material image; otherwise, organize the material photos; S103: Judge whether the photo needs to be edited. If so, edit the photo. If not, extract the final material photo and judge whether to save it as a PDF file or a picture file.
8. The method for directly invoking the native technology of a material high-speed scanner in a B / S architecture business system according to claim 1, characterized in that, It also includes the interface mode process of the material high-speed camera, and the interface mode process of the material high-speed camera includes: S111: The business system opens the material high-speed camera by calling the interface and judges whether rectification and cropping are required; S112: If so, automatically recognize the material image and take pictures of the rectified and cropped material photos; if not, take pictures and organize the material photos; S113: Judge whether the photo needs to be edited. If so, edit the photo. If not, save the final material photo. When the number of required photos is greater than 1, take pictures again; S114: Select the interface to return the base64 of the PDF file or the list of base64 of the image files returned by the interface.
Citation Information
Patent Citations
Method and device for collecting electronic image via browser
CN105611102A
Computer peripheral information acquisition method and device and computer equipment
CN109947577A
Method for automatically connecting high-speed photographic apparatus and third-party accessory platform under Web framework
CN111464715A
A web-oriented high-speed document scanner image acquisition system and image acquisition method
CN114938417A
Image acquisition equipment calling method and device, electronic equipment and storage medium
CN121486672A