Merge branch 'Dev2' of https://git.pstw.com.my/catalyx/PSTW_CentralizeSystem into Dev2
This commit is contained in:
commit
fdc3c81574
@ -780,29 +780,58 @@ console.log("🎬 Video.srcObject:", video?.srcObject);
|
|||||||
if (capabilities.sharpness) {
|
if (capabilities.sharpness) {
|
||||||
// track.applyConstraints({
|
// track.applyConstraints({
|
||||||
// advanced: [ { sharpness: 100 }, Max sharpness
|
// advanced: [ { sharpness: 100 }, Max sharpness
|
||||||
// { contrast: 50 }, Boost contrast
|
// { contrast: 50 }, Boost contrast
|
||||||
// { brightness: 60 }, Increase brightness
|
// { brightness: 60 }, Increase brightness
|
||||||
// { frameRate: 30 }, Try max FPS
|
// { frameRate: 30 }, Try max FPS
|
||||||
// { exposureTime: 100 }, Lower for less motion blur
|
// { exposureTime: 100 }, Lower for less motion blur
|
||||||
// { focusMode: "continuous" }, Ensure auto-focus
|
// { focusMode: "continuous" }, Ensure auto-focus
|
||||||
// { width: 1280, height: 720 }]}) Max resolution] Max sharpness
|
// { width: 1280, height: 720 }
|
||||||
track.applyConstraints ({
|
//]
|
||||||
advanced: [
|
// }) Max resolution] Max sharpness
|
||||||
{ width: 1280, height: 720 }
|
|
||||||
]
|
|
||||||
|
// track.applyConstraints ({
|
||||||
|
// advanced: [
|
||||||
|
// {sharpness: 80},
|
||||||
|
// { width: 1280, height: 720 }
|
||||||
|
// ]
|
||||||
|
// })
|
||||||
|
// .then(() => {console.log("✅ Sharpness applied"); console.log("📷 Applied Constraintsss:", track.getSettings()); })
|
||||||
|
// .catch(err => console.error("❌ Failed to apply sharpness:", err));
|
||||||
|
|
||||||
|
// Step 1: Apply resolution constraints first
|
||||||
|
track.applyConstraints({
|
||||||
|
advanced: [{ width: 1280, height: 720 }]
|
||||||
|
}).then(() => {
|
||||||
|
console.log("✅ Resolution applied", track.getSettings().width, "x", track.getSettings().height);
|
||||||
|
|
||||||
|
// Step 2: Apply sharpness separately
|
||||||
|
return track.applyConstraints({ advanced: [{ sharpness: 100 }] });
|
||||||
|
}).then(() => {console.log("✅ Sharpness applied")
|
||||||
|
|
||||||
|
// Step 2: Apply sharpness separately
|
||||||
|
return track.applyConstraints({ advanced: [{ whiteBalanceMode: "continuous" }] });
|
||||||
|
}).then(() => {console.log("✅ whitebalancemode continous applied");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
.then(() => console.log("✅ Sharpness applied"))
|
.then(() => { console.log("📷 Applied Constraintsss:", track.getSettings());
|
||||||
.catch(err => console.error("❌ Failed to apply sharpness:", err));
|
}).catch(err => console.error("❌ Failed to apply constraints:", err));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.warn("⚠️ Sharpness not supported on this camera");
|
console.warn("⚠️ Sharpness not supported on this camera");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("📷 Applied Constraints:", track.getSettings());
|
console.log("📷 Applied Constraintsss:", track.getSettings());
|
||||||
|
console.log("📷 Applied Capabilities:",track.getCapabilities());
|
||||||
|
|
||||||
console.log("Is it a video element?", videoElement instanceof HTMLVideoElement);
|
// console.log("Is it a video element?", videoElement instanceof HTMLVideoElement);
|
||||||
console.log("Camera Ready! Video element:", videoElement);
|
// console.log("Camera Ready! Video element:", videoElement);
|
||||||
this.videoElement = videoElement; // Store for later use
|
// this.videoElement = videoElement; Store for later use
|
||||||
// this.scanStartTime = performance.now(); Start timing
|
// this.scanStartTime = performance.now(); Start timing
|
||||||
// this.scanTime = null; Reset previous scan time
|
// this.scanTime = null; Reset previous scan time
|
||||||
// if (!videoElement || !videoElement.srcObject) {
|
// if (!videoElement || !videoElement.srcObject) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user