get_live_histo - General Help and Assistance on using CHDK stable releases - CHDK Forum
supplierdeeply

get_live_histo

  • 6 Replies
  • 906 Views
get_live_histo
« on: 05 / June / 2022, 11:48:31 »
Advertisements
@reyalp @philmoz

I've just noticed a strangeness between the G5X and the G7X.

When using get_live_histo() on the G5X, my Lua script runs as expected.

When I run the the same script on the G7X, the get_live_histo doesn't seem to return any values, ie only 0.

As I say, identical code.

Do you have any insight/ideas as to why this should be?

Cheers

Garry
« Last Edit: 05 / June / 2022, 16:13:13 by pigeonhill »

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: get_live_histo
« Reply #1 on: 05 / June / 2022, 18:31:51 »
@pigeonhill


Does it return the histogram array where all the values are 0 or is it failing and not returning the histogram array at all?


If the latter then you might be running out of memory - get_live_histo can fail if there is no memory to allocate for a temp buffer.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline reyalp

  • ******
  • 14084
Re: get_live_histo
« Reply #2 on: 05 / June / 2022, 18:59:13 »
I've just noticed a strangeness between the G5X and the G7X.
Just to clarify, you have G7 X II, not the original G7 X, correct?

edit:
You can use https://chdk.fandom.com/wiki/Lua/Lua_Reference#get_meminfo to check available memory.
« Last Edit: 05 / June / 2022, 19:14:15 by reyalp »
Don't forget what the H stands for.

Re: get_live_histo
« Reply #3 on: 05 / June / 2022, 20:06:36 »
I’m using the XIMR build and I have the g7X 100d.


The script inspects up to the top 10 bins of the get_live_histo, ie 245 to 255.


On the G5X the bins have non zero values when the image is over exposed.


The same script, on the g7X, with an over exposed image, returns zero in every inspected bin.


*

Offline reyalp

  • ******
  • 14084
Re: get_live_histo
« Reply #4 on: 05 / June / 2022, 20:24:40 »
I’m using the XIMR build and I have the g7X 100d.


The script inspects up to the top 10 bins of the get_live_histo, ie 245 to 255.
G7 X mk1 is one of the cameras that uses less than the full 8 bits for the YUV buffer, with the full range being approximately 16 to 238

https://en.wikipedia.org/wiki/YUV#Relation_with_Y%E2%80%B2CbCr has some discussion of the variations
Don't forget what the H stands for.

Re: get_live_histo
« Reply #5 on: 05 / June / 2022, 20:32:26 »
@reyalp

Thanks, I did not know that.

I’ll recode and report back when I can.

Cheers

Garry

Re: get_live_histo
« Reply #6 on: 06 / June / 2022, 01:51:40 »
@reyalp

Just did a quick test on the G7X and it looks like the highest bin that gets saturated is 235, ie rather than 255.

Many thanks for the education.

Cheers

Garry

 

Related Topics