a small story for my scanner

Built a scanner? Started to build a scanner? Record your progress here. Doesn't need to be a whole scanner - triggers and other parts are fine. Commercial scanners are fine too.

Moderator: peterZ

dpc
Posts: 379
Joined: 01 Apr 2011, 18:05
Number of books owned: 0
Location: Issaquah, WA

Re: a small story for my scanner

Post 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.
Konos93a
Posts: 179
Joined: 19 Sep 2016, 10:00
E-book readers owned: kobo aura,kindle 1,kindle pw3,pocketbook inkpad 2
Number of books owned: 3000
Country: greece

Re: a small story for my scanner

Post 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
Konos93a
Posts: 179
Joined: 19 Sep 2016, 10:00
E-book readers owned: kobo aura,kindle 1,kindle pw3,pocketbook inkpad 2
Number of books owned: 3000
Country: greece

Re: a small story for my scanner

Post by Konos93a »

2023-03-15 05_35_54-Viber.png
2023-03-15 05_35_54-Viber.png (902.15 KiB) Viewed 4710 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
Konos93a
Posts: 179
Joined: 19 Sep 2016, 10:00
E-book readers owned: kobo aura,kindle 1,kindle pw3,pocketbook inkpad 2
Number of books owned: 3000
Country: greece

Re: a small story for my scanner

Post 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 4709 times
User avatar
daniel_reetz
Posts: 2812
Joined: 03 Jun 2009, 13:56
E-book readers owned: Used to have a PRS-500
Number of books owned: 600
Country: United States
Contact:

Re: a small story for my scanner

Post by daniel_reetz »

Scann and I are looking at your scanner together and it is awesome :)
Konos93a
Posts: 179
Joined: 19 Sep 2016, 10:00
E-book readers owned: kobo aura,kindle 1,kindle pw3,pocketbook inkpad 2
Number of books owned: 3000
Country: greece

Re: a small story for my scanner

Post 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
```
Attachments
z_img_20240118_173133.jpg
peterZ
Posts: 27
Joined: 16 Jun 2013, 06:13
Number of books owned: 20000
Country: Australia

Re: a small story for my scanner

Post by peterZ »

I like the idea of using magnetic sensors. Good idea.
Konos93a
Posts: 179
Joined: 19 Sep 2016, 10:00
E-book readers owned: kobo aura,kindle 1,kindle pw3,pocketbook inkpad 2
Number of books owned: 3000
Country: greece

Re: a small story for my scanner

Post 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
Attachments
0-02-05-6896ef5fb48f200be28bfb9aaf85ebad41cf47fec296d76d3ad1948e2bced6fd_3c7b8bd833e9064.jpg
0-02-05-d9816ea46b3ab0f83af6eb8c6238353aeb8717fc12723176df99ad35166b77ef_ebee972a2f0c6dd6.jpg
Konos93a
Posts: 179
Joined: 19 Sep 2016, 10:00
E-book readers owned: kobo aura,kindle 1,kindle pw3,pocketbook inkpad 2
Number of books owned: 3000
Country: greece

Re: a small story for my scanner

Post by Konos93a »

[attachment=0]2024-01-26 12_26_29-Fullscreen Projector (Preview).png
Attachments
2024-01-26 12_26_29-Fullscreen Projector (Preview).png
Konos93a
Posts: 179
Joined: 19 Sep 2016, 10:00
E-book readers owned: kobo aura,kindle 1,kindle pw3,pocketbook inkpad 2
Number of books owned: 3000
Country: greece

Re: a small story for my scanner

Post by Konos93a »

use subtitles rasberypi5 2 camera module v3 https://www.youtube.com/watch?v=0PodyJVMFxg
Attachments
IMG_20240202_145252.jpg
Post Reply