A color adjustment method for oblique photography three-dimensional model
Patent Information
- Application Number
- CN202211539641.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-02
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2042-12-02
Smart Images

Figure CN116129093B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a color adjustment method, and more particularly to a color adjustment method for oblique photogrammetric 3D models. Background Technology
[0002] Currently, in oblique photogrammetry, factors such as weather, time, and light intensity during flight can cause color differences in aerial photographs from different flight strips (sequences of overlapping images acquired during aerial photography along a certain direction). When the survey area (the area requiring aerial data acquisition in oblique photogrammetry) is large and needs to be divided into multiple survey zones, color differences will also occur between aerial photographs from different zones. These color differences in aerial photographs will lead to color variations in the generated 3D model, with particularly noticeable color differences between models from adjacent survey zones.
[0003] To address color difference in models, the existing solution involves homogenizing the aerial photographs with light and color before 3D model production to reduce color differences between photographs. This homogenization is then performed before 3D model production. While this method can solve color difference problems in small-scale 3D models, it cannot address color differences between survey sections in large-scale oblique photogrammetry projects and can only be performed during the data production stage.
[0004] In digital city projects, oblique photogrammetry 3D models from different production units and at different times may be collected. In this case, the color difference between data from different sources is more obvious. During project use, it is often desirable to adjust the colors of different data to be consistent. There is currently no good solution for the need to perform regional or overall color adjustment on oblique photogrammetry data products. Summary of the Invention
[0005] To address the shortcomings of the aforementioned technologies, this invention provides a color adjustment method for oblique photogrammetry 3D models.
[0006] To solve the above technical problems, the technical solution adopted by the present invention is: a color adjustment method for oblique photogrammetry 3D models, the steps of which are as follows:
[0007] S1, Analyze the raw model data of the oblique photogrammetry;
[0008] S2, extract texture information from the original model data of the oblique photogrammetry and save it as an image;
[0009] S3 calls a third-party image processing tool to color-correct the image in S2 and generate new texture information;
[0010] S4 uses new texture information to generate a color-corrected oblique photogrammetric 3D model.
[0011] Furthermore, the original model data in S1 is taken from the osgb format oblique photogrammetry 3D model, and each osgb model file in the tile folder is parsed.
[0012] Furthermore, in S2, multi-angle screenshots are taken of the oblique photogrammetric 3D model that requires color adjustment, and multi-angle screenshots are also taken of the reference target for color adjustment.
[0013] Furthermore, the method for multi-angle screenshots is as follows: a visualization program and screenshot function are developed based on the OSG 3D engine, and the oblique photogrammetry 3D model is browsed manually, with the angle selected manually for screenshots.
[0014] Furthermore, the method for multi-angle screenshots is as follows: based on the OSG 3D engine, an automatic screenshot function is developed to take screenshots of the oblique photogrammetric 3D model that requires color adjustment from multiple angles.
[0015] Furthermore, the automatic screenshot function requires initializing a 3D scene, loading the oblique photogrammetry 3D model into the 3D scene, defining a virtual camera to observe the 3D scene, rendering the virtual camera in the graphics processor, and exporting the rendered image to complete the screenshot.
[0016] Furthermore, S3 simultaneously opens and loads screenshot files obtained from multi-angle screenshots by calling a third-party image processing tool, utilizes the third-party image recording action, and adjusts the multi-angle screenshots of the oblique photogrammetric 3D model that needs color adjustment by referring to the multi-angle screenshots of the reference target for color adjustment, generates an adjustment template, and saves it as a batch processing command.
[0017] Furthermore, the batch processing command mentioned above is invoked to perform color adjustment operations on the image file obtained in S2 and save it as a new image file.
[0018] Furthermore, the resulting new image file is read into memory, parsed into a new texture, and the new texture is replaced one by one according to the original position to obtain a new OSG model, which is then saved as a new OSGB model file.
[0019] Furthermore, after traversing all tiles and all model files, the resulting oblique photogrammetry 3D model with color adjustment is obtained.
[0020] This invention discloses a color adjustment method for oblique photogrammetry 3D models. This method can efficiently perform color adjustment operations on oblique photogrammetry 3D models without modifying the file format or structure, ensuring that the geometric structure of the model remains unchanged before and after color adjustment. By manually defining batch processing actions in third-party image processing software in advance, complex color adjustment operations can be easily implemented, improving the quality of color adjustment. This method can meet the needs of post-processing color adjustment for oblique photogrammetry products. Attached Figure Description
[0021] Figure 1 This is a flowchart of the color adjustment method of the present invention. Detailed Implementation
[0022] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0023] like Figure 1 The color adjustment method shown is for oblique photogrammetry 3D models. Oblique photogrammetry technology acquires images simultaneously from five different perspectives—one vertical, four oblique, and one horizontal—to obtain rich, high-resolution textures of building rooftops and side views. It not only realistically reflects ground features and acquires object texture information with high precision, but also generates realistic 3D city models through advanced positioning, fusion, and modeling techniques. Oblique photogrammetry 3D models are based on aerial photographs acquired using oblique photogrammetry technology. Pixel matching generates color point clouds, which are then used to construct irregular triangular meshes. Textures are added to these point clouds to generate continuous triangular mesh models of ground features. Common formats for oblique photogrammetry 3D models include OBJ and OSGB, where OBJ is a tiled, first-level fine-grained model, and OSGB is a tiled, multi-level model.
[0024] The steps of the color adjustment method of the present invention are as follows:
[0025] S1, Analyze the raw model data of the oblique photogrammetry;
[0026] S2, extract texture information from the original model data of the oblique photogrammetry and save it as an image;
[0027] S3 calls a third-party image processing tool to color-correct the image in S2 and generate new texture information;
[0028] S4 uses new texture information to generate a color-corrected oblique photogrammetric 3D model.
[0029] The original model data in S1 is taken from an oblique photogrammetric 3D model in OSGB format. OSGB is the binary version of the OpenSceneGraph Scene Data (OSG) format. OSG files are a 3D model format supported by the OpenSceneGraph 3D engine. Its internal structure is tree-like, and the format is publicly available. The OSG file stores the model structure of the 3D model internally, while textures are stored through external images. OSGB files are created by compressing the OSG file and simultaneously packaging the textures into it. This reduces the data size, allowing both textures and geometry to be contained in a single file, resulting in high read efficiency and suitability for online publishing. OSGB format oblique photogrammetry 3D models are saved as tiles. The 3D model is spatially divided into tiles, with each tile partially overlapping its neighbors. Tiles are stored in folders, and each tile contains several levels of Level of Detail (LOD) data, starting with the finest level and simplifying to generate the next level of LOD. The coarsest LOD is saved as a single OSGB file. LOD generation follows a quadtree partitioning method, with the number of OSGB files approximately quadrupling with each additional level. This tile-based approach improves data loading efficiency and allows for the simplification of invisible data during display, reducing the load on the display client. Therefore, the original model data requires parsing every OSGB model file within the tile folder.
[0030] In S2, multi-angle screenshots are taken of the oblique photogrammetry 3D model requiring color adjustment, and simultaneously, multi-angle screenshots are taken of the reference target for color adjustment. There are two methods for multi-angle screenshots: one is to develop a visualization program and screenshot function based on the OSG 3D engine, where the oblique photogrammetry 3D model is browsed manually, and screenshots are taken from angles such as top view and side view. The other is to develop an automatic screenshot function based on the OSG 3D engine, taking screenshots of the oblique photogrammetry 3D model requiring color adjustment from multiple angles. Specifically, a virtual camera is defined to observe the 3D scene, and the virtual camera is rendered on the GPU. The rendered image is then exported to complete the screenshot. Images of the oblique photogrammetry 3D model are generated from multiple angles, including top view, side view, and 45-degree oblique view.
[0031] S3 simultaneously opens and loads screenshot files obtained from multi-angle captures by calling a third-party image processing tool. Utilizing the third-party image recording action, it adjusts the multi-angle screenshots of the oblique photogrammetry 3D model requiring color adjustment, referencing a reference target for color adjustment, generating an adjustment template, and saving it as a batch processing command. This batch processing command is then called to perform color adjustment operations on the image files obtained in S2, saving them as new image files. The new image file is read into memory, parsed into new textures, and then replaced with the new textures in their original positions to obtain a new OSG model, which is saved as a new OSGB model file. After traversing all tiles and all model files, the color-adjusted oblique photogrammetry 3D model is obtained.
[0032] The following example uses Photoshop to demonstrate how to automatically open the Photoshop program and load the screenshot file by calling photoshop.exe and passing the screenshot file path as a parameter.
[0033] Record actions in Photoshop, taking multi-angle screenshots of the oblique photogrammetric 3D model that requires color adjustment, and then adjust the resulting images. Generate an adjustment template and save it as a batch processing command. The steps are as follows:
[0034] 1) Create a new action in the Actions panel of Photoshop. Start by taking multiple screenshots from the reference target for color adjustment. Adjust the color of the oblique photogrammetric 3D model that needs color adjustment from multiple angles. You can use any adjustment function provided in Photoshop. After the adjustment is complete, save the action.
[0035] 2) Use Photoshop's quick batch processing function, select the action you just recorded, and check "overwrite open" and "save" commands. After completion, you will get a batch template file.
[0036] Then, the oblique photogrammetry 3D model results that need adjustment are analyzed. For each tile folder, each OSGB model file in the tile folder is traversed, and the following steps are executed by writing a computer program:
[0037] 1) Parse the OSGB model file, extract texture information and save it as an image file. The parsing process is as follows:
[0038] a. Read the osgb file in binary mode, use the osg 3D engine to deserialize the binary data, and generate an osg model in computer memory;
[0039] b. Write an OSG node accessor to traverse the OSG model. This accessor can read all geode nodes of the OSG model. When a geode node is accessed, it retrieves all geometry nodes under that node, extracts the stateset from the geometry nodes, and maps the Texture property in the stateset to Texture2D.
[0040] c. For each Texture2D, obtain its image and image name, and save it as an image to the computer's hard drive.
[0041] 3) Use batch processing commands to perform color adjustments on the image file containing the extracted texture information, and save it as a new image file. Taking Photoshop as an example, the image adjustment is implemented as follows:
[0042] a. The batch processing command is an EXE file. Execute the EXE file and pass the file path of the image file from which the texture information is extracted and saved as a parameter to the batch processing command.
[0043] b. At this point, the program will automatically open Photoshop and execute the actions recorded in the batch command, performing the same operations on the image file to adjust its color.
[0044] C. After the action is completed, the image file will be saved, the color-adjusted image file will be obtained, and Photoshop will be closed.
[0045] The image file obtained in step 2) is read into memory, parsed into a texture, and the new texture is replaced one by one according to the original position to obtain a new OSG model. This new OSG model is then saved as a new OSGB model file.
[0046] After traversing all tiles and all model files, the resulting oblique photogrammetry 3D model with color adjustments is obtained.
[0047] This method focuses on parsing the raw oblique photogrammetry data in OSGB format, extracting its texture information, saving it as an image, and using mature third-party image processing software with predefined templates to achieve batch color adjustment of the image. Based on the adjusted image, texture information is generated to obtain the adjusted data. This method simplifies the complex problem of model color adjustment to an image color adjustment problem. The entire process only requires manual creation of color adjustment templates and generation of batch processing commands by software assistance before each batch of data is processed; subsequent color adjustments are automatically completed by a computer program. This invention can efficiently perform color adjustment operations on oblique photogrammetry 3D models. Besides adjusting the color of the 3D model, it does not modify the file format or structure, ensuring that the geometric structure of the model remains unchanged before and after color adjustment. By manually defining batch processing actions in the third-party image processing software in advance, complex color adjustment operations can be easily implemented, improving the quality of color adjustment. It can meet the needs of post-processing color adjustment for oblique photogrammetry products.
[0048] The above embodiments are not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the technical solution of the present invention are also within the protection scope of the present invention.
Claims
1. A color adjustment method for oblique photogrammetry 3D models, characterized in that, The steps of the color adjustment method are as follows: S1, parse the original model data of the oblique photogrammetry; the original model data in S1 is taken from the OSGB format oblique photogrammetry 3D model, and each OSGB model file in the tile folder is parsed. S2, Extract the texture information from the original model data of the oblique photography and save it as an image; The OSGB file is read in binary mode. Using the OSG 3D engine, the binary data is deserialized to generate an OSG model in computer memory. An OSG node accessor is written to traverse the OSG model. This accessor can read all geode nodes of the OSG model. When a geode node is accessed, all geometry nodes under that node are obtained, and the stateset in the geometry node is extracted. The Texture attribute in the stateset is mapped to Texture2D. For each Texture2D, its image and image name are obtained and saved as an image to the computer hard drive. S3: A third-party image processing tool is invoked to perform color correction on the image obtained in S2, generating new texture information. S3 simultaneously opens and loads screenshot files obtained from multi-angle captures using the third-party image processing tool. The tool is used to record actions and adjust the multi-angle screenshots of the oblique photogrammetry 3D model requiring color adjustment, referencing a reference target for color adjustment. An adjustment template is generated and saved as a batch processing command. This batch processing command, an exe file, is invoked, and the file path of the image file saved in S2 is passed as a parameter. Color adjustment is performed on the image file obtained in S2, and the image is saved as a new image file. The new image file is read into memory, parsed into a new texture, and the new texture is replaced one by one according to its original position to obtain a new OSG model, which is then saved as a new OSGB model file. After traversing all tiles and all model files, the color-adjusted oblique photogrammetry 3D model is obtained. S4, using the new texture information to generate a color-corrected oblique photography 3D model.
2. The color adjustment method for oblique photogrammetry 3D models according to claim 1, characterized in that: In step S3, multiple-angle screenshots are taken of the oblique photogrammetric 3D model that requires color adjustment, and multiple-angle screenshots are also taken of the reference target for color adjustment.
3. The color adjustment method for oblique photogrammetry 3D models according to claim 2, characterized in that, The method for multi-angle screenshots is as follows: a visualization program and screenshot function are developed based on the OSG 3D engine, and the oblique photogrammetry 3D model is browsed manually, with the angle selected manually for screenshots.
4. The color adjustment method for oblique photogrammetry 3D models according to claim 2, characterized in that, The method for multi-angle screenshots is as follows: an automatic screenshot function is developed based on the OSG 3D engine to take screenshots of the oblique photogrammetric 3D model that requires color adjustment from multiple angles.
5. The color adjustment method for oblique photogrammetry 3D models according to claim 4, characterized in that, The automatic screenshot function requires initializing a 3D scene, loading the oblique photogrammetry 3D model into the 3D scene, defining a virtual camera to observe the 3D scene, rendering the virtual camera in the graphics processor, and exporting the rendered image to complete the screenshot.
Citation Information
Patent Citations
Real-time color homogenizing method for real-scene three-dimensional model
CN110969688A
Efficient toning method for large-scale three-dimensional model
CN114677465A