Re: PureBasic Interface to OpenCV
Posted: Wed Oct 04, 2017 11:02 am
Ok, thank you both !
http://www.purebasic.com
http://forums.purebasic.com/english/
Code: Select all
;OpenCV32
UseJPEGImageDecoder()
UseJPEGImageEncoder()
IncludeFile "includes/cv_functions.pbi"
EnableExplicit
Global PBfont=LoadFont(#PB_Any ,"Arial",18,#PB_Font_HighQuality|#PB_Font_Bold )
Global *writer , *capture.CvCapture,*decode.IplImage,*image.IplImage,*convert.iplImage
Global video_W=360,Video_H=288,FPS=30
Define nCreate,cnt,movex,FrameCount.d
Procedure PBPutText(text.s="add image demo")
Protected img,w,h,*buffer,*mat.CvMat
img= CreateImage(#PB_Any, 100, 30,32)
If img And StartDrawing(ImageOutput(img))
DrawingFont(FontID(PBfont))
DrawingMode( #PB_2DDrawing_Transparent )
DrawText(5, 4, text,$00410000)
DrawText(1,1, text,$000C7CC5)
StopDrawing()
EndIf
If IsImage(img)
*buffer = EncodeImage(img, #PB_ImagePlugin_JPEG)
*mat = cvCreateMatHeader(ImageWidth(img), ImageHeight(img), CV_MAKETYPE(#CV_8U, 3))
cvSetData(*mat, *buffer, #CV_AUTOSTEP)
*decode = cvDecodeImage(*mat,#CV_LOAD_IMAGE_COLOR); #CV_LOAD_IMAGE_COLOR)
FreeImage(img)
EndIf
EndProcedure
PBPutText("JHPJHP")
*writer = cvCreateVideoWriter("/videos/outtext.avi", CV_FOURCC("D", "I", "V", "X"), FPS,video_W,video_H, #True); 360,300,#True);960,720, #True)
Repeat
nCreate + 1
*capture = cvCreateFileCapture("binaries/videos/ball.mp4")
Until nCreate = 5 Or *capture
FrameCount = cvGetCaptureProperty(*capture, #CV_CAP_PROP_FRAME_COUNT)
movex=1
Repeat
*image = cvQueryFrame(*capture)
If *image
cvSetImageROI(*image,movex,10,100,20) ; Location of moving text
Define *iroi.IplImage = cvCreateImage(100, 20, *image\depth, *image\nChannels) ;section of image to transform
cvcopy(*image, *iroi,#Null)
*convert = cvCreateImage(100, 20, *decode\depth, *decode\nChannels) ; in case the image I create is a different size
cvResize(*decode, *convert, #CV_INTER_AREA)
;cvcvtcolor(*decode,*convert,#CV_RGBA2BGR,1) ;I wish It was as simple as changing color
Define *tgray.IplImage = cvCreateImage(100, 20, #IPL_DEPTH_8U, 1) ; create temp gray image
cvCvtColor(*convert, *tgray, #CV_BGR2GRAY,1) ; get our letters turn them gray 1 channel
Define *gray.IplImage = cvCreateImage(100, 20, #IPL_DEPTH_8U, 3) ; go back to 3 channels
cvThreshold(*tgray, *tgray, 50, 255, #CV_THRESH_BINARY ) ; mask
cvCvtColor(*tgray, *gray, #CV_GRAY2BGR,1) ; back to 3 channel
Define *notgray.IplImage = cvCreateImage(100, 20, #IPL_DEPTH_8U, 3) ; I want to not the LETTERS so that iroi displays fine
cvnot(*gray,*notgray)
;cvand(*iroi,*notgray,*iroi, #Null) ; and notgray to create mask
;cvand(*convert,*iroi,*convert,#Null) add mask to original LETTERS
cvAdd(*image,*convert,*image,#Null)
cvResetImageROI(*image)
cvWriteFrame(*writer, *image)
Debug cnt
Else
Break
EndIf
cnt+1
movex +5
If movex > 250 : movex=250:EndIf
Until cnt> 60
;Until cnt>FrameCount
cvReleaseVideoWriter(@*writer)
Sometimes I think it would be useful to make a guide to the examples.normeus wrote:I will try to at least read the names of the examples. Examples are there for a reason!!!
Code: Select all
IncludeFile "includes/cv_functions.pbi"
Global openCV, *save.IplImage, exitCV, lpPrevWndFunc
#CV_WINDOW_NAME = "PureBasic Interface to OpenCV"
#CV_DESCRIPTION = "Draw text using PureBasic commands with any font onto an OpenCV generated image." + #LF$ + #LF$ +
"SPACEBAR " + #TAB$ + ": Change to another font."
Procedure WindowCallback(hWnd, uMsg, wParam, lParam)
Select uMsg
Case #WM_COMMAND
Select wParam
Case 1
openCV = #True
keybd_event_(#VK_ESCAPE, 0, 0, 0)
Case 2
FileName.s = SaveCVImage()
If FileName
params.CvSaveData
Select LCase(GetExtensionPart(FileName))
Case "bmp", "dib"
Case "jpeg", "jpg", "jpe"
params\paramId = #CV_IMWRITE_JPEG_QUALITY
params\paramValue = 95
Case "jp2"
Case "png"
params\paramId = #CV_IMWRITE_PNG_COMPRESSION
params\paramValue = 3
Case "ppm", "pgm", "pbm"
params\paramId = #CV_IMWRITE_PXM_BINARY
params\paramValue = 1
Case "sr", "ras"
Case "tiff", "tif"
Default
Select SelectedFilePattern()
Case 0
FileName + ".bmp"
Case 1
FileName + ".jpg"
params\paramId = #CV_IMWRITE_JPEG_QUALITY
params\paramValue = 95
Case 2
FileName + ".jp2"
Case 3
FileName + ".png"
params\paramId = #CV_IMWRITE_PNG_COMPRESSION
params\paramValue = 3
Case 4
FileName + ".ppm"
params\paramId = #CV_IMWRITE_PXM_BINARY
params\paramValue = 1
Case 5
FileName + ".sr"
Case 6
FileName + ".tiff"
EndSelect
EndSelect
cvSaveImage(FileName, *save, @params)
EndIf
Case 10
keybd_event_(#VK_ESCAPE, 0, 0, 0)
EndSelect
Case #WM_DESTROY
exitCV = #True
EndSelect
ProcedureReturn CallWindowProc_(lpPrevWndFunc, hWnd, uMsg, wParam, lParam)
EndProcedure
Procedure CvMouseCallback(event, x.l, y.l, flags, *param.CvUserData)
Select event
Case #CV_EVENT_RBUTTONDOWN
*save = *param\Pointer1
DisplayPopupMenu(0, *param\Value)
EndSelect
EndProcedure
Procedure OpenCV(ImageFile.s)
If FileSize(ImageFile) > 0
cvNamedWindow(#CV_WINDOW_NAME, #CV_WINDOW_AUTOSIZE)
window_handle = cvGetWindowHandle(#CV_WINDOW_NAME)
*window_name = cvGetWindowName(window_handle)
lpPrevWndFunc = SetWindowLongPtr_(window_handle, #GWL_WNDPROC, @WindowCallback())
If CreatePopupImageMenu(0, #PB_Menu_ModernLook)
MenuItem(1, "Open")
MenuBar()
MenuItem(2, "Save")
MenuBar()
MenuItem(10, "Exit")
EndIf
hWnd = GetParent_(window_handle)
iconCV = LoadImage_(GetModuleHandle_(0), @"icons/opencv.ico", #IMAGE_ICON, 35, 32, #LR_LOADFROMFILE)
SendMessage_(hWnd, #WM_SETICON, 0, iconCV)
wStyle = GetWindowLongPtr_(hWnd, #GWL_STYLE)
SetWindowLongPtr_(hWnd, #GWL_STYLE, wStyle & ~(#WS_MAXIMIZEBOX | #WS_MINIMIZEBOX | #WS_SIZEBOX))
*image.IplImage = cvLoadImage(ImageFile, #CV_LOAD_IMAGE_ANYDEPTH | #CV_LOAD_IMAGE_ANYCOLOR)
dtWidth = DesktopWidth(0) : dtHeight = DesktopHeight(0)
If *image\width >= dtWidth - 100 Or *image\height >= dtHeight - 100
iWidth = dtWidth - 100
iRatio1.d = iWidth / *image\width
iHeight = dtHeight - 100
iRatio2.d = iHeight / *image\height
If iRatio1 < iRatio2
iWidth = *image\width * iRatio1
iHeight = *image\height * iRatio1
Else
iWidth = *image\width * iRatio2
iHeight = *image\height * iRatio2
EndIf
cvResizeWindow(#CV_WINDOW_NAME, iWidth, iHeight)
*resize.IplImage = cvCreateImage(iWidth, iHeight, #IPL_DEPTH_8U, *image\nChannels)
cvResize(*image, *resize, #CV_INTER_AREA)
Else
cvResizeWindow(#CV_WINDOW_NAME, *image\width, *image\height)
*resize.IplImage = cvCloneImage(*image)
EndIf
cvMoveWindow(#CV_WINDOW_NAME, 20, 20)
ToolTip(window_handle, #CV_DESCRIPTION)
If *resize\width >= 640 And *resize\height >= 480 And *resize\nChannels = 3
*reset.IplImage = cvCloneImage(*resize)
*mask.IplImage = cvCreateImage(*resize\width, 80, #IPL_DEPTH_8U, *resize\nChannels)
*maskShadow.IplImage = cvCloneImage(*mask)
pbImage = CreateImage(#PB_Any, *mask\width, 80, 24, RGB(0, 0, 0))
pbImageShadow = CreateImage(#PB_Any, *mask\width, 80, 24, RGB(0, 0, 0))
fontName.s = "Comic Sans MS"
nFont = LoadFont(#PB_Any, fontName, 36, #PB_Font_HighQuality)
If *resize\width = 640 : fontX = 20 : Else : fontX = (*resize\width - 640) / 2 + 20 : EndIf : fontY = 5
font.CvFont : cvInitFont(@font, #CV_FONT_HERSHEY_COMPLEX | #CV_FONT_ITALIC, 1, 1, #Null, 1, #CV_AA)
*param.CvUserData = AllocateMemory(SizeOf(CvUserData))
*param\Pointer1 = *resize
*param\Value = window_handle
cvSetMouseCallback(*window_name, @CvMouseCallback(), *param)
Repeat
If *resize
cvSetZero(*mask)
cvSetZero(*maskShadow)
If StartDrawing(ImageOutput(pbImage))
DrawingFont(FontID(nFont))
DrawingMode(#PB_2DDrawing_Transparent|#PB_2DDrawing_Gradient )
DrawText(fontX, fontY, "Use any font with OpenCV!", $00000000)
*mask\imageData = DrawingBuffer()
StopDrawing()
EndIf
If StartDrawing(ImageOutput(pbImageShadow))
DrawingFont(FontID(nFont))
DrawingMode(#PB_2DDrawing_Transparent|#PB_2DDrawing_Gradient )
DrawText(fontX+5, fontY+5, "Use any font with OpenCV!", $FFFFFFFF) ; +5 to see the effect
*maskShadow\imageData = DrawingBuffer()
StopDrawing()
cvSmooth(*maskShadow, *maskShadow, #CV_GAUSSIAN, 13, 13, 0, 0) ; <----- blurring the shadow
EndIf
cvFlip(*mask, #Null, 0)
cvFlip(*maskShadow, #Null, 0)
cvSetImageROI(*resize, 0, *resize\height - 100, *resize\width, 80)
;cvAddS(*resize, 70, 70, 70, 0, *resize, 0)
cvSub(*resize, *maskShadow, *resize, 0)
cvAdd(*resize, *mask, *resize, 0)
cvResetImageROI(*resize)
cvPutText(*resize, fontName, 7, 30, @font, 0, 0, 0, 0)
cvPutText(*resize, fontName, 5, 28, @font, 255, 255, 255, 0)
cvShowImage(#CV_WINDOW_NAME, *resize)
keyPressed = cvWaitKey(0)
If keyPressed = 32
newfont = (newfont + 1) % 10
FreeFont(nFont)
Select newfont
Case 0
fontName = "Comic Sans MS"
fontY = 5
nFont = LoadFont(#PB_Any, "Comic Sans MS", 36, #PB_Font_HighQuality)
Case 1
fontName = "Arial"
fontY = 12
nFont = LoadFont(#PB_Any, "Arial", 37, #PB_Font_HighQuality)
Case 2
fontName = "Impact"
fontY = 8
nFont = LoadFont(#PB_Any, "Impact", 42, #PB_Font_HighQuality)
Case 3
fontName = "Times New Roman"
fontY = 10
nFont = LoadFont(#PB_Any, "Times New Roman", 40, #PB_Font_HighQuality)
Case 4
fontName = "Verdana"
fontY = 14
nFont = LoadFont(#PB_Any, "Verdana", 33, #PB_Font_HighQuality)
Case 5
fontName = "Courier New"
fontY = 22
nFont = LoadFont(#PB_Any, "Courier New", 30, #PB_Font_HighQuality)
Case 6
fontName = "Tahoma"
fontY = 8
nFont = LoadFont(#PB_Any, "Tahoma", 38, #PB_Font_HighQuality)
Case 7
fontName = "Modern"
fontY = 8
nFont = LoadFont(#PB_Any, "Modern", 44, #PB_Font_Bold | #PB_Font_HighQuality)
Case 8
fontName = "Georgia"
fontY = 14
nFont = LoadFont(#PB_Any, "Georgia", 37, #PB_Font_HighQuality)
Case 9
fontName = "Garamond"
fontY = 12
nFont = LoadFont(#PB_Any, "Garamond", 37, #PB_Font_HighQuality)
EndSelect
EndIf
cvReleaseImage(@*resize)
*resize = cvCloneImage(*reset)
EndIf
Until keyPressed = 27 Or exitCV
FreeMemory(*param)
FreeFont(nFont)
FreeImage(pbImage)
cvReleaseImage(@*mask)
cvReleaseImage(@*reset)
cvReleaseImage(@*resize)
cvReleaseImage(@*image)
cvDestroyAllWindows()
If openCV
openCV = #False
exitCV = #False
OpenCV(OpenCVImage())
EndIf
Else
If *resize\nChannels = 3
MessageRequester(#CV_WINDOW_NAME, ImageFile + #LF$ + #LF$ + "... does not meet the size requirements, please try another image.", #MB_ICONERROR)
Else
MessageRequester(#CV_WINDOW_NAME, ImageFile + #LF$ + #LF$ + "... does not meet the channel requirements, please try another image.", #MB_ICONERROR)
EndIf
cvReleaseImage(@*resize)
cvReleaseImage(@*image)
cvDestroyAllWindows()
exitCV = #False
OpenCV(OpenCVImage())
EndIf
EndIf
EndProcedure
ExamineDesktops()
OpenCV("images/colors.jpg")
Code: Select all
...
If StartDrawing(ImageOutput(pbImageShadow))
DrawingFont(FontID(nFont))
DrawingMode(#PB_2DDrawing_Transparent|#PB_2DDrawing_Gradient )
DrawText(fontX+5, fontY+5, "Use any font with OpenCV!", $FFFFFFFF)
*maskShadow\imageData = DrawingBuffer()
StopDrawing()
cvSmooth(*maskShadow, *maskShadow, #CV_GAUSSIAN, 13, 13, 0, 0) ; <----- blurring the shadow
EndIf
...
Code: Select all
cvResizeWindow()
NOTE: You could also include an option to have all six cameras displaying at the same time; relatively easy using OpenCV.captain_skank wrote:On another item is is there a correct way to change feeds ? I want to cycle through 6 different ip cameras.
Code: Select all
IncludeFile "includes/cv_functions.pbi"
Global lpPrevWndFunc
#CV_WINDOW_NAME = "PureBasic Interface to OpenCV"
#CV_DESCRIPTION = "View RTSP (Real Time Streaming Protocol) feeds." + #LF$ + #LF$ +
"[ 1-7 ] KEYS" + #TAB$ + ": Change Feed."
Procedure WindowCallback(hWnd, uMsg, wParam, lParam)
Shared exitCV
Select uMsg
Case #WM_COMMAND
Select wParam
Case 10
exitCV = #True
EndSelect
Case #WM_DESTROY
exitCV = #True
EndSelect
ProcedureReturn CallWindowProc_(lpPrevWndFunc, hWnd, uMsg, wParam, lParam)
EndProcedure
Procedure CaptureFeed(Array arrRTSP.s(1), nFeed)
*capture.CvCapture
If *capture : cvReleaseCapture(@*capture) : EndIf
Repeat
nCreate + 1
*capture = cvCreateFileCapture(arrRTSP(nFeed) + "?Transport=multicast")
Until nCreate = 5 Or *capture
ProcedureReturn *capture
EndProcedure
Procedure ResizeFrame(*capture, MaxSize)
FrameWidth = cvGetCaptureProperty(*capture, #CV_CAP_PROP_FRAME_WIDTH)
FrameHeight = cvGetCaptureProperty(*capture, #CV_CAP_PROP_FRAME_HEIGHT)
If FrameWidth > MaxSize
nRatio.d = MaxSize / FrameWidth
FrameWidth * nRatio : FrameHeight * nRatio
EndIf
*frame.IplImage
If *frame : cvReleaseImage(@*frame) : EndIf
*frame = cvCreateImage(FrameWidth, FrameHeight, #IPL_DEPTH_8U, 3)
ProcedureReturn *frame
EndProcedure
Dim arrRTSP.s(7)
arrRTSP(0) = "http://live.wazcam.net/live/quds.stream/playlist.m3u8"
arrRTSP(1) = "http://live.wazcam.net/live/kana.stream/playlist.m3u8"
arrRTSP(2) = "http://live.wazcam.net/live/tamra.stream/playlist.m3u8"
arrRTSP(3) = "http://live.wazcam.net/live/big.stream/playlist.m3u8"
arrRTSP(4) = "http://live.wazcam.net/live/city2.stream/playlist.m3u8"
arrRTSP(5) = "http://live.wazcam.net/live/mashhad.stream/playlist.m3u8"
arrRTSP(6) = "http://live.wazcam.net/live/reneh.stream/playlist.m3u8"
cvNamedWindow(#CV_WINDOW_NAME, #CV_WINDOW_AUTOSIZE)
window_handle = cvGetWindowHandle(#CV_WINDOW_NAME)
*window_name = cvGetWindowName(window_handle)
lpPrevWndFunc = SetWindowLongPtr_(window_handle, #GWL_WNDPROC, @WindowCallback())
hWnd = GetParent_(window_handle)
iconCV = LoadImage_(GetModuleHandle_(0), @"icons/opencv.ico", #IMAGE_ICON, 35, 32, #LR_LOADFROMFILE)
SendMessage_(hWnd, #WM_SETICON, 0, iconCV)
wStyle = GetWindowLongPtr_(hWnd, #GWL_STYLE)
SetWindowLongPtr_(hWnd, #GWL_STYLE, wStyle & ~(#WS_MAXIMIZEBOX | #WS_MINIMIZEBOX | #WS_SIZEBOX))
cvMoveWindow(#CV_WINDOW_NAME, 20, 20)
ToolTip(window_handle, #CV_DESCRIPTION)
*capture = CaptureFeed(arrRTSP(), 0)
*frame = ResizeFrame(*capture, 640)
*image.IplImage
font.CvFont : cvInitFont(@font, #CV_FONT_HERSHEY_COMPLEX_SMALL, 2, 2, #Null, 2, #CV_AA)
Repeat
*image = cvQueryFrame(*capture)
If *image
cvResize(*image, *frame, #CV_INTER_AREA)
cvPutText(*frame, "RTSP Feed: " + Str(nFeed + 1), 30, 60, @font, 0, 255, 255, 0)
cvShowImage(#CV_WINDOW_NAME, *frame)
keyPressed = cvWaitKey(10)
Select keyPressed
Case 49 To 55
nFeed = keyPressed - 49
*capture = CaptureFeed(arrRTSP(), nFeed)
*frame = ResizeFrame(*capture, 640)
EndSelect
Else
Break
EndIf
Until keyPressed = 27 Or exitCV
If *frame : cvReleaseImage(@*frame) : EndIf
cvDestroyAllWindows()
If *capture : cvReleaseCapture(@*capture) : EndIf
My fault, I should have asked which version of the interface you downloaded.captain_skank wrote:Unfortunately the code provided won't run - it throws an error 'The code execution cannot proceed becasue opencv_world330.dll was not found'
*** The previous (updated) / following example should only be used as a guide to a more robust solution ***captain_skank wrote:I would be interested in knowing how to display multiple feeds at once though.
Code: Select all
IncludeFile "includes/cv_functions.pbi"
Global lpPrevWndFunc
#CV_WINDOW_NAME = "PureBasic Interface to OpenCV"
#CV_DESCRIPTION = "View 6 RTSP (Real Time Streaming Protocol) feeds."
Procedure WindowCallback(hWnd, uMsg, wParam, lParam)
Shared exitCV
Select uMsg
Case #WM_COMMAND
Select wParam
Case 10
exitCV = #True
EndSelect
Case #WM_DESTROY
exitCV = #True
EndSelect
ProcedureReturn CallWindowProc_(lpPrevWndFunc, hWnd, uMsg, wParam, lParam)
EndProcedure
Dim arrRTSP.s(6) : Dim *capture.CvCapture(6)
arrRTSP(0) = "http://live.wazcam.net/live/quds.stream/playlist.m3u8"
arrRTSP(1) = "http://live.wazcam.net/live/kana.stream/playlist.m3u8"
arrRTSP(2) = "http://live.wazcam.net/live/tamra.stream/playlist.m3u8"
arrRTSP(3) = "http://live.wazcam.net/live/big.stream/playlist.m3u8"
arrRTSP(4) = "http://live.wazcam.net/live/city2.stream/playlist.m3u8"
arrRTSP(5) = "http://live.wazcam.net/live/mashhad.stream/playlist.m3u8"
For rtnCount = 0 To ArraySize(*capture()) - 1
Repeat
nCreate + 1
*capture(rtnCount) = cvCreateFileCapture(arrRTSP(rtnCount) + "?Transport=multicast")
Until nCreate = 5 Or *capture(rtnCount)
nCreate = 0
Next
FrameWidth = cvGetCaptureProperty(*capture(0), #CV_CAP_PROP_FRAME_WIDTH)
FrameHeight = cvGetCaptureProperty(*capture(0), #CV_CAP_PROP_FRAME_HEIGHT)
If FrameWidth > 320
nRatio.d = 320 / FrameWidth
FrameWidth * nRatio : FrameHeight * nRatio
EndIf
*frame.IplImage = cvCreateImage(FrameWidth * 3, FrameHeight * 2, #IPL_DEPTH_8U, 3)
cvNamedWindow(#CV_WINDOW_NAME, #CV_WINDOW_AUTOSIZE)
window_handle = cvGetWindowHandle(#CV_WINDOW_NAME)
*window_name = cvGetWindowName(window_handle)
lpPrevWndFunc = SetWindowLongPtr_(window_handle, #GWL_WNDPROC, @WindowCallback())
hWnd = GetParent_(window_handle)
iconCV = LoadImage_(GetModuleHandle_(0), @"icons/opencv.ico", #IMAGE_ICON, 35, 32, #LR_LOADFROMFILE)
SendMessage_(hWnd, #WM_SETICON, 0, iconCV)
wStyle = GetWindowLongPtr_(hWnd, #GWL_STYLE)
SetWindowLongPtr_(hWnd, #GWL_STYLE, wStyle & ~(#WS_MAXIMIZEBOX | #WS_MINIMIZEBOX | #WS_SIZEBOX))
cvMoveWindow(#CV_WINDOW_NAME, 20, 20)
ToolTip(window_handle, #CV_DESCRIPTION)
*image1.IplImage : *image2.IplImage : *image3.IplImage : *image4.IplImage : *image5.IplImage : *image6.IplImage
font.CvFont : cvInitFont(@font, #CV_FONT_HERSHEY_COMPLEX_SMALL, 1, 1, #Null, 1, #CV_AA)
Repeat
*image1 = cvQueryFrame(*capture(0)) : *image2 = cvQueryFrame(*capture(1)) : *image3 = cvQueryFrame(*capture(2))
*image4 = cvQueryFrame(*capture(3)) : *image5 = cvQueryFrame(*capture(4)) : *image6 = cvQueryFrame(*capture(5))
If *image1 And *image2 And *image3 And *image4 And *image5 And *image6
cvSetImageROI(*frame, 0, 0, FrameWidth, FrameHeight)
cvResize(*image1, *frame, #CV_INTER_AREA)
cvResetImageROI(*frame)
cvPutText(*frame, "----", 20, 30, @font, 0, 255, 255, 0)
cvSetImageROI(*frame, FrameWidth, 0, FrameWidth, FrameHeight)
cvResize(*image2, *frame, #CV_INTER_AREA)
cvResetImageROI(*frame)
cvPutText(*frame, "----", FrameWidth + 20, 30, @font, 0, 255, 255, 0)
cvSetImageROI(*frame, FrameWidth * 2, 0, FrameWidth, FrameHeight)
cvResize(*image3, *frame, #CV_INTER_AREA)
cvResetImageROI(*frame)
cvPutText(*frame, "----", FrameWidth * 2 + 20, 30, @font, 0, 255, 255, 0)
cvSetImageROI(*frame, 0, FrameHeight, FrameWidth, FrameHeight)
cvResize(*image4, *frame, #CV_INTER_AREA)
cvResetImageROI(*frame)
cvPutText(*frame, "----", 20, FrameHeight + 30, @font, 0, 255, 255, 0)
cvSetImageROI(*frame, FrameWidth, FrameHeight, FrameWidth, FrameHeight)
cvResize(*image5, *frame, #CV_INTER_AREA)
cvResetImageROI(*frame)
cvPutText(*frame, "----", FrameWidth + 20, FrameHeight + 30, @font, 0, 255, 255, 0)
cvSetImageROI(*frame, FrameWidth * 2, FrameHeight, FrameWidth, FrameHeight)
cvResize(*image6, *frame, #CV_INTER_AREA)
cvResetImageROI(*frame)
cvPutText(*frame, "----", FrameWidth * 2 + 20, FrameHeight + 30, @font, 0, 255, 255, 0)
cvShowImage(#CV_WINDOW_NAME, *frame)
keyPressed = cvWaitKey(10)
Else
Break
EndIf
Until keyPressed = 27 Or exitCV
cvReleaseImage(@*frame)
cvDestroyAllWindows()
For rtnCount = 0 To ArraySize(*capture()) - 1
If *capture(rtnCount) : cvReleaseCapture(@*capture(rtnCount)) : EndIf
Next