Page 8 of 8

Re: a small story for my scanner

Posted: 08 Jun 2021, 13:34
by dpc
If you want to see reflections, put black paper under the platen, leave the lights ON, then photograph the black paper. I'm not sure what photographing book pages with the lights OFF shows, other than light contributions to your images from light sources other than the scanner's light.

Re: a small story for my scanner

Posted: 10 Jun 2021, 12:05
by Konos93a
If you want to see reflections, put black paper under the platen, leave the lights ON, then photograph the black paper. I'm not sure what photographing book pages with the lights OFF shows, other than light contributions to your images from light sources other than the scanner's light.
ok the last images are the same with the lights ON but the black one are edited .with abbyfinereader or photoshop or any editor reduce bright option i made it black so i could see how the light is on the surface of the page easier and some reflections.

reflections could be seen from camera with one photo or more difficult with liveview using a black paper under the glass or a mirror upper the glass

Re: a small story for my scanner

Posted: 15 Mar 2023, 00:08
by Konos93a
2023-03-15 05_35_54-Viber.png
2023-03-15 05_35_54-Viber.png (902.15 KiB) Viewed 8417 times
i added a magnetic sensor to power my 2 camera with electric trigger i can count about around 30 pages per minute or max 1800 pages per hour .

on the last book was 7 pages from 700 pages that needed to recapture.

i think that the most important with the magnetic trigger is that i dont have to do a move more in a page -capture cycle and is easier to scan

Re: a small story for my scanner

Posted: 15 Mar 2023, 00:42
by Konos93a
from
2023-03-15 06_39_41-IMG_6426.JPG - Πρ. προβολής φωτογραφιών Windows.png
to
2023-03-15 06_40_17-Viber.png
2023-03-15 06_40_17-Viber.png (1.66 MiB) Viewed 8416 times

Re: a small story for my scanner

Posted: 05 Dec 2023, 06:55
by daniel_reetz
Scann and I are looking at your scanner together and it is awesome :)

Re: a small story for my scanner

Posted: 18 Jan 2024, 11:48
by Konos93a
using raspberry pi 5 and camera module 3 i

in rasbery pi 3+ is about 1 sec and something
in rasbery 5 check the results is like a fire
i dont know if that staff can replace camera i will do some more tests but since is difficult to find canon cameras that support chdk i believe this is a very good alternative.

if u ever use it try to have more than 1.5 mb capture photos

i will try and with gpio to have liveview from the camera because qt ask permission and i already run the script with root permissions


```
import keyboard
from picamera2 import Picamera2
import time
from datetime import datetime
from libcamera import controls
import os

picam2 = Picamera2()
config = picam2.create_still_configuration(buffer_count=3)
picam2.configure(config)
picam2.start(show_preview=False)
picam2.set_controls({"AfMode": controls.AfModeEnum.Continuous})


try:
while True:

# Wait for the space key to be pressed
keyboard.wait("space")


# Record the start time
start_time = time.time()

# Capture an image
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
filename = f"z_img_{timestamp}.jpg"

request = picam2.capture_request(flush=True)
request.save('main', filename)
request.release()

# Get the size of the captured image in bytes
file_size_bytes = os.path.getsize(filename)

# Convert the file size to megabytes
file_size_mb = file_size_bytes / (1024 ** 2)

# Record the end time
end_time = time.time()

# Calculate and print the time taken and the size of the image in megabytes
capture_time = end_time - start_time

print(f"Image captured: {filename}, Time taken: {capture_time:.2f} seconds, Size: {file_size_mb:.2f} MB")

except KeyboardInterrupt:
pass
finally:
# Clean up
picam2.stop()
```
results

```
^Ckonos93@raspberrypi:~/Desktop/camera $ sudo python k.py
[1:06:13.537387199] [5054] INFO Camera camera_manager.cpp:284 libcamera v0.1.0+118-563cd78e
[1:06:13.551804215] [5060] INFO RPI pisp.cpp:653 libpisp version v1.0.2 fa44a258644a 22-11-2023 (21:59:22)
[1:06:13.562088602] [5060] INFO RPI pisp.cpp:1112 Registered camera /base/axi/pcie@120000/rp1/i2c@80000/imx708@1a to CFE device /dev/media0 and ISP device /dev/media2 using PiSP variant BCM2712_C0
[1:06:13.563516768] [5054] INFO Camera camera_manager.cpp:284 libcamera v0.1.0+118-563cd78e
[1:06:13.581083617] [5063] INFO RPI pisp.cpp:653 libpisp version v1.0.2 fa44a258644a 22-11-2023 (21:59:22)
[1:06:13.591861763] [5063] INFO RPI pisp.cpp:1112 Registered camera /base/axi/pcie@120000/rp1/i2c@80000/imx708@1a to CFE device /dev/media0 and ISP device /dev/media2 using PiSP variant BCM2712_C0
[1:06:13.594569762] [5054] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format Y16
[1:06:13.594628188] [5054] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format RGB6
[1:06:13.594636373] [5054] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format BGR6
[1:06:13.594646132] [5054] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format PC1M
[1:06:13.595732169] [5054] INFO Camera camera.cpp:1183 configuring streams: (0) 4608x2592-BGR888 (1) 4608x2592-BGGR16_PISP_COMP1
[1:06:13.595897891] [5063] INFO RPI pisp.cpp:1396 Sensor: /base/axi/pcie@120000/rp1/i2c@80000/imx708@1a - Selected sensor format: 4608x2592-SBGGR10_1X10 - Selected CFE format: 4608x2592-PC1B
Image captured: z_img_20240118_173253.jpg, Time taken: 0.37 seconds, Size: 1.68 MB
Image captured: z_img_20240118_173254.jpg, Time taken: 0.30 seconds, Size: 1.72 MB
Image captured: z_img_20240118_173255.jpg, Time taken: 0.34 seconds, Size: 1.84 MB
```

Re: a small story for my scanner

Posted: 19 Jan 2024, 20:43
by peterZ
I like the idea of using magnetic sensors. Good idea.

Re: a small story for my scanner

Posted: 25 Jan 2024, 22:38
by Konos93a
this is for raspberry pi5
to use one camera v3

import keyboard
from picamera2 import Picamera2, Preview
import time
from datetime import datetime
from datetime import datetime
from libcamera import controls
import os

picam2 = Picamera2() # if u have one camera it will try to check it
#if u have alrerd two connected and wanna use only one use Picamera2(1) or Picamera2(1)
config = picam2.create_still_configuration(buffer_count=3)
picam2.configure(config)

picam2.start_preview(Preview.QTGL)
preview_config = picam2.create_preview_configuration({"size": (4096, 2592)})
picam2.configure(preview_config)

picam2.start()

picam2.set_controls({"AfMode": controls.AfModeEnum.Continuous })



try:
while True:

# Wait for the space key to be pressed
keyboard.wait("space")


# Record the start time
start_time = time.time()

# Capture an image
timeStamp = datetime.now().strftime("%Y%m%d-%H%M%S.%f")[:-4]
filename = f"z_img_{timeStamp}.jpg"

request = picam2.capture_request(flush=False )
request.save('main', filename)
request.release()

# Get the size of the captured image in bytes
file_size_bytes = os.path.getsize(filename)

# Convert the file size to megabytes
file_size_mb = file_size_bytes / (1024 ** 2)

# Record the end time
end_time = time.time()

# Calculate and print the time taken and the size of the image in megabytes
capture_time = end_time - start_time

print(f"Image captured: {filename}, Time taken: {capture_time:.2f} seconds, Size: {file_size_mb:.2f} MB")

except KeyboardInterrupt:
pass
finally:
# Clean up
picam2.stop_preview()
picam2.stop()

for two camera v3

import keyboard
from picamera2 import Picamera2, Preview
import time
from datetime import datetime
from libcamera import controls
import os

def capture_image(picam2, filename_prefix):
# Record the start time
start_time = time.time()

# Capture an image
timeStamp = datetime.now().strftime("%Y%m%d-%H%M%S.%f")[:-4]
filename = f"{filename_prefix}_img_{timeStamp}.jpg"

request = picam2.capture_request(flush=False)
request.save('main', filename)
request.release()

# Get the size of the captured image in bytes
file_size_bytes = os.path.getsize(filename)

# Convert the file size to megabytes
file_size_mb = file_size_bytes / (1024 ** 2)

# Record the end time
end_time = time.time()

# Calculate and print the time taken and the size of the image in megabytes
capture_time = end_time - start_time

print(f"Image captured: {filename}, Time taken: {capture_time:.2f} seconds, Size: {file_size_mb:.2f} MB")

# Set up the first camera
picam1 = Picamera2(1)
config1 = picam1.create_still_configuration(buffer_count=3)
picam1.configure(config1)
picam1.start_preview(Preview.QTGL)
preview_config1 = picam1.create_preview_configuration({"size": (4096, 2592)})
picam1.configure(preview_config1)
picam1.start()
picam1.set_controls({"AfMode": controls.AfModeEnum.Continuous})

# Set up the second camera
picam2 = Picamera2(0)
config2 = picam2.create_still_configuration(buffer_count=3)
picam2.configure(config2)
picam2.start_preview(Preview.QTGL)
preview_config2 = picam2.create_preview_configuration({"size": (4096, 2592)})
picam2.configure(preview_config2)
picam2.start()
picam2.set_controls({"AfMode": controls.AfModeEnum.Continuous})

try:
while True:
# Wait for the space key to be pressed
keyboard.wait("space")

# Capture images from both cameras
capture_image(picam1, "y")
capture_image(picam2, "x")

except KeyboardInterrupt:
pass
finally:
# Close QtGL preview windows
picam1.stop_preview()
picam2.stop_preview()

# Clean up both cameras
picam1.stop()
picam2.stop()

to calibrate camera i use app_capture_overlay.py before i use what script we made

if u wanna have lens opposite from a glass u have to see in the middle the lens on a mirror

i will scan a whole book and say the results and in the future i will make a ^-scanner

Re: a small story for my scanner

Posted: 26 Jan 2024, 06:28
by Konos93a
[attachment=0]2024-01-26 12_26_29-Fullscreen Projector (Preview).png

Re: a small story for my scanner

Posted: 14 Feb 2024, 22:04
by Konos93a
use subtitles rasberypi5 2 camera module v3 https://www.youtube.com/watch?v=0PodyJVMFxg