Method for obtaining continuous picture target site gray scale information through target detection
By dividing the image into grid units and using machine learning algorithms to train the target feature recognition ability, the problem of low efficiency in obtaining grayscale information of target sites in continuous pictures in the prior art is solved, and efficient and accurate grayscale information acquisition is achieved.
Patent Information
- Application Number
- CN202411872811.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-05-13
AI Technical Summary
The prior art is difficult to efficiently obtain grayscale information of target sites in continuous pictures, especially when processing large numbers of pictures, manual information acquisition is inefficient and low accuracy.
By dividing the image into grid cells, using machine learning algorithms to train the target feature recognition ability. After repeated training reaches high accuracy, the average grayscale within the target range is calculated to obtain the grayscale information of the target sites of the continuous image.
It achieves efficient and accurate acquisition of grayscale information of target sites in the picture, with improved efficiency, high accuracy and stability, and is suitable for processing large numbers of pictures.
Smart Images

Figure CN119991694A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for obtaining grayscale information of target sites in an image, and in particular to a method for obtaining grayscale information of target sites in continuous images through target detection. Background Art
[0002] Image processing technology is a discipline that uses computers to analyze, process and process images, aiming to improve image quality or extract useful information. It includes key technologies such as image digitization, enhancement, compression, segmentation, description and recognition. The application of image processing is very extensive, covering many fields such as medical imaging, security monitoring, remote sensing detection, computer vision and game development. For example, in the medical field, image processing technology can help doctors identify lesions more clearly; in the field of security monitoring, it can be used to enhance the clarity of surveillance videos to better identify human faces or vehicle features; in the field of material manufacturing, image processing can help control material processing quality and analysis. With the development of technology, image processing technology will show its important value in more fields.
[0003] The application of machine learning in image processing is extensive and deep. It enables computers to perform tasks such as image classification, object detection, and image segmentation through algorithms. For example, machine learning models can identify objects in images and locate them, or help identify lesions in medical imaging analysis. In addition, machine learning can also be used for image enhancement to improve image quality, such as noise reduction and resolution improvement.
[0004] Target positioning is an essential process in the field of graphics processing and instrument imaging, mainly including: based on traditional methods: such as Haar+cascade classifier, HOG+SVM, etc.; based on machine learning: R-CNN series (including Fast R-CNN and Faster R-CNN), YOLO and SSD, etc.; based on candidate regions: classification and regression are performed after generating candidate regions to improve positioning accuracy. Target positioning methods based on target detection are increasingly becoming an important basis for computer-aided vision processing, especially for the processing of continuous images and simultaneous acquisition of target site information, such as grayscale information, for further data analysis or scientific research. It is widely used in industrial processing and imaging instruments. The purpose of this patent is to propose a method for target detection to obtain grayscale information of target sites in continuous images. Summary of the invention
[0005] The purpose of the present invention is to provide a method for target detection to obtain grayscale information of target sites in continuous images in order to solve the above-mentioned problems.
[0006] The present invention provides a method for obtaining grayscale information of target sites in continuous images by target detection, comprising the following steps:
[0007] S1, select the template range according to the target features, divide the image into a×b grid units, and according to the algorithm, if the center of the detected target falls within the grid, the grid predicts the target, that is, the target is detected;
[0008] S2, input several pictures into the detection program, train the algorithm's recognition ability of the selected features, repeat several times, reach the target accuracy of more than 90%, select the target range to calculate the average grayscale, and obtain the grayscale information of the target site of the continuous picture.
[0009] In some embodiments, the method further includes binarizing the image and then selecting a feature range template.
[0010] In some implementations, the number of consecutive images input for machine training is 200-1000 times.
[0011] In some implementations, the target position size is 1-25 pixels, and the position of the target detected in the image remains consistent with an error within 1 pixel.
[0012] Compared with the prior art, the present invention has the following beneficial effects:
[0013] First, compared with purely manual acquisition of grayscale information of target positions in images, the computer algorithm used in the present invention is more efficient and can process a large number of images continuously.
[0014] Secondly, the method for obtaining the grayscale of an image of the present invention can specify the target position size as 1-25 pixels, and ensure that the position of the detected target in all images remains consistent, with an error within 1 pixel, and has high accuracy and stability.
[0015] Finally, the method of the present invention is simple in operation, fast in running speed, and has a certain potential for expansion to the detection of various different targets. Extracting the grayscale information of the target site is of great significance in instrument development and signal processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 The selected area is manually marked and a schematic diagram of the center position of the target area is obtained.
[0017] Figure 2 This is the result of image binarization.
[0018] Figure 3 Schematic diagram of the computer detection program for the target area.
[0019] Figure 4 This is a graph showing the change in detection accuracy after multiple training of the detection algorithm model.
[0020] Figure 5 A random picture is taken for display.
[0021] Figure 6 The grayscale data of 9 pixels at the target position of 1 million images captured in continuous video. DETAILED DESCRIPTION
[0022] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the appended claims of the application equally.
[0023] Example 1
[0024] Step 1: Binarize an 800×600 pixel image, such as Figure 2 As shown in the figure, the result of the image binarization processing proves that the target area is the center of the intersection of the diagonal lines of the approximate rectangle. As a result, there are only two colors, black and white. The rectangular area occupied by the white area is selected as the data set for machine learning, and the selected image is divided into 8×6 grid units.
[0025] Step 2: Input a series of similar image data into the detection program to train the machine to improve accuracy, repeat 300 times, and reach a target accuracy of more than 93%. Then select 25 pixels around the target point, calculate the average grayscale and output it to obtain the grayscale information of the target site.
[0026] Example 2
[0027] Step 1: Binarize a 400×300 pixel image, resulting in only black and white colors. Select the rectangular area occupied by the white area as the data set for machine learning and divide the selected image into 4×3 grid units.
[0028] Step 2: Input a series of similar image data into the detection program to train the machine to improve accuracy, repeat 500 times, and reach a target accuracy of more than 95%. Then select 9 pixel points around the target point, calculate the average grayscale and output it to obtain the grayscale information of the target site.
[0029] The more data a machine is given for training, the higher the accuracy of recognition and positioning will be. Figure 4 It is shown that in the standard 300 learning process, as the number of learning times increases, the recognition accuracy of the target needle tip continues to improve. When the recognition accuracy reaches more than 95%, it can basically meet the usual recognition requirements for the target position. Figure 5 What is shown is a randomly captured image, showing the realistic target capture effect, and the target is located completely and accurately. Figure 6Shown is the grayscale data of 9 pixels at the target position of 1 million images captured in continuous video. The information can be used to further analyze the grayscale changes, such as in information processing, graphic instrument development, etc.
[0030] Finally, it should be noted that: technicians in this industry should understand that the present invention is not limited to the above-mentioned implementation cases. The above-mentioned embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which shall fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A method for obtaining grayscale information of target sites in continuous images by target detection, characterized in that: The following steps are involved: S1, select the template range according to the target features, divide the image into a×b grid units, and according to the algorithm, if the center of the detected target falls within the grid, the grid predicts the target, that is, the target is detected; S2, input several pictures into the detection program, train the algorithm's recognition ability of the selected features, repeat several times, reach the target accuracy of more than 90%, select the target range to calculate the average grayscale, and obtain the grayscale information of the target site of the continuous picture.
2. The method for obtaining grayscale information of target sites in continuous images by target detection according to claim 1, characterized in that: It also includes binarizing the image and then selecting a feature range template.
3. The method for obtaining grayscale information of target locations in continuous images by target detection according to claim 2, characterized in that: The number of continuous images input for machine training is 200-1000 times.
4. The method for obtaining grayscale information of target sites in continuous images by target detection according to claim 1, characterized in that: The target position size is 1-25 pixels, and the position of the target detected in the image remains consistent with an error within 1 pixel.