VorlonCD / bi-aidetection

Alarm system for Blue Iris based on Artificial Intelligence.
https://ipcamtalk.com/threads/tool-tutorial-free-ai-person-detection-for-blue-iris.37330/
GNU General Public License v2.0
206 stars 45 forks source link

Is it possible to change the rectDetectionText Color? #197

Closed MindfulWolfPack closed 3 years ago

MindfulWolfPack commented 3 years ago

Hi @VorlonCD I see how I can change the rectDetectionText Size, Font, and the rectRelevant Color. But I can't find how to change the Merged JPG rectDetectionText Color. Is this possible?

The problem is that the current color (black) is unreadable on some backgrounds (see Merged JPG examples below).

image image

I wanted to clarify that my question/request is more about the Merged JPG. I see that in the UI (under History) the font color is much clearer (see images below), while the problematic font is in the Merged JPG (the picture above).

image image

Thanks!

VorlonCD commented 3 years ago

There is no way right now to change the background other than to change the Relevant or Irrelevant color settings. I can add it for a future version.

But just increase the Alpha settings to 255 to make it solid (also try increasing the JPEGQUALITY setting in Actions.) RectRelevantColorAlpha = 150; //255=solid, 127 half transparent RectIrrelevantColorAlpha = 150; RectMaskedColorAlpha = 150;

MindfulWolfPack commented 3 years ago

Thank you @VorlonCD I changed the Merged JPEG quality to 100% and the RectRelevantColorAlpha to 255 and it is a little bit better. Obviously, the way it looks in the UI (history) is the best.

image

VorlonCD commented 3 years ago

My bad, I found the bug. There was an offset applied to the UI history tab but not the jpeg image merging code. Will try to post an update by weekend. I wonder why hasnt this been reported before, it must have existed for a few months?

MindfulWolfPack commented 3 years ago

@VorlonCD Thank you so much! I'm guilty too, I have seen it for a while but either didn't pay attention or it didn't bother me too much. But recently with snow and ice on the ground detection has been a pain (tons of false positives) so I have been looking at email alerts more and noticed that it wasn't easy to see the text.

BTW, if there's a way to make the relevant rectangle lines wider (more pixels) on the Merged JPEG that would be great as well. On high-resolution cameras (e.g., 8MP) the line is super thin when compared to the rest of the image. I don't know if I make sense, I can try to include some photos.

VorlonCD commented 3 years ago

Yup, see "RectBorderWidth" in json file. I think it is in pixels and defaults to 3.

Making a guess with your username...


“Another thing that got forgotten was the fact that against all probability a sperm whale had suddenly been called into existence several miles above the surface of an alien planet.

And since this is not a naturally tenable position for a whale, this poor innocent creature had very little time to come to terms with its identity as a whale before it then had to come to terms with not being a whale any more.

This is a complete record of its thoughts from the moment it began its life till the moment it ended it.

Ah … ! What’s happening? it thought.

Er, excuse me, who am I?

Hello?

Why am I here? What’s my purpose in life?

What do I mean by who am I?

Calm down, get a grip now … oh! this is an interesting sensation, what is it? It’s a sort of … yawning, tingling sensation in my … my … well I suppose I’d better start finding names for things if I want to make any headway in what for the sake of what I shall call an argument I shall call the world, so let’s call it my stomach.

Good. Ooooh, it’s getting quite strong. And hey, what’s about this whistling roaring sound going past what I’m suddenly going to call my head? Perhaps I can call that … wind! Is that a good name? It’ll do … perhaps I can find a better name for it later when I’ve found out what it’s for. It must be something very important because there certainly seems to be a hell of a lot of it. Hey! What’s this thing? This … let’s call it a tail – yeah, tail. Hey! I can can really thrash it about pretty good can’t I? Wow! Wow! That feels great! Doesn’t seem to achieve very much but I’ll probably find out what it’s for later on. Now – have I built up any coherent picture of things yet?

No.

Never mind, hey, this is really exciting, so much to find out about, so much to look forward to, I’m quite dizzy with anticipation …

Or is it the wind?

There really is a lot of that now isn’t it?

And wow! Hey! What’s this thing suddenly coming towards me very fast? Very very fast. So big and flat and round, it needs a big wide sounding name like … ow … ound … round … ground! That’s it! That’s a good name – ground!

I wonder if it will be friends with me?

And the rest, after a sudden wet thud, was silence.

Curiously enough, the only thing that went through the mind of the bowl of petunias as it fell was Oh no, not again. Many people have speculated that if we knew exactly why the bowl of petunias had thought that we would know a lot more about the nature of the universe than we do now.”

― Douglas Adams, The Hitchhiker's Guide to the Galaxy

MindfulWolfPack commented 3 years ago

:-) indeed @VorlonCD, HG2G is my favorite! And thanks for pointing me in the direction of RectBorderWidth. I will adjust it now.

So long, and thanks for all the fish!

VorlonCD commented 3 years ago

I have found that "learning to fly by not hitting the ground when you fall" doesn't usually work for me. :) no one reads that one.

VorlonCD commented 3 years ago

This one should correctly position the background box behind the text so it stands out better. And if you need to, in the JSON file you can override RectDetectionTextForeColor and BackColor in JSON file. If set to "Gainsboro" (the default) it will simply use the RectRelevantColor or RectIrrelevantColor settings as it always has.

AITool-VorlonCD-v2.0.928.zip

MindfulWolfPack commented 3 years ago

Hi @VorlonCD after I installed this version all my cameras' relevant objects settings are messed up. Any idea? I reverted the entire folder to an earlier version from backup and the cameras' relevant objects settings are back to what they were. Just to make sure it is not a corrupt config, I re-installed 2.0.928 again, and the relevant object settings reset (seems random, some cameras lost them all). Then restored the entire folder back to the previous version and they came back again.

What do you think?

Thanks!

VorlonCD commented 3 years ago

I kind of expected you might have to redo relevant objects settings. If you do does it stick?

MindfulWolfPack commented 3 years ago

Thanks @VorlonCD i will give it a try tomorrow and report back.

MindfulWolfPack commented 3 years ago

@VorlonCD I apologize, I must have missed discussions about the latest way relevant objects are set (I haven't touched mine since they were checkboxes directly on the camera UI), how do I bring back the list of relevant detections that I used before? Here is an example of my settings for one camera before this version: image

Then after the update I get: image

If I try to click the Add Defaults button the list goes empty: image

And the same happens if I click the Reset button (list goes empty as above).

Any way to add the default detections that Deepstack supports so I can choose which ones I want?

Thanks!

VorlonCD commented 3 years ago

Something is still a little wonky in the code. Pick the DEFAULT camera and reset all the objects to what you want them to be, then use RESET on the other cameras objects and reset will use those DEFAULT objects. I'll try to get this straightened out.

It is expected that as new objects are seen, they will be added "disabled" to all the cameras just so they are available if needed later. Not sure this is the right logic, but I thought it might be useful.

VorlonCD commented 3 years ago

This one should be working better for relevant objects. Note that if you were using a few builds back, that it should correctly migrate the list forward now, so the object list may be different if you made recent changes to it. AITool-VorlonCD-v2.0.942.zip

MindfulWolfPack commented 3 years ago

@VorlonCD this version worked perfectly! relevant objects were migrated from the older build I was using! Thank you so much!

MindfulWolfPack commented 3 years ago

Hi @VorlonCD with the new version I changed my config to be: "rectDetectionTextSize": 12, "rectDetectionTextFont": "Segoe UI Semibold", "rectDetectionTextBackColor": "Red", "rectDetectionTextForeColor": "Gainsboro", "rectRelevantColor": "Red",

But the Merged JPEG images still look like this:

image

What am I doing wrong?

Thanks!

MindfulWolfPack commented 3 years ago

And this is what I get when I changed the config to: "rectRelevantColorAlpha": 255, "rectBorderWidth": 4, "rectDetectionTextSize": 14, "rectDetectionTextFont": "Segoe UI Semibold", "rectDetectionTextBackColor": "Red", "rectDetectionTextForeColor": "White", "rectRelevantColor": "Red",

Merged JPG: image

UI: image

It looks like it ignores the rectDetectionTextBackColor value?

VorlonCD commented 3 years ago

I may have fixed it. I havent seen the background missing for a while on my machine, and I was seeing the same thing you were off and on.

It also shows the annotation on-screen the same as it would be merged in (it scales the line width and text according to how big the picture is on screen vs the actual width/height in pixels of the image.

And you get to control annotation colors via History tab > Adjust Annotations:

AITool-VorlonCD-v2.0.988.zip

image

MindfulWolfPack commented 3 years ago

Thank you @VorlonCD this solution worked beautifully! Thank you so much.