Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:18 26 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Introducing PicoVision

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 05:33pm 04 Nov 2023
Copy link to clipboard 
Print this post

Actually just an extra bitbang command coming soon

BITBANG CAMERA OPEN XCLKpin, PCLKpin, HREFpin, VSYNCpin, RESETpin, DATA0pin

BITBANG CAMERA CAPTURE [scale, [x , y]]

BITBANG CAMERA REGISTER reg%, data%

BITBANG CAMERA TEST tnum

BITBANG CAMERA CLOSE

This uses the cheapest version of the OV7670 camera e.g. and captures a 160x120 RGB565 image which it then writes to the screen. The colour rendition is tolerable (much better than it appears in the photo) but could be improved further by tuning the various camera registers. Update rate is 7FPS onto the display at 1:1 scale and 5FPS scaled to 320x240. The camera is set up using an I2C connection which must be defined using OPTION SYSTEM I2C. In all
15 pins are used including the I2C connection. DATA0pin defines the start of a range of 8 contiguous pins (e.g.GP0 - GP7). Pullups on the I2C pins are essential. I used 2K7 resistors.







If there is serious interest I will code up a basic movement detection capability

Edited 2023-11-05 03:42 by matherp
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2129
Posted: 05:51pm 04 Nov 2023
Copy link to clipboard 
Print this post

far out!
 
gadgetjack
Senior Member

Joined: 15/07/2016
Location: United States
Posts: 142
Posted: 07:27pm 04 Nov 2023
Copy link to clipboard 
Print this post

I am impressed!!!
 
karlelch

Senior Member

Joined: 30/10/2014
Location: Germany
Posts: 172
Posted: 07:31pm 04 Nov 2023
Copy link to clipboard 
Print this post

Nice!!
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 11:19pm 04 Nov 2023
Copy link to clipboard 
Print this post

Hi Peter,

That looks pretty cool.

I have a couple of questions if you can assist.

What is the focal range of the camera, or can it be adjusted?

The specs (well the headline on the listing) states 640x480 resolution, what is the bottleneck with getting that higher resolution?

I see this, for my applications, better as a remote sender to send a static image rather than video.

For instance, I have 2 applications already but both only need a snapshot, static image, and will need the data for the image sent over a network, say hc12, and displayed on a remote screen.

One is a small unit in the letterbox to see if there is mail to collect, this needs a short (say 10cm) focal length, the other is on my porch, I have 2 security cameras but there is a blind spot where the postie often leaves parcels, it would be good to see this spot, on demand, this would need a focal length of say 2m.

Anyway, I realise that this is still early days. I applaud your great work on this as well as ‘mites in general.

Regards,

Mick (the big one)



.
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 396
Posted: 12:05am 05 Nov 2023
Copy link to clipboard 
Print this post

Wow, that's impressive!

But how does it work? I mean is this another iteration of Basic for the Picos, like WebMite,PicoMiteVGA etc? Is this somehow possible to use a VGA monitor?

Greetings
Daniel
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 1344
Posted: 12:09am 05 Nov 2023
Copy link to clipboard 
Print this post

yes it is impressive and if it will work on the pico it should work on the CMM2 aswell and if it can do vga prepare for some interesting wildlife pic's coming up in a while.

Heading up to Mt Isa for a shutdown tomorrow so in the evening I'll be reading reading and reading all about this CMM2 as it will be here when I get home at the end of the month
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 03:11am 05 Nov 2023
Copy link to clipboard 
Print this post

  Quote  What is the focal range of the camera, or can it be adjusted?

If it is a fixed focus lens all is not lost.
Long ago helped the local National Park set up some wildlife cameras that had fixed focus lenses.
These cameras were intended for large animals and so were focused in the distance but they were interested in small animals and birds close up.
The solution was to take the lenses out of reading glasses and tape them over the camera lens. They got snaps of large Bobuck Possum small Brushtail Phascogale and tiny Agile Antechinus as well as birds of all sizes.
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 554
Posted: 05:58am 05 Nov 2023
Copy link to clipboard 
Print this post

Will it run on wlan pico to create a webcam?
Plasma
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 08:23am 05 Nov 2023
Copy link to clipboard 
Print this post

The code is just a new command for the standard Pico variants

The lens screw in and out for focus and I believe different lens are available (standard 12mm thread)

It is not possible to support any resolution > 160x120 due to the limited memory on the RP2040. The pixels are read into a buffer at 3Mbytes/second

It should work on the web version (untested) but it does have to disable interrupts while capturing the picture which may give an issue

I haven't included on the VGA version thus far as the colour pallet is so limited (RGB121)

I've also now got motion detection working in principal - just need to work out how best to package it in MMBasic for ease of use
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 10:34am 05 Nov 2023
Copy link to clipboard 
Print this post

OK I'm happy with this subject to any useful comments or suggestions

BITBANG CAMERA CHANGE image%(),change! [,scale [,x ,y]]

image% is an array of size 160x120 bytes (DIM image%(160,120/8-1)
On calling the command the first time it holds a packed 8-bit greyscale image.
The change! variable returns the percentage the image has changed from the previous time the command was called.
Optionally if "scale" is set then the image delta is output to the screen i.e. the difference between the previous image and this one.
The new command makes it trivially easy to check for and log activity in the camera's field of view

Example program

  Quote  'simple motion detection app
CLS
Dim a%(120*160/8-1) 'create the image buffer
Dim change!
Bitbang camera open gp20,gp21,gp26,gp27,gp28,gp0
Pause 5000 'allow time for the gain control and white balance to settle
Bitbang camera change a%(),change! 'establish the baseline image
Do
 Bitbang camera change a%(),change!
 If (change!>5) Then ' 5% change in the image is the threshold for logging
   Bitbang camera capture 2
   Text 0,0,DateTime$(now),,,,RGB(red),-1
   ' create a unique filename
   fname$="B:/pic"
   Inc fname$,Right$(Date$,4)
   Inc fname$,Mid$(Date$,4,2)
   Inc fname$,Left$(Date$,2)
   Inc fname$,Left$(Time$,2)
   Inc fname$,Mid$(Time$,4,2)
   Inc fname$,Right$(Time$,2)
   ' save the timestamped image
   Save image fname$
 EndIf
Loop

 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2129
Posted: 09:13pm 05 Nov 2023
Copy link to clipboard 
Print this post

Is there a IR filter you could "peel off" and change the colours to make a "thermal camera"?
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 09:34pm 05 Nov 2023
Copy link to clipboard 
Print this post

Thermal cameras use a different sensor material sensitive to long wave infrared.
They also use a black germanium lens as glass and plastic block long wave infrared.
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 396
Posted: 09:52pm 05 Nov 2023
Copy link to clipboard 
Print this post

But what you can do, if you remove the IR filter element of the camera, you get a really sensitive night vision camera, which - additionaly to IR LED spots - can make a cool night vision camera.

Greeings
Daniel
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2129
Posted: 05:24pm 06 Nov 2023
Copy link to clipboard 
Print this post

Thermal imaging cameras are expensive. Just thought a cheaper option.
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 396
Posted: 08:37pm 06 Nov 2023
Copy link to clipboard 
Print this post

@ stanleyella

but there is a cheap thermal imaging cam, take a look at the "AMG8833". It is just 8x8 but you can read them in basic and use it as a "human presence detector" etc.


Greetings
Daniel
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2129
Posted: 02:40pm 07 Nov 2023
Copy link to clipboard 
Print this post

I thought of using servos and a cheap laser thermometer sensor and found someone had similar thoughts years ago. I was thinking a tiny rc servo mounted on another, scans left taking temp reads and storing then 2nd servo drops it a "line" and it scans the other direction and stores readings and repeats until there's an "image" of temp readings then send to display with different colours for different temps . https://hackaday.io/project/20394-diy-thermal-camera
Edited 2023-11-08 00:57 by stanleyella
 
r2d2
Newbie

Joined: 16/02/2024
Location: Czech Republic
Posts: 1
Posted: 10:26pm 20 Feb 2024
Copy link to clipboard 
Print this post

Hello,

Is it possible to run camera without connected LCD ?
I tried and got error:

[2] Device CAMERA OPEN 26, 17, 25, 24, 16, 6
Error : Invalid display type
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 10:47pm 20 Feb 2024
Copy link to clipboard 
Print this post

No: the display is used as a framebuffer
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024