CN118537600A - Data acquisition and reading method based on computer vision image - Google Patents
Data acquisition and reading method based on computer vision image Download PDFInfo
- Publication number
- CN118537600A CN118537600A CN202410714760.2A CN202410714760A CN118537600A CN 118537600 A CN118537600 A CN 118537600A CN 202410714760 A CN202410714760 A CN 202410714760A CN 118537600 A CN118537600 A CN 118537600A
- Authority
- CN
- China
- Prior art keywords
- information
- image
- image information
- similarity
- shooting angle
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/761—Proximity, similarity or dissimilarity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/12—Edge-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/40—Analysis of texture
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/24—Aligning, centring, orientation detection or correction of the image
- G06V10/242—Aligning, centring, orientation detection or correction of the image by image rotation, e.g. by 90 degrees
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/72—Data preparation, e.g. statistical preprocessing of image or video features
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/61—Control of cameras or camera modules based on recognised objects
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/95—Computational photography systems, e.g. light-field imaging systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20112—Image segmentation details
- G06T2207/20132—Image cropping
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- Signal Processing (AREA)
- Artificial Intelligence (AREA)
- Databases & Information Systems (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及图像数据的采集读取技术领域,尤其涉及一种基于计算机视觉图像的数据采集读取方法。The present invention relates to the technical field of image data acquisition and reading, and in particular to a data acquisition and reading method based on computer vision images.
背景技术Background Art
基于计算机视觉图像的数据采集读取方法是指利用计算机视觉技术对图像或视频进行识别和分类,并将其作为数据源进行采集和整理。这种方法在很多领域都有着广泛的应用,如智能监控、自动驾驶、人脸识别等。传统的执行计算机视觉图像识别需要大量人工参与,费时费力。而基于计算机视觉图像的数据采集读取方法可以实现自动化,节省人力成本,提高数据采集效率,常规的基于计算机视觉图像的数据采集读取方法往往采用人工智能技术结合,基于计算机视觉图像的数据采集读取方法需要同时处理大量的图像或视频数据,支持高并发、大规模的数据采集需求,对计算设备要求负荷较大,从而导致成本高,运算结果较慢。The data acquisition and reading method based on computer vision images refers to the use of computer vision technology to identify and classify images or videos, and collect and organize them as data sources. This method has a wide range of applications in many fields, such as intelligent monitoring, autonomous driving, face recognition, etc. The traditional execution of computer vision image recognition requires a lot of manual participation, which is time-consuming and labor-intensive. The data acquisition and reading method based on computer vision images can be automated, save labor costs, and improve data acquisition efficiency. Conventional data acquisition and reading methods based on computer vision images often use artificial intelligence technology in combination. The data acquisition and reading method based on computer vision images needs to process a large amount of image or video data at the same time, support high concurrency and large-scale data acquisition needs, and require a large load on the computing equipment, resulting in high costs and slow calculation results.
发明内容Summary of the invention
本发明为解决上述技术问题,提出了一种基于计算机视觉图像的数据采集读取方法,以解决至少一个上述技术问题。In order to solve the above technical problems, the present invention proposes a data acquisition and reading method based on computer vision images to solve at least one of the above technical problems.
本申请提供一种基于计算机视觉图像的数据采集读取方法,包括以下步骤:The present application provides a method for data acquisition and reading based on computer vision images, comprising the following steps:
步骤S1:获取目标识别任务信息,并控制摄像头以初级拍摄角度进行图像采集作业,从而获取图像信息;Step S1: obtaining target recognition task information, and controlling the camera to perform image acquisition at a primary shooting angle, thereby obtaining image information;
步骤S2:通过初步图像识别模型对图像信息进行识别,从而获得初步图像识别信息;Step S2: Recognize the image information through the preliminary image recognition model to obtain preliminary image recognition information;
步骤S3:利用相似度公式对初步图像识别信息与目标识别任务信息中的目标描述信息进行比对计算,从而获得相似度系数;Step S3: using a similarity formula to compare and calculate the preliminary image recognition information with the target description information in the target recognition task information, thereby obtaining a similarity coefficient;
步骤S4:判断相似度系数是否大于或等于预设的相似度阈值信息;Step S4: Determine whether the similarity coefficient is greater than or equal to a preset similarity threshold information;
步骤S5:确定相似度系数小于预设的相似度阈值信息时,则返回步骤S1并调整次级拍摄角度;Step S5: when it is determined that the similarity coefficient is less than the preset similarity threshold information, return to step S1 and adjust the secondary shooting angle;
步骤S6:确定相似度系数大于或等于预设的相似度阈值信息时,则根据图像信息通过精准图像识别模型进行识别,从而获得精准图像识别信息。Step S6: When it is determined that the similarity coefficient is greater than or equal to the preset similarity threshold information, the image information is identified by using the accurate image recognition model to obtain accurate image recognition information.
该技术可以通过计算机视觉图像识别自动采集数据,提高数据采集的效率和准确性。同时,该方法可以根据预设的相似度阈值信息来控制摄像头拍摄角度,使得采集到的图像更具有代表性和可比性,通过使用初步图像识别模型和相似度公式,可以快速筛选出符合目标识别任务要求的图像,提高了识别的准确性和效率。This technology can automatically collect data through computer vision image recognition, improving the efficiency and accuracy of data collection. At the same time, this method can control the camera shooting angle according to the preset similarity threshold information, making the collected images more representative and comparable. By using the preliminary image recognition model and similarity formula, images that meet the requirements of the target recognition task can be quickly screened out, improving the accuracy and efficiency of recognition.
在本说明书的一个实施例中,初级图像信息包括第一图像信息以及第二图像信息,初级拍摄角度包括第一拍摄角度以及第二拍摄角度,步骤S1具体为:In one embodiment of the present specification, the primary image information includes first image information and second image information, the primary shooting angle includes a first shooting angle and a second shooting angle, and step S1 is specifically as follows:
步骤S11:获取目标识别任务信息;Step S11: Obtain target recognition task information;
步骤S12:控制第一摄像头以第一采集频率通过第一摄像角度进行拍摄作业,从而获得第一图像信息;Step S12: controlling the first camera to perform a shooting operation at a first acquisition frequency and a first camera angle, thereby obtaining first image information;
步骤S13:控制第二摄像头以第二采集频率通过第二摄像角度进行拍摄作业,从而获得第二图像信息,其中第一采集频率与第二采集频率为不同的采集频率,第一摄像角度与第二拍摄角度之间的夹角为锐角。Step S13: Control the second camera to perform a shooting operation at a second acquisition frequency through a second camera angle to obtain second image information, wherein the first acquisition frequency and the second acquisition frequency are different acquisition frequencies, and the angle between the first camera angle and the second shooting angle is an acute angle.
本实施例使用初级拍摄角度进行图像采集,可以减少采集成本和时间,并且避免复杂场景下的噪声和干扰,能够更加快速地获取目标对象的图像信息。使用初步图像识别模型对图像信息进行预处理,能够有效地筛选出目标对象,提高数据采集的效率和准确性。利用相似度公式进行相似度比对计算,能够量化表达初步图像识别信息与目标识别任务信息中的目标描述信息之间的相似程度,从而判断图像是否符合要求,避免大量无效数据的产生。同时,设定预设的相似度阈值,能够根据实际需要灵活调整识别的敏感度和精度,提高数据采集的准确性和完整性。根据相似度系数与预设的相似度阈值进行比较,确定图像是否符合要求。当相似度系数小于预设的相似度阈值时,进行次级拍摄角度的调整,从而进一步提高数据采集的准确性和完整性。当相似度系数大于或等于预设的相似度阈值时,采用精准图像识别模型进行图像识别,能够获得更加准确和精细的图像识别信息,为后续的分析和应用提供更加有价值的数据支持,本实施例的基于计算机视觉图像的数据采集读取方法具有高效、准确和灵活的特点,能够快速地从复杂场景中获取符合要求的数据,并为后续的分析和应用提供更加优质的数据资源。This embodiment uses the primary shooting angle for image acquisition, which can reduce the acquisition cost and time, avoid noise and interference in complex scenes, and can obtain the image information of the target object more quickly. Using the preliminary image recognition model to preprocess the image information can effectively screen out the target object and improve the efficiency and accuracy of data acquisition. Using the similarity formula to perform similarity comparison calculation, it is possible to quantify the similarity between the preliminary image recognition information and the target description information in the target recognition task information, so as to judge whether the image meets the requirements and avoid the generation of a large amount of invalid data. At the same time, setting a preset similarity threshold can flexibly adjust the sensitivity and accuracy of recognition according to actual needs, thereby improving the accuracy and completeness of data acquisition. According to the comparison between the similarity coefficient and the preset similarity threshold, it is determined whether the image meets the requirements. When the similarity coefficient is less than the preset similarity threshold, the secondary shooting angle is adjusted to further improve the accuracy and completeness of data acquisition. When the similarity coefficient is greater than or equal to the preset similarity threshold, the use of a precise image recognition model for image recognition can obtain more accurate and detailed image recognition information, providing more valuable data support for subsequent analysis and application. The data acquisition and reading method based on computer vision images in this embodiment is efficient, accurate and flexible, and can quickly obtain data that meets the requirements from complex scenes, and provide better quality data resources for subsequent analysis and application.
在本说明书的一个实施例中,步骤S2中初步图像识别模型的构建步骤具体为:In one embodiment of the present specification, the steps of constructing the preliminary image recognition model in step S2 are specifically as follows:
步骤S21:获取图像信息;Step S21: acquiring image information;
步骤S22:根据图像信息进行图像标注,从而获取标注图像信息;Step S22: annotating the image according to the image information, thereby obtaining annotated image information;
步骤S23:根据标注图像信息进行优化误差划分,从而获得训练图像信息以及测试图像信息;Step S23: optimizing error division according to the labeled image information, thereby obtaining training image information and test image information;
步骤S24:根据训练图像信息进行数据增强,从而获得增强图像信息;Step S24: performing data enhancement according to the training image information, thereby obtaining enhanced image information;
步骤S25:根据增强图像信息通过预设的特征提取器进行特征提取,从而获得特征信息;Step S25: extracting features through a preset feature extractor according to the enhanced image information, thereby obtaining feature information;
步骤S26:根据特征信息进行最小代价降维计算,从而获得降维特征信息;Step S26: performing minimum cost dimensionality reduction calculation according to the feature information, thereby obtaining dimensionality reduction feature information;
步骤S27:根据降维特征信息进行分类器构建,从而构建识别分类器;Step S27: constructing a classifier according to the dimension reduction feature information, thereby constructing a recognition classifier;
步骤S28:根据测试图像信息对识别分类器进行迭代识别修正,从而获得初步图像识别模型。Step S28: iteratively perform recognition correction on the recognition classifier according to the test image information, so as to obtain a preliminary image recognition model.
本实施例的初步图像识别模型构建步骤可以提高图像识别的准确性和稳定性,通过数据增强、特征提取以及最小代价降维计算等技术手段,能够有效地从原始图像信息中提取出更加鲁棒和有用的特征信息,进而构建出更加有效的图像识别分类器。所描述的图像识别模型构建步骤,通过数据增强、特征提取和最小代价降维计算的操作,可以有效提高初步图像识别模型的精度和鲁棒性。此外,迭代识别修正也有助于进一步提升模型的准确性和可靠性。The preliminary image recognition model construction step of this embodiment can improve the accuracy and stability of image recognition. Through technical means such as data enhancement, feature extraction, and minimum cost dimensionality reduction calculation, it can effectively extract more robust and useful feature information from the original image information, thereby building a more effective image recognition classifier. The described image recognition model construction step can effectively improve the accuracy and robustness of the preliminary image recognition model through the operations of data enhancement, feature extraction, and minimum cost dimensionality reduction calculation. In addition, iterative recognition correction also helps to further improve the accuracy and reliability of the model.
在本说明书的一个实施例中,步骤S22具体为:In one embodiment of this specification, step S22 is specifically:
步骤S221:根据图像信息进行边缘提取,从而获得边缘图像信息;Step S221: extracting edges according to the image information, thereby obtaining edge image information;
步骤S222:根据边缘图像信息进行区域划分,从而获得划分区域信息,其中划分区域信息包括区域像素量数据以及区域位置信息;Step S222: performing region division according to the edge image information, thereby obtaining divided region information, wherein the divided region information includes region pixel quantity data and region position information;
步骤S223:根据划分区域信息进行提取框生成,从而生成图像提取框;Step S223: generating an extraction frame according to the divided area information, thereby generating an image extraction frame;
步骤S224:根据图像提取框对图像信息进行图像提取,从而获得提取图像信息,其中提取图像信息包括提取图像位置信息以及提取图像区域信息;Step S224: extracting the image information according to the image extraction frame to obtain extracted image information, wherein the extracted image information includes extracting image position information and extracting image area information;
步骤S225:根据提取图像信息进行特征提取,从而获得图像特征信息,其中图像特征信息包括色彩图像特征、纹理图像特征以及形状图像特征;Step S225: performing feature extraction according to the extracted image information, thereby obtaining image feature information, wherein the image feature information includes color image features, texture image features, and shape image features;
步骤S226:根据图像特征信息以及提取图像区域信息进行语义提取,从而获得图像描述信息,其中图像描述信息包括图像描述坐标信息、图像色彩描述信息、图像纹理描述信息以及图像形状描述信息;Step S226: performing semantic extraction according to the image feature information and the extracted image region information, thereby obtaining image description information, wherein the image description information includes image description coordinate information, image color description information, image texture description information and image shape description information;
步骤S227:根据图像描述信息对图像信息进行图像标注,从而获得标注图像信息。Step S227: annotate the image information according to the image description information, thereby obtaining annotated image information.
本实施例所描述的图像标注方法,通过边缘提取、区域划分、提取框生成等操作,可以自动化地对图像进行精细化的划分和标注,能够更加准确地提取出图像的特征信息,并且获得更加详细、全面的图像描述信息。通过使用这种方法进行图像标注,可以大大提高图像识别模型的训练效率和模型精度,同时减少了人工标注的时间和劳动成本。The image annotation method described in this embodiment can automatically perform fine division and annotation of images through edge extraction, region division, extraction frame generation and other operations, and can more accurately extract the feature information of the image and obtain more detailed and comprehensive image description information. By using this method for image annotation, the training efficiency and model accuracy of the image recognition model can be greatly improved, while reducing the time and labor cost of manual annotation.
在本说明书的一个实施例中,步骤S225具体为:In one embodiment of this specification, step S225 is specifically as follows:
步骤S2251:根据提取图像信息进行像素点统计计算,从而获得色彩图像特征,其中色彩图像特征包括像素平均色彩信息、像素最大色彩信息以及像素颜色直方图信息,像素平均色彩信息包括像素平均红色信息、像素平均绿色信息以及像素平均蓝色信息;Step S2251: performing pixel point statistics calculation according to the extracted image information to obtain color image features, wherein the color image features include pixel average color information, pixel maximum color information, and pixel color histogram information, and the pixel average color information includes pixel average red information, pixel average green information, and pixel average blue information;
步骤S2252:根据提取图像信息进行纹理特征提取,从而生成纹理图像特征;Step S2252: extracting texture features according to the extracted image information, thereby generating texture image features;
步骤S2253:根据提取图像信息进行形状图像特征提取,从而获得形状图像特征。Step S2253: extract shape image features based on the extracted image information to obtain shape image features.
本实施例中色彩图像特征提取能够准确描述图像中的颜色信息,包括平均色彩信息、最大色彩信息以及颜色直方图信息等,这些信息对于识别和分类彩色图像非常重要;纹理特征提取能够捕捉到图像中的细节和纹理信息,获得与图像纹理相关的特征信息,提高了图像识别模型的鲁棒性;形状特征提取能够描绘图像的几何形状和轮廓,可以为模型提供更加精细化的特征信息。In this embodiment, color image feature extraction can accurately describe the color information in the image, including average color information, maximum color information, and color histogram information, which is very important for identifying and classifying color images; texture feature extraction can capture the details and texture information in the image, obtain feature information related to the image texture, and improve the robustness of the image recognition model; shape feature extraction can depict the geometric shape and contour of the image, and can provide more refined feature information for the model.
在本说明书的一个实施例中,标注图像信息包括标注信息,标注信息包括颜色标注信息、纹理标注信息以及图像形状标注信息,训练图像信息包括训练颜色图像信息、训练纹理图像信息以及训练形状图像信息,测试图像信息包括测试颜色图像信息、测试纹理图像信息以及测试形状图像信息;步骤S23具体为:In one embodiment of the present specification, the annotated image information includes annotation information, the annotation information includes color annotation information, texture annotation information, and image shape annotation information, the training image information includes training color image information, training texture image information, and training shape image information, and the test image information includes test color image information, test texture image information, and test shape image information; step S23 is specifically:
步骤S231:根据颜色标注信息对标注图像信息通过预设的划分比例进行随机划分,从而获得训练颜色图像信息以及测试颜色图像信息;Step S231: randomly dividing the annotated image information according to the color annotation information at a preset division ratio, thereby obtaining training color image information and test color image information;
步骤S232:根据纹理标注信息对标注图像信息通过预设的划分比例进行随机划分,从而获得训练纹理图像信息以及测试纹理图像信息;Step S232: randomly dividing the annotated image information according to the texture annotation information at a preset division ratio, thereby obtaining training texture image information and test texture image information;
步骤S233:根据形状标注信息对标注图像信息通过预设的划分比例进行随机划分,从而获得训练形状图像信息以及测试形状图像信息。Step S233: randomly dividing the annotated image information according to the shape annotation information at a preset division ratio, thereby obtaining training shape image information and test shape image information.
本实施例针对不同的特征信息进行随机划分,可以提高模型在各个方面的泛化能力和鲁棒性,使得模型更加稳定可靠,通过随机划分,可以构建更加完整、多样化的图像数据集,提高了模型的训练效率和精度,有助于克服过拟合和欠拟合等问题,对于给定的图像数据集,使用不同的特征信息进行划分,可以生成多个独立的测试集,从而可以更加客观地评估模型的性能,提高了模型的可比性和可靠性。This embodiment performs random division according to different feature information, which can improve the generalization ability and robustness of the model in various aspects, making the model more stable and reliable. Through random division, a more complete and diversified image data set can be constructed, which improves the training efficiency and accuracy of the model, and helps to overcome problems such as overfitting and underfitting. For a given image data set, different feature information is used for division to generate multiple independent test sets, so that the performance of the model can be evaluated more objectively, and the comparability and reliability of the model are improved.
在本说明书的一个实施例中,步骤S24具体为:In one embodiment of this specification, step S24 is specifically:
步骤S241:根据训练图像信息通过预设的阈值角度进行随机旋转,从而获得旋转图像信息;Step S241: performing random rotation according to the training image information by a preset threshold angle, thereby obtaining rotated image information;
步骤S242:对翻转图像信息进行随机缩放处理,从而获得缩放图像信息;Step S242: performing random scaling processing on the flipped image information to obtain scaled image information;
步骤S243:对缩放图像信息进行随机平移处理,生成平移图像信息;Step S243: performing random translation processing on the zoomed image information to generate translated image information;
步骤S244:对平移图像信息进行随机翻转处理,从而获得翻转图像信息;Step S244: performing random flipping processing on the translated image information to obtain flipped image information;
步骤S245:根据翻转图像信息中的标注信息对翻转图像信息进行剪裁,获得剪裁图像信息;Step S245: cropping the flipped image information according to the annotation information in the flipped image information to obtain cropped image information;
步骤S246:对剪裁图像信息进行随机变形处理,从而获得增强图像信息。Step S246: performing random deformation processing on the cropped image information to obtain enhanced image information.
本实施例通过随机旋转图像,可以使模型更好地学习到不同角度下的物体表现,避免出现只对固定角度下物体进行识别的情况,提高模型的旋转不变性;通过随机缩放处理,可以模拟远近距离下物体的表现,增加模型对尺度变化的适应性;通过随机平移处理,可以模拟物体在图像中的位置变换,增加模型对位置变化的适应性;通过随机翻转处理,可以增加模型对左右翻转的镜像变换的鲁棒性;通过剪裁处理,可以去除图像背景噪声,保留关键目标信息,并可以提高模型对目标形变的适应性;通过随机变形处理,可以增加模型对目标形变的适应性,并且可以进一步丰富训练数据的多样性。By randomly rotating the image, this embodiment can enable the model to better learn the performance of objects at different angles, avoid the situation where only objects at fixed angles are recognized, and improve the rotation invariance of the model; through random scaling processing, the performance of objects at long and short distances can be simulated, and the adaptability of the model to scale changes can be increased; through random translation processing, the position change of objects in the image can be simulated, and the adaptability of the model to position changes can be increased; through random flipping processing, the robustness of the model to left-right flipping mirror transformation can be increased; through cropping processing, image background noise can be removed, key target information can be retained, and the adaptability of the model to target deformation can be improved; through random deformation processing, the adaptability of the model to target deformation can be increased, and the diversity of training data can be further enriched.
在本说明书的一个实施例中,步骤S26具体为:In one embodiment of this specification, step S26 is specifically:
对特征信息进行均方根计算,从而获得特征均方根信息;Performing root mean square calculation on the characteristic information to obtain characteristic root mean square information;
根据特征均方根信息对特征信息进行降维计算,从而获得降维特征信息。The feature information is subjected to dimensionality reduction calculation according to the feature root mean square information, thereby obtaining the dimensionality reduction feature information.
本实施例通过对特征信息进行均方根计算,可以将原始的高维特征信息转换为一维的特征均方根信息,这种一维信息的表示方式既能够保留原始特征信息的重要性,又可以减少特征信息的冗余和噪声,从而提高特征信息的质量和稳定性;通过对特征均方根信息进行降维计算,可以将高维特征信息压缩成低维特征信息。这样做的好处是能够减少特征信息的维度,从而减少计算复杂度,提高模型的计算效率,并且能够抑制不必要的维度噪声和过拟合。This embodiment can convert the original high-dimensional feature information into one-dimensional feature root mean square information by performing root mean square calculation on the feature information. This one-dimensional information representation method can not only retain the importance of the original feature information, but also reduce the redundancy and noise of the feature information, thereby improving the quality and stability of the feature information; by performing dimensionality reduction calculation on the feature root mean square information, the high-dimensional feature information can be compressed into low-dimensional feature information. The advantage of doing so is that it can reduce the dimension of the feature information, thereby reducing the computational complexity, improving the computational efficiency of the model, and suppressing unnecessary dimensional noise and overfitting.
在本说明书的一个实施例中,步骤S13具体为:In one embodiment of this specification, step S13 is specifically:
步骤S131:将目标识别任务信息进行描述语言转化,从而获得目标描述信息;Step S131: converting the target recognition task information into a description language to obtain target description information;
步骤S132:根据目标描述信息进行向量化,从而获得目标描述向量;Step S132: performing vectorization according to the target description information, thereby obtaining a target description vector;
步骤S133:根据初步图像识别信息进行向量化,从而获得初步图像识别向量;Step S133: performing vectorization according to the preliminary image recognition information, thereby obtaining a preliminary image recognition vector;
步骤S134:根据初步图像识别向量以及目标描述向量进行相似度计算,从而获得相似度系数。Step S134: perform similarity calculation based on the preliminary image recognition vector and the target description vector to obtain a similarity coefficient.
本实施例通过将目标识别任务信息进行描述语言转化,可以将自然语言的描述信息转换为机器识别的目标描述信息,从而更加准确地表达目标的特征和属性;通过将目标描述信息和初步图像识别信息分别进行向量化,可以将它们都表示为数学上的向量形式,方便进行后续的相似度计算;通过利用向量化后的目标描述向量和初步图像识别向量进行相似度计算,可以得到一个数值化的相似度系数,该系数反映了目标描述信息和初步图像识别信息之间的相似程度。根据该系数可以进一步确定目标的分类和识别结果。This embodiment converts the target recognition task information into a description language, so that the description information in natural language can be converted into the target description information recognized by the machine, thereby more accurately expressing the characteristics and attributes of the target; by vectorizing the target description information and the preliminary image recognition information respectively, they can be expressed in a mathematical vector form, which is convenient for subsequent similarity calculation; by using the vectorized target description vector and the preliminary image recognition vector for similarity calculation, a numerical similarity coefficient can be obtained, which reflects the similarity between the target description information and the preliminary image recognition information. According to this coefficient, the classification and recognition results of the target can be further determined.
在本说明书的一个实施例中,相似度计算通过相似度计算公式进行计算,其中相似度计算公式具体为:In one embodiment of the present specification, the similarity calculation is performed by a similarity calculation formula, wherein the similarity calculation formula is specifically:
L为相似度系数,αi为初步图像识别向量中第i个数据的调整系数,ai为初步图像识别向量中第i个数据,βi为目标描述向量中第i个数据的调整系数,bi为目标描述向量中第i个数据,q为相似度系数偏移项,g为相似度系数的缩放系数,w为相似度系数的初始项,m为误差修正项,k为相似度系数调整指数,为初步图像识别向量中数据平均值,为目标描述向量中数据平均值,r为误差调整项,∈为相似度系数的修正项。L is the similarity coefficient, α i is the adjustment coefficient of the i-th data in the preliminary image recognition vector, a i is the i-th data in the preliminary image recognition vector, β i is the adjustment coefficient of the i-th data in the target description vector, b i is the i-th data in the target description vector, q is the similarity coefficient offset term, g is the scaling factor of the similarity coefficient, w is the initial term of the similarity coefficient, m is the error correction term, k is the similarity coefficient adjustment index, is the average value of the data in the preliminary image recognition vector, is the average value of the data in the target description vector, r is the error adjustment term, and ∈ is the correction term of the similarity coefficient.
本实施例提供一种相似度计算公式,该公式充分考虑了初步图像识别向量中第i个数据的调整系数αi、初步图像识别向量中第i个数据ai、目标描述向量中第i个数据的调整系数βi、目标描述向量中第i个数据bi、相似度系数偏移项q、相似度系数的缩放系数g、相似度系数的初始项w、误差修正项m、相似度系数调整指数k、初步图像识别向量中数据平均值目标描述向量中数据平均值误差调整项r以及相互之间的作用关系,从而形成函数关系αi以及ai用于调整初步图像识别向量中第i个数据的权重和值,反映了该特征对于相似度计算的贡献程度,βi以及bi用于调整目标描述向量中第i个数据的权重和值,反映了该特征对于相似度计算的贡献程度,相似度系数偏移项q用于平移相似度曲线,增加样本之间相似度的差异性,相似度系数的缩放系数g用于控制相似度曲线的斜率和变化速度,从而更好地表达样本之间的相似关系,相似度系数的初始项w用于保证相似度计算公式的初始值为正数,避免出现负值的情况,以及分别是初步图像识别向量和目标描述向量的均值,用于控制相似度计算中的基准线,r用于校正相似度计算中可能存在的误差,提高相似度计算的鲁棒性,并通过相似度系数的修正项∈进行修正,从而更好地计算初步图像识别向量和目标描述向量之间的相似度系数,从而提高模型的识别准确率和性能表现。This embodiment provides a similarity calculation formula, which fully considers the adjustment coefficient α i of the i-th data in the preliminary image recognition vector, the i-th data a i in the preliminary image recognition vector, the adjustment coefficient β i of the i-th data in the target description vector, the i-th data b i in the target description vector, the similarity coefficient offset term q, the scaling coefficient g of the similarity coefficient, the initial term w of the similarity coefficient, the error correction term m, the similarity coefficient adjustment index k, the average value of the data in the preliminary image recognition vector The average value of the data in the target description vector The error adjustment term r and their interaction form a functional relationship α i and a i are used to adjust the weight and value of the i-th data in the preliminary image recognition vector, reflecting the contribution of the feature to the similarity calculation. β i and b i are used to adjust the weight and value of the i-th data in the target description vector, reflecting the contribution of the feature to the similarity calculation. The similarity coefficient offset term q is used to translate the similarity curve to increase the difference in similarity between samples. The scaling factor g of the similarity coefficient is used to control the slope and change speed of the similarity curve, so as to better express the similarity relationship between samples. The initial term w of the similarity coefficient is used to ensure that the initial value of the similarity calculation formula is a positive number to avoid negative values. as well as are the means of the preliminary image recognition vector and the target description vector, respectively, which are used to control the baseline in the similarity calculation. r is used to correct possible errors in the similarity calculation, improve the robustness of the similarity calculation, and make corrections through the correction term ∈ of the similarity coefficient, so as to better calculate the similarity coefficient between the preliminary image recognition vector and the target description vector, thereby improving the recognition accuracy and performance of the model.
在本说明书的一个实施例中,次级拍摄角度包括第三拍摄角度以及第四拍摄角度,步骤S15具体为:In one embodiment of the present specification, the secondary shooting angle includes a third shooting angle and a fourth shooting angle, and step S15 is specifically as follows:
确定相似度系数小于预设的相似度阈值信息时,则将第一摄像角度调整至第三摄像角度,并将第二摄像角度调整为第四摄像角度,其中第一摄像角度与第三摄像角度互余,第二摄像角度与第四摄像角度互余。When it is determined that the similarity coefficient is less than the preset similarity threshold information, the first camera angle is adjusted to the third camera angle, and the second camera angle is adjusted to the fourth camera angle, wherein the first camera angle and the third camera angle are complementary, and the second camera angle and the fourth camera angle are complementary.
本实施例,在实际场景中,由于多个摄像头的位置和角度不同,可能导致拍摄到的图像存在视角变化,从而影响识别精度。为了解决这个问题,可以在不同角度和位置拍摄多张图像,然后进行角度和位置的调整,从而提高图像识别的准确性和可靠性;如果相似度系数小于预设的相似度阈值信息,即第一次拍摄的图像与数据库中的图像不够相似,则将第一摄像头的角度调整为第三摄像头的角度,将第二摄像头的角度调整为第四摄像头的角度。这样调整后,可以得到新的拍摄图像,使得视角与数据库中的图像更加相似,从而提高了图像识别的准确性和可靠性。In this embodiment, in actual scenes, due to the different positions and angles of multiple cameras, the perspective of the captured image may change, thereby affecting the recognition accuracy. In order to solve this problem, multiple images can be captured at different angles and positions, and then the angles and positions can be adjusted to improve the accuracy and reliability of image recognition; if the similarity coefficient is less than the preset similarity threshold information, that is, the image captured for the first time is not similar enough to the image in the database, the angle of the first camera is adjusted to the angle of the third camera, and the angle of the second camera is adjusted to the angle of the fourth camera. After such adjustment, a new captured image can be obtained, so that the perspective is more similar to the image in the database, thereby improving the accuracy and reliability of image recognition.
本发明通过初级拍摄角度进行图像采集,可以减少采集成本和时间,并且避免复杂场景下的噪声和干扰;利用初步图像识别模型对图像信息进行快速预处理,能够有效地筛选出目标对象,提高数据采集的效率和准确性;引入相似度公式进行相似度比对计算,能够量化表达初步图像识别信息与目标识别任务信息中的目标描述信息之间的相似程度,从而判断图像是否符合要求,避免大量无效数据的产生;设定预设的相似度阈值,能够根据实际需要灵活调整识别的敏感度和精度;在相似度系数小于预设的相似度阈值时,进行次级拍摄角度的调整,从而进一步提高数据采集的准确性和完整性;采用精准图像识别模型进行图像识别,能够获得更加准确和精细的图像识别信息,为后续的分析和应用提供更加有价值的数据支持。The present invention collects images through a primary shooting angle, which can reduce collection costs and time, and avoid noise and interference in complex scenes; uses a preliminary image recognition model to quickly preprocess image information, which can effectively screen out target objects and improve the efficiency and accuracy of data collection; introduces a similarity formula to perform similarity comparison calculation, which can quantify the similarity between the preliminary image recognition information and the target description information in the target recognition task information, so as to judge whether the image meets the requirements and avoid the generation of a large amount of invalid data; sets a preset similarity threshold, which can flexibly adjust the sensitivity and accuracy of recognition according to actual needs; when the similarity coefficient is less than the preset similarity threshold, adjusts the secondary shooting angle, so as to further improve the accuracy and completeness of data collection; adopts a precise image recognition model to perform image recognition, which can obtain more accurate and detailed image recognition information, and provide more valuable data support for subsequent analysis and application.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
通过阅读参照以下附图所作的对非限制性实施所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting implementations made with reference to the following drawings:
图1示出了一实施例的一种基于计算机视觉图像的数据采集读取方法的步骤流程图;FIG1 shows a flowchart of a method for data acquisition and reading based on computer vision images according to an embodiment;
图2示出了一实施例的一种图像采集方法的步骤流程图;FIG2 shows a flowchart of steps of an image acquisition method according to an embodiment;
图3示出了一实施例的初步图像识别模型构建方法的步骤流程图;FIG3 is a flowchart showing a method for constructing a preliminary image recognition model according to an embodiment;
图4示出了一实施例的一种标注图像信息获取方法的步骤流程图;FIG4 shows a flowchart of a method for obtaining annotated image information according to an embodiment;
图5示出了一实施例的一种图像特征信息获取方法的步骤流程图;FIG5 is a flowchart showing a method for acquiring image feature information according to an embodiment;
图6示出了一实施例的一种图像集优化误差划分方法的步骤流程图;FIG6 shows a flowchart of a method for optimizing error partitioning of an image set according to an embodiment;
图7示出了一实施例的一种图像增强方法的步骤流程图;FIG7 shows a flowchart of steps of an image enhancement method according to an embodiment;
图8示出了一实施例的一种相似度系数获取方法的步骤流程图。FIG. 8 shows a flowchart of a method for obtaining a similarity coefficient according to an embodiment of the present invention.
具体实施方式DETAILED DESCRIPTION
下面结合附图对本发明专利的技术方法进行清楚、完整的描述,显然,所描述的实施例是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域所属的技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following is a clear and complete description of the technical method of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by technicians in this field without creative work are within the scope of protection of the present invention.
此外,附图仅为本发明的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器方法和/或微控制器方法中实现这些功能实体。In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and/or processor methods and/or microcontroller methods.
应当理解的是,虽然在这里可能使用了术语“第一”、“第二”等等来描述各个单元,但是这些单元不应当受这些术语限制。使用这些术语仅仅是为了将一个单元与另一个单元进行区分。举例来说,在不背离示例性实施例的范围的情况下,第一单元可以被称为第二单元,并且类似地第二单元可以被称为第一单元。这里所使用的术语“和/或”包括其中一个或更多所列出的相关联项目的任意和所有组合。It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and/or" used herein includes any and all combinations of one or more of the listed associated items.
请参阅图1至图8,本申请提供一种基于计算机视觉图像的数据采集读取方法,包括以下步骤:Please refer to FIG. 1 to FIG. 8 , the present application provides a data acquisition and reading method based on computer vision images, comprising the following steps:
步骤S1:获取目标识别任务信息,并控制摄像头以初级拍摄角度进行图像采集作业,从而获取图像信息;Step S1: obtaining target recognition task information, and controlling the camera to perform image acquisition at a primary shooting angle, thereby obtaining image information;
具体地,例如设置相机参数,根据目标识别任务信息中的拍摄角度和距离要求,设置相机的焦距、光圈、曝光时间的参数,控制相机拍摄,通过控制接口,向相机发送控制指令并启动拍摄功能,从而获取多张图像信息。Specifically, for example, the camera parameters are set, and according to the shooting angle and distance requirements in the target recognition task information, the camera focal length, aperture, and exposure time parameters are set, and the camera shooting is controlled. Through the control interface, control instructions are sent to the camera and the shooting function is started, thereby obtaining multiple image information.
步骤S2:通过初步图像识别模型对图像信息进行识别,从而获得初步图像识别信息;Step S2: Recognize the image information through the preliminary image recognition model to obtain preliminary image recognition information;
具体地,例如将所获得的标签区域图像输入到初步图像识别模型中,进行图像预处理和初步识别,提取出标签信息,输出初步图像识别信息,包括标签类型、位置、大小、颜色的特征,并进行文本化处理Specifically, for example, the obtained label area image is input into the preliminary image recognition model, image preprocessing and preliminary recognition are performed, label information is extracted, and preliminary image recognition information is output, including label type, position, size, color features, and text processing is performed.
步骤S3:利用相似度公式对初步图像识别信息与目标识别任务信息中的目标描述信息进行比对计算,从而获得相似度系数;Step S3: using a similarity formula to compare and calculate the preliminary image recognition information with the target description information in the target recognition task information, thereby obtaining a similarity coefficient;
具体地,例如利用相似度公式对初步图像识别信息和目标描述向量进行比对计算,获得相似度系数,cosine_similarity=dot_product(a,b)/(norm(a)*norm(b)),其中,a和b分别代表两个向量,dot_product表示它们的点积,norm表示向量的模长,对于图像识别信息和目标描述向量,可以将它们转化为数字向量,例如使用特征提取算法从图像中提取出关键特征,并将这些特征转化为数字向量。目标描述向量可以是由人工描述或者自动生成的与目标相关的特征向量,将这两个向量带入余弦相似度公式中,即可得到它们之间的相似度系数。相似度系数越高,则表示它们越相似。Specifically, for example, the similarity formula is used to compare and calculate the preliminary image recognition information and the target description vector to obtain the similarity coefficient, cosine_similarity = dot_product (a, b) / (norm (a) * norm (b)), where a and b represent two vectors, dot_product represents their dot product, and norm represents the modulus of the vector. For the image recognition information and the target description vector, they can be converted into digital vectors, for example, using a feature extraction algorithm to extract key features from the image and convert these features into digital vectors. The target description vector can be a feature vector related to the target that is manually described or automatically generated. By bringing these two vectors into the cosine similarity formula, the similarity coefficient between them can be obtained. The higher the similarity coefficient, the more similar they are.
步骤S4:判断相似度系数是否大于或等于预设的相似度阈值信息;Step S4: Determine whether the similarity coefficient is greater than or equal to a preset similarity threshold information;
步骤S5:确定相似度系数小于预设的相似度阈值信息时,则返回步骤S1并调整次级拍摄角度;Step S5: when it is determined that the similarity coefficient is less than the preset similarity threshold information, return to step S1 and adjust the secondary shooting angle;
步骤S6:确定相似度系数大于或等于预设的相似度阈值信息时,则根据图像信息通过精准图像识别模型进行识别,从而获得精准图像识别信息。Step S6: When it is determined that the similarity coefficient is greater than or equal to the preset similarity threshold information, the image information is identified by using the accurate image recognition model to obtain accurate image recognition information.
具体地,例如判断相似度系数:判断相似度系数是否大于或等于预设的相似度阈值信息;如果相似度系数小于预设的相似度阈值信息,则返回步骤S1并调整次级拍摄角度,重新采集图像;如果相似度系数大于或等于预设的相似度阈值信息,则根据图像信息通过精准图像识别模型进行识别,从而获得精准图像识别信息。Specifically, for example, the similarity coefficient is determined: whether the similarity coefficient is greater than or equal to the preset similarity threshold information; if the similarity coefficient is less than the preset similarity threshold information, return to step S1 and adjust the secondary shooting angle to recapture the image; if the similarity coefficient is greater than or equal to the preset similarity threshold information, identify the image through the accurate image recognition model according to the image information, so as to obtain accurate image recognition information.
具体地,例如在智能门锁系统中,当用户需要开锁时,摄像头会采集用户的面部图像,并将其转化为数字向量作为初步图像识别信息。然后,将该向量与系统中存储的目标描述向量(即已注册用户的面部特征向量)进行比对计算,获得相似度系数。接着,系统会根据预设的相似度阈值信息,判断相似度系数是否大于或等于这个值。如果相似度系数小于预设的相似度阈值信息,则说明该用户的面部特征与数据库中的数据不匹配,此时系统会要求用户重新进行验证,返回到步骤S1,同时可以调整次级拍摄角度来提高识别率。如果相似度系数大于或等于预设的相似度阈值信息,则说明该用户的面部特征与数据库中的数据匹配成功。此时,系统会通过精准图像识别模型进行识别,从而获得精准的人脸识别信息,并且完成门锁的解锁操作。Specifically, for example, in a smart door lock system, when a user needs to unlock the door, the camera will capture the user's facial image and convert it into a digital vector as preliminary image recognition information. Then, the vector is compared and calculated with the target description vector (i.e., the facial feature vector of the registered user) stored in the system to obtain a similarity coefficient. Next, the system will determine whether the similarity coefficient is greater than or equal to this value based on the preset similarity threshold information. If the similarity coefficient is less than the preset similarity threshold information, it means that the user's facial features do not match the data in the database. At this time, the system will ask the user to re-verify and return to step S1. At the same time, the secondary shooting angle can be adjusted to improve the recognition rate. If the similarity coefficient is greater than or equal to the preset similarity threshold information, it means that the user's facial features successfully match the data in the database. At this time, the system will identify through the precise image recognition model to obtain precise face recognition information and complete the unlocking operation of the door lock.
该技术可以通过计算机视觉图像识别自动采集数据,提高数据采集的效率和准确性。同时,该方法可以根据预设的相似度阈值信息来控制摄像头拍摄角度,使得采集到的图像更具有代表性和可比性,通过使用初步图像识别模型和相似度公式,可以快速筛选出符合目标识别任务要求的图像,提高了识别的准确性和效率。This technology can automatically collect data through computer vision image recognition, improving the efficiency and accuracy of data collection. At the same time, this method can control the camera shooting angle according to the preset similarity threshold information, making the collected images more representative and comparable. By using the preliminary image recognition model and similarity formula, images that meet the requirements of the target recognition task can be quickly screened out, improving the accuracy and efficiency of recognition.
在本说明书的一个实施例中,初级图像信息包括第一图像信息以及第二图像信息,初级拍摄角度包括第一拍摄角度以及第二拍摄角度,步骤S1具体为:In one embodiment of the present specification, the primary image information includes first image information and second image information, the primary shooting angle includes a first shooting angle and a second shooting angle, and step S1 is specifically as follows:
步骤S11:获取目标识别任务信息;Step S11: Obtain target recognition task information;
步骤S12:控制第一摄像头以第一采集频率通过第一摄像角度进行拍摄作业,从而获得第一图像信息;Step S12: controlling the first camera to perform a shooting operation at a first acquisition frequency and a first camera angle, thereby obtaining first image information;
步骤S13:控制第二摄像头以第二采集频率通过第二摄像角度进行拍摄作业,从而获得第二图像信息,其中第一采集频率与第二采集频率为不同的采集频率,第一摄像角度与第二拍摄角度之间的夹角为锐角。Step S13: Control the second camera to perform a shooting operation at a second acquisition frequency through a second camera angle to obtain second image information, wherein the first acquisition frequency and the second acquisition frequency are different acquisition frequencies, and the angle between the first camera angle and the second shooting angle is an acute angle.
具体地,例如获取目标识别任务信息:确定要追踪和识别的目标以及其特征;根据目标位置和运动轨迹,控制第一摄像头以第一采集频率通过第一摄像角度进行拍摄作业,从而获得第一图像信息,例如,可以使用无人机或便携式云台相机等设备来完成此任务;同时,控制第二摄像头以第二采集频率通过第二摄像角度进行拍摄作业,从而获得第二图像信息。第一采集频率与第二采集频率可以设置为不同的采集频率,以提高目标检测的准确性。第一摄像角度与第二拍摄角度之间的夹角为锐角,以覆盖更广的视野范围,提高目标追踪的效率和精度;Specifically, for example, to obtain target recognition task information: determine the target to be tracked and identified and its characteristics; according to the target position and motion trajectory, control the first camera to perform shooting operations at a first acquisition frequency through a first camera angle to obtain first image information. For example, a drone or a portable gimbal camera or other equipment can be used to complete this task; at the same time, control the second camera to perform shooting operations at a second acquisition frequency through a second camera angle to obtain second image information. The first acquisition frequency and the second acquisition frequency can be set to different acquisition frequencies to improve the accuracy of target detection. The angle between the first camera angle and the second shooting angle is an acute angle to cover a wider field of view and improve the efficiency and accuracy of target tracking;
本实施例使用初级拍摄角度进行图像采集,可以减少采集成本和时间,并且避免复杂场景下的噪声和干扰,能够更加快速地获取目标对象的图像信息。使用初步图像识别模型对图像信息进行预处理,能够有效地筛选出目标对象,提高数据采集的效率和准确性。利用相似度公式进行相似度比对计算,能够量化表达初步图像识别信息与目标识别任务信息中的目标描述信息之间的相似程度,从而判断图像是否符合要求,避免大量无效数据的产生。同时,设定预设的相似度阈值,能够根据实际需要灵活调整识别的敏感度和精度,提高数据采集的准确性和完整性。根据相似度系数与预设的相似度阈值进行比较,确定图像是否符合要求。当相似度系数小于预设的相似度阈值时,进行次级拍摄角度的调整,从而进一步提高数据采集的准确性和完整性。当相似度系数大于或等于预设的相似度阈值时,采用精准图像识别模型进行图像识别,能够获得更加准确和精细的图像识别信息,为后续的分析和应用提供更加有价值的数据支持,本实施例的基于计算机视觉图像的数据采集读取方法具有高效、准确和灵活的特点,能够快速地从复杂场景中获取符合要求的数据,并为后续的分析和应用提供更加优质的数据资源。This embodiment uses the primary shooting angle for image acquisition, which can reduce the acquisition cost and time, avoid noise and interference in complex scenes, and can obtain the image information of the target object more quickly. Using the preliminary image recognition model to preprocess the image information can effectively screen out the target object and improve the efficiency and accuracy of data acquisition. Using the similarity formula to perform similarity comparison calculation, it is possible to quantify the similarity between the preliminary image recognition information and the target description information in the target recognition task information, so as to judge whether the image meets the requirements and avoid the generation of a large amount of invalid data. At the same time, setting a preset similarity threshold can flexibly adjust the sensitivity and accuracy of recognition according to actual needs, thereby improving the accuracy and completeness of data acquisition. According to the comparison between the similarity coefficient and the preset similarity threshold, it is determined whether the image meets the requirements. When the similarity coefficient is less than the preset similarity threshold, the secondary shooting angle is adjusted to further improve the accuracy and completeness of data acquisition. When the similarity coefficient is greater than or equal to the preset similarity threshold, the precise image recognition model is used for image recognition to obtain more accurate and detailed image recognition information, providing more valuable data support for subsequent analysis and application. The data acquisition and reading method based on computer vision images in this embodiment is efficient, accurate and flexible, and can quickly obtain data that meets the requirements from complex scenes, and provide better quality data resources for subsequent analysis and application.
在本说明书的一个实施例中,步骤S2中初步图像识别模型的构建步骤具体为:In one embodiment of the present specification, the steps of constructing the preliminary image recognition model in step S2 are specifically as follows:
步骤S21:获取图像信息;Step S21: acquiring image information;
具体地,例如从数据库中预存储的数据进行数据读取,以存入内存等待下一步的行动。Specifically, for example, data is read from pre-stored data in a database to store it in a memory and wait for the next action.
步骤S22:根据图像信息进行图像标注,从而获取标注图像信息;Step S22: annotating the image according to the image information, thereby obtaining annotated image information;
具体地,例如目标检测:使用目标检测算法,如YOLO、Faster R-CNN等,基于图像特征信息对道路中的障碍物进行检测,例如,可以使用目标框(bounding box)将检测到的障碍物标注出来;简单或粗略的图像标注:根据检测结果,通过简单或粗略的方式对检测到的障碍物进行标注,例如,在目标框内标注“行人”、“车辆”、“建筑物”、“路障”等相对简单的标签信息;将标注后的图像保存下来,从而获得标注图像信息。Specifically, for example, target detection: using target detection algorithms, such as YOLO, Faster R-CNN, etc., to detect obstacles on the road based on image feature information. For example, a target box (bounding box) can be used to mark the detected obstacles; simple or rough image annotation: based on the detection results, the detected obstacles are marked in a simple or rough manner. For example, relatively simple label information such as "pedestrians", "vehicles", "buildings", and "roadblocks" are marked in the target box; the labeled image is saved to obtain the labeled image information.
步骤S23:根据标注图像信息进行优化误差划分,从而获得训练图像信息以及测试图像信息;Step S23: optimizing error division according to the labeled image information, thereby obtaining training image information and test image information;
具体地,例如在图像分类任务中,通过标注一些图像,并将它们分为不同的类别,这些标注数据被称为训练集,使用这些训练集数据训练一个分类器模型,以便能够自动地将新的、未知的图像归类到正确的类别中,可以使用另一组已经标注好的测试集来评估模型的性能表现,分类器模型采用聚类算法进行计算生成。Specifically, for example, in image classification tasks, some images are labeled and divided into different categories. These labeled data are called training sets. A classifier model is trained using these training set data so that new and unknown images can be automatically classified into the correct categories. Another set of labeled test sets can be used to evaluate the performance of the model. The classifier model is calculated and generated using a clustering algorithm.
步骤S24:根据训练图像信息进行数据增强,从而获得增强图像信息;Step S24: performing data enhancement according to the training image information, thereby obtaining enhanced image information;
具体地,例如通过随机裁剪,随机翻转,调整亮度和对比度对训练图像信息进行处理,增加噪声,从而获得增强图像信息。Specifically, the training image information is processed by, for example, random cropping, random flipping, adjusting brightness and contrast, and adding noise, thereby obtaining enhanced image information.
步骤S25:根据增强图像信息通过预设的特征提取器进行特征提取,从而获得特征信息;Step S25: extracting features through a preset feature extractor according to the enhanced image information, thereby obtaining feature information;
具体地,例如使用已经训练好的CNN模型来对图像进行特征提取。例如,在图像分类任务中,使用VGG、ResNet或Inception的CNN模型中的卷积层作为特征提取器。Specifically, for example, a trained CNN model is used to extract features from an image. For example, in an image classification task, a convolutional layer in a CNN model of VGG, ResNet, or Inception is used as a feature extractor.
步骤S26:根据特征信息进行最小代价降维计算,从而获得降维特征信息;Step S26: performing minimum cost dimensionality reduction calculation according to the feature information, thereby obtaining dimensionality reduction feature information;
具体地,例如确定可视化或降维的数据,并确保数据是合适的格式。使用欧几里得距离或者其他相似性度量来计算高维和低维空间之间的距离。在进行降维前需要选择一个合适的相似性度量,并将数据矩阵转换为距离矩阵。设置参数,如目标维度和困惑度(perplexity)。目标维度是降维后的空间维度,通常为2或3。困惑度是一个超参数,用于控制局部拓扑结构的复杂度。还有其他的一些参数,如学习率、迭代次数。根据以上参数运行t-SNE算法,获得低维特征表示。Specifically, for example, determine the data for visualization or dimensionality reduction and make sure the data is in a suitable format. Use Euclidean distance or other similarity metrics to calculate the distance between high-dimensional and low-dimensional spaces. Before dimensionality reduction, you need to choose a suitable similarity metric and convert the data matrix into a distance matrix. Set parameters such as target dimension and perplexity. The target dimension is the dimension of the space after dimensionality reduction, usually 2 or 3. Perplexity is a hyperparameter used to control the complexity of the local topological structure. There are also other parameters, such as learning rate and number of iterations. Run the t-SNE algorithm according to the above parameters to obtain a low-dimensional feature representation.
步骤S27:根据降维特征信息进行分类器构建,从而构建识别分类器;Step S27: constructing a classifier according to the dimension reduction feature information, thereby constructing a recognition classifier;
具体地,例如根据降维特征信息进行分类器构建,从而构建识别分类器,如支持向量机算法。Specifically, for example, a classifier is constructed based on the dimensionality reduction feature information, thereby constructing a recognition classifier, such as a support vector machine algorithm.
步骤S28:根据测试图像信息对识别分类器进行迭代识别修正,从而获得初步图像识别模型。Step S28: iteratively perform recognition correction on the recognition classifier according to the test image information, so as to obtain a preliminary image recognition model.
具体地,例如将训练集划分为若干个子集,并使用其中的一部分来验证模型的准确率。在每次迭代中,使用不同的子集作为验证集,以检查模型的泛化能力,从而获得初步图像识别模型。Specifically, for example, the training set is divided into several subsets, and a part of them is used to verify the accuracy of the model. In each iteration, a different subset is used as a validation set to check the generalization ability of the model, thereby obtaining a preliminary image recognition model.
本实施例的初步图像识别模型构建步骤可以提高图像识别的准确性和稳定性,通过数据增强、特征提取以及最小代价降维计算等技术手段,能够有效地从原始图像信息中提取出更加鲁棒和有用的特征信息,进而构建出更加有效的图像识别分类器。所描述的图像识别模型构建步骤,通过数据增强、特征提取和最小代价降维计算的操作,可以有效提高初步图像识别模型的精度和鲁棒性。此外,迭代识别修正也有助于进一步提升模型的准确性和可靠性。The preliminary image recognition model construction step of this embodiment can improve the accuracy and stability of image recognition. Through technical means such as data enhancement, feature extraction, and minimum cost dimensionality reduction calculation, it can effectively extract more robust and useful feature information from the original image information, thereby building a more effective image recognition classifier. The described image recognition model construction step can effectively improve the accuracy and robustness of the preliminary image recognition model through the operations of data enhancement, feature extraction, and minimum cost dimensionality reduction calculation. In addition, iterative recognition correction also helps to further improve the accuracy and reliability of the model.
在本说明书的一个实施例中,步骤S22具体为:In one embodiment of this specification, step S22 is specifically:
步骤S221:根据图像信息进行边缘提取,从而获得边缘图像信息;Step S221: extracting edges according to the image information, thereby obtaining edge image information;
具体地,例如使用高斯滤波器对图像进行平滑处理,并计算梯度幅值和方向来检测边缘,从而获得边缘图像信息。Specifically, for example, a Gaussian filter is used to smooth the image, and the gradient magnitude and direction are calculated to detect the edge, thereby obtaining edge image information.
步骤S222:根据边缘图像信息进行区域划分,从而获得划分区域信息,其中划分区域信息包括区域像素量数据以及区域位置信息;Step S222: performing region division according to the edge image information, thereby obtaining divided region information, wherein the divided region information includes region pixel quantity data and region position information;
具体地,例如通过迭代计算数据点周围的核密度函数,将数据点归为密度最大的区域。在图像分割中,使用均值漂移算法来找到具有相似颜色和纹理的像素,从而获得划分区域信息。Specifically, for example, by iteratively calculating the kernel density function around the data point, the data point is classified as the area with the highest density. In image segmentation, the mean shift algorithm is used to find pixels with similar colors and textures, thereby obtaining the division area information.
步骤S223:根据划分区域信息进行提取框生成,从而生成图像提取框;Step S223: generating an extraction frame according to the divided area information, thereby generating an image extraction frame;
具体地,例如根据划分区域信息对应像素所在区域生成对应的四边形边框或者围绕边缘,从而生成图像提取框。Specifically, for example, a corresponding quadrilateral frame or surrounding edge is generated according to the area where the pixel is located according to the divided area information, thereby generating an image extraction frame.
步骤S224:根据图像提取框对图像信息进行图像提取,从而获得提取图像信息,其中提取图像信息包括提取图像位置信息以及提取图像区域信息;Step S224: extracting the image information according to the image extraction frame to obtain extracted image information, wherein the extracted image information includes extracting image position information and extracting image area information;
具体地,例如根据图像提取框对图像信息进行划分为不同的区域,从而获得提取图像信息。Specifically, for example, the image information is divided into different areas according to the image extraction frame, so as to obtain the extracted image information.
步骤S225:根据提取图像信息进行特征提取,从而获得图像特征信息,其中图像特征信息包括色彩图像特征、纹理图像特征以及形状图像特征;Step S225: performing feature extraction according to the extracted image information, thereby obtaining image feature information, wherein the image feature information includes color image features, texture image features, and shape image features;
具体地,例如色彩特征是指图像中像素的颜色分布和统计特征,包括颜色直方图、颜色矩,纹理特征是指图像中像素的纹理分布和统计特征,包括灰度共生矩阵(GLCM)、局部二值模式(LBP),形状特征是指图像中物体的轮廓、边缘的形状信息,包括边缘特征、角点特征。Specifically, for example, color features refer to the color distribution and statistical characteristics of pixels in an image, including color histograms and color moments; texture features refer to the texture distribution and statistical characteristics of pixels in an image, including gray-level co-occurrence matrices (GLCMs) and local binary patterns (LBPs); shape features refer to the shape information of the contours and edges of objects in an image, including edge features and corner features.
步骤S226:根据图像特征信息以及提取图像区域信息进行语义提取,从而获得图像描述信息,其中图像描述信息包括图像描述坐标信息、图像色彩描述信息、图像纹理描述信息以及图像形状描述信息;Step S226: performing semantic extraction according to the image feature information and the extracted image region information, thereby obtaining image description information, wherein the image description information includes image description coordinate information, image color description information, image texture description information and image shape description information;
具体地,例如将图像特征信息以及提取图像区域信息进行数值语义转化,如红色,左上角,矩形物体,或者黄色花朵,呈圆形,花瓣纹理。Specifically, for example, the image feature information and the extracted image region information are converted into numerical semantics, such as red, upper left corner, rectangular object, or yellow flower, round shape, petal texture.
步骤S227:根据图像描述信息对图像信息进行图像标注,从而获得标注图像信息。Step S227: annotate the image information according to the image description information, thereby obtaining annotated image information.
具体地,例如根据生成的图像描述信息对图像信息进行图像标注,从而获得标注图像信息。Specifically, for example, the image information is annotated according to the generated image description information, thereby obtaining the annotated image information.
本实施例所描述的图像标注方法,通过边缘提取、区域划分、提取框生成等操作,可以自动化地对图像进行精细化的划分和标注,能够更加准确地提取出图像的特征信息,并且获得更加详细、全面的图像描述信息。通过使用这种方法进行图像标注,可以大大提高图像识别模型的训练效率和模型精度,同时减少了人工标注的时间和劳动成本。The image annotation method described in this embodiment can automatically perform fine division and annotation of images through edge extraction, region division, extraction frame generation and other operations, and can more accurately extract the feature information of the image and obtain more detailed and comprehensive image description information. By using this method for image annotation, the training efficiency and model accuracy of the image recognition model can be greatly improved, while reducing the time and labor cost of manual annotation.
在本说明书的一个实施例中,步骤S225具体为:In one embodiment of this specification, step S225 is specifically as follows:
步骤S2251:根据提取图像信息进行像素点统计计算,从而获得色彩图像特征,其中色彩图像特征包括像素平均色彩信息、像素最大色彩信息以及像素颜色直方图信息,像素平均色彩信息包括像素平均红色信息、像素平均绿色信息以及像素平均蓝色信息;Step S2251: performing pixel point statistics calculation according to the extracted image information to obtain color image features, wherein the color image features include pixel average color information, pixel maximum color information, and pixel color histogram information, and the pixel average color information includes pixel average red information, pixel average green information, and pixel average blue information;
具体地,例如通过对图像中所有像素的颜色值求平均值,获得图像的平均色彩信息。例如,可以计算像素平均红色信息、像素平均绿色信息以及像素平均蓝色信息,通过对图像中所有像素的颜色值取最大值,获得图像的最大色彩信息。例如,可以计算像素最大红色信息、像素最大绿色信息以及像素最大蓝色信息,通过统计图像中每种颜色的出现频率,获得图像的颜色直方图信息。例如,可以计算每种颜色在图像中出现的次数,并绘制相应的颜色直方图。Specifically, for example, the average color information of the image is obtained by averaging the color values of all pixels in the image. For example, the average red information of the pixel, the average green information of the pixel, and the average blue information of the pixel can be calculated, and the maximum color information of the image can be obtained by taking the maximum value of the color values of all pixels in the image. For example, the maximum red information of the pixel, the maximum green information of the pixel, and the maximum blue information of the pixel can be calculated, and the color histogram information of the image can be obtained by counting the frequency of occurrence of each color in the image. For example, the number of times each color appears in the image can be calculated, and the corresponding color histogram can be drawn.
步骤S2252:根据提取图像信息进行纹理特征提取,从而生成纹理图像特征;Step S2252: extracting texture features according to the extracted image information, thereby generating texture image features;
具体地,例如统计图像中相邻像素之间的灰度级别差异,生成灰度共生矩阵,并计算相应的纹理特征,如能量、对比度、协方差。Specifically, for example, the gray level differences between adjacent pixels in the image are statistically analyzed to generate a gray level co-occurrence matrix, and the corresponding texture features, such as energy, contrast, and covariance, are calculated.
步骤S2253:根据提取图像信息进行形状图像特征提取,从而获得形状图像特征。Step S2253: extract shape image features based on the extracted image information to obtain shape image features.
具体地,例如根据物体的轮廓线提取相应的形状特征,如周长、面积、凸性。Specifically, for example, corresponding shape features such as perimeter, area, and convexity are extracted based on the contour of the object.
本实施例中色彩图像特征提取能够准确描述图像中的颜色信息,包括平均色彩信息、最大色彩信息以及颜色直方图信息等,这些信息对于识别和分类彩色图像非常重要;纹理特征提取能够捕捉到图像中的细节和纹理信息,获得与图像纹理相关的特征信息,提高了图像识别模型的鲁棒性;形状特征提取能够描绘图像的几何形状和轮廓,可以为模型提供更加精细化的特征信息。In this embodiment, color image feature extraction can accurately describe the color information in the image, including average color information, maximum color information, and color histogram information, which is very important for identifying and classifying color images; texture feature extraction can capture the details and texture information in the image, obtain feature information related to the image texture, and improve the robustness of the image recognition model; shape feature extraction can depict the geometric shape and contour of the image, and can provide more refined feature information for the model.
在本说明书的一个实施例中,标注图像信息包括标注信息,标注信息包括颜色标注信息、纹理标注信息以及图像形状标注信息,训练图像信息包括训练颜色图像信息、训练纹理图像信息以及训练形状图像信息,测试图像信息包括测试颜色图像信息、测试纹理图像信息以及测试形状图像信息;步骤S23具体为:In one embodiment of the present specification, the annotated image information includes annotation information, the annotation information includes color annotation information, texture annotation information, and image shape annotation information, the training image information includes training color image information, training texture image information, and training shape image information, and the test image information includes test color image information, test texture image information, and test shape image information; step S23 is specifically:
步骤S231:根据颜色标注信息对标注图像信息通过预设的划分比例进行随机划分,从而获得训练颜色图像信息以及测试颜色图像信息;Step S231: randomly dividing the annotated image information according to the color annotation information at a preset division ratio, thereby obtaining training color image information and test color image information;
步骤S232:根据纹理标注信息对标注图像信息通过预设的划分比例进行随机划分,从而获得训练纹理图像信息以及测试纹理图像信息;Step S232: randomly dividing the annotated image information according to the texture annotation information at a preset division ratio, thereby obtaining training texture image information and test texture image information;
步骤S233:根据形状标注信息对标注图像信息通过预设的划分比例进行随机划分,从而获得训练形状图像信息以及测试形状图像信息。Step S233: randomly dividing the annotated image information according to the shape annotation information at a preset division ratio, thereby obtaining training shape image information and test shape image information.
具体地,例如将标注图像信息随机地划分为训练集和测试集。例如,可以将标注图像信息按照3:1的比例进行随机划分,其中75%的数据用于训练模型,25%的数据用于测试模型。Specifically, for example, the labeled image information is randomly divided into a training set and a test set. For example, the labeled image information can be randomly divided in a ratio of 3:1, where 75% of the data is used for training the model and 25% of the data is used for testing the model.
本实施例针对不同的特征信息进行随机划分,可以提高模型在各个方面的泛化能力和鲁棒性,使得模型更加稳定可靠,通过随机划分,可以构建更加完整、多样化的图像数据集,提高了模型的训练效率和精度,有助于克服过拟合和欠拟合等问题,对于给定的图像数据集,使用不同的特征信息进行划分,可以生成多个独立的测试集,从而可以更加客观地评估模型的性能,提高了模型的可比性和可靠性。This embodiment performs random division according to different feature information, which can improve the generalization ability and robustness of the model in various aspects, making the model more stable and reliable. Through random division, a more complete and diversified image data set can be constructed, which improves the training efficiency and accuracy of the model, and helps to overcome problems such as overfitting and underfitting. For a given image data set, different feature information is used for division to generate multiple independent test sets, so that the performance of the model can be evaluated more objectively, and the comparability and reliability of the model are improved.
在本说明书的一个实施例中,步骤S24具体为:In one embodiment of this specification, step S24 is specifically:
步骤S241:根据训练图像信息通过预设的阈值角度进行随机旋转,从而获得旋转图像信息;Step S241: performing random rotation according to the training image information by a preset threshold angle, thereby obtaining rotated image information;
具体地,例如随机旋转方法是指根据预设的阈值角度,将训练图像随机地旋转一个角度。例如,可以在-30°到30°的范围内随机旋转训练图像。Specifically, for example, the random rotation method refers to randomly rotating the training image by an angle according to a preset threshold angle. For example, the training image can be randomly rotated within a range of -30° to 30°.
步骤S242:对翻转图像信息进行随机缩放处理,从而获得缩放图像信息;Step S242: performing random scaling processing on the flipped image information to obtain scaled image information;
具体地,例如随机缩放方法是指在翻转图像中随机地选择一个比例因子进行缩放操作。例如,可以在0.8到1.2之间随机选择一个比例因子进行缩放操作,并保留缩放后大小为224x224的图像作为缩放图像。Specifically, for example, the random scaling method refers to randomly selecting a scaling factor in the flipped image for scaling operation. For example, a scaling factor can be randomly selected between 0.8 and 1.2 for scaling operation, and the image with a scaled size of 224x224 is retained as the scaled image.
步骤S243:对缩放图像信息进行随机平移处理,生成平移图像信息;Step S243: performing random translation processing on the zoomed image information to generate translated image information;
具体地,例如随机平移方法是指根据预设的平移范围,将缩放图像随机地进行平移操作。例如,可以在横向和纵向上分别随机平移1-5个像素。Specifically, for example, the random translation method refers to randomly performing a translation operation on the zoomed image according to a preset translation range, for example, the image may be randomly translated by 1-5 pixels in the horizontal direction and the vertical direction respectively.
步骤S244:对平移图像信息进行随机翻转处理,从而获得翻转图像信息;Step S244: performing random flipping processing on the translated image information to obtain flipped image information;
具体地,例如随机翻转方法是指将平移图像在水平或垂直方向上随机地进行镜像翻转操作。例如,可以以50%的概率在水平或垂直方向上进行镜像翻转。Specifically, for example, the random flip method refers to randomly performing a mirror flip operation on the translated image in the horizontal or vertical direction. For example, the mirror flip operation may be performed in the horizontal or vertical direction with a probability of 50%.
步骤S245:根据翻转图像信息中的标注信息对翻转图像信息进行剪裁,获得剪裁图像信息;Step S245: cropping the flipped image information according to the annotation information in the flipped image information to obtain cropped image information;
具体地,例如根据翻转图像信息中的标注信息中的坐标信息以及区域面积信息对翻转图像信息进行剪裁,获得剪裁图像信息。Specifically, for example, the flipped image information is clipped according to the coordinate information and the region area information in the annotation information in the flipped image information to obtain the clipped image information.
步骤S246:对剪裁图像信息进行随机变形处理,从而获得增强图像信息。Step S246: performing random deformation processing on the cropped image information to obtain enhanced image information.
具体地,例如随机扭曲方法是指对剪裁图像进行非线性变换操作。例如,可以对剪裁图像进行随机的局部仿射、透视变换,从而获得增强图像信息。Specifically, for example, the random distortion method refers to performing a nonlinear transformation operation on the cropped image. For example, a random local affine or perspective transformation may be performed on the cropped image to obtain enhanced image information.
本实施例通过随机旋转图像,可以使模型更好地学习到不同角度下的物体表现,避免出现只对固定角度下物体进行识别的情况,提高模型的旋转不变性;通过随机缩放处理,可以模拟远近距离下物体的表现,增加模型对尺度变化的适应性;通过随机平移处理,可以模拟物体在图像中的位置变换,增加模型对位置变化的适应性;通过随机翻转处理,可以增加模型对左右翻转的镜像变换的鲁棒性;通过剪裁处理,可以去除图像背景噪声,保留关键目标信息,并可以提高模型对目标形变的适应性;通过随机变形处理,可以增加模型对目标形变的适应性,并且可以进一步丰富训练数据的多样性。By randomly rotating the image, this embodiment can enable the model to better learn the performance of objects at different angles, avoid the situation where only objects at fixed angles are recognized, and improve the rotation invariance of the model; through random scaling processing, the performance of objects at long and short distances can be simulated, and the adaptability of the model to scale changes can be increased; through random translation processing, the position change of objects in the image can be simulated, and the adaptability of the model to position changes can be increased; through random flipping processing, the robustness of the model to left-right flipping mirror transformation can be increased; through cropping processing, image background noise can be removed, key target information can be retained, and the adaptability of the model to target deformation can be improved; through random deformation processing, the adaptability of the model to target deformation can be increased, and the diversity of training data can be further enriched.
在本说明书的一个实施例中,步骤S26具体为:In one embodiment of this specification, step S26 is specifically:
对特征信息进行均方根计算,从而获得特征均方根信息;Performing root mean square calculation on the characteristic information to obtain characteristic root mean square information;
具体地,例如将其每个像素的通道值平方后求平均值再开根号,得到该图像的均方根值作为其能量特征。例如,可以对图像的灰度、RGB通道等进行均方根计算,以提取其能量特征。Specifically, for example, the channel value of each pixel is squared, the average value is calculated, and then the square root is taken to obtain the root mean square value of the image as its energy feature. For example, the root mean square calculation can be performed on the grayscale, RGB channels, etc. of the image to extract its energy feature.
根据特征均方根信息对特征信息进行降维计算,从而获得降维特征信息。The feature information is subjected to dimensionality reduction calculation according to the feature root mean square information, thereby obtaining the dimensionality reduction feature information.
具体地,例如通过线性变换将原始特征投影到新的低维空间中,使得特征之间的相关性尽量小。在实现过程中,可以使用特征均方根信息作为权重。Specifically, for example, the original features are projected into a new low-dimensional space through linear transformation, so that the correlation between the features is minimized. In the implementation process, the feature root mean square information can be used as a weight.
本实施例通过对特征信息进行均方根计算,可以将原始的高维特征信息转换为一维的特征均方根信息,这种一维信息的表示方式既能够保留原始特征信息的重要性,又可以减少特征信息的冗余和噪声,从而提高特征信息的质量和稳定性;通过对特征均方根信息进行降维计算,可以将高维特征信息压缩成低维特征信息。这样做的好处是能够减少特征信息的维度,从而减少计算复杂度,提高模型的计算效率,并且能够抑制不必要的维度噪声和过拟合。This embodiment can convert the original high-dimensional feature information into one-dimensional feature root mean square information by performing root mean square calculation on the feature information. This one-dimensional information representation method can not only retain the importance of the original feature information, but also reduce the redundancy and noise of the feature information, thereby improving the quality and stability of the feature information; by performing dimensionality reduction calculation on the feature root mean square information, the high-dimensional feature information can be compressed into low-dimensional feature information. The advantage of doing so is that it can reduce the dimension of the feature information, thereby reducing the computational complexity, improving the computational efficiency of the model, and suppressing unnecessary dimensional noise and overfitting.
在本说明书的一个实施例中,步骤S13具体为:In one embodiment of this specification, step S13 is specifically:
步骤S131:将目标识别任务信息进行描述语言转化,从而获得目标描述信息;Step S131: converting the target recognition task information into a description language to obtain target description information;
具体地,例如原始目标识别任务信息为给定一张狗的图片,要求识别出其中的狗的品种,转化为类狗形状、任何颜色以及带有五官标志。Specifically, for example, the original target recognition task information is given a picture of a dog, and requires identifying the breed of the dog, converting it into a dog-like shape, any color, and with facial features.
步骤S132:根据目标描述信息进行向量化,从而获得目标描述向量;Step S132: performing vectorization according to the target description information, thereby obtaining a target description vector;
步骤S133:根据初步图像识别信息进行向量化,从而获得初步图像识别向量;Step S133: performing vectorization according to the preliminary image recognition information, thereby obtaining a preliminary image recognition vector;
具体地,例如使用特征提取算法(如SIFT、HOG、SURF等)提取文字中的局部特征,使用聚类算法(如K-means)对特征进行聚类,生成视觉单词,并将每个视觉单词出现的次数作为图像的向量表示。Specifically, for example, a feature extraction algorithm (such as SIFT, HOG, SURF, etc.) is used to extract local features in the text, a clustering algorithm (such as K-means) is used to cluster the features, visual words are generated, and the number of occurrences of each visual word is used as a vector representation of the image.
步骤S134:根据初步图像识别向量以及目标描述向量进行相似度计算,从而获得相似度系数。Step S134: perform similarity calculation based on the preliminary image recognition vector and the target description vector to obtain a similarity coefficient.
具体地,例如通过计算两个向量之间的夹角余弦值来判断它们的相似程度,使用余弦相似度计算初步图像识别向量和目标描述向量之间的相似度系数。Specifically, for example, the cosine value of the angle between two vectors is calculated to determine their similarity, and the cosine similarity is used to calculate the similarity coefficient between the preliminary image recognition vector and the target description vector.
本实施例通过将目标识别任务信息进行描述语言转化,可以将自然语言的描述信息转换为机器识别的目标描述信息,从而更加准确地表达目标的特征和属性;通过将目标描述信息和初步图像识别信息分别进行向量化,可以将它们都表示为数学上的向量形式,方便进行后续的相似度计算;通过利用向量化后的目标描述向量和初步图像识别向量进行相似度计算,可以得到一个数值化的相似度系数,该系数反映了目标描述信息和初步图像识别信息之间的相似程度。根据该系数可以进一步确定目标的分类和识别结果。This embodiment converts the target recognition task information into a description language, so that the description information in natural language can be converted into the target description information recognized by the machine, thereby more accurately expressing the characteristics and attributes of the target; by vectorizing the target description information and the preliminary image recognition information respectively, they can be expressed in a mathematical vector form, which is convenient for subsequent similarity calculation; by using the vectorized target description vector and the preliminary image recognition vector for similarity calculation, a numerical similarity coefficient can be obtained, which reflects the similarity between the target description information and the preliminary image recognition information. According to this coefficient, the classification and recognition results of the target can be further determined.
在本说明书的一个实施例中,相似度计算通过相似度计算公式进行计算,其中相似度计算公式具体为:In one embodiment of the present specification, the similarity calculation is performed by a similarity calculation formula, wherein the similarity calculation formula is specifically:
L为相似度系数,αi为初步图像识别向量中第i个数据的调整系数,ai为初步图像识别向量中第i个数据,βi为目标描述向量中第i个数据的调整系数,bi为目标描述向量中第i个数据,q为相似度系数偏移项,g为相似度系数的缩放系数,w为相似度系数的初始项,m为误差修正项,k为相似度系数调整指数,为初步图像识别向量中数据平均值,为目标描述向量中数据平均值,r为误差调整项,∈为相似度系数的修正项。L is the similarity coefficient, α i is the adjustment coefficient of the i-th data in the preliminary image recognition vector, a i is the i-th data in the preliminary image recognition vector, β i is the adjustment coefficient of the i-th data in the target description vector, b i is the i-th data in the target description vector, q is the similarity coefficient offset term, g is the scaling factor of the similarity coefficient, w is the initial term of the similarity coefficient, m is the error correction term, k is the similarity coefficient adjustment index, is the average value of the data in the preliminary image recognition vector, is the average value of the data in the target description vector, r is the error adjustment term, and ∈ is the correction term of the similarity coefficient.
本实施例提供一种相似度计算公式,该公式充分考虑了初步图像识别向量中第i个数据的调整系数αi、初步图像识别向量中第i个数据ai、目标描述向量中第i个数据的调整系数βi、目标描述向量中第i个数据bi、相似度系数偏移项q、相似度系数的缩放系数g、相似度系数的初始项w、误差修正项m、相似度系数调整指数k、初步图像识别向量中数据平均值目标描述向量中数据平均值误差调整项r以及相互之间的作用关系,从而形成函数关系αi以及ai用于调整初步图像识别向量中第i个数据的权重和值,反映了该特征对于相似度计算的贡献程度,βi以及bi用于调整目标描述向量中第i个数据的权重和值,反映了该特征对于相似度计算的贡献程度,相似度系数偏移项q用于平移相似度曲线,增加样本之间相似度的差异性,相似度系数的缩放系数g用于控制相似度曲线的斜率和变化速度,从而更好地表达样本之间的相似关系,相似度系数的初始项w用于保证相似度计算公式的初始值为正数,避免出现负值的情况,以及分别是初步图像识别向量和目标描述向量的均值,用于控制相似度计算中的基准线,r用于校正相似度计算中可能存在的误差,提高相似度计算的鲁棒性,并通过相似度系数的修正项∈进行修正,从而更好地计算初步图像识别向量和目标描述向量之间的相似度系数,从而提高模型的识别准确率和性能表现。This embodiment provides a similarity calculation formula, which fully considers the adjustment coefficient α i of the i-th data in the preliminary image recognition vector, the i-th data a i in the preliminary image recognition vector, the adjustment coefficient β i of the i-th data in the target description vector, the i-th data b i in the target description vector, the similarity coefficient offset term q, the scaling coefficient g of the similarity coefficient, the initial term w of the similarity coefficient, the error correction term m, the similarity coefficient adjustment index k, the average value of the data in the preliminary image recognition vector The average value of the data in the target description vector The error adjustment term r and their interaction form a functional relationship α i and a i are used to adjust the weight and value of the i-th data in the preliminary image recognition vector, reflecting the contribution of the feature to the similarity calculation. β i and b i are used to adjust the weight and value of the i-th data in the target description vector, reflecting the contribution of the feature to the similarity calculation. The similarity coefficient offset term q is used to translate the similarity curve to increase the difference in similarity between samples. The scaling factor g of the similarity coefficient is used to control the slope and change speed of the similarity curve, so as to better express the similarity relationship between samples. The initial term w of the similarity coefficient is used to ensure that the initial value of the similarity calculation formula is a positive number to avoid negative values. as well as are the means of the preliminary image recognition vector and the target description vector, respectively, which are used to control the baseline in the similarity calculation. r is used to correct possible errors in the similarity calculation, improve the robustness of the similarity calculation, and make corrections through the correction term ∈ of the similarity coefficient, so as to better calculate the similarity coefficient between the preliminary image recognition vector and the target description vector, thereby improving the recognition accuracy and performance of the model.
在本说明书的一个实施例中,次级拍摄角度包括第三拍摄角度以及第四拍摄角度,步骤S15具体为:In one embodiment of the present specification, the secondary shooting angle includes a third shooting angle and a fourth shooting angle, and step S15 is specifically as follows:
确定相似度系数小于预设的相似度阈值信息时,则将第一摄像角度调整至第三摄像角度,并将第二摄像角度调整为第四摄像角度,其中第一摄像角度与第三摄像角度互余,第二摄像角度与第四摄像角度互余。When it is determined that the similarity coefficient is less than the preset similarity threshold information, the first camera angle is adjusted to the third camera angle, and the second camera angle is adjusted to the fourth camera angle, wherein the first camera angle and the third camera angle are complementary, and the second camera angle and the fourth camera angle are complementary.
具体地,例如对于相似度小于阈值的相邻摄像头,可以将前面的一台摄像头的角度调整为后面的摄像头的角度,并将后面的摄像头的角度调整为前面的摄像头的角度。例如,可以将A摄像头的角度调整为C摄像头的角度,将B摄像头的角度调整为D摄像头的角度。Specifically, for example, for adjacent cameras whose similarity is less than a threshold, the angle of the front camera can be adjusted to the angle of the rear camera, and the angle of the rear camera can be adjusted to the angle of the front camera. For example, the angle of camera A can be adjusted to the angle of camera C, and the angle of camera B can be adjusted to the angle of camera D.
具体地,例如第一拍摄角度与第三拍摄角度互余,第二拍摄角度与第四拍摄角度互余。Specifically, for example, the first shooting angle and the third shooting angle are complementary to each other, and the second shooting angle and the fourth shooting angle are complementary to each other.
本实施例,在实际场景中,由于多个摄像头的位置和角度不同,可能导致拍摄到的图像存在视角变化,从而影响识别精度。为了解决这个问题,可以在不同角度和位置拍摄多张图像,然后进行角度和位置的调整,从而提高图像识别的准确性和可靠性;如果相似度系数小于预设的相似度阈值信息,即第一次拍摄的图像与数据库中的图像不够相似,则将第一摄像头的角度调整为第三摄像头的角度,将第二摄像头的角度调整为第四摄像头的角度。这样调整后,可以得到新的拍摄图像,使得视角与数据库中的图像更加相似,从而提高了图像识别的准确性和可靠性。In this embodiment, in actual scenes, due to the different positions and angles of multiple cameras, the perspective of the captured image may change, thereby affecting the recognition accuracy. In order to solve this problem, multiple images can be captured at different angles and positions, and then the angles and positions can be adjusted to improve the accuracy and reliability of image recognition; if the similarity coefficient is less than the preset similarity threshold information, that is, the image captured for the first time is not similar enough to the image in the database, the angle of the first camera is adjusted to the angle of the third camera, and the angle of the second camera is adjusted to the angle of the fourth camera. After such adjustment, a new captured image can be obtained, so that the perspective is more similar to the image in the database, thereby improving the accuracy and reliability of image recognition.
本发明通过初级拍摄角度进行图像采集,可以减少采集成本和时间,并且避免复杂场景下的噪声和干扰;利用初步图像识别模型对图像信息进行快速预处理,能够有效地筛选出目标对象,提高数据采集的效率和准确性;引入相似度公式进行相似度比对计算,能够量化表达初步图像识别信息与目标识别任务信息中的目标描述信息之间的相似程度,从而判断图像是否符合要求,避免大量无效数据的产生;设定预设的相似度阈值,能够根据实际需要灵活调整识别的敏感度和精度;在相似度系数小于预设的相似度阈值时,进行次级拍摄角度的调整,从而进一步提高数据采集的准确性和完整性;采用精准图像识别模型进行图像识别,能够获得更加准确和精细的图像识别信息,为后续的分析和应用提供更加有价值的数据支持。The present invention collects images through a primary shooting angle, which can reduce collection costs and time, and avoid noise and interference in complex scenes; uses a preliminary image recognition model to quickly preprocess image information, which can effectively screen out target objects and improve the efficiency and accuracy of data collection; introduces a similarity formula to perform similarity comparison calculation, which can quantify the similarity between the preliminary image recognition information and the target description information in the target recognition task information, so as to judge whether the image meets the requirements and avoid the generation of a large amount of invalid data; sets a preset similarity threshold, which can flexibly adjust the sensitivity and accuracy of recognition according to actual needs; when the similarity coefficient is less than the preset similarity threshold, adjusts the secondary shooting angle, so as to further improve the accuracy and completeness of data collection; adopts a precise image recognition model to perform image recognition, which can obtain more accurate and detailed image recognition information, and provide more valuable data support for subsequent analysis and application.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本发明内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
以上所述仅是本发明的具体实施方式,使本领域技术人员能够理解或实现本发明。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所发明的原理和新颖特点相一致的最宽的范围。The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410714760.2A CN118537600A (en) | 2024-06-04 | 2024-06-04 | Data acquisition and reading method based on computer vision image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410714760.2A CN118537600A (en) | 2024-06-04 | 2024-06-04 | Data acquisition and reading method based on computer vision image |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118537600A true CN118537600A (en) | 2024-08-23 |
Family
ID=92389275
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410714760.2A Withdrawn CN118537600A (en) | 2024-06-04 | 2024-06-04 | Data acquisition and reading method based on computer vision image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118537600A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119250486A (en) * | 2024-12-04 | 2025-01-03 | 上海天律信息技术有限公司 | A CPI-based data verification method, system, terminal and storage medium |
CN119478748A (en) * | 2025-01-13 | 2025-02-18 | 深圳坤元生态科技有限公司 | A computer vision-based ecological plot monitoring method and system |
-
2024
- 2024-06-04 CN CN202410714760.2A patent/CN118537600A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119250486A (en) * | 2024-12-04 | 2025-01-03 | 上海天律信息技术有限公司 | A CPI-based data verification method, system, terminal and storage medium |
CN119478748A (en) * | 2025-01-13 | 2025-02-18 | 深圳坤元生态科技有限公司 | A computer vision-based ecological plot monitoring method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Tabernik et al. | Deep learning for large-scale traffic-sign detection and recognition | |
US9008429B2 (en) | Label-embedding for text recognition | |
CN108304873B (en) | Target detection method and system based on high-resolution optical satellite remote sensing image | |
US9626594B2 (en) | Method and system to perform text-to-image queries with wildcards | |
CN105574534B (en) | Conspicuousness object detection method based on sparse subspace clustering and low-rank representation | |
Gavrila | A bayesian, exemplar-based approach to hierarchical shape matching | |
Garcia et al. | Convolutional face finder: A neural architecture for fast and robust face detection | |
CN107506703B (en) | Pedestrian re-identification method based on unsupervised local metric learning and reordering | |
CN102332092B (en) | Flame detection method based on video analysis | |
US7508961B2 (en) | Method and system for face detection in digital images | |
CN116503622A (en) | Data acquisition and reading method based on computer vision image | |
CN107330397B (en) | A Pedestrian Re-identification Method Based on Large-Interval Relative Distance Metric Learning | |
CN108090406B (en) | Face recognition method and system | |
CN107103317A (en) | Fuzzy license plate image recognition algorithm based on image co-registration and blind deconvolution | |
Zhang et al. | Road recognition from remote sensing imagery using incremental learning | |
CN118537600A (en) | Data acquisition and reading method based on computer vision image | |
CN111666434A (en) | Streetscape picture retrieval method based on depth global features | |
CN102208038A (en) | Image classification method based on visual dictionary | |
CN108932518B (en) | Shoe print image feature extraction and retrieval method based on visual bag-of-words model | |
CN104751475B (en) | A kind of characteristic point Optimum Matching method towards still image Object identifying | |
CN108664968B (en) | An Unsupervised Text Localization Method Based on Text Selection Model | |
CN109993213A (en) | An Automatic Recognition Method for Apparel Parts Diagram | |
CN118675158B (en) | A construction waste identification and recycling method, device, equipment and storage medium | |
He et al. | A Bayesian local binary pattern texture descriptor | |
CN113963295A (en) | Method, device, equipment and storage medium for recognizing landmark in video clip |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20240823 |