in WinUser.h, lines 1975-2548.
You can also use this webbsite to create the linear animation effects in a simpler way:
I found a substitute that worked:
https://docs.expo.dev/debugging/tools/#debugging-with-vs-code
I have this same problem with the same setup. Did you find out what the root cause was?
You should view this video :-)
https://www.youtube.com/watch?v=Rehv9fk-RjU with topic "Replacing Multiple Substrings in Power Query M"
JJ
why is it giving me an error?: "offers", "review" o "aggregateRating"
Check how to install PM2 and use it effectively!
npm install -g eas-cli --force
Did You find a fix? I have the same problem now
I was facing the same issue. I was indeed also inside a numbered list, but I found a way to avoid this numbering to be applied to the code source I want to paste. Simply do a right-click where you plan to paste in Word, then select "Keep source formatting" paste option. Et voilà! :D
Awesome work thanks for sharing this info it really helped me a lot.
Google Chrome";v="141", "Not?A_Brand";v="8", "Chromium";v="141"
SEC-CH-UA-MOBILE ?1
Still struggling with this issue
cyrillic_font = TrueTypeFont("DejaVuSans.ttf") - doesn't work
AttributeError: type object 'TrueTypeFont' has no attribute 'true_type_font_from_file' - the mistake when I try to use true_type_font_from_file
Please help!
I'm having the same exact issue. Any solution?
With Swift 6 this seems to be problematic even as Codable, even with simples structs, and unless being an optional gives warning. Is there solution to this?
Finally... Hola finalmente como solucionaste el error con el paquete ibm_bd .. yo sigo con el problema.. no lo he podido solucionar... Cuales fueron los pasos correctos que solucionaron tu problema con ibm_db
I ended up usng revenuecat and it works great
I managed to figure it out with some help from the GNOME Discourse page- see this post for details.
Yo utilice esta solucion con IA:
Tu Laragon con PHP 8.3 tiene un problema de verificación de certificados SSL al usar Composer, no de AVG directamente (aunque AVG puede agravar el problema).
Te explico exactamente cómo repararlo paso a paso en Laragon (Windows), probado para este tipo de error:
curl error 60 while downloading ... SSL certificate problem: unable to get local issuer certificate
Composer no puede verificar los certificados HTTPS (Packagist, GitHub, etc.).
Debemos hacer que PHP conozca los certificados raíz correctos (cacert.pem) y que Composer los use.
Ve al sitio oficial de cURL:
👉 https://curl.se/ca/cacert.pem
Guarda el archivo como:
C:\laragon\bin\php\php-8.3.26-Win32-vs16-x64\extras\ssl\cacert.pem
(Si las carpetas extras\ssl no existen, créalas manualmente.)
Abre este archivo con un editor de texto:
C:\laragon\bin\php\php-8.3.26-Win32-vs16-x64\php.ini
Busca las líneas (usa Ctrl + F):
;curl.cainfo
;openssl.cafile
Cámbialas (quita el ; y ajusta la ruta completa a tu cacert.pem):
curl.cainfo = "C:\laragon\bin\php\php-8.3.26-Win32-vs16-x64\extras\ssl\cacert.pem"
openssl.cafile = "C:\laragon\bin\php\php-8.3.26-Win32-vs16-x64\extras\ssl\cacert.pem"
Guarda los cambios.
Ejecuta en una terminal de Laragon:
composer config -g cafile "C:\laragon\bin\php\php-8.3.26-Win32-vs16-x64\extras\ssl\cacert.pem"
👉 Esto asegura que Composer use exactamente ese mismo certificado.
Cierra completamente Laragon.
Vuelve a abrirlo → haz clic en “Start All”.
En la terminal, ejecuta:
composer diagnose
👉 Ahora las líneas de Checking https connectivity deberían mostrar:
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Словил эту проблему, когда стал запускать свое приложение через докер. Помогло добавить в docker-compose.yaml строчку: network_mode: "host"
$("#toremove").detach();
Hey guys i made an hta 2 exe compiler. You can find it at https://github.com/TheYoungDev430/Cloveland- i hope my compiler solves your problem
I see that everyone has fixed the issue by doing a reboot? But when I restart my pc (repaired aswell visual studio 2026 with the installer) and opened again the "http" and pressed "send request". The issue is still the same. I'm using the "long term support 8". Anyone else still have the same issue with this and know how to solve this issue?
No Longer Working. Please advise as I HATE The new Tab Page...
Microsoft Edge Policies
Policy Name > NewTabPageLocation
Policy Value > about:blank
Source > Platform
Applies To > Device
Level > Mandatory
Status > Error, Ignored
Show More >
NewTabPageLocationabout:blankPlatformDeviceMandatoryError, Ignored
Value > about:blank
Error > This policy is blocked, its value will be ignored.
Same issue, even now in 2025, but only when I build everything into a .pyz file.
Publishing a little update because I keep getting pinged by stackoverflow because people still face the same issue. Some answers are quite good because they explain me how to convert my current project into something that work. Thanks for your answers and efforts. But my question was really how to create a Python project where I can have my own custom package and use it easily.
So for the record, if it can help someone in the future, this is what I was looking for: https://docs.astral.sh/uv/concepts/projects/init/#packaged-applications
So you have to create a project with
uv init --package example-pkg
and then you can just do uv run <your-script> and your custom package will be referenced automatically. So if in your script you are doing a import example-pkg it will work. No need for any setup.py or anything else.
How do you create a new sender address that's unique and assigns the amounts to it in the live blockchain without going via the banking services provider?
I don't know how to get my ai development tool to insert the transaction values onto the live raw broadcast on blockcypher.
I’ve read several of your replies about WooCommerce/Stripe and I found them extremely helpful.
I’m currently working on a WooCommerce multi-vendor marketplace using WCFM + Stripe Connect (Direct Charges), and I’m facing an issue with partial payments when customers place orders with multiple vendors. The system still creates the order even when one of the Stripe charges fails.
Before I go too deep into building a full custom solution, I’d really appreciate your technical opinion: what would be the best approach to intercept or block order creation in WooCommerce until all Stripe charges are confirmed?
If you’re open to discussing this further, please let me know the best way to get in touch. Your expertise would be greatly appreciated.
Are you participating in IEEEXtreme 19.0? LOL
Are HLR tests only black box? Basically, are HLRs tests only integration tests?
This is a known issue:
https://github.com/actions/runner-images/issues/13135?utm_source=chatgpt.com
Maybe this can help you:
I haven't used Java for years, so double-check what I'm saying..
I see that you are using a Transactional annotation in that service, but I don't see any commit for it. Is it handled by Hibernate by default?
iam building the same project for my graduation , i am using the same pipeline but didn't find good text to gcode generator script , could you please share the script you are using , you will save me if you responde to me , i hope you reply!
I think you'd be better off using this repository.
I'm using Elsa Workflows 3 for a project, and there are four types of triggers (source):
HTTP Endpoint: triggers the workflow when a given HTTP request is sent to the workflow server.
Timer: triggers the workflow each given interval based on a TimeSpan expression.
Cron: triggers the workflow each given interval based on a CRON expression.
Event: triggers when a given event is received by the workflow server.
I'm trying to figure out how to implement a Cron based trigger in code, but the only documentation I can find (here and here) is for an HTTP Based Trigger.
How do I implement a Cron based trigger in Elsa Workflows 3?
How do I use this adb shell pm revoke com.android.systemui android.permission.SYSTEM_ALERT_WINDOW because it doesn't work
I implement a cursor-like inline diff editor with accept/reject undo/redo
https://github.com/Dimitri-WEI-Lingfeng/monaco-inline-diff-editor-with-accept-reject-undo
I'm trying to implement the function with WebView within the IOS app, is there a way? As far as I know, webView.setWebChromeClient() does not support it.
Nowadays you just have to allow fingerprinting.
https://brave.com/privacy-updates/28-sunsetting-strict-fingerprinting-mode/
A simple concat and sort_values could work:
pd.concat((dtrijen, dtvolkel)).sort_values(by='datetime')
But can you explain what you mean (no pun intended) by "keeping the average"?
I've been trying to do the same thing and just figured this out. You should be able to use the transformation "Partition by values".
You'll want to use transformations or value mapping to rename your values, but this gets your data in the right format.
do you have anything in log?, try to add debug log in .prop for printing request logs.
did you solve this issue? I have issue getting token from FCM when on opera other browsers work fine.
community.cloudflare.com/t/intermittent-etimedout-when-using-cloudflare-proxying/578664/2
I'm working on a project that can be of interest to you https://github.com/pkvartsianyi/spatio
I also encountered this problem, and I've already set my account to private mode, but it still doesn't work. May I ask if you have any solutions?
txs, after searching several hours .. this does the trick THANKS a LOT
All,
This is the VBA code.
Can you give me some way to make this work pls.
Sub LoopCheckValue()
Dim cell As Range
Dim i As Integer
i = 4
For Each cell In ActiveSheet.Range("J5:J13")
'What's the criteria?
If (cell.Value <= 0) Then
Set Outapp = CreateObject("Outlook.Application")
Set Outmail = Outapp.CreateItem(0)
With Outmail
.to = "mail" 'CHANGE THIS
.CC = ""
.BCC = ""
.Subject = [F2].Value + " Item due date reached"
.Body = Range("A" & i).Value & " is due "
.Send 'or use .Display
End With
ElseIf (cell.Value >= 30) And (cell.Value < 180) Then
Set Outapp = CreateObject("Outlook.Application")
Set Outmail = Outapp.CreateItem(0)
With Outmail
.to = "mail" 'CHANGE THIS
.CC = ""
.BCC = ""
.Subject = [F2].Value + " Item due date reached"
.Body = Range("A" & i).Value & " is due in less then 30 days"
.Send 'or use .Display
End With
ElseIf (cell.Value < 180) Then
Set Outapp = CreateObject("Outlook.Application")
Set Outmail = Outapp.CreateItem(0)
With Outmail
.to = "mail" 'CHANGE THIS
.CC = ""
.BCC = ""
.Subject = [F2].Value + " Item due date reached"
.Body = Range("A" & i).Value & " is due in less then 180 days"
.Send 'or use .Display
End With
End If
i = i + 1
Next cell
End Sub
Private Sub Worksheet_Selection(ByVal target As Range)
If ActiveCell.NumberFormat = "dd-mmm-yy," Then
ActiveSheet.Shape("Calendar").Visible = True
ActiveSheet.Shape("Calendar").Left = ActiveCell.Left + ActiveCell.Width
ActiveSheet.Shape("Calendar").Top = ActiveCell.Top + ActiveCell.Height
Else: ActiveSheet.Shape("Calendar").Visible = False
End If
End Sub
For now, you can fix it like described here https://youtrack.jetbrains.com/issue/PY-85025
can anyone help me by solving the following error:
[nas@sna obdx_base_installation]$ python runInstaller.py >>>> STARTING OBDX PRODUCT INSTALLATION <<<< Starting OBDX Database Installation with OBPM143 FLAVOR Tablespace with name OBDX_DEV and OBDX_AUDIT_DEV exists Dropping User... Objects dropped Schema dropped Role dropped Creating User... User Created Creating Role... Role Created Executing Grants... Execution of clip_master_script.sql started Execution of clip_master_script.sql completed Execution of clip_constraints.sql started Execution of clip_constraints.sql completed Execution of clip_seeds_executable.sql started Execution of clip_seeds_executable.sql completed Execution of clip_master_generic_rest_script.sql started Execution of clip_master_generic_rest_script.sql completed SUCCESSFULLY installed OBDX database Starting OBPM143 Database Installation... Table space with name TBS_OBDX_EHMS exists Dropping User Objects dropped Schema dropped Role dropped Creating User... User Created Creating Role... Roles Created Executing Grants... Executing OBPM Grants... Execution of table-scripts.sql started Execution of table-scripts.sql completed Execution of ubs_object_scripts.sql started Execution of ubs_object_scripts.sql completed Execution of obpm_object_scripts.sql started Execution of obpm_object_scripts.sql completed Execution of execute-seeds.sql started Execution of execute-seeds.sql completed Execution of obpm-seeds.sql started Execution of obpm-seeds.sql completed SUCCESSFULLY installed OBPM143 database Executed DIGX_FW_CONFIG_ALL_O.sql successfully Executed DIGX_FW_ABOUT_OBPM143.sql successfully Executed DIGX_FW_CONFIG_VAR_B.sql successfully Executed DIGX_FW_CONFIG_UBS_ALL_O.sql successfully Policy seeding successful Creating STB Schemas ... Dropping RCU RCU Schema dropped Running RCU Schema creation in progess ... STB Schemas Created Successfully Starting WEBLOGIC Setup and Configuration... Error: Could not find or load main class weblogic.WLST
Hi I have overcome this with this stackblitz.
Are you trying to have the username underneath the items in the small design?
I just built https://www.commitcompare.dev/ to get the compare URL and diff files easily!
I made a step by step video implementing Entra external ID. Maybe it can help you.
Allowed IP subnet in storage account fixed the issue.. Thank you !
Currenlty, having the same issue with my Jetson Nano Dev. Kit.
Could you be so kind to send me the full file.
Got the same issue while compiling.
do you have any update on this, i am also having similar query on how to achieve this
Trying some of the methods mentioned here should help: https://github.com/orgs/community/discussions/162702
A few years later, but this guide is a great explanation of what's going on:
https://community.databricks.com/t5/technical-blog/deep-dive-streaming-deduplication/ba-p/105062
it looks like having given my answer that i can not longer comment on others ..
A shout out to @markp-fuso for setting a very high bar for quality of answer.
I had not even considered your assumption C but your additional care for my solution is appreciated .. i am, of course, going to use your code to improve my own. Thanks for that
and a harsh raspberry to whoever down voted my own solution immediately as i posted it
I have the same issue but with a UIScrollView and not a UITableView and seems that any of the suggested solution (title + largeTitle, Top constraint to 0 to the superview) is working. Is any of you having the same issue ? Any solution found ?
I am also facing this issue !!
has anybody got any solutions for this ? Still getting the same thing.
Did you manage to resolve this issue?
I’m facing the same problem — android:usesCleartextTraffic="true", but it doesn’t seem to work in a MAUI Blazor Hybrid project.
How much time does this step require? Thanks in advance
That actually worked! But I don't get why. Yes, it is correct, that I wanted to estimate a man, with the first education level, from an unknown citizen class, who is 20 years old, and his political views are "Reform". But how do the levels work here?
make sure uncheck this box
hey did u ever figure this out?
This issue has been fixed by Google:
https://android-review.googlesource.com/c/platform/frameworks/support/+/3794126
I have find this : https://guacamole.apache.org/doc/1.6.0/gug/guacamole-native.html
You have all the dependencies for fedora because amazon linux 2023 is based on !
Else, you can help you with this AMI to see the dependencies deployed : https://aws.amazon.com/marketplace/pp/prodview-ya7i5ohmfyl3e
thank you very much, I spet 1 hour thinking my localhost is somehow blocked
What are the permissions on your perl script ?
In the top part of most pages you can switch what is currently the Focused (global) Selection. If you try changing to another page after changing it, you'll notice that the selection will follow you to another page. You can always switch to <No Selection> to start over (but yes, previous selections will still be available in the combo box).
I take it that you're looking for a way to clear out all previous selections, and not just selecting the "<No Selection>"? If so, how would you want to access that functionality? A context menu with "Clear All Selections"? Something else? Please let me know what you'd prefer, and I'll open an issue and add it. :)
PostgreSQL in Astra Linux have breaking changes and not compatible with TimescaleDB.
https://wiki.astralinux.ru/kb/postgresql-rasshirenie-timescaledb-371817563.html
Open this link: https://nodejs.org/en/download/archive/v0.12.18 and scroll down to Installer Packages. Then download the package foe windows.
Note that 0.12.18 is the last version that was supported by win xp.
Hello please use our official npm package at https://www.npmjs.com/package/@bugrecorder/sdk
Are you using ControlFormat ?
Is your approach to work with shapes? Perhaps manipulate the OptionBotton sate, 'if' button inserted as a Form Control.
New here .. Curious did you modify the .value property of the OptionBotton object?
the trick is to use env variable
New here .. Curious did you modify the .value property of the OptionBotton object?
you must change getMaxCores function, roll it back to 0.25, then install package by tar.gz file . Detail in this article by me https://www.bilibili.com/opus/1126187884464832514 .
I was able to resolve this by using the "Reload Project" option from VS 2022 menu (not sure how I missed that). Thanks for the responses
fixed: turns out you cant do that in textual
rightclick -> format document ?
how do i create something like the 1 answer but for something else.. theres a website i want to scrape but i want to scrape for a specific "src="specific url ""
If your organisation permits you might be able to use LDAP to populate those field:
VBA excel Getting information from active directory with the username based in cells
ive acidently passed a const argument. dosent seem to be the issu in youre case tho.
Follow this inComplete guide repo to install and setup jupyter notebook on termux android 13+
I have a similar kind of issue, where the page is splitting unnecessarily.
I have three components a header, a title and a chart using chart js, the issue is the header and title is coming in the first page and chart is going to the second page keeping the first page blank, so what else I can do here it is working fine when the chart data is fit with in the first page.
Can somebody please help me to fix this issue
Here is the code
<div className="chart-container">
<div className="d-flex justify-content-between">
<label className="chart-title m-2">{props.title}</label>
</div>
{data.length == 0
? <div className="no-data-placeholder">
<span>No Data Found!</span>
</div>
: <div id={props.elementID} style={props.style}></div>
}
</div>
Cant you probably just look up the JS code of the router page and see what requests it sends?
i am stuck when i have ti submet where thay aked if im a android
# compare_icon_fmt.py
import cv2
import numpy as np
from dataclasses import dataclass
from typing import Tuple, List
# ===================== T H A M S Ố & C ᾳ U H Ì N H =====================
@dataclass
class RedMaskParams:
# Dải đỏ HSV đôi: [0..10] U [170..180]
lower1: Tuple[int, int, int] = (0, 80, 50)
upper1: Tuple[int, int, int] = (10, 255, 255)
lower2: Tuple[int, int, int] = (170, 80, 50)
upper2: Tuple[int, int, int] = (180, 255, 255)
open_ksize: int = 3
close_ksize: int = 5
@dataclass
class CCParams:
dilate_ksize: int = 3
min_area: int = 150
max_area: int = 200000
aspect_min: float = 0.5
aspect_max: float = 2.5
pad: int = 2
@dataclass
class FMTParams:
hann: bool = True
eps: float = 1e-3
min_scale: float = 0.5
max_scale: float = 2.0
@dataclass
class MatchParams:
ncc_threshold: float = 0.45
canny_low: int = 60
canny_high: int = 120
# ===================== 1) LOAD & BINARIZE =====================
def load_and_binarize(path: str):
img_bgr = cv2.imread(path, cv2.IMREAD_COLOR)
if img_bgr is None:
raise FileNotFoundError(f"Không thể đọc ảnh: {path}")
rgb = cv2.cvtColor(img_bgr, cv2.COLOR_BGR2RGB)
gray = cv2.cvtColor(img_bgr, cv2.COLOR_BGR2GRAY)
_, binarized = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
return img_bgr, rgb, binarized
# ===================== 2) TEMPLATE BIN + INVERT =====================
def binarize_and_invert_template(tpl_bgr):
tpl_gray = cv2.cvtColor(tpl_bgr, cv2.COLOR_BGR2GRAY)
_, tpl_bin = cv2.threshold(tpl_gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
tpl_inv = cv2.bitwise_not(tpl_bin)
return tpl_bin, tpl_inv
# ===================== 3) RED MASK =====================
def red_mask_on_dashboard(dash_bgr, red_params: RedMaskParams):
hsv = cv2.cvtColor(dash_bgr, cv2.COLOR_BGR2HSV)
m1 = cv2.inRange(hsv, red_params.lower1, red_params.upper1)
m2 = cv2.inRange(hsv, red_params.lower2, red_params.upper2)
mask = cv2.bitwise_or(m1, m2)
if red_params.open_ksize > 0:
k = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (red_params.open_ksize,)*2)
mask = cv2.morphologyEx(mask, cv2.MORPH_OPEN, k)
if red_params.close_ksize > 0:
k = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (red_params.close_ksize,)*2)
mask = cv2.morphologyEx(mask, cv2.MORPH_CLOSE, k)
return mask
def apply_mask_to_binarized(binarized, mask):
return cv2.bitwise_and(binarized, binarized, mask=mask)
# ===================== 4) DILATE + CONNECTED COMPONENTS =====================
def find_candidate_boxes(masked_bin, cc_params: CCParams) -> List[Tuple[int,int,int,int]]:
k = cv2.getStructuringElement(cv2.MORPH_RECT, (cc_params.dilate_ksize,)*2)
dil = cv2.dilate(masked_bin, k, iterations=1)
num_labels, labels, stats, _ = cv2.connectedComponentsWithStats((dil>0).astype(np.uint8), connectivity=8)
boxes = []
H, W = masked_bin.shape[:2]
for i in range(1, num_labels):
x, y, w, h, area = stats[i]
if area < cc_params.min_area or area > cc_params.max_area:
continue
aspect = w / (h + 1e-6)
if not (cc_params.aspect_min <= aspect <= cc_params.aspect_max):
continue
x0 = max(0, x - cc_params.pad)
y0 = max(0, y - cc_params.pad)
x1 = min(W, x + w + cc_params.pad)
y1 = min(H, y + h + cc_params.pad)
boxes.append((x0, y0, x1-x0, y1-y0))
return boxes
# ===================== 5) CROP CHẶT TEMPLATE =====================
def tight_crop_template(tpl_inv):
cnts, _ = cv2.findContours(tpl_inv, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
if not cnts:
return tpl_inv
x, y, w, h = cv2.boundingRect(max(cnts, key=cv2.contourArea))
return tpl_inv[y:y+h, x:x+w]
# ===================== 6) FOURIER–MELLIN (scale, rotation) =====================
def _fft_magnitude(img: np.ndarray, use_hann=True, eps=1e-3) -> np.ndarray:
if use_hann:
hann_y = cv2.createHanningWindow((img.shape[1], 1), cv2.CV_32F)
hann_x = cv2.createHanningWindow((1, img.shape[0]), cv2.CV_32F)
window = hann_x @ hann_y
img = img * window
dft = cv2.dft(img, flags=cv2.DFT_COMPLEX_OUTPUT)
dft_shift = np.fft.fftshift(dft, axes=(0,1))
mag = cv2.magnitude(dft_shift[:,:,0], dft_shift[:,:,1])
mag = np.log(mag + eps)
mag = cv2.normalize(mag, None, 0, 1, cv2.NORM_MINMAX)
return mag
def _log_polar(mag: np.ndarray) -> Tuple[np.ndarray, float]:
center = (mag.shape[1]//2, mag.shape[0]//2)
max_radius = min(center[0], center[1])
M = mag.shape[1] / np.log(max_radius + 1e-6)
lp = cv2.logPolar(mag, center, M, cv2.WARP_FILL_OUTLIERS + cv2.INTER_LINEAR)
return lp, M
def fourier_mellin_register(img_ref: np.ndarray, img_mov: np.ndarray, fmt_params: FMTParams):
a = cv2.normalize(img_ref.astype(np.float32), None, 0, 1, cv2.NORM_MINMAX)
b = cv2.normalize(img_mov.astype(np.float32), None, 0, 1, cv2.NORM_MINMAX)
amag = _fft_magnitude(a, use_hann=fmt_params.hann, eps=fmt_params.eps)
bmag = _fft_magnitude(b, use_hann=fmt_params.hann, eps=fmt_params.eps)
alp, M = _log_polar(amag)
blp, _ = _log_polar(bmag)
shift, response = cv2.phaseCorrelate(alp, blp)
# phaseCorrelate trả (shiftX, shiftY)
shiftX, shiftY = shift
cols = alp.shape[1]
scale = np.exp(shiftY / (M + 1e-9))
rotation = -360.0 * (shiftX / (cols + 1e-9))
scale = float(np.clip(scale, fmt_params.min_scale, fmt_params.max_scale))
rotation = float(((rotation + 180) % 360) - 180)
return scale, rotation, float(response)
def warp_template_by(scale: float, rotation_deg: float, tpl_gray: np.ndarray, target_size: Tuple[int, int]):
h, w = tpl_gray.shape[:2]
center = (w/2, h/2)
M = cv2.getRotationMatrix2D(center, rotation_deg, scale)
warped = cv2.warpAffine(tpl_gray, M, (w, h), flags=cv2.INTER_LINEAR, borderMode=cv2.BORDER_CONSTANT, borderValue=0)
warped = cv2.resize(warped, (target_size[0], target_size[1]), interpolation=cv2.INTER_LINEAR)
return warped
# ===================== 7) MATCH SCORE (robust) =====================
def edge_preprocess(img_gray: np.ndarray, mp: MatchParams):
# CLAHE để chống ảnh phẳng
clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8))
g = clahe.apply(img_gray)
edges = cv2.Canny(g, mp.canny_low, mp.canny_high)
# Nếu cạnh quá ít → dùng gradient magnitude
if np.count_nonzero(edges) < 0.001 * edges.size:
gx = cv2.Sobel(g, cv2.CV_32F, 1, 0, ksize=3)
gy = cv2.Sobel(g, cv2.CV_32F, 0, 1, ksize=3)
mag = cv2.magnitude(gx, gy)
mag = cv2.normalize(mag, None, 0, 255, cv2.NORM_MINMAX).astype(np.uint8)
return mag
# Dãn cạnh nhẹ
k = cv2.getStructuringElement(cv2.MORPH_RECT, (3,3))
edges = cv2.dilate(edges, k, iterations=1)
return edges
def _nan_to_val(x: float, val: float = -1.0) -> float:
return float(val) if (x is None or (isinstance(x, float) and (x != x))) else float(x)
def ncc_score(scene: np.ndarray, templ: np.ndarray) -> float:
Hs, Ws = scene.shape[:2]
Ht, Wt = templ.shape[:2]
if Hs < Ht or Ws < Wt:
pad = np.zeros((max(Hs,Ht), max(Ws,Wt)), dtype=scene.dtype)
pad[:Hs,:Ws] = scene
scene = pad
# 1) TM_CCOEFF_NORMED
res = cv2.matchTemplate(scene, templ, cv2.TM_CCOEFF_NORMED)
s1 = _nan_to_val(res.max())
# 2) Fallback: TM_CCORR_NORMED
s2 = -1.0
if s1 <= -0.5:
res2 = cv2.matchTemplate(scene, templ, cv2.TM_CCORR_NORMED)
s2 = _nan_to_val(res2.max())
# 3) Fallback cuối: IoU giữa 2 mask nhị phân
if s1 <= -0.5 and s2 <= 0:
t = templ
sc = scene
if sc.shape != t.shape:
sc = cv2.resize(sc, (t.shape[1], t.shape[0]), interpolation=cv2.INTER_NEAREST)
_, tb = cv2.threshold(t, 0, 255, cv2.THRESH_BINARY+cv2.THRESH_OTSU)
_, sb = cv2.threshold(sc, 0, 255, cv2.THRESH_BINARY+cv2.THRESH_OTSU)
inter = np.count_nonzero(cv2.bitwise_and(tb, sb))
union = np.count_nonzero(cv2.bitwise_or(tb, sb))
iou = inter / union if union > 0 else 0.0
return float(iou)
return max(s1, s2)
def thicken_binary(img: np.ndarray, ksize: int = 3, iters: int = 1) -> np.ndarray:
k = cv2.getStructuringElement(cv2.MORPH_RECT, (ksize,ksize))
return cv2.dilate(img, k, iterations=iters)
# ===================== P I P E L I N E C H Í N H =====================
def find_icon_with_fmt(
dashboard_path: str,
template_path: str,
red_params=RedMaskParams(),
cc_params=CCParams(),
fmt_params=FMTParams(),
match_params=MatchParams(),
):
# 1) Dashboard: RGB + bin
dash_bgr, dash_rgb, dash_bin = load_and_binarize(dashboard_path)
# 2) Template: bin + invert
tpl_bgr = cv2.imread(template_path, cv2.IMREAD_COLOR)
if tpl_bgr is None:
raise FileNotFoundError(f"Không thể đọc template: {template_path}")
tpl_bin, tpl_inv = binarize_and_invert_template(tpl_bgr)
# 3) Lọc đỏ & áp mask lên ảnh nhị phân dashboard
redmask = red_mask_on_dashboard(dash_bgr, red_params)
dash_masked = apply_mask_to_binarized(dash_bin, redmask)
# 4) Dãn + tìm CC để lấy candidate boxes
boxes = find_candidate_boxes(dash_masked, cc_params)
# 5) Cắt chặt template & chuẩn bị phiên bản grayscale
tpl_tight = tight_crop_template(tpl_inv)
tpl_tight_gray = cv2.GaussianBlur(tpl_tight, (3,3), 0)
# Tiền xử lý cạnh cho template
tpl_edges = edge_preprocess(tpl_tight_gray, match_params)
best = {
"score": -1.0,
"box": None,
"scale": None,
"rotation": None
}
dash_gray = cv2.cvtColor(dash_bgr, cv2.COLOR_BGR2GRAY)
for (x, y, w, h) in boxes:
roi = dash_gray[y:y+h, x:x+w]
if roi.size == 0 or w < 8 or h < 8:
continue
# Resize tạm cho FMT
tpl_norm = cv2.resize(tpl_tight_gray, (w, h), interpolation=cv2.INTER_LINEAR)
roi_norm = cv2.resize(roi, (w, h), interpolation=cv2.INTER_LINEAR)
# 6) FMT ước lượng scale/rotation (có fallback)
try:
scale, rotation, resp = fourier_mellin_register(tpl_norm, roi_norm, fmt_params)
except Exception:
scale, rotation, resp = 1.0, 0.0, 0.0
warped = warp_template_by(scale, rotation, tpl_tight_gray, target_size=(w, h))
# (tuỳ chọn) làm dày biên template
warped = thicken_binary(warped, ksize=3, iters=1)
# 7) Tính điểm khớp trên đặc trưng robust
roi_feat = edge_preprocess(roi, match_params)
warped_feat = edge_preprocess(warped, match_params)
score = ncc_score(roi_feat, warped_feat)
if score > best["score"]:
best.update({
"score": score,
"box": (x, y, w, h),
"scale": scale,
"rotation": rotation
})
return {
"best_score": best["score"],
"best_box": best["box"], # (x, y, w, h) trên dashboard
"best_scale": best["scale"],
"best_rotation_deg": best["rotation"],
"pass": (best["score"] is not None and best["score"] >= match_params.ncc_threshold),
"num_candidates": len(boxes),
}
# ===================== V Í D Ụ C H Ạ Y =====================
if __name__ == "__main__":
# ĐỔI 2 ĐƯỜNG DẪN NÀY THEO MÁY BẠN
DASHBOARD = r"\Icon\dashboard.jpg"
TEMPLATE = r"\Icon\ID01.jpg"
result = find_icon_with_fmt(
dashboard_path=DASHBOARD,
template_path=TEMPLATE,
red_params=RedMaskParams(), # nới dải đỏ nếu cần
cc_params=CCParams(min_area=60, max_area=120000, pad=3),
fmt_params=FMTParams(min_scale=0.6, max_scale=1.8),
match_params=MatchParams(ncc_threshold=0.55, canny_low=50, canny_high=130)
)
print("=== KẾT QUẢ ===")
for k, v in result.items():
print(f"{k}: {v}")
# Vẽ khung best match để kiểm tra nhanh
if result["best_box"] is not None:
img = cv2.imread(DASHBOARD)
x, y, w, h = result["best_box"]
cv2.rectangle(img, (x,y), (x+w, y+h), (0,255,0), 2)
cv2.putText(img, f"NCC={result['best_score']:.2f}", (x, max(0,y-8)),
cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0,255,0), 2, cv2.LINE_AA)
cv2.imshow("Best match", img)
cv2.waitKey(0)
cv2.destroyAllWindows()
Hi i am using but it don't find correct image. Please help me check
code not run
import { Directive, ElementRef, HostListener } from '@angular/core';
@Directive({
selector: '[formatDate]', // Este é o seletor que você usará no HTML
standalone: true // Torna a diretiva autônoma (não precisa ser declarada em um módulo)
})
export class FormataDateDirective {
constructor(private el: ElementRef) {}
/**
* O HostListener escuta eventos no elemento hospedeiro (o <input>).
* Usamos o evento 'input' porque ele captura cada alteração,
* incluindo digitação, colagem e exclusão de texto.
* @param event O evento de entrada disparado.
*/
@HostListener('input', ['$event'])
onInputChange(event: Event): void {
const inputElement = event.target as HTMLInputElement;
let inputValue = inputElement.value.replace(/\D/g, ''); // Remove tudo que não for dígito
// Limita a entrada a 8 caracteres (DDMMAAAA)
if (inputValue.length > 8) {
inputValue = inputValue.slice(0, 8);
}
let formattedValue = '';
// Aplica a formatação DD/MM/AAAA conforme o usuário digita
if (inputValue.length > 0) {
formattedValue = inputValue.slice(0, 2);
}
if (inputValue.length > 2) {
formattedValue = `${inputValue.slice(0, 2)}/${inputValue.slice(2, 4)}`;
}
if (inputValue.length > 4) {
formattedValue = `${inputValue.slice(0, 2)}/${inputValue.slice(2, 4)}/${inputValue.slice(4, 8)}`;
}
// Atualiza o valor do campo de entrada
inputElement.value = formattedValue;
}
/**
* Este listener lida com o pressionamento da tecla Backspace.
* Ele garante que a barra (/) seja removida junto com o número anterior,
* proporcionando uma experiência de usuário mais fluida.
*/
@HostListener('keydown.backspace', ['$event'])
onBackspace(event: KeyboardEvent): void {
const inputElement = event.target as HTMLInputElement;
const currentValue = inputElement.value;
if (currentValue.endsWith('/') && currentValue.length > 0) {
// Remove a barra e o número anterior de uma vez
inputElement.value = currentValue.slice(0, currentValue.length - 2);
// Previne o comportamento padrão do backspace para não apagar duas vezes
event.preventDefault();
}
}
}
<main class="center"> <router-outlet></router-outlet> <input type="text" placeholder="DD/MM/AAAA" [formControl]="dateControl" formatDate maxlength="10"
</main>
Seems that it is a common issue, so please vote at https://github.com/angular/angular/issues/64553
this was so helpful, I finally got my toaster to cook a pizza in the morning
And how would I go about this when I want this to work with CUDA.jl CuArrays as well?
Ever solved this?
Tried everything I could find on this topic. Works on all my devices except Android.
Eventually tried 192,0,2,1 instead and this works on my Android just fine.