[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BQMZG7RPVZA07F0K8QVWHC":3,"skill-same:01M7BQMZG7RPVZA07F0K8QVWHC":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7BQMZG7RPVZA07F0K8QVWHC","dyn-object-masks",null,"Generate dynamic-object binary masks after global motion compensation, output CSR sparse format.","linyouxue\u002Fskill-repair-benchmark","linyouxue","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F216151464?v=4","01M7BJEVCXKD74KH6FG9CBVSQB","林宥学","01M7BJEVE02NP217V93BKZFC0J",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fevaluation\u002Fdata\u002Fskillsbench87\u002Freferences\u002Fdynamic-object-aware-egomotion\u002Fskills\u002Fdyn-object-masks\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: dyn-object-masks\ndescription: \"Generate dynamic-object binary masks after global motion compensation, output CSR sparse format.\"\n---\n\n# When to use\n- Detect moving objects in scenes with camera motion; produce sparse masks aligned to sampled frames.\n\n# Frame-to-mask assignment contract\n- For sampled frames `frames[0:N]`, compute forward motion evidence from `frames[i]` to `frames[i+1]` and store the resulting source-frame mask as `f_i`.\n- Produce exactly one mask for every sampled frame. For `f_{N-1}`, propagate or copy the last valid mask estimate, or compute an aligned backward estimate when appropriate.\n- Do not make `f_0` empty merely because there is no preceding frame. It has valid forward evidence from `frames[0]` to `frames[1]`.\n- Keep this assignment consistent through temporal filtering and CSR serialization; do not shift pairwise evidence by one index.\n\n# Workflow\n1) **Dense observed motion**: compute dense optical flow from each sampled frame to the next (for example, Farneback). Pairwise intensity difference may be used as supporting evidence, but not as the primary detector when the camera moves.\n2) **Dedicated projective global-motion model**: for mask compensation, estimate a homography from `frames[i]` to `frames[i+1]` using spatially distributed correspondences and robust outlier rejection, then convert it into expected background flow at every valid pixel. Do not reuse a partial affine transform selected for motion-label classification as the default mask model: affine or spatial-median flow is only a documented fallback after the homography fails finite, non-degeneracy, inlier-support, or valid-warp checks. The motion classifier and mask compensator may deliberately use different transforms.\n3) **Residual-flow evidence**: subtract the expected global flow from the observed dense flow and threshold the residual magnitude. Use a distribution-aware threshold with a small flow floor so interpolation, compression, and low-amplitude noise are not promoted to foreground.\n4) **Valid region and edge suppression**: exclude pixels whose transformed coordinates fall outside the image and suppress a resolution-scaled outer margin where warping artifacts dominate.\n5) **Morphology + area filter**: open then close; keep connected components above a minimum area scaled to image size. If filtering removes every component even though coherent residual evidence remains, retain the unfiltered coherent mask rather than returning an unconditional empty mask.\n6) **Temporal propagation**: maintain a confidence map, move it from its source-frame coordinates into the current-frame coordinates, decay it, and fuse it numerically with current residual evidence before thresholding. Do not replace this with a sequence-level IoU gate followed by a one-off boolean OR: that discards useful history precisely when a mask is sparse or displaced.\n7) **CSR encoding**: for each final bool mask\n   - `rows, cols = nonzero(mask)`\n   - `indices = cols.astype(int32)`; `data = ones(nnz, uint8)`\n   - `counts = bincount(rows, minlength=H)`; `indptr = cumsum(counts, prepend=0)`\n   - store as `f_{i}_data\u002Findices\u002Findptr`\n\n# Robust residual-flow sketch\n```python\nflow = cv2.calcOpticalFlowFarneback(\n    prev_gray, curr_gray, None,\n    pyr_scale=0.5, levels=3, winsize=15,\n    iterations=3, poly_n=5, poly_sigma=1.2, flags=0,\n)\n\n# Estimate a dedicated projective transform for the mask branch, for example:\n# H_mat, inliers = cv2.findHomography(src_pts, dst_pts, cv2.RANSAC, reproj_px)\n# Validate that H_mat is finite\u002Fnon-degenerate and has adequate distributed\n# inlier support. Fall back only when those checks fail.\nif H_mat is not None:\n    yy, xx = np.mgrid[0:H_img, 0:W_img].astype(np.float32)\n    points = np.stack([xx, yy, np.ones_like(xx)], axis=-1)\n    warped = points.reshape(-1, 3) @ H_mat.T\n    warped = warped.reshape(H_img, W_img, 3)\n    expected_x = warped[..., 0] \u002F (warped[..., 2] + 1e-8) - xx\n    expected_y = warped[..., 1] \u002F (warped[..., 2] + 1e-8) - yy\nelse:\n    expected_x = np.full((H_img, W_img), np.median(flow[..., 0]))\n    expected_y = np.full((H_img, W_img), np.median(flow[..., 1]))\n\nresidual = np.hypot(flow[..., 0] - expected_x, flow[..., 1] - expected_y)\nthreshold = max(flow_floor, residual[valid].std() * residual_sigma)\nraw = (residual > threshold) & valid & interior_mask\n\nm = cv2.morphologyEx(raw.astype(np.uint8), cv2.MORPH_OPEN, kernel)\nm = cv2.morphologyEx(m, cv2.MORPH_CLOSE, kernel)\nmask = filter_connected_components(m, min_area_fraction)\n\nclass TemporalTracker:\n    def __init__(self, decay=0.7, decision_level=0.3):\n        self.confidence = None\n        self.decay = decay\n        self.decision_level = decision_level\n\n    def update(self, current_mask, flow_prev_to_current=None):\n        current = current_mask.astype(np.float32)\n        if self.confidence is None:\n            self.confidence = current\n        else:\n            propagated = warp_forward_confidence(\n                self.confidence, flow_prev_to_current,\n                border_value=0,\n            )\n            propagated *= self.decay\n            self.confidence = np.maximum(current, propagated)\n        refined = self.confidence >= self.decision_level\n        return cv2.morphologyEx(\n            refined.astype(np.uint8), cv2.MORPH_CLOSE,\n            np.ones((3, 3), np.uint8),\n        ).astype(bool)\n\n# pair_flow[i] and raw_mask[i] are evidence for source sampled frame i.\n# When updating f_i for i>0, propagate prior state with pair_flow[i-1], which\n# maps sampled frame i-1 into sampled frame i. For the final sampled frame,\n# propagate once with the last available pair flow and no new forward evidence.\n```\n\n# Observable quality gate without ground truth\n- Record, for every sampled frame, raw\u002Fpostprocessed\u002Ftracked foreground ratios, connected-component count, residual-flow quantiles, and whether the projective model passed its support checks.\n- Flag repeated empty or near-empty postprocessed masks when coherent raw residual components persist; also flag an isolated occupancy spike that is an extreme outlier relative to the positive-occupancy sequence, or repeated zero\u002Fnonzero toggling while motion statistics remain smooth.\n- If a flag fires, re-check homography support, flow direction, expected-flow construction, threshold scale, edge validity, morphology, and component filtering, then re-estimate or use the documented fallback before serialization. Do not fabricate foreground merely to satisfy this check.\n\n# Self-check\n- [ ] `f_i` uses evidence assigned to sampled frame `i`; pairwise results are not shifted by one frame.\n- [ ] There is one mask per sampled frame, including evidence-based handling of the first frame and propagation\u002Faligned handling of the final frame.\n- [ ] Dynamic evidence is residual motion after removing global camera motion, not raw photometric difference alone.\n- [ ] The mask branch uses a dedicated projective homography when perspective\u002Fscale motion is present; any fallback is deliberate and documented.\n- [ ] Masks only cover valid\u002Finterior pixels; edge warping artifacts are suppressed.\n- [ ] Temporal propagation uses correctly aligned, decaying confidence rather than an IoU-gated boolean OR.\n- [ ] Foreground ratios and frame-to-frame changes are inspected for systematic over-segmentation, repeated empty\u002Ftiny-mask collapse, isolated spikes, and excessive flicker; detected collapse triggers re-estimation before submission.\n- [ ] `shape` is `[H, W]` int32; `len(indptr)==H+1`; `indptr[-1]==indices.size`; indices remain in `[0, W)`.\n","# When to use\n- Detect moving objects in scenes with camera motion; produce sparse masks aligned to sampled frames.\n\n# Frame-to-mask assignment contract\n- For sampled frames `frames[0:N]`, compute forward motion evidence from `frames[i]` to `frames[i+1]` and store the resulting source-frame mask as `f_i`.\n- Produce exactly one mask for every sampled frame. For `f_{N-1}`, propagate or copy the last valid mask estimate, or compute an aligned backward estimate when appropriate.\n- Do not make `f_0` empty merely because there is no preceding frame. It has valid forward evidence from `frames[0]` to `frames[1]`.\n- Keep this assignment consistent through temporal filtering and CSR serialization; do not shift pairwise evidence by one index.\n\n# Workflow\n1) **Dense observed motion**: compute dense optical flow from each sampled frame to the next (for example, Farneback). Pairwise intensity difference may be used as supporting evidence, but not as the primary detector when the camera moves.\n2) **Dedicated projective global-motion model**: for mask compensation, estimate a homography from `frames[i]` to `frames[i+1]` using spatially distributed correspondences and robust outlier rejection, then convert it into expected background flow at every valid pixel. Do not reuse a partial affine transform selected for motion-label classification as the default mask model: affine or spatial-median flow is only a documented fallback after the homography fails finite, non-degeneracy, inlier-support, or valid-warp checks. The motion classifier and mask compensator may deliberately use different transforms.\n3) **Residual-flow evidence**: subtract the expected global flow from the observed dense flow and threshold the residual magnitude. Use a distribution-aware threshold with a small flow floor so interpolation, compression, and low-amplitude noise are not promoted to foreground.\n4) **Valid region and edge suppression**: exclude pixels whose transformed coordinates fall outside the image and suppress a resolution-scaled outer margin where warping artifacts dominate.\n5) **Morphology + area filter**: open then close; keep connected components above a minimum area scaled to image size. If filtering removes every component even though coherent residual evidence remains, retain the unfiltered coherent mask rather than returning an unconditional empty mask.\n6) **Temporal propagation**: maintain a confidence map, move it from its source-frame coordinates into the current-frame coordinates, decay it, and fuse it numerically with current residual evidence before thresholding. Do not replace this with a sequence-level IoU gate followed by a one-off boolean OR: that discards useful history precisely when a mask is sparse or displaced.\n7) **CSR encoding**: for each final bool mask\n   - `rows, cols = nonzero(mask)`\n   - `indices = cols.astype(int32)`; `data = ones(nnz, uint8)`\n   - `counts = bincount(rows, minlength=H)`; `indptr = cumsum(counts, prepend=0)`\n   - store as `f_{i}_data\u002Findices\u002Findptr`\n\n# Robust residual-flow sketch\n```python\nflow = cv2.calcOpticalFlowFarneback(\n    prev_gray, curr_gray, None,\n    pyr_scale=0.5, levels=3, winsize=15,\n    iterations=3, poly_n=5, poly_sigma=1.2, flags=0,\n)\n\n# Estimate a dedicated projective transform for the mask branch, for example:\n# H_mat, inliers = cv2.findHomography(src_pts, dst_pts, cv2.RANSAC, reproj_px)\n# Validate that H_mat is finite\u002Fnon-degenerate and has adequate distributed\n# inlier support. Fall back only when those checks fail.\nif H_mat is not None:\n    yy, xx = np.mgrid[0:H_img, 0:W_img].astype(np.float32)\n    points = np.stack([xx, yy, np.ones_like(xx)], axis=-1)\n    warped = points.reshape(-1, 3) @ H_mat.T\n    warped = warped.reshape(H_img, W_img, 3)\n    expected_x = warped[..., 0] \u002F (warped[..., 2] + 1e-8) - xx\n    expected_y = warped[..., 1] \u002F (warped[..., 2] + 1e-8) - yy\nelse:\n    expected_x = np.full((H_img, W_img), np.median(flow[..., 0]))\n    expected_y = np.full((H_img, W_img), np.median(flow[..., 1]))\n\nresidual = np.hypot(flow[..., 0] - expected_x, flow[..., 1] - expected_y)\nthreshold = max(flow_floor, residual[valid].std() * residual_sigma)\nraw = (residual > threshold) & valid & interior_mask\n\nm = cv2.morphologyEx(raw.astype(np.uint8), cv2.MORPH_OPEN, kernel)\nm = cv2.morphologyEx(m, cv2.MORPH_CLOSE, kernel)\nmask = filter_connected_components(m, min_area_fraction)\n\nclass TemporalTracker:\n    def __init__(self, decay=0.7, decision_level=0.3):\n        self.confidence = None\n        self.decay = decay\n        self.decision_level = decision_level\n\n    def update(self, current_mask, flow_prev_to_current=None):\n        current = current_mask.astype(np.float32)\n        if self.confidence is None:\n            self.confidence = current\n        else:\n            propagated = warp_forward_confidence(\n                self.confidence, flow_prev_to_current,\n                border_value=0,\n            )\n            propagated *= self.decay\n            self.confidence = np.maximum(current, propagated)\n        refined = self.confidence >= self.decision_level\n        return cv2.morphologyEx(\n            refined.astype(np.uint8), cv2.MORPH_CLOSE,\n            np.ones((3, 3), np.uint8),\n        ).astype(bool)\n\n# pair_flow[i] and raw_mask[i] are evidence for source sampled frame i.\n# When updating f_i for i>0, propagate prior state with pair_flow[i-1], which\n# maps sampled frame i-1 into sampled frame i. For the final sampled frame,\n# propagate once with the last available pair flow and no new forward evidence.\n```\n\n# Observable quality gate without ground truth\n- Record, for every sampled frame, raw\u002Fpostprocessed\u002Ftracked foreground ratios, connected-component count, residual-flow quantiles, and whether the projective model passed its support checks.\n- Flag repeated empty or near-empty postprocessed masks when coherent raw residual components persist; also flag an isolated occupancy spike that is an extreme outlier relative to the positive-occupancy sequence, or repeated zero\u002Fnonzero toggling while motion statistics remain smooth.\n- If a flag fires, re-check homography support, flow direction, expected-flow construction, threshold scale, edge validity, morphology, and component filtering, then re-estimate or use the documented fallback before serialization. Do not fabricate foreground merely to satisfy this check.\n\n# Self-check\n- [ ] `f_i` uses evidence assigned to sampled frame `i`; pairwise results are not shifted by one frame.\n- [ ] There is one mask per sampled frame, including evidence-based handling of the first frame and propagation\u002Faligned handling of the final frame.\n- [ ] Dynamic evidence is residual motion after removing global camera motion, not raw photometric difference alone.\n- [ ] The mask branch uses a dedicated projective homography when perspective\u002Fscale motion is present; any fallback is deliberate and documented.\n- [ ] Masks only cover valid\u002Finterior pixels; edge warping artifacts are suppressed.\n- [ ] Temporal propagation uses correctly aligned, decaying confidence rather than an IoU-gated boolean OR.\n- [ ] Foreground ratios and frame-to-frame changes are inspected for systematic over-segmentation, repeated empty\u002Ftiny-mask collapse, isolated spikes, and excessive flicker; detected collapse triggers re-estimation before submission.\n- [ ] `shape` is `[H, W]` int32; `len(indptr)==H+1`; `indptr[-1]==indices.size`; indices remain in `[0, W)`.\n",{"name":5,"description":7},"main","cdcb6d230f3b15c3c33f8a2bdd16439f43602cbe","evaluation\u002Fdata\u002Fskillsbench87\u002Freferences\u002Fdynamic-object-aware-egomotion\u002Fskills\u002Fdyn-object-masks",1,"https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark","https:\u002F\u002Fgithub.com\u002Flinyouxue","2026-11-14 20:28:35",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add linyouxue\u002Fskill-repair-benchmark --skill dyn-object-masks",{"tool":37,"command":38},"bunx","bunx skills add linyouxue\u002Fskill-repair-benchmark --skill dyn-object-masks",{"tool":40,"command":41},"pnpm","pnpm dlx skills add linyouxue\u002Fskill-repair-benchmark --skill dyn-object-masks","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fevaluation\u002Fdata\u002Fskillsbench87\u002Freferences\u002Fdynamic-object-aware-egomotion\u002Fskills\u002Fdyn-object-masks\u002FSKILL.md",true,[],[46,53,60,67,72,77],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M7E1HGVRY73NBJ022CJG13X6","video-frame-extraction","Extract frames from video files and save them as images using OpenCV","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fvideo-frame-extraction\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7E1HAG5R7CJ9C8NYJS771MB","openai-vision","Analyze images and multi-frame sequences using OpenAI GPT vision models","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fopenai-vision\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7E1H7DADKB6QBWKC2KQ63SZ","image-ocr","Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[],{"skillNo":68,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7E1H0WBNT43TENGQY7AVZHD","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fvideo-frame-extraction\u002FSKILL.md",[],[],{"skillNo":73,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7E1GTC7D4N4Q2EF03875J9E","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fopenai-vision\u002FSKILL.md",[],[],{"skillNo":78,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7E1GQ92CWFMGH53KSSE4WER","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[]]