A method and electronic device for scene cutline detection
By downsampling and integral image calculation of single-channel images, combined with difference and SVM classification, the accuracy and adaptability problems of scene separation line detection in existing technologies are solved, and efficient and reliable separation line detection is achieved.
Patent Information
- Application Number
- CN202310137589.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-20
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2043-02-20
AI Technical Summary
Existing technologies struggle to reliably and accurately extract scene separation lines in complex environments, especially in environments with scene interference, and their adaptability to visible light and infrared images is insufficient.
By downsampling a single-channel image, a gradient saliency enhancement image is constructed. Candidate regions for separator lines are obtained using integral images. Separator lines are then detected by combining horizontal and vertical difference calculations with a support vector machine (SVM) classifier.
It improves computational efficiency, is resistant to interference such as noise and sunlight reflection, and has scene adaptability, ensuring accurate detection of dividing lines under different lighting conditions.
Smart Images

Figure CN116310801B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of image recognition, and in particular to a scene separation line detection method. BACKGROUND
[0002] The scene separation line, including the horizon line and the sea-sky line, can be used for civil forest fire prevention by identifying the scene separation line, avoiding the sky part as a false alarm target, and also for airborne warning, avoiding false ground target false alarm. In the prior art, for scene separation line detection, generally based on image gradient enhancement preprocessing to obtain candidate regions, the detection is converted into a recognition task, and a learning-based method can accurately locate the separation line in the scene from the complex background, cloud layer, sun reflection, and high noise scene. For example, patent CN11275698A based on gray image processing, obtains the gray value of the region with the most dense gray value distribution, calculates the entropy value according to the gray value to realize maximum entropy segmentation, obtains the connected band of the image on the segmentation result, and finally calculates the gray mutation point in the connected band region as the horizon line. Patent CN106056139A, a forest fire smoke detection method based on image segmentation, obtains a single frame video image; performs horizon line detection on the obtained single frame video image; performs superpixel segmentation on the image after horizon line detection according to color distance and spatial distance; and classifies the pixel blocks of the image by using a support vector machine, thereby identifying the smoke. The present application can exclude the interference of sky, cloud and light on smoke detection.
[0003] However, in the prior art, based on the original gray image or extracting gradient information on the gray image, it is impossible to stably and accurately extract the scene separation line in an environment with scene interference, and to adapt to the extraction of different types of input images such as visible light and infrared in different scenes of horizon line and sea-sky line. SUMMARY
[0004] In view of the above problems, the present application is proposed in order to provide a scene separation line detection method and electronic device which can overcome the above problems or at least partially solve the above problems.
[0005] In order to solve the above technical problems, the embodiments of the present application disclose the following technical solutions:
[0006] A scene separation line detection method, comprising:
[0007] obtaining a single-channel image to be detected, performing image down-sampling processing, performing integral image calculation on the down-sampled image, constructing a gradient saliency enhancement image based on the calculation result of the integral image, and obtaining a preprocessed image;
[0008] Secondly, integral image calculation is performed on the obtained preprocessed image to obtain a vertical direction integral image, and a maximum value screening is performed based on the vertical direction integral image to obtain a candidate area of a separation line;
[0009] When the candidate area of the separation line exists, horizontal and vertical difference calculation is performed on the candidate area of the separation line image, and whether the difference calculation result satisfies a preset condition is judged based on the difference calculation result;
[0010] When the difference calculation result satisfies the preset condition, a confirmation area of the separation line is output, and a position of the separation line is fitted to output a detection result of the separation line.
[0011] Further, integral image calculation is performed on the whole area of the down-sampled image, specifically including: obtaining a sum G(m, n) of the gray values of all pixel points in a rectangular area surrounded by a top-left corner of the image and a current pixel point I(i, j):
[0012]
[0013] Then, a sum T(R) of the values of all pixels in the area R is calculated:
[0014] T(R) = G(m0, n0) + G(m i ,n i )-G(m0, n i )-G(m i ,n0)
[0015] Where (m0, n0) is the row and column coordinates of the top-left corner of any rectangular area R in the image, and (m i ,n i ) is the row and column coordinates of the bottom-right corner, and T(R) is calculated for each pixel point in the image to obtain the integral image of the whole area.
[0016] Further, a gradient saliency enhancement image is constructed based on the calculation result of the integral image to obtain a preprocessed image, specifically including: taking a box filter as a gradient saliency enhancement template, the black rectangular in the template corresponds to an image area R1, and the white rectangular corresponds to an image area R2, the sum of the gray values of all pixels in the rectangular areas R1 and R2 is calculated through the integral image, and the calculation formula of the gradient saliency E(i, j) of the image pixel point I(i, j) at the center of the template is:
[0017] E(i, j) = |T(R1) - T(R2)|
[0018] Where T(R1) is the sum of the values of all pixels in the black rectangular area, and T(R2) is the sum of the values of all pixels in the white rectangular area, and E(i, j) is calculated for each pixel point on the integral image of the whole area to obtain the gradient enhancement preprocessed image.
[0019] Further, a second integral image calculation is performed on the obtained preprocessed image to obtain a vertical direction integral image, and the specific method is as follows: performing a second integral image calculation on the obtained preprocessed image, and setting a box region with a width of w and a height of a, obtaining the vertical direction significance accumulation value of the image in each box region to obtain a gradient-enhanced significance intensity curve, wherein the calculation formula of the significance value is as follows:
[0020]
[0021] wherein i represents the position of each candidate row, W represents the width of the image, and a represents the height of the box region.
[0022] Further, based on the vertical direction integral image, a maximum value screening is performed to obtain a separation line candidate region, and the specific method includes: obtaining a multi-peak region on the significance intensity curve through the obtained gradient-enhanced significance intensity curve, then performing sorting based on the significance value of the multi-peak region, and comparing with a preset significance threshold to obtain the separation line candidate region.
[0023] Further, horizontal and vertical difference calculations are performed on the separation line candidate region image, and the specific calculation method includes: calculating the horizontal and vertical direction gradient differences on the enhanced significance map E on all candidate regions, and the specific calculation formula is as follows:
[0024] row_map i,j = |2*E[i][j]-E[i-1][j]-E[i+1][j]|
[0025] col_map i,j = |2*E[i][j]-E[i][j-1]-E[i][j+1]|
[0026]
[0027]
[0028] P = (H-2a)*(W-2)
[0029]
[0030]
[0031] wherein row_map i,j is the horizontal direction significance difference, region_sum row represents the sum of the horizontal direction significance difference, W and H are the width and height of the significance map E respectively, P is the number of pixel points in each candidate box, and diff_sum rowThe gradient difference value in the horizontal direction is represented by diff_sum. col This represents the gradient difference value in the vertical direction.
[0032] Furthermore, based on the difference calculation results, it is determined whether the difference calculation results meet the preset conditions. The determination method includes: obtaining the gradient difference value diff_sum in the horizontal direction of the separator line. row The gradient difference value in the vertical direction, diff_sum col And the significance value S(i), when there is a candidate region, the larger the significance value S(i), the higher the gradient difference value diff_sum in the horizontal direction. row The gradient difference value diff_sum in the vertical direction and the month is large. col The smaller the size, the more likely the current candidate area for the separator line will be confirmed as the confirmed area for the separator line.
[0033] Furthermore, when the difference calculation result does not meet the preset conditions, feature extraction is performed on the image, and an SVM classifier is used to classify the candidate region separator lines. The difference calculation result is then re-evaluated to determine whether it meets the preset conditions. When the difference calculation result meets the preset conditions, the separator line confirmation region is output, and the separator line position is fitted to output the separator line detection result.
[0034] Furthermore, feature extraction is performed on the image, and an SVM classifier is used to classify the candidate region separator lines. Specifically, during the SVM classification process, the feature dimension obtained by extracting grayscale features from the original input image according to the candidate regions is W*α. The feature-extracted image is then input into a pre-trained model for binary classification.
[0035] The present invention also discloses an electronic device, characterized in that it comprises:
[0036] Memory is used to store instructions that can be executed by the processor;
[0037] A processor configured to execute the instructions to implement a scene separator detection method.
[0038] The beneficial effects of the above-described technical solutions provided in the embodiments of the present invention include at least the following:
[0039] The scene separation line detection method disclosed by the application comprises the following steps: obtaining a single-channel image to be detected, performing image down-sampling processing, performing integral image calculation on the down-sampled image in the whole image area, constructing a gradient saliency enhancement image based on the calculation result of the integral image, and obtaining a preprocessed image; performing second integral image calculation on the obtained preprocessed image, obtaining a vertical direction integral image, and obtaining a separation line candidate area through maximum value screening based on the vertical direction integral image; when the separation line candidate area exists, performing horizontal and vertical difference calculation on the separation line candidate area image, judging whether the difference calculation result meets a preset condition based on the difference calculation result; when the difference calculation result meets the preset condition, outputting a separation line confirmation area, fitting the separation line position, and outputting a separation line detection result. Compared with the prior art, the application has the following beneficial effects:
[0040] 1. High calculation efficiency. The application does not strictly depend on image input of original size, can perform operation on a down-sampled single-channel gray image, has high calculation efficiency, and has the ability of real-time output of separation line detection.
[0041] 2. Anti-interference. The application can resist noise and environmental interference such as solar reflection because the image traditional feature is based on image gradient information.
[0042] 3. Scene adaptability. The application combines a traditional image processing method and a SVM learning method based on machine learning, obtains a candidate area through the traditional method, performs simple labeling and data enhancement, sends the separation line of a similar scene into a SVM to obtain a model, and has strong adaptability.
[0043] 4. Accuracy and reliability. The application can adapt to separation line detection under visible light images and infrared images, can normally work in a pitch-black night, and the analysis and processing result is accurate and reliable.
[0044] The technical solutions of the application will be further described in detail below with reference to the drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0045] The accompanying drawings are used to provide a further understanding of the application, constitute a part of the specification, are used to explain the application together with embodiments of the application, and do not constitute a limitation on the application. In the drawings:
[0046] Figure 1 It is a flowchart of a scene separation line detection method in embodiment 1 of the application;
[0047] Figure 2 It is a saliency graph and intensity curve graph after gradient enhancement in embodiment 1 of the application;
[0048] Figure 3 It is a gradient enhancement template schematic diagram in embodiment 1 of the application;
[0049] Figure 4 Figure 1 is a schematic diagram of a partition line detection candidate box region in an embodiment of the present application;
[0050] Figure 5 Figure 2 is a schematic diagram of horizontal and vertical difference templates in an embodiment of the present application;
[0051] Figure 6 Figure 3 is a schematic diagram of obtaining a partition line detection frame in an embodiment of the present application;
[0052] Figure 7 Figure 4 is a fitting effect diagram of a partition line detection result in an embodiment of the present application. DETAILED DESCRIPTION
[0053] Exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the present disclosure to those skilled in the art.
[0054] To solve the problems in the prior art, an embodiment of the present application provides a scene partition line detection method.
[0055] Embodiment 1
[0056] The present embodiment discloses a scene partition line detection method, which comprises the steps of: Figure 1 , and specifically comprises the steps of:
[0057] S100. Acquire a single-channel image to be detected, perform image down-sampling processing, calculate an integral image of a full-image region of the down-sampled image, construct a gradient saliency enhancement image based on the calculation result of the integral image, and obtain a preprocessed image;
[0058] Specifically, the present embodiment reads a single frame of visible light or infrared single-channel image, down-samples the full image to X*X (X of the present embodiment is preferably 128) resolution to obtain an input image I, and improves the operation speed of partition line detection through image down-sampling processing, thereby meeting the requirements of the present embodiment in a real-time system.
[0059] In the present embodiment, the down-sampled image is subjected to integral image calculation of a full-image region, specifically comprising the steps of: acquiring the sum G(m,n) of the gray values of all pixel points in a rectangular region surrounded by the top-left corner of the image and a current pixel point I(i,j):
[0060]
[0061] Then, the sum T(R) of the values of all pixels in the region R is calculated:
[0062] T(R) = G(m0,n0) + G(m i ,n i -G(m0,n) i )-G(m i ,n0)
[0063] Among them, the preprocessed image is as follows Figure 2 As shown in the left figure. (m0, n0) are the row and column coordinates of the top left corner of any rectangular region R in image I, (m i ,n i Let T(R) be the row and column coordinates of the lower right corner. By calculating T(R) for each pixel in the image, the integral image of the entire region can be obtained.
[0064] In this embodiment, the preprocessed image is as follows: Figure 2 As shown in the left figure, a gradient saliency enhancement image is constructed based on the calculation results of the integral image, resulting in a preprocessed image. Specifically, this includes using a box filter as a gradient saliency enhancement template, as shown in the image. Figure 3 As shown, the width and height of the template are α and 2α, respectively. The black rectangle in the template corresponds to image region R1, and the white rectangle corresponds to image region R2. By calculating the sum of the gray values of all pixels in rectangular regions R1 and R2 using the integral image, the formula for calculating the gradient significance E(i,j) of pixel I(i,j) in the center image of the template is:
[0065] E(i,j)=|T(R1)-T(R2)|
[0066] Where T(R1) is the sum of the values of all pixels within the black rectangular area, and T(R2) is the sum of the values of all pixels within the white rectangular area. E(i,j) is calculated for each pixel on the integral map of the entire image area to obtain the gradient enhancement preprocessed image. From the saliency map after gradient enhancement, it can be seen that the enhanced image produces obvious stratification.
[0067] S200. Perform a second integral image calculation on the obtained preprocessed image to obtain a vertical integral image. Based on the vertical integral image, obtain candidate regions for the dividing line by filtering through the maximum value.
[0068] Specifically, the method for obtaining the vertical integral image is as follows: A second integral image calculation is performed on the preprocessed image, and a box region with width w and height α is defined. Within each box region, the cumulative saliency value in the vertical direction of the image is obtained, resulting in the saliency intensity curve after gradient enhancement. Figure 2 On the right, the formula for calculating the significance value is:
[0069]
[0070] where i represents the position of each candidate line, W represents the width of the image, and a represents the height of the box region.
[0071] From the Figure 2 It can be seen that multiple peaks appear on the saliency intensity cumulative curve. Figure 2 The three regions in the upper, middle and lower parts of the left image correspond to Figure 2 The corresponding saliency intensity curve values in the right image are the color positions of the same frame, and it can be seen that the saliency intensity is the largest in the middle sky layering region.
[0072] In this embodiment, the multiple peak regions on the saliency intensity curve are obtained by finding the region where the maximum value on the saliency intensity curve is located, and the saliency value of the multiple peak region is sorted and compared with the preset saliency threshold, and the candidate region result of the separation line is obtained as shown in Figure 4 , wherein the position corresponding to each dashed frame is the potential region of the separation line.
[0073] When the candidate region of the separation line exists, the horizontal and vertical difference calculation is performed on the candidate region image of the separation line, and based on the difference calculation result, it is judged whether the difference calculation result satisfies the preset condition.
[0074] Specifically, the horizontal and vertical gradient differences are calculated on the enhanced saliency map on all candidate regions, and the horizontal and vertical gradient difference templates are as shown in Figure 5 , that is, the difference value between each column and the surrounding two columns is calculated in the horizontal direction as the difference map, and the variance of each position and the difference is calculated on the difference map; the same is true in the vertical direction.
[0075] Specifically, the horizontal and vertical difference calculation is performed on the candidate region image of the separation line, and the specific calculation method includes: calculating the horizontal and vertical gradient differences on the enhanced saliency map E on all candidate regions, and the specific calculation formula is as follows:
[0076] row_map i,j =|2*E[i][j]-E[i-1][j]-E[i+1][j]|
[0077] col_map i,j =|2*E[i][j]-E[i][j-1]-E[i][j+1]|
[0078]
[0079]
[0080] P=(H-2α)*(W-2)
[0081]
[0082]
[0083] wherein row_map i,j is the difference of saliency in horizontal direction, region_sum row represents the sum of saliency difference in horizontal direction, W, H are width and height of saliency map E respectively, P is the number of pixels in each candidate box, diff_sum row represents the difference of gradient in horizontal direction, diff_sum col represents the difference of gradient in vertical direction.
[0084] In the embodiment, based on the difference calculation result, it is judged whether the difference calculation result satisfies the preset condition, and the method of judging includes: obtaining the difference of gradient in horizontal direction diff_sum row , the difference of gradient in vertical direction diff_sum col and the saliency value S(i) of the separating line in horizontal direction, when the candidate region saliency value S(i) is greater, the horizontal direction gradient difference diff_sum row is greater and the vertical direction gradient difference diff_sum col is smaller, the current separating line candidate region is confirmed as the separating line confirmed region.
[0085] Specifically, because the separating line after the saliency enhancement, the greater the horizontal difference of the upper and lower boundary characteristics of the separating line itself, the more consistent with the characteristics of the separating line, the smaller the vertical difference, the more consistent with the characteristics of the separating line, so the candidate region has the condition MAX(S(i)), MAX(diff_sum row ), MIN(diff_sum col) ) is satisfied, then the detection confirmed candidate position of the separating line is directly confirmed as
[0086] In some preferred embodiments, when the difference calculation result does not satisfy the preset condition, then the image is subjected to feature extraction, and the SVM classifier is used to classify the candidate region separating line, and it is re-judged whether the difference calculation result satisfies the preset condition, when the difference calculation result satisfies the preset condition, the separating line confirmed region is output, and the separating line position is fitted, and the separating line detection result is output.
[0087] Specifically, feature extraction is performed on the image, and an SVM classifier is used to classify the candidate region separation line, specifically including: in the process of SVM classification, the feature dimension of the gray image feature extracted on the original input image according to the candidate region is W*α, and the image after feature extraction is input into the pre-trained model for binary classification.
[0088] When the difference calculation result meets the preset condition, the separation line confirmation area is output, and the separation line position is fitted, and the separation line detection result is output.
[0089] As shown in the scene separation line detection method disclosed in the embodiment, Figure 6 As shown in the scene separation line detection method disclosed in the embodiment,
[0090] As shown in the scene separation line detection method disclosed in the embodiment, Figure 7 As shown in the scene separation line detection method disclosed in the embodiment,
[0091]
[0092] From the image of the separation line detection, the scheme can accurately locate the separation line in the background layering, cloud layer and high noise scene, and fit the appropriate position of the separation line.
[0093] The scene separation line detection method disclosed in the embodiment comprises: acquiring a single-channel image to be detected, performing image down-sampling processing, performing integral image calculation on the down-sampled image, constructing a gradient saliency enhancement image based on the calculation result of the integral image, and obtaining a preprocessed image; performing second integral image calculation on the obtained preprocessed image to obtain a vertical direction integral image, and obtaining a separation line candidate region through maximum value screening based on the vertical direction integral image; when the separation line candidate region exists, performing horizontal and vertical difference calculation on the separation line candidate region image, judging whether the difference calculation result meets a preset condition based on the difference calculation result; and when the difference calculation result meets the preset condition, outputting a separation line confirmation area, fitting the separation line position, and outputting a separation line detection result.
[0094] The scene separation line detection method disclosed in the embodiment has the following beneficial effects compared with the prior art:
[0095] 1. High calculation efficiency. The present application does not strictly depend on the original size of the image input, and can perform operation on the down-sampled single-channel gray image, so the calculation efficiency is high, and the present application has the ability of real-time output of the separation line detection.
[0096] 2. Anti-interference. The application can resist environmental interference such as noise and sunlight reflection because the traditional features of the image are based on image gradient information.
[0097] 3. Scene adaptability. The application combines traditional image processing methods and SVM learning methods based on machine learning. The traditional method obtains candidate regions for simple labeling and data enhancement, and the similar scene separation lines are sent to the SVM training to obtain the model, and the adaptability is strong.
[0098] 4. Accuracy and reliability. The application can adapt to the separation line detection under visible light images and infrared images, so it can work normally in the dark night, and the analysis and processing result is accurate and reliable.
[0099] Embodiment 2
[0100] The embodiment also discloses an electronic device, comprising: a memory for storing instructions executable by a processor; and the processor is configured to execute the instructions to implement the method of embodiment 1.
[0101] It should be understood that the specific order or hierarchy of steps in the disclosed processes should not be interpreted as reflecting an exhaustive listing of required elements, or that the specific order or hierarchy of steps is the only order or hierarchy that can be implemented. The steps of the processes disclosed herein can be re-ordered or combined in ways not explicitly described, without departing from the scope of the disclosure. The accompanying method claims set forth in the appended claims use "comprising", "including", "carrying", "containing", "smoothing" or "having", and their conjugates to mean that the listed steps are "included" but not "limited to" or "consist only of the methods and / or apparatuses specifically recited. Optional steps can be combined with the claimed steps, or optional steps can be practiced without the claimed steps, without departing from the scope of the disclosure.
[0102] In the detailed description above, various features are grouped together in single embodiments for the purpose of streamlining the disclosure. This disclosed approach is not to be interpreted as reflecting an intention that the claimed embodiments require more features than the claim language demands. Rather, as recited in the attached claims, the application lies in less than all features of the disclosed single embodiments. Accordingly, the claims are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate preferred embodiment of the application.
[0103] Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans can implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
[0104] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium can be integral to the processor. The processor and the storage medium can reside in an ASIC. The ASIC can reside in a user terminal. In the alternative, the processor and the storage medium can reside as discrete components in a user terminal.
[0105] For a software implementation, the techniques described herein can be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes can be stored in memory units and executed by processors. The memory unit can be implemented within the processor or external to the processor, in which case it can be communicatively coupled to the processor via various means as is known in the art.
[0106] The above description includes one or more examples of the embodiments. Of course, not all possible combinations of components or method steps described above can be claimed as embodiments. One of ordinary skill in the art can recognize that modifications and variations of the described embodiments are possible and are within the scope of the present disclosure. It is therefore intended that the embodiments described herein be considered in all respects as only illustrative and not restrictive. Specifically, the description of the embodiments should be considered to be illustrative and not exhaustive, and should be considered in the light of the claims. Further, the use of the term "comprise" in the specification is to be construed in the same way as the term "comprise" as defined in the claims. In addition, the use of any term "or" in the specification is to be construed as "non-exclusive or".
Claims
1. A method of scene cut detection, the method comprising: The method comprises the following steps: obtaining a single-channel image to be detected, performing image down-sampling processing, performing integral image calculation on the down-sampled image in a full-image region, constructing a gradient saliency enhancement image based on the calculation result of the integral image, and obtaining a preprocessed image; performing second integral image calculation on the obtained preprocessed image to obtain a vertical direction integral image, and obtaining a candidate region of a separation line based on the integral image in the vertical direction through maximum value screening. When the candidate region of the separation line exists, performing horizontal and vertical difference calculation on the candidate region of the separation line image, and judging whether the difference calculation result meets a preset condition based on the difference calculation result. When the difference calculation result meets the preset condition, outputting a separation line confirmation region, fitting the position of the separation line, and outputting a separation line detection result.
2. The scene cutline detection method of claim 1, wherein, The integral image calculation on the down-sampled image in the full-image region specifically comprises the following steps: obtaining the sum G(m, n) of the gray values of all pixel points in a rectangular region surrounded by the top-left corner of the image and a current pixel point I(i, j): Then, the sum T(R) of the values of all pixels in the region R is calculated: T(R) = G(m0,n0) + G(m i ,n i )-G(m0,n i )-G(m i ,n0) Wherein, (m0, n0) is the left upper corner row and column coordinates of any rectangular region R in the image I, (m i , n i ) is the right lower corner row and column coordinates, and T(R) is calculated for each pixel point in the image, so as to obtain the integral graph of the whole image region.
3. The scene cutline detection method of claim 2, wherein, The gradient saliency enhancement image is constructed based on the calculation result of the integral image, and a preprocessed image is obtained. Specifically, the box filter is used as a gradient saliency enhancement template, the black rectangle in the template corresponds to an image region R1, the white rectangle corresponds to an image region R2, the sum of the gray values of all pixels in the rectangular regions R1 and R2 is calculated through the integral image, and the calculation formula of the gradient saliency E(i, j) of the image pixel point I(i, j) at the center of the template is: E(i, j) = |T(R1) - T(R2)| Wherein, T(R1) is the sum of the values of all pixels in the black rectangular region, T(R2) is the sum of the values of all pixels in the white rectangular region, E(i, j) is calculated for each pixel point on the integral image in the full-image region, and a gradient enhancement preprocessed image is obtained.
4. The scene cutline detection method of claim 1, wherein, The second integral image calculation is performed on the obtained preprocessed image to obtain a vertical direction integral image. The specific method is as follows: the second integral image calculation is performed on the obtained preprocessed image, a box region with a width of w and a height of a is set, the saliency accumulation value in the vertical direction of the image is obtained in each box region, and a gradient-enhanced saliency intensity curve graph is obtained. The calculation formula of the saliency value is as follows: Wherein, i represents the position of each candidate row, W represents the width of the image, and a represents the height of the box region.
5. The scene cutline detection method of claim 4, wherein, Based on the integral image in the vertical direction, the candidate region of the separation line is obtained through maximum value screening. Specifically, the multi-peak region on the saliency intensity curve graph is obtained through the obtained gradient-enhanced saliency intensity curve graph, the saliency values of the multi-peak region are sorted, and the sorted saliency values are compared with a preset saliency threshold to obtain the candidate region of the separation line.
6. The scene cutline detection method of claim 1, wherein, The horizontal and vertical difference calculation is performed on the candidate region of the separation line image. The specific calculation method comprises the following steps: the horizontal and vertical gradient difference is calculated on the enhanced saliency graph E in all candidate regions. The specific calculation formula is as follows: row_map i,j = |2*E[i][j] - E[i-1][j] - E[i+1][j]| col_map i,j = |2*E[i][j] - E[i][j-1] - E[i][j+1]| P = (H - 2a) * (W - 2) wherein row_map i,j is the saliency difference in the horizontal direction, region_sum row denotes the sum of the saliency difference in the horizontal direction, W, H are the width and height of the saliency map E respectively, P is the number of pixels in each candidate box, diff_sum row denotes the gradient difference value in the horizontal direction, diff_sum col denotes the gradient difference value in the vertical direction.
7. A scene cutline detection method as claimed in claim 6, characterized in that, Based on the difference calculation result, it is judged whether the difference calculation result satisfies a preset condition, and the judging method comprises the following steps: obtaining gradient difference values diff_sum row in a horizontal direction and gradient difference values diff_sum col in a vertical direction and a saliency value S(i) of the candidate region, and when the saliency value S(i) of the candidate region is greater, the gradient difference value diff_sum row in the horizontal direction is greater, and the gradient difference value diff_sum col in the vertical direction is smaller, the current candidate region of the separation line is confirmed as a confirmed region of the separation line.
8. The scene cutline detection method of claim 1, wherein, When the difference calculation result does not satisfy the preset condition, the image is subjected to feature extraction, and the SVM classifier is used to classify the candidate region separation line, and it is re-judged whether the difference calculation result satisfies the preset condition, when the difference calculation result satisfies the preset condition, the separation line confirmation region is output, and the separation line position is fitted, and the separation line detection result is output.
9. The scene cutline detection method of claim 7, wherein, The image is subjected to feature extraction, and the SVM classifier is used to classify the candidate region separation line, specifically comprising: in the process of SVM classification, the feature dimension obtained by performing gray-scale feature extraction on the original input image according to the candidate region is W*alpha, and the image after feature extraction is input into the pre-trained model for binary classification.
10. An electronic device, comprising: Comprise: a memory for storing instructions executable by a processor; a processor configured to execute the instructions to implement the method of any one of claims 1-9.
Citation Information
Patent Citations
Forest fire smoke / fog detection method based on image segmentation
CN106056139A
Vehicle detection method and system
CN108268866A
Sea surface ship candidate region detection method based on visual saliency
CN110414411A