Normbox

GCV scripting for Gtuner IV and Titan Two. Configuration, examples, questions.

Normbox

Postby Ketechi » Tue May 05, 2020 10:49 pm

Hi everyone,

Today I bring you a new tool that can facilitate the use of Norm. I call this script/tool Normbox. the script allows you to take the image of the specific area you are trying to compare with Norm and also it will provide you a text file that contains the coordinates so you don’t have to find them yourself.

This is the controller functionalities:
RS/R3: Will freeze/unfreeze the frame to make it easier to adjust the box.
LS/L3: Will extract the image located on the inside of the box.
LB/L1: Will change the x and y index, for example, X1 Y1 to X2 Y2.
D-pad UP: Will move the selected Y index up.
D-pad DOWN: Will move the selected Y index down.
D-pad LEFT: Will move the selected X index left.
D-pad RIGHT: Will move the selected X index right.

Here is a tutorial I made on how to use this script:
[YouTube]https://youtu.be/34cgrzyaOzE[/YouTube]

Here you can find the script:
https://pastebin.com/GkHRZD1n

I hope this script helps you guys,
Stay safe :smile0201:
User avatar
Ketechi
Staff Sergeant
Staff Sergeant
 
Posts: 13
Joined: Thu Feb 22, 2018 8:13 pm

Re: Normbox

Postby antithesis » Wed May 06, 2020 12:29 am

Thanks for sharing Ketechi.

For those of us unfamiliar with CV, what is Norm?
Official Australian retailer for Titan One, Titan Two and XIM APEX at Mod Squad
User avatar
antithesis
Colonel
Colonel
 
Posts: 1912
Joined: Sat May 28, 2016 10:45 pm

Re: Normbox

Postby bmpt guard » Wed May 06, 2020 3:04 am

antithesis wrote:Thanks for sharing Ketechi.

For those of us unfamiliar with CV, what is Norm?

well from watching the youtube videos he posted in discord, it looks like "visual gpc for gcv" on gtuner iv. best way to explain in my mind.
but why i get error i dont know if anyone knows why i got error when trying to run norm let me know. thanks
User avatar
bmpt guard
Command Sergeant Major
Command Sergeant Major
 
Posts: 142
Joined: Thu May 12, 2016 9:33 pm

Re: Normbox

Postby doko54 » Wed May 06, 2020 8:45 am

Hi ketechi ,
we got these type of error at launch the script
GCV Error: ('invalid decimal literal', ('', 6, 7, 'from 1___normbox import GCVWorker'))
GCV Error: SyntaxError: invalid decimal literal (, line 6)

Did you know how to fix them and from wheere it provide ?
User avatar
doko54
Private First Class
Private First Class
 
Posts: 2
Joined: Thu Apr 23, 2020 12:39 pm

Re: Normbox

Postby hammer » Wed May 06, 2020 10:11 am

Rename the file to normbox.py
Delete the 1 and the _ infront.
doko54 wrote:Hi ketechi ,
we got these type of error at launch the script
GCV Error: ('invalid decimal literal', ('', 6, 7, 'from 1___normbox import GCVWorker'))
GCV Error: SyntaxError: invalid decimal literal (, line 6)

Did you know how to fix them and from wheere it provide ?
User avatar
hammer
Sergeant Major
Sergeant Major
 
Posts: 104
Joined: Sun Sep 30, 2018 1:36 pm
Location: Germany

Re: Normbox

Postby bmpt guard » Wed May 06, 2020 2:59 pm

hammer wrote:Rename the file to normbox.py
Delete the 1 and the _ infront.
doko54 wrote:Hi ketechi ,
we got these type of error at launch the script
GCV Error: ('invalid decimal literal', ('', 6, 7, 'from 1___normbox import GCVWorker'))
GCV Error: SyntaxError: invalid decimal literal (, line 6)

Did you know how to fix them and from wheere it provide ?

ok i did what you said to fix, but now got these errors:
GCV Error: cannot reshape array of size 8294400 into shape (27,25,4)
Computer Vision: ERROR: Gpython process exited with error code 121

tried fixing just coping raw from pastebin to py normbox.
seems the script works in null, but when trying to run script on dual monitor setup it doesnt work
User avatar
bmpt guard
Command Sergeant Major
Command Sergeant Major
 
Posts: 142
Joined: Thu May 12, 2016 9:33 pm

Re: Normbox

Postby hammer » Wed May 06, 2020 8:18 pm

Full credit to DontAtMe or ME on discord!!

This error came up on some people pc's and after some changes it works now, at least for me ;P
Code: Select all
GCV Error: cannot reshape array of size 8294400 into shape (27,25,4)
Computer Vision: ERROR: Gpython process exited with error code 121

This was related to:
Code: Select all
self.w = self.x2 - self.x1
self.h = self.y2 - self.y1

I only changed the font size a bit to make it more clear.

EDIT: This doesnt mean that Ketechi's original Pastebin version dont work in general!!!
People told me that it worked out of the box
Attachments
normbox.rar
(1.53 KiB) Downloaded 325 times
User avatar
hammer
Sergeant Major
Sergeant Major
 
Posts: 104
Joined: Sun Sep 30, 2018 1:36 pm
Location: Germany

Re: Normbox

Postby hammer » Sat May 23, 2020 9:58 am

Just wanted to add his tutorial on how to use it if that is unclear :)



And how to implement that into a script

User avatar
hammer
Sergeant Major
Sergeant Major
 
Posts: 104
Joined: Sun Sep 30, 2018 1:36 pm
Location: Germany

Re: Normbox

Postby gobroncos671 » Sun Sep 06, 2020 9:07 pm

hammer wrote:Full credit to DontAtMe or ME on discord!!

This error came up on some people pc's and after some changes it works now, at least for me ;P
Code: Select all
GCV Error: cannot reshape array of size 8294400 into shape (27,25,4)
Computer Vision: ERROR: Gpython process exited with error code 121

This was related to:
Code: Select all
self.w = self.x2 - self.x1
self.h = self.y2 - self.y1

I only changed the font size a bit to make it more clear.

EDIT: This doesnt mean that Ketechi's original Pastebin version dont work in general!!!
People told me that it worked out of the box


Thanks for this! I was getting that initial error with the original file.

Your version works at first, but after spending more than one minute expanding the box and taking a picture, I receive the following error:

Code: Select all
GCV Error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-k8sx3e60\opencv\modules\imgcodecs\src\loadsave.cpp:738: error: (-215:Assertion failed) !_img.empty() in function 'cv::imwrite'
 
 


Any idea what may be causing this?
User avatar
gobroncos671
Private First Class
Private First Class
 
Posts: 2
Joined: Mon Jun 08, 2020 1:47 pm

Re: Normbox

Postby GrandpaMike » Sun Feb 14, 2021 1:49 pm

gobroncos671 wrote:
hammer wrote:Full credit to DontAtMe or ME on discord!!

This error came up on some people pc's and after some changes it works now, at least for me ;P
Code: Select all
GCV Error: cannot reshape array of size 8294400 into shape (27,25,4)
Computer Vision: ERROR: Gpython process exited with error code 121

This was related to:
Code: Select all
self.w = self.x2 - self.x1
self.h = self.y2 - self.y1

I only changed the font size a bit to make it more clear.

EDIT: This doesnt mean that Ketechi's original Pastebin version dont work in general!!!
People told me that it worked out of the box


Thanks for this! I was getting that initial error with the original file.

Your version works at first, but after spending more than one minute expanding the box and taking a picture, I receive the following error:

Code: Select all
GCV Error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-k8sx3e60\opencv\modules\imgcodecs\src\loadsave.cpp:738: error: (-215:Assertion failed) !_img.empty() in function 'cv::imwrite'
 
 


Any idea what may be causing this?



you might want to check this out if you still have the error.
https://stackoverflow.com/questions/541 ... cvcvtcolor

I did get the error today trying to save a screenshot..
121Error.JPG
121Error.JPG (62.26 KiB) Viewed 5118 times

the error did not crash the program and i was able to take several still shots after.

Great tutorial definitely got me started with some basic questions i had. I did need to use the modified version but it works great.
User avatar
GrandpaMike
Corporal
Corporal
 
Posts: 5
Joined: Wed Jan 06, 2021 3:29 pm
Location: Georgia

Next

Return to Gtuner Computer Vision

Who is online

Users browsing this forum: No registered users and 44 guests