Cross-CCD (Charge Coupled Device) target area slice calculation method and system
By adopting the target area slice calculation method in image data processing across CCD, the problems of data integrity and processing speed in the prior art are solved, and efficient cross-CCD slice calculation is realized.
Patent Information
- Application Number
- CN202411878562.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-05-13
AI Technical Summary
The prior art lacks technology to ensure data integrity and processing speed when processing image data across multiple charge-coupled devices CCDs.
A method of calculating the target area slice across CCD is provided. By obtaining target information, the flow number of the start row of the slice is calculated, and the column number of the left and right endpoints of the starting row is initially calculated based on the target information. Determine whether the slice crosses the CCD. If it crosses the CCD, update the starting row and column number, and find the flow number when the same as the current row time code in the adjacent queue through row matching, as the flow number of the left and right endpoints of the starting row.
It is realized that the information of the target area slices is efficiently calculated and processed in the case where the slices cross CCD, ensuring data integrity and processing speed.
Smart Images

Figure CN119990266A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of satellite communications, and in particular, relates to a cross-CCD target area slice calculation method and system. Background Art
[0002] In satellite communication systems, after the image data collected by the satellite camera array system is transmitted to the ground, a series of operations such as target detection and positioning are required to obtain data products.
[0003] The publication number CN104252624A is called a method for positioning and extracting satellite-borne regional point target images. It discloses reading auxiliary data of satellite images, calculating the current row and column number of satellite images, judging satellite ephemeris jumps and ephemeris jump cycles, calculating camera row cycles, etc.; it proposes an algorithm based on parameter update and real and predicted calculation of geographic information to ensure the stability and real-time performance of positioning accuracy; it determines whether the regional point target is within the current detection range, and calculates its corresponding predicted starting row and column number; it compares it with the real-time row and column number, and outputs the result according to the point target extraction format; it loops and calculates until the task is completed. By using several existing satellite positioning models, the positioning of remote sensing images of satellites in orbit at any time is realized after the satellite is turned on, and the real-time or non-real-time extraction of satellite-borne regional point target images is completed, providing an option for high-level processing of on-orbit images.
[0004] Linear arrangement is a common arrangement of satellite camera arrays. It has the advantages of low cost, easy deployment, and wide field of view. Compared with traditional cameras, it can achieve high-precision and high-speed image acquisition and transmission. Therefore, image data based on linear camera arrays is an important type of satellite payload data. After detecting the target and calculating its position in the camera image, the local area where the target is located is often cut to facilitate subsequent processing or display. Therefore, slice calculation has become a common data processing method.
[0005] The publication number CN114066898A is entitled "A real-time line-by-line segmentation method for material images of a linear array camera". A real-time line-by-line segmentation method for material images of a linear array camera is disclosed, including step 1: binarizing the current scanning line T of the camera; step 2: updating the existing material range: comparing T with the current range Si of each material i: if T and Si do not have an intersection, the material scan ends, otherwise, the intersection interval of the two is searched, and Si is updated with the new interval in T; step 3: new material search: if a certain pixel interval Rj in T has no intersection with the existing material range, then Rj constitutes a newly appeared material range; step 4: material range merging processing: traversing the non-zero material ranges in the range set {Si} of all materials, and merging when the two ranges overlap; step 5: updating the material cache image. The method solves the problem of large time delay between image acquisition and air valve injection in the prior art, and is suitable for real-time segmentation of material images.
[0006] The prior art lacks technology for processing image data across multiple charge coupled devices (CCDs) and ensuring data integrity and processing speed. Summary of the invention
[0007] In view of the defects in the prior art, an object of the present invention is to provide a cross-CCD target area slice calculation method and system.
[0008] A cross-CCD target area slice calculation method provided by the present invention includes:
[0009] Step S1: Get the target information and calculate the starting row serial number S of the slice start ;
[0010] Step S2: According to the target information, preliminarily calculate the initial value Y of the column number of the left endpoint of the starting row l0 、The initial value of the column number of the right endpoint Y r0 ;
[0011] Step S3: judging whether the slice crosses CCD according to the initial values of the column numbers of the left and right endpoints of the starting row and the number of pixels; if it crosses CCD, updating the starting row and column numbers; if not, no updating is required;
[0012] Step S4: Update the serial number of the slice across CCD; perform row matching on the endpoints across CCD, find the serial number with the same time code as the current row in the adjacent queue, and use it as the serial number of the left and right endpoints of the starting row;
[0013] Step S5: Calculate the CCD number, column number and serial number of the endpoint of the end row of the slice according to the updated column number, serial number and slice height of the left and right endpoints of the start row;
[0014] Step S6: Integrate the information of the target area slice across the CCD through the position information of the endpoints of the start row and the end row.
[0015] Preferably, the step S1 comprises:
[0016] Step S1.1: Obtain the target information from the data collected by the CCD array, including the target point CCD number d tar , Column No. Y tar and serial number S tar , the height of the slice is H;
[0017] Step S1.2: Calculate the starting row serial number of the slice; the center point of the area slice is the target point, and the starting row serial number of the slice is S start for:
[0018] S start =S tar -H / 2.
[0019] Preferably, step S2 comprises:
[0020] The target point column number is equal to the starting row center point column number Y tar , based on the slice width W, preliminary calculation:
[0021] Initial value of the column number of the left endpoint Y l0 for:
[0022] Y l0 =Y tar -W / 2
[0023] Initial value of the column number of the right endpoint Y r0 for:
[0024] Y r0 =Y tar +W / 2.
[0025] Preferably, step S3 comprises:
[0026] Step S3.1: M CCDs collect data to obtain single-row linear array data composed of M CCDs; wherein the data at the same index in each queue in the array data are collected at the same time or at a nearby time, and the number of pixels of the M CCDs obtained is stored in a 1*M array Arr, where M is an integer greater than 1;
[0027] Step S3.2: Determine whether the endpoint crosses the CCD; when the column number of the left endpoint of the starting row is the initial value Y l0 When it is less than 0, it means that the left endpoint crosses CCD; when the initial value of the column number of the right endpoint of the starting row is Y r0 When it is greater than or equal to the number of CCD pixels, it means that the right endpoint crosses the CCD;
[0028] Step S3.3: Update the endpoint column number;
[0029] When the left endpoint crosses CCD, calculate the CCD number d of the left endpoint of the starting row l and column number Y l :
[0030] d l =d tar -1
[0031] Y l =Arr[d tar -1]+Y l0 , whenY l0 <0
[0032] When the right endpoint crosses CCD, calculate the CCD number d of the right endpoint of the starting row r and column number Y r :
[0033] d r =d tar +1
[0034] Y r =Y r0 -Arr[d tar ],whenY r0 ≥Arr[d tar ].
[0035] Preferably, step S4 comprises:
[0036] Step S4.1: In the current queue, the serial numbers of the first pixel and the last pixel are S0 and S1 respectively. n-1 , n is the number of pixels in the queue, the queue length is n1, in the current queue, find the starting row serial number S start The corresponding data, that is, the starting row data, then the index of the starting row data in the queue is I t1 for:
[0037]
[0038] Step S4.2: In the current queue, determine I t1 Is the serial number at the same as the starting line serial number S start If they are the same, the current data is the starting row data; if it is greater than S start , then move forward a preset distance k, and then traverse one by one, that is, from I0 = I t1 -k starts traversal; if it is less than S start , then from I t1 Start traversing one by one; until you find the one that matches S startThe data at the same time is the start row data, and the time code of the start row is T t ; The center point of the starting line and the left and right endpoints are collected at the same time;
[0039] Step S4.3: In adjacent queues, the time codes of the head pixel and the tail pixel are T0 and T1 respectively. n-1 , the queue length is n2, T t The time code of the current row is found in the adjacent queue with the time code T t The corresponding data, that is, the row data where the endpoint is located, then the index of the data in the queue is I t2 for:
[0040]
[0041] Step S4.4: In the adjacent queue, determine I t2 Is the time code at the same as the time code T t Same, if the same, the current data is the data at the same time; if greater than T t , then move forward a preset distance k and then traverse one by one, that is, from I0 = I t2 -k starts traversal; if it is less than T t , then from I t2 Start traversing one by one; until you find the one that matches T t The data at the same time is the data across CCD endpoints;
[0042] Since the endpoint and the center point occur at the same time, the current serial number is the endpoint serial number. Update the serial number to get the serial numbers S of the left and right endpoints of the starting row. lu and S ru .
[0043] Preferably, step S5 comprises:
[0044] According to the left and right endpoint information of the starting row and the slice height H, the CCD number, column number and serial number of the end point of the slice ending row are calculated;
[0045] The serial numbers of the left and right endpoints of the termination line are S ld and S rd :
[0046] S ld =S lu -H
[0047] S rd =S ru -H
[0048] For the left endpoint, the CCD number of the left endpoint of the ending row is the same as the CCD number of the left endpoint of the starting row. lSame; the column number of the left endpoint of the ending row and the column number of the left endpoint of the starting row Y l same;
[0049] For the right endpoint, the CCD number of the left endpoint of the ending row is the same as the CCD number of the left endpoint of the starting row. r Same; the column number of the left endpoint of the ending row and the column number of the left endpoint of the starting row Y r same.
[0050] Preferably, including:
[0051] The data collected by the CCD array is received and saved by each queue using a circular queue. The circular queue is based on an array of fixed length, and uses a read pointer and a write pointer to point to the beginning and end of the array respectively. The data is read at the beginning, the data pointed to by the read pointer is read, and added at the end. After writing, the write pointer moves back one position.
[0052] The head and tail of the array are logically connected. When the pointer points to the tail of the array, it will point to the head of the array after moving again, realizing the function of the circular queue, and the storage status of the queue can be determined according to the relative position of the pointer;
[0053] Among them, the array length is fixed.
[0054] A cross-CCD target area slice calculation system provided by the present invention includes:
[0055] Module M1: Get the target information and calculate the starting row serial number S of the slice start ;
[0056] Module M2: Based on the target information, preliminarily calculate the initial value Y of the column number of the left endpoint of the starting row l0 、The initial value of the column number of the right endpoint Y r0 ;
[0057] Module M3: Determine whether the slice crosses CCD according to the initial values of the column numbers and the number of pixels at the left and right endpoints of the starting row; if it crosses CCD, update the starting row and column numbers; if not, no update is required;
[0058] Module M4: Update the slice serial number across CCD; perform row matching on the endpoints across CCD, find the serial number with the same time code as the current row in the adjacent queue, and use it as the serial number of the left and right endpoints of the starting row;
[0059] Module M5: Calculate the CCD number, column number and serial number of the endpoint of the end row of the slice according to the column number, serial number and slice height of the left and right endpoints of the updated start row;
[0060] Module M6: Integrate the information of the target area slice across the CCD through the position information of the start row and the end row endpoints.
[0061] Preferably, the module M1 comprises:
[0062] Module M1.1: Obtain target information from the data collected by the CCD array, including the target point CCD number d tar , Column No. Y tar and serial number S tar , the height of the slice is H;
[0063] Module M1.2: Calculate the starting row serial number of the slice; the center point of the regional slice is the target point, and the starting row serial number of the slice is S start for:
[0064] S start =S tar -H / 2
[0065] The module M2 comprises:
[0066] The target point column number is equal to the starting row center point column number Y tar , based on the slice width W, preliminary calculation:
[0067] Initial value of the column number of the left endpoint Y l0 for:
[0068] Y l0 =Y tar -W / 2
[0069] Initial value of the column number of the right endpoint Y r0 for:
[0070] Y r0 =Y tar +W / 2.
[0071] Preferably, the module M4 includes:
[0072] Module M4.1: In the current queue, the serial numbers of the first pixel and the last pixel are S0 and S1 respectively. n-1 , n is the number of pixels in the queue, the queue length is n1, in the current queue, find the starting row serial number S start The corresponding data, that is, the starting row data, then the index of the starting row data in the queue is I t1 for:
[0073]
[0074] Module M4.2: In the current queue, determine I t1 Is the serial number at the same as the starting line serial number S start If they are the same, the current data is the starting row data; if it is greater than S start, then move forward a preset distance k, and then traverse one by one, that is, from I0 = I t1 -k starts traversal; if it is less than S start , then from I t1 Start traversing one by one; until you find the one that matches S start The data at the same time is the start row data, and the time code of the start row is T t ; The center point of the starting line and the left and right endpoints are collected at the same time;
[0075] Module M4.3: In adjacent queues, the time codes of the head pixel and the tail pixel are T0 and T1 respectively. n-1 , the queue length is n2, T t The time code of the current row is found in the adjacent queue with the time code T t The corresponding data, that is, the row data where the endpoint is located, then the index of the data in the queue is I t2 for:
[0076]
[0077] Module M4.4: In adjacent queues, determine I t2 Is the time code at the same as the time code T t Same, if the same, the current data is the data at the same time; if greater than T t , then move forward a preset distance k and then traverse one by one, that is, from I0 = I t2 -k starts traversal; if it is less than T t , then from I t2 Start traversing one by one; until you find the one that matches T t The data at the same time is the data across CCD endpoints;
[0078] Update the serial number. Since the endpoint and the center point occur at the same time, the current serial number is the endpoint serial number. The serial numbers S of the left and right endpoints of the starting row are obtained. lu and S ru .
[0079] The module M5 comprises:
[0080] According to the left and right endpoint information of the starting row and the slice height H, the CCD number, column number and serial number of the end point of the slice ending row are calculated;
[0081] The serial numbers of the left and right endpoints of the termination line are S ld and S rd :
[0082] S ld =S lu -H
[0083] S rd =Sru -H
[0084] For the left endpoint, the CCD number of the left endpoint of the ending row is the same as the CCD number of the left endpoint of the starting row. l Same; the column number of the left endpoint of the ending row and the column number of the left endpoint of the starting row Y l same;
[0085] For the right endpoint, the CCD number of the left endpoint of the ending row is the same as the CCD number of the left endpoint of the starting row. r Same; the column number of the left endpoint of the ending row and the column number of the left endpoint of the starting row Y r same.
[0086] Compared with the prior art, the present invention has the following beneficial effects:
[0087] 1. The data type applicable to the present invention is image data collected by a linear camera array, centered on the target point, and compatible with the situation where the slice crosses the CCD;
[0088] 2. The present invention uses an optimized row matching method to search for the corresponding time code in the queue according to the serial number, and to search for the serial number in the queue according to the time code. Both methods use a calculation combined with traversal, which greatly saves the search time cost;
[0089] 3. The data collected by the CCD array of the present invention is stored in respective circular queues, which are based on arrays of fixed size to ensure memory security;
[0090] 4. The present invention solves the problem of being compatible with different CCD sampling frequencies. When the slices span CCDs and the adjacent CCD sampling frequencies are different, the data at the same sampling time can be determined through a row matching algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0092] Figure 1 A flow chart of a target area slice calculation method across CCDs of the present invention;
[0093] Figure 2 This is a schematic diagram of a regional slice across a CCD of the present invention;
[0094] Figure 3 This is a schematic diagram of row matching across CCDs of the present invention. DETAILED DESCRIPTION
[0095] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0096] A cross-CCD target area slice calculation method provided by the present invention includes:
[0097] Step S1: Get the target information, including the number of pixels and slice height, and calculate the starting row serial number S of the slice. start ;
[0098] Step S2: According to the target information, preliminarily calculate the initial value Y of the column number of the left endpoint of the starting row l0 、The initial value of the column number of the right endpoint Y r0 ;
[0099] Step S3: judging whether the slice crosses CCD according to the initial values of the column numbers of the left and right endpoints of the starting row and the number of pixels; if it crosses CCD, updating the starting row and column numbers; if not, no updating is required;
[0100] Step S4: Update the serial number of the slice across CCD; perform row matching on the endpoints across CCD, find the serial number with the same time code as the current row in the adjacent queue, and use it as the serial number of the left and right endpoints of the starting row;
[0101] Step S5: Calculate the CCD number, column number and serial number of the endpoint of the end row of the slice according to the updated column number, serial number and slice height of the left and right endpoints of the start row;
[0102] Step S6: Integrate the information of the target area slice across the CCD through the position information of the endpoints of the start row and the end row.
[0103] Specifically, the step S1 includes:
[0104] Step S1.1: Obtain the target information from the data collected by the CCD array, including the target point CCD number d tar , Column No. Y tar and serial number S tar , the height of the slice is H;
[0105] Step S1.2: Calculate the starting row serial number of the slice; the center point of the area slice is the target point, and the starting row serial number of the slice is S start for:
[0106] S start =S tar -H / 2.
[0107] Specifically, step S2 includes:
[0108] The target point column number is equal to the starting row center point column number Y tar , based on the slice width W, preliminary calculation:
[0109] Initial value of the column number of the left endpoint Y l0 for:
[0110] Y l0 =Y tar -W / 2
[0111] Initial value of the column number of the right endpoint Y r0 for:
[0112] Y r0 =Y tar +W / 2.
[0113] Specifically, step S3 includes:
[0114] Step S3.1: M CCDs collect data to obtain single-row linear array data composed of M CCDs; wherein the data at the same index in each queue in the array data are collected at the same time or at a nearby time, and the number of pixels of the M CCDs obtained is stored in a 1*M array Arr, where M is an integer greater than 1;
[0115] Step S3.2: Determine whether the endpoint crosses the CCD; when the column number of the left endpoint of the starting row is the initial value Y l0 When it is less than 0, it means that the left endpoint crosses CCD; when the initial value of the column number of the right endpoint of the starting row is Y r0 When it is greater than or equal to the number of CCD pixels, it means that the right endpoint crosses the CCD;
[0116] Step S3.3: Update the endpoint column number;
[0117] When the left endpoint crosses CCD, calculate the CCD number d of the left endpoint of the starting row l and column number Y l :
[0118] d l =d tar -1
[0119] Y l =Arr[d tar -1]+Y l0 , when Y l0 <0
[0120] When the right endpoint crosses CCD, calculate the CCD number d of the right endpoint of the starting row r and column number Y r :
[0121] d r =d tar +1
[0122] Y r =Y r0 -Arr[d tar ],whenY r0 ≥Arr[d tar ].
[0123] Specifically, step S4 includes:
[0124] Step S4.1: In the current queue, the serial numbers of the first pixel and the last pixel are S0 and S1 respectively. n-1 , n is the number of pixels in the queue, the queue length is n1, in the current queue, find the starting row serial number S start The corresponding data, that is, the starting row data, then the index of the starting row data in the queue is I t1 for:
[0125]
[0126] Step S4.2: In the current queue, determine I t1 Is the serial number at the same as the starting line serial number S start If they are the same, the current data is the starting row data; if it is greater than S start , then move forward a preset distance k, and then traverse one by one, that is, from I0 = I t1 -k starts traversal; if it is less than S start , then from I t1 Start traversing one by one; until you find the one that matches S start The data at the same time is the start row data, and the time code of the start row is T t ; The center point of the starting line and the left and right endpoints are collected at the same time;
[0127] Step S4.3: In adjacent queues, the time codes of the head pixel and the tail pixel are T0 and T1 respectively. n-1 , the queue length is n2, T t The time code of the current row is found in the adjacent queue with the time code T t The corresponding data, that is, the row data where the endpoint is located, then the index of the data in the queue is I t2 for:
[0128]
[0129] Step S4.4: In the adjacent queue, determine I t2 Is the time code at the same as the time code T tSame, if the same, the current data is the data at the same time; if greater than T t , then move forward a preset distance k and then traverse one by one, that is, from I0 = I t2 -k starts traversal; if it is less than T t , then from I t2 Start traversing one by one; until you find the one that matches T t The data at the same time is the data across CCD endpoints;
[0130] Update the serial number. Since the endpoint and the center point occur at the same time, the current serial number is the endpoint serial number. The serial numbers S of the left and right endpoints of the starting row are obtained. lu and S ru .
[0131] Specifically, step S5 includes:
[0132] According to the left and right endpoint information of the starting row and the slice height H, the CCD number, column number and serial number of the end point of the slice ending row are calculated;
[0133] The serial numbers of the left and right endpoints of the termination line are S ld and S rd :
[0134] S ld =S lu -H
[0135] S rd =S ru -H
[0136] For the left endpoint, the CCD number of the left endpoint of the ending row is the same as the CCD number of the left endpoint of the starting row. l Same; the column number of the left endpoint of the ending row and the column number of the left endpoint of the starting row Y l same;
[0137] For the right endpoint, the CCD number of the left endpoint of the ending row is the same as the CCD number of the left endpoint of the starting row. r Same; the column number of the left endpoint of the ending row and the column number of the left endpoint of the starting row Y r same.
[0138] Specifically, they include:
[0139] The data collected by the CCD array is received and saved by each queue using a circular queue. The circular queue is based on an array of fixed length, and uses a read pointer and a write pointer to point to the beginning and end of the array respectively. The data is read at the beginning, the data pointed to by the read pointer is read, and added at the end. After writing, the write pointer moves back one position.
[0140] The head and tail of the array are logically connected. When the pointer points to the tail of the array, it will point to the head of the array after moving again, realizing the function of a circular queue. The storage status of the queue can be determined according to the relative position of the pointer.
[0141] Example 1
[0142] like Figure 1 As shown, a target area slice calculation method across a CCD, wherein the CCD is a charge-coupled device, comprising:
[0143] Step S1: Get the target information, including the CCD number of the target point tar , Column No. Y tar and serial number S tar ;
[0144] Get the height H of the slice, use the target point as the center point of the region slice, and calculate the starting row serial number S of the slice based on the height of the slice start , the formula is:
[0145] S start =S tar -H / 2
[0146] Step S2: The target point column number is also the column number of the center point of the starting row. tar And the slice width W, preliminarily calculate the column number Y of the left and right endpoints of the starting row l0 and Y r0 , the formula is:
[0147] Y l0 =Y tar -W / 2
[0148] Y r0 =Y tar +W / 2
[0149] Among them, Y l0 May be negative.
[0150] Step S3: Calculate the initial value Y based on the left endpoint l0 , right endpoint column number Y r0 The number of pixels of the CCD where the target is located is used to determine whether the slice crosses the CCD. The number of pixels of the CCD is stored in the one-dimensional array Arr. The number of elements is the same as the number of CCDs, which is recorded as M. When the endpoint column number is not within the pixel number range, that is, Y l0 and Y r0 Not Available If the endpoint is within the range, it means that the endpoint is on an adjacent CCD, then the column numbers of the left and right endpoints are updated and the column number of the CCD where the endpoint is located is calculated.
[0151] When the left endpoint crosses the CCD, the left endpoint CCD number d l and column number Y l for:
[0152] d l =d tar -1
[0153] Y l =Arr[d tar -1]+Y l0 , when Y l0 <0
[0154] When the right endpoint crosses the CCD, the right endpoint CCD number d r and column number Y r for:
[0155] d r =d tar +1
[0156] Y r =Y r0 -Arr[d tar ],when Y r0 ≥Arr[d tar ]
[0157] like Figure 2 As shown, the schematic diagram of regional slicing across CCD:
[0158] Step S4: In the slice, the center point and the endpoint of the same row of data are collected at the same time. However, when the endpoint and the target point are not in the same CCD, the time code of the same row of data in adjacent CCDs is not necessarily the same as the target time code. Therefore, matching is required to find the serial number in the adjacent queue that is the same as the collection time of the current target, which is the serial number of the endpoint.
[0159] The data cache queue is customized based on a fixed-length array. The read pointer and write pointer are used to point to the beginning and end of the array respectively. The data is read at the beginning, the data pointed to by the read pointer is read, and the data is added at the end. After writing, the write pointer moves back one position. The beginning and end of the array are logically connected, that is, when the pointer points to the end of the array, it will point to the beginning of the array after moving again, realizing the function of the circular queue, and the data storage status of the queue can be judged according to the relative position of the pointer, such as the queue is empty, the queue overflows, and the queue length is calculated as follows:
[0160] n=(back-front+maxsize)%maxsize
[0161] Among them, back represents the write pointer at the tail end of the queue, front represents the read pointer at the head end of the queue, and maxsize represents the fixed length of the array.
[0162] Next, calculate the serial number S of the left and right endpoints of the starting row lu and S ru .
[0163] like Figure 3 As shown, the row matching diagram when crossing CCD:
[0164] Perform row matching on the endpoints across CCDs and find the corresponding data in the adjacent queues; in the slice, the center point and the endpoints of the same row are collected at the same time. When the endpoint and the target point are not in the same CCD, since the collection time of the same row of data in adjacent CCDs may not be the same, row matching is required to find the serial number in the adjacent queue that is the same as the collection time of the current target to ensure that the center point of the starting row and the left and right endpoints are collected at the same time.
[0165] In the current queue, the serial numbers of the first pixel and the last pixel are S0 and S1 respectively. n-1 , the queue length is n1, S t is the serial number of the starting row. In the current queue, search for the row with the same serial number S t The corresponding data, that is, the starting row data, then the index of the data in the queue is I t1 for:
[0166]
[0167] In the current queue, first check I t1 Is the serial number at the same as the starting line serial number S t If they are the same, then the search will hit the target in one go, and the current data will be the starting row data; if it is greater than S t , then move forward a certain distance k and then traverse one by one, that is, from I0 = I t1 -k starts traversal; if it is less than S t , then start traversing one by one. Find the t The data at the same time, the current time code is T t .
[0168] In adjacent queues, the time codes of the head pixel and the tail pixel are T0 and T2 respectively. n-1 , the queue length is n2, T t The time code of the current row is found in the adjacent queue with the time code T t The corresponding data, that is, the row data where the endpoint is located, then the index of the data in the queue is I t2 for:
[0169]
[0170] The process is the same. In the adjacent queue, first check It2 Is the time code at the same as the time code T t If they are the same, then the search will hit the target in one go, and the current data is the data at the same time; if it is greater than T t , then move forward a certain distance k and then traverse one by one, that is, from I0 = I t2 -k starts traversal; if it is less than T t , then start traversing one by one. Find the t The data at the same time is the data across the CCD endpoints. The current serial number is the endpoint serial number, and the serial numbers S of the left and right endpoints of the starting row are obtained. lu and S ru . Among them, the center point and the left and right endpoints refer to the points in the same row, with the same sampling time and the same serial number. Ideally (each CCD has the same sampling frequency and there is no loss of data), the index of the sampling points at the same time in the cache queue should also be the same. In actual situations, the sampling frequencies of each CCD are different, and the positions of the sampling points at the same time in the cache queue are not necessarily the same. Therefore, when the slice crosses CCDs, it is necessary to perform row matching based on the basis of "occurring at the same time" and update the serial numbers of the endpoints at different CCDs.
[0171] Step S5: Calculate the CCD number, column number and serial number of the endpoint of the end row of the slice according to the left and right endpoint information of the starting row and the slice height. For the left endpoint, the CCD number and column number of the left endpoint of the starting row and the end row are equal; similarly, for the right endpoint, the CCD number and column number of the right endpoint of the starting row and the end row are also equal. The serial numbers of the left and right endpoints of the end row are S ld and S rd :
[0172] S ld =S lu -H
[0173] S rd =S ru -H
[0174] At this point, based on the center point position information, slice size, and CCD pixel number, the position information of the four corner points of the slice is calculated, including the CCD number, column number, and serial number, and the slice calculation method across CCDs is analyzed in detail.
[0175] Example 2
[0176] A cross-CCD target area slice calculation method, comprising:
[0177] Step 1: Get the target information, including the target point CCD number, column number and serial number, and calculate the starting row serial number of the slice according to the height of the slice;
[0178] Step 2: The column number of the target point is also the column number of the center point of the starting row. According to the column number of the target point and the slice width, the column numbers of the left and right endpoints of the starting row are preliminarily calculated;
[0179] Step 3: According to the initial calculation value of the column number of the left and right endpoints and the number of pixels of the CCD where the target is located, determine whether the slice crosses the CCD. When the column number of the endpoint is not within the pixel number range, it means that the endpoint is on an adjacent CCD, then update the column number of the left and right endpoints and calculate the column number of the CCD where the endpoint is located;
[0180] Step 4: Update the serial number of the endpoint, perform row matching on the endpoints across the CCD, and find the serial number with the same time code as the current row in the adjacent queue as the serial number of the endpoint;
[0181] Step 5: Calculate the CCD number, column number and serial number of the endpoint of the end row of the slice according to the left and right endpoint information of the starting row and the slice height;
[0182] Step 6: Integrate the information of the target area slice across the CCD through the position information of the start row and the end row endpoints.
[0183] Specifically, the data used is collected by M CCDs. The present invention only discusses a single-row linear array composed of M CCDs. The collected data is stored and transmitted by M queues respectively. The queues are independent of each other. The data at the same index in the queue is not necessarily collected at the same time, but may be collected at adjacent times. The number of pixels of the M CCDs is stored in a 1*M array and can be added according to the actual installation of the camera array.
[0184] Specifically, based on the target point and the slice width, the column numbers of the left and right endpoints are preliminarily calculated, and it is determined whether the endpoints cross the CCD; based on the number of CCD pixels in the note number parameter, the column number of the endpoints that cross the CCD is updated. The column number of the target point is equal to the column number of the center point of the starting row. Based on the width of the slice, the column numbers of the left and right endpoints of the starting row are preliminarily calculated. When the column number of the left endpoint is less than 0, it means that the left endpoint crosses the CCD; when the column number of the right endpoint is greater than the CCD pixel range, it means that the right endpoint crosses the CCD. When the left endpoint crosses the CCD, the column number of the left endpoint on the left CCD is calculated based on the initial value of the left endpoint column number and the number of adjacent CCD pixels on the left; when the right endpoint crosses the CCD, the column number of the right endpoint on the right CCD is calculated based on the initial value of the right endpoint column number and the current number of CCD pixels.
[0185] Specifically, row matching is performed on the endpoints across CCDs, and the corresponding data is found in the adjacent queues. In the slice, the center point and the endpoints of the same row are collected at the same time. When the endpoint and the target point are not in the same CCD, since the collection time of the same row of data in adjacent CCDs is not necessarily the same, row matching is required to find the serial number in the adjacent queue that is the same as the collection time of the current target to ensure that the center point of the starting row and the left and right endpoints are collected at the same time.
[0186] Specifically, according to the target serial number, an optimized calculation combined with traversal method is used to search for the time code corresponding to the current row. When the slice crosses CCD, it is necessary to perform row matching on the endpoints across CCD, and the occurrence time of the endpoints is the same as that of the center point. Therefore, it is necessary to calculate the occurrence time of the center point based on the center point serial number, and this process searches the target in the current queue. The center point data is stored in the queue, and searching it one by one is bound to require a high time cost. Therefore, first calculate the approximate range of the center point in the queue based on the serial number of the center point and the serial numbers of the first and last elements of the queue; then, use the traversal method within a small range to find the time code corresponding to the target serial number.
[0187] Specifically, according to the target time code, an optimized calculation combined with a traversal method is used to search for the serial number corresponding to the current moment. When performing row matching on endpoints across CCDs, the occurrence time of the endpoints and the center point is the same, that is, the occurrence time of the center point is also the occurrence time of the endpoints. Therefore, it is necessary to search for the serial number corresponding to the same time in the data queue of the adjacent CCD according to the center point time code, that is, the serial number across the CCD endpoints. First, the search range is greatly narrowed based on the time code and the time code of the first and last elements of the queue; then, a traversal search is performed within a small range.
[0188] Specifically, a circular queue is used to receive and save data. The circular queue is based on an array of fixed length. The read pointer and write pointer are used to point to the beginning and end of the array respectively. The data is read at the beginning, the data pointed to by the read pointer is read, and the data is added at the end. After writing, the write pointer moves back one position. The beginning and end of the array are logically connected, that is, when the pointer points to the end of the array, it will point to the beginning of the array after moving again, realizing the function of the circular queue, and the storage status of the queue can be judged according to the relative position of the pointer. The length of the array is fixed to ensure that the memory is safe and controllable.
[0189] The present invention also provides a cross-CCD target area slicing calculation system, which can be implemented by executing the process steps of the cross-CCD target area slicing calculation method, that is, those skilled in the art can understand the cross-CCD target area slicing calculation method as a preferred implementation of the cross-CCD target area slicing calculation system.
[0190] A cross-CCD target area slice calculation system, comprising: module M1: obtain target information and calculate the starting row serial number S of the slice start ; Module M2: According to the target information, preliminarily calculate the initial value Y of the column number of the left endpoint of the starting row l0 、The initial value of the column number of the right endpoint Y r0 ; Module M3: Determine whether the slice crosses the CCD based on the initial column number and the number of pixels of the left and right endpoints of the starting row; if it crosses the CCD, update the starting row and column numbers, if not, no update is required; Module M4: Update the serial number of the slice that crosses the CCD; perform row matching on the endpoints that cross the CCD, and find the serial number with the same time code as the current row in the adjacent queue as the serial number of the left and right endpoints of the starting row; Module M5: Calculate the CCD number, column number and serial number of the endpoint of the terminating row of the slice based on the updated column number, serial number and slice height of the left and right endpoints of the starting row; Module M6: Integrate the information of the slice of the target area that crosses the CCD through the position information of the endpoints of the starting row and the terminating row.
[0191] Specifically, the module M1 includes: Module M1.1: Obtaining target information from the data collected by the CCD array, including the target point CCD number d tar , Column No. Y tar and serial number S tar , the height of the slice is H; Module M1.2: Calculate the starting row serial number of the slice; the center point of the regional slice is the target point, and the starting row serial number of the slice is S start for:
[0192] S start =S tar -H / 2
[0193] The module M2 includes: the target point column number is equal to the starting row center point column number Y tar , based on the slice width W, preliminary calculation:
[0194] Initial value of the column number of the left endpoint Y l0 for:
[0195] Y l0 =Y tar -W / 2
[0196] Initial value of the column number of the right endpoint Y r0 for:
[0197] Y r0 =Y tar +W / 2.
[0198] Specifically, the module M4 includes: Module M4.1: In the current queue, the serial numbers of the head pixel and the tail pixel are S0 and S1 respectively. n-1, n is the number of pixels in the queue, the queue length is n1, in the current queue, find the starting row serial number S start The corresponding data, that is, the starting row data, then the index of the starting row data in the queue is I t1 for:
[0199]
[0200] Module M4.2: In the current queue, determine I t1 Is the serial number at the same as the starting line serial number S start If they are the same, the current data is the starting row data; if it is greater than S start , then move forward a preset distance k, and then traverse one by one, that is, from I0 = I t1 -k starts traversal; if it is less than S start , then from I t1 Start traversing one by one; until you find the one that matches S start The data at the same time is the start row data, and the time code of the start row is T t ; The center point of the starting row and the left and right endpoints are collected at the same time; Module M4.3: In adjacent queues, the time codes of the head pixel and the tail pixel are T0 and T1 respectively. n-1 , the queue length is n2, T t The time code of the current row is found in the adjacent queue with the time code T t The corresponding data, that is, the row data where the endpoint is located, then the index of the data in the queue is I t2 for:
[0201]
[0202] Module M4.4: In adjacent queues, determine I t2 Is the time code at the same as the time code T t Same, if the same, the current data is the data at the same time; if greater than T t , then move forward a preset distance k and then traverse one by one, that is, from I0 = I t2 -k starts traversal; if it is less than T t , then from I t2 Start traversing one by one; until you find the one that matches T t The data at the same time is the data of the cross-CCD endpoints; since the endpoints and the center point occur at the same time, the current serial number is the endpoint serial number, and the serial number is updated to obtain the serial numbers S of the left and right endpoints of the starting row. lu and S ru .
[0203] The module M5 includes: calculating the CCD number, column number and serial number of the endpoint of the end row of the slice according to the left and right endpoint information of the starting row and the slice height H; the serial numbers of the left and right endpoints of the end row are S respectively ld and S rd :
[0204] S ld =S lu -H
[0205] S rd =S ru -H
[0206] For the left endpoint, the CCD number of the left endpoint of the ending row is the same as the CCD number of the left endpoint of the starting row. l Same; the column number of the left endpoint of the ending row and the column number of the left endpoint of the starting row Y l Same; for the right endpoint, the CCD number of the left endpoint of the ending row is the same as the CCD number of the left endpoint of the starting row. r Same; the column number of the left endpoint of the ending row and the column number of the left endpoint of the starting row Y r same.
[0207] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.
[0208] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A cross-CCD target area slice calculation method, characterized in that: include: Step S1: Get the target information and calculate the starting row serial number S of the slice start ; Step S2: According to the target information, preliminarily calculate the initial value Y of the column number of the left endpoint of the starting row l0 、The initial value of the column number of the right endpoint Y r0 ; Step S3: judging whether the slice crosses CCD according to the initial values of the column numbers of the left and right endpoints of the starting row and the number of pixels; if it crosses CCD, updating the starting row and column numbers; if not, no updating is required; Step S4: Update the serial number of the slice across CCD; perform row matching on the endpoints across CCD, find the serial number with the same time code as the current row in the adjacent queue, and use it as the serial number of the left and right endpoints of the starting row; Step S5: Calculate the CCD number, column number and serial number of the endpoint of the end row of the slice according to the updated column number, serial number and slice height of the left and right endpoints of the start row; Step S6: Integrate the information of the target area slice across the CCD through the position information of the endpoints of the start row and the end row.
2. The cross-CCD target area slice calculation method according to claim 1, characterized in that: The step S1 comprises: Step S1.1: Obtain the target information from the data collected by the CCD array, including the target point CCD number d tar , Column No. Y tar and serial number S tar , the height of the slice is H; Step S1.2: Calculate the starting row serial number of the slice; the center point of the area slice is the target point, and the starting row serial number of the slice is S start for: S start =S tar -H / 2。 3. The cross-CCD target area slice calculation method according to claim 1, characterized in that: The step S2 comprises: The target point column number is equal to the starting row center point column number Y tar , based on the slice width W, preliminary calculation: Initial value of the column number of the left endpoint Y l0 for: Y l0 =Y tar -W / 2 Initial value of the column number of the right endpoint Y r0 for: Y r0 =Y tar +W / 2。 4. The cross-CCD target area slice calculation method according to claim 1, characterized in that: The step S3 comprises: Step S3.1: M CCDs collect data to obtain single-row linear array data composed of M CCDs; wherein the data at the same index in each queue in the array data are collected at the same time or at a nearby time, and the number of pixels of the M CCDs obtained is stored in a 1*M array Arr, where M is an integer greater than 1; Step S3.2: Determine whether the endpoint crosses the CCD; when the column number of the left endpoint of the starting row is the initial value Y l0 When it is less than 0, it means that the left endpoint crosses CCD; when the initial value of the column number of the right endpoint of the starting row is Y r0 When it is greater than or equal to the number of CCD pixels, it means that the right endpoint crosses the CCD; Step S3.3: Update the endpoint column number; When the left endpoint crosses CCD, calculate the CCD number d of the left endpoint of the starting row l and column number Y l : d l =d tar -1 Y l =Arr[d tar -1]+Y l0 ,when Y l0 <0 When the right endpoint crosses CCD, calculate the CCD number d of the right endpoint of the starting row r and column number Y r : d r =d tar +1 Y r =Y r0 -Arr[d tar ],when Y r0 ≥Arr[d tar ]。 5. The cross-CCD target area slice calculation method according to claim 1, characterized in that: The step S4 comprises: Step S4.1: In the current queue, the serial numbers of the first pixel and the last pixel are S0 and S1 respectively. n-1 , n is the number of pixels in the queue, the queue length is n1, in the current queue, find the starting row serial number S start The corresponding data, that is, the starting row data, then the index of the starting row data in the queue is I t1 for: Step S4.2: In the current queue, determine I t1 Is the serial number at the same as the starting line serial number S start If they are the same, the current data is the starting row data; if it is greater than S start , then move forward a preset distance k, and then traverse one by one, that is, from I0 = I t1 -k starts traversal; if it is less than S start , then from I t1 Start traversing one by one; until you find the one that matches S start The data at the same time is the start row data, and the time code of the start row is T t ; The center point of the starting line and the left and right endpoints are collected at the same time; Step S4.3: In adjacent queues, the time codes of the head pixel and the tail pixel are T0 and T1 respectively. n-1 , the queue length is n2, T t The time code of the current row is found in the adjacent queue with the time code T t The corresponding data, that is, the row data where the endpoint is located, then the index of the data in the queue is I t2 for: Step S4.4: In the adjacent queue, determine I t2 Is the time code at the same as the time code T t Same, if the same, the current data is the data at the same time; if greater than T t , then move forward a preset distance k and then traverse one by one, that is, from I0 = I t2 -k starts traversal; if it is less than T t , then from I t2 Start traversing one by one; until you find the one that matches T t The data at the same time is the data across CCD endpoints; Update the serial number. Since the endpoint and the center point occur at the same time, the current serial number is the endpoint serial number. The serial numbers S of the left and right endpoints of the starting row are obtained. lu and S ru .
6. The cross-CCD target area slice calculation method according to claim 1, characterized in that: The step S5 comprises: According to the left and right endpoint information of the starting row and the slice height H, the CCD number, column number and serial number of the end point of the slice ending row are calculated; The serial numbers of the left and right endpoints of the termination line are S ld and S rd : S ld =S lu -H S rd =S ru -H For the left endpoint, the CCD number of the left endpoint of the ending row is the same as the CCD number of the left endpoint of the starting row. l Same; the column number of the left endpoint of the ending row and the column number of the left endpoint of the starting row Y l same; For the right endpoint, the CCD number of the left endpoint of the ending row is the same as the CCD number of the left endpoint of the starting row. r Same; the column number of the left endpoint of the ending row and the column number of the left endpoint of the starting row Y r same.
7. The cross-CCD target area slice calculation method according to claim 2, characterized in that: include: For the data collected by the CCD array, each queue uses a circular queue to receive and save data; The circular queue is based on an array of fixed length, using a read pointer and a write pointer to point to the beginning and end of the array respectively. Data is read at the beginning, the data pointed to by the read pointer is read, and added at the end. After writing, the write pointer moves back one position; The head and tail of the array are logically connected. When the pointer points to the tail of the array, it will point to the head of the array after moving again, realizing the function of a circular queue. The storage status of the queue can be determined according to the relative position of the pointer.
8. A cross-CCD target area slice calculation system, characterized in that: include: Module M1: Get the target information and calculate the starting row serial number S of the slice start ; Module M2: Based on the target information, preliminarily calculate the initial value Y of the column number of the left endpoint of the starting row l0 、The initial value of the column number of the right endpoint Y r0 ; Module M3: Determine whether the slice crosses CCD according to the initial values of the column numbers and the number of pixels at the left and right endpoints of the starting row; if it crosses CCD, update the starting row and column numbers; if not, no update is required; Module M4: Update the slice serial number across CCD; perform row matching on the endpoints across CCD, find the serial number with the same time code as the current row in the adjacent queue, and use it as the serial number of the left and right endpoints of the starting row; Module M5: Calculate the CCD number, column number and serial number of the endpoint of the end row of the slice according to the column number, serial number and slice height of the left and right endpoints of the updated start row; Module M6: Integrate the information of the target area slice across the CCD through the position information of the start row and the end row endpoints.
9. The cross-CCD target area slice calculation system according to claim 8, characterized in that: The module M1 comprises: Module M1.1: Obtain target information from the data collected by the CCD array, including the target point CCD number d tar , Column No. Y tar and serial number S tar , the height of the slice is H; Module M1.2: Calculate the starting row serial number of the slice; the center point of the regional slice is the target point, and the starting row serial number of the slice is S start for: S start =S tar -H / 2 The module M2 comprises: The target point column number is equal to the starting row center point column number Y tar , based on the slice width W, preliminary calculation: Initial value of the column number of the left endpoint Y l0 for: Y l0 =Y tar -W / 2 Initial value of the column number of the right endpoint Y r0 for: Y r0 =Y tar +W / 2。 10. The cross-CCD target area slice calculation system according to claim 8, characterized in that: The module M4 comprises: Module M4.1: In the current queue, the serial numbers of the first pixel and the last pixel are S0 and S1 respectively. n-1 , n is the number of pixels in the queue, the queue length is n1, in the current queue, find the starting row serial number S start The corresponding data, that is, the starting row data, then the index of the starting row data in the queue is I t1 for: Module M4.2: In the current queue, determine I t1 Is the serial number at the same as the starting line serial number S start If they are the same, the current data is the starting row data; if it is greater than S start , then move forward a preset distance k, and then traverse one by one, that is, from I0 = I t1 -k starts traversal; if it is less than S start , then from I t1 Start traversing one by one; until you find the one that matches S start The data at the same time is the start row data, and the time code of the start row is T t ; The center point of the starting line and the left and right endpoints are collected at the same time; Module M4.3: In adjacent queues, the time codes of the head pixel and the tail pixel are T0 and T1 respectively. n-1 , the queue length is n2, T t The time code of the current row is found in the adjacent queue with the time code T t The corresponding data, that is, the row data where the endpoint is located, then the index of the data in the queue is I t2 for: Module M4.4: In adjacent queues, determine I t2 Is the time code at the same as the time code T t Same, if the same, the current data is the data at the same time; if greater than T t , then move forward a preset distance k and then traverse one by one, that is, from I0 = I t2 -k starts traversal; if it is less than T t , then from I t2 Start traversing one by one; until you find the one that matches T t The data at the same time is the data across CCD endpoints; Update the serial number. Since the endpoint and the center point occur at the same time, the current serial number is the endpoint serial number. The serial numbers S of the left and right endpoints of the starting row are obtained. lu and S ru . The module M5 comprises: According to the left and right endpoint information of the starting row and the slice height H, the CCD number, column number and serial number of the end point of the slice ending row are calculated; The serial numbers of the left and right endpoints of the termination line are S ld and S rd : S ld =S lu -H S rd =S ru -H For the left endpoint, the CCD number of the left endpoint of the ending row is the same as the CCD number of the left endpoint of the starting row. l Same; the column number of the left endpoint of the ending row and the column number of the left endpoint of the starting row Y l same; For the right endpoint, the CCD number of the left endpoint of the ending row is the same as the CCD number of the left endpoint of the starting row. r Same; the column number of the left endpoint of the ending row and the column number of the left endpoint of the starting row Y r same.
Citation Information
Patent Citations
Method for positioning and extracting images of point target of satellite-borne area
CN104252624A
Material image line-by-line real-time segmentation method for linear array camera
CN114066898A