Hello everyone !
An interesting task has appeared that needs to be implemented on the ESP 32 module.
There is an ip camera that looks at the TV on which the changing content is displayed
Sometimes, the program that displays this content freezes,
It is necessary to catch the fact that the image freezes and restart the computer using a relay module.
There is no access to the computer that outputs the content, there is only a picture from the ip camera.
I have an idea to get a picture to calculate a hash and compare 2 hashes
if the distance between them is short, then the picture does not change.
Since there is no way to send a picture from the camera to the server and calculate the hash there, everything needs to be done on the ESP itself
I will be grateful for ideas!
esp32 calculate perceptual hash
Re: esp32 calculate perceptual hash
Did you try to capture 2 still images, store and compare?
I think you should start with this simple experiment to make sure you can capture at least 2 images with the same content before you even start to calculate hash.
I think you should start with this simple experiment to make sure you can capture at least 2 images with the same content before you even start to calculate hash.
Re: esp32 calculate perceptual hash
Hello !
The camera I'm connecting to is AXIS model AXIS M3105-LVE Network Camera
it provides an opportunity to immediately receive a jpg example of an address at a dedicated address
http://10.178.0.101/axis-cgi/jpg/image. ... profile=S1
I get 1 minute intervals
The camera I'm connecting to is AXIS model AXIS M3105-LVE Network Camera
it provides an opportunity to immediately receive a jpg example of an address at a dedicated address
http://10.178.0.101/axis-cgi/jpg/image. ... profile=S1
I get 1 minute intervals
- http.begin(serverPath.c_str());
- int httpResponseCode = http.GET();
- if (httpResponseCode>0) {
- Serial.print("HTTP Response code: ");
- Serial.println(httpResponseCode);
- String payload = http.getString();
- Serial.println(payload);
- }
- else {
- Serial.print("Error code: ");
- Serial.println(httpResponseCode);
- }
Re: esp32 calculate perceptual hash
Just a heads up for googling this: a good hash should have a vastly different output for even slightly different inputs, so that's likely the opposite of what you're looking for. Instead "fingerprint" or "image similarity".
I doubt you would need to do anything fancy... I'd start with an extremely naive approach like xor'ing together two frames and summing the result. The value would be zero for identical data and should grow larger with dissimilarity. With any luck, that might be sufficient for your use case. Add a low pass filter to remove noise in the next step ...
These types of thing usually require a great deal of trial and error, you'll need to gather some real data and experiment.
I doubt you would need to do anything fancy... I'd start with an extremely naive approach like xor'ing together two frames and summing the result. The value would be zero for identical data and should grow larger with dissimilarity. With any luck, that might be sufficient for your use case. Add a low pass filter to remove noise in the next step ...
These types of thing usually require a great deal of trial and error, you'll need to gather some real data and experiment.
Who is online
Users browsing this forum: No registered users and 64 guests