Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pixymon: since the header files aren't in the same directory as the sour... #18

Open
wants to merge 7 commits into
base: gcc
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,36 @@
*.jtag
*.swp
*.swo
/src/device/libpixy_m0/Release/liblibpixy_m0.a
/src/device/libpixy_m0/src/debug_frmwrk.c
/src/device/libpixy_m0/src/ipc_mbx.c
/src/device/libpixy_m0/src/lpc43xx_adc.c
/src/device/libpixy_m0/src/lpc43xx_cgu.c
/src/device/libpixy_m0/src/lpc43xx_i2c.c
/src/device/libpixy_m0/src/lpc43xx_scu.c
/src/device/libpixy_m0/src/lpc43xx_ssp.c
/src/device/libpixy_m0/src/lpc43xx_uart.c
/src/device/libpixy_m0/src/system_LPC43xx.c
/src/device/libpixy_m4/Release/liblibpixy_m4.a
/src/device/libpixy_m4/src/blob.cpp
/src/device/libpixy_m4/src/blobs.cpp
/src/device/libpixy_m4/src/calc.cpp
/src/device/libpixy_m4/src/chirp.cpp
/src/device/libpixy_m4/src/colorlut.cpp
/src/device/libpixy_m4/src/debug_frmwrk.c
/src/device/libpixy_m4/src/ipc_mbx.c
/src/device/libpixy_m4/src/lpc43xx_adc.c
/src/device/libpixy_m4/src/lpc43xx_cgu.c
/src/device/libpixy_m4/src/lpc43xx_i2c.c
/src/device/libpixy_m4/src/lpc43xx_scu.c
/src/device/libpixy_m4/src/lpc43xx_ssp.c
/src/device/libpixy_m4/src/lpc43xx_uart.c
/src/device/libpixy_m4/src/qqueue.cpp
/src/device/libpixy_m4/src/system_LPC43xx.c
/src/device/main_m0/Release/cr_startup_lpc43xx-m0app.asm
/src/device/main_m0/Release/main_m0.asm
/src/device/main_m4/SPIFI/pixy_firmware.hex
*.pro.user
*~
/src/device/libpixy_m4/src/robo.cpp
/src/host/build-pixymon-Desktop-Debug/*
89 changes: 89 additions & 0 deletions robodetection.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
clear 'all';
close 'all';

Path = 'Z:/Documents/PixyMon/';
files = dir(strcat(Path, '*.png'));
while 1
for file = files'
Image = imread(strcat(Path, file.name));

figure(1);

subplot(3,3,1);
imshow(Image);
title('Original');

ImageGray = rgb2gray(Image);

subplot(3,3,2);
imshow(ImageGray);
title('gray');

averaged = imfilter(ImageGray, fspecial('gaussian'));

subplot(3,3,3);
imshow(averaged);
title('averaged');

DX = [-1 0 1; -2 0 2; -1 0 1];
DY = DX';

ImageDy = imfilter(ImageGray, DY);
ImageDx = imfilter(ImageGray, DX);

subplot(3,3,4);
imshow(ImageDy);
title('dl/dy');

summed = sum(ImageDy, 2);


[h, w] = size(ImageGray);

filteredSummed = (summed > (sum(summed)/length(summed)));
filterMat = [ 1 2 1 ] * [ 1; 2; 1 ];
filtered = (imfilter(ImageDy, filterMat/sum(sum(filterMat))) > 120);

subplot(3,3,5);
imshow(filtered);
title('filtered dl/dy');

allPlatePixels = [];
for x = 11:w-10
platePixels = 0;
for y = h:-1:1
if ((filtered(y, x) == 1))
break;
end
platePixels = platePixels + 1;
end
allPlatePixels = [allPlatePixels platePixels];
end

avgPlatePixels = sum(allPlatePixels) / length(allPlatePixels);
sortedAllPlatePixels = sort(allPlatePixels);
medianPlatePixels = sortedAllPlatePixels(length(allPlatePixels)/2);

subplot(3,3,7);
plot(allPlatePixels);
title('sum');

%ImageCroppedGray = imcrop(ImageGray, [ 0 h - medianPlatePixels w medianPlatePixels]);

subplot(3,3,8);
imshow(ImageDx);
title('dl/dx');

subplot(3,3,9);
imshow(ImageDx);
title('dl/dx');

%ImageCroppedDx = imfilter(ImageCroppedGray, DX);

%subplot(3,3,7);
%imshow(ImageCroppedDx);
%title('dl/dx');

pause(1)
end
end
20 changes: 20 additions & 0 deletions src/common/inc/robo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// begin license header
//
// This file is part of Pixy CMUcam5 or "Pixy" for short
//
// All Pixy source code is provided under the terms of the
// GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).
// Those wishing to use Pixy source code, software and/or
// technologies under different licensing terms should contact us at
// cmucam@cs.cmu.edu. Such licensing terms are available for
// all portions of the Pixy codebase presented here.
//
// end license header
//

#ifndef ROBO_H
#define ROBO_H


#endif // ROBO_H
23 changes: 23 additions & 0 deletions src/common/src/robo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// begin license header
//
// This file is part of Pixy CMUcam5 or "Pixy" for short
//
// All Pixy source code is provided under the terms of the
// GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).
// Those wishing to use Pixy source code, software and/or
// technologies under different licensing terms should contact us at
// cmucam@cs.cmu.edu. Such licensing terms are available for
// all portions of the Pixy codebase presented here.
//
// end license header
//

void test()
{
auto f = []
{
};

(void)f;
}
2 changes: 1 addition & 1 deletion src/device/libpixy_m4/Release/makefile_alt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ clean:
src/%.o: ../src/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: MCU C++ Compiler'
arm-none-eabi-c++ -D__MULTICORE_NONE -DIPC_MASTER -DPIXY -D__NEWLIB__ -DNDEBUG -D__CODE_RED -DCORE_M4 -D__LPC43XX__ -I../inc -I../../common/inc -I../../../common/inc -Os -Os -g -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fsingle-precision-constant -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -D__NEWLIB__ -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
arm-none-eabi-c++ -D__MULTICORE_NONE -DIPC_MASTER -DPIXY -D__NEWLIB__ -DNDEBUG -D__CODE_RED -DCORE_M4 -D__LPC43XX__ -I../inc -I../../common/inc -I../../../common/inc -Os -Os -g -Wall -std=c++11 -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fsingle-precision-constant -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -D__NEWLIB__ -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Expand Down
2 changes: 1 addition & 1 deletion src/device/main_m4/RAM/makefile_alt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ clean:
src/%.o: ../src/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: MCU C++ Compiler'
arm-none-eabi-c++ -D__MULTICORE_MASTER -DIPC_MASTER -DPIXY -D__NEWLIB__ -DNDEBUG -D__CODE_RED -DCORE_M4 -DCPP_USE_HEAP -D__LPC43XX__ -DLPC43_MULTICORE_M0APP -I../inc -I../../libpixy_m4/inc -I../../common/inc -I../../../common/inc -O1 -Os -g -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fsingle-precision-constant -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -D__NEWLIB__ -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
arm-none-eabi-c++ -D__MULTICORE_MASTER -DIPC_MASTER -DPIXY -D__NEWLIB__ -DNDEBUG -D__CODE_RED -DCORE_M4 -DCPP_USE_HEAP -D__LPC43XX__ -DLPC43_MULTICORE_M0APP -I../inc -I../../libpixy_m4/inc -I../../common/inc -I../../../common/inc -O1 -Os -g -Wall -std=c++11 -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fsingle-precision-constant -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -D__NEWLIB__ -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Expand Down
2 changes: 1 addition & 1 deletion src/device/main_m4/SPIFI/makefile_alt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ main_m4.axf: $(OBJS) $(USER_OBJS)
src/%.o: ../src/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: MCU C++ Compiler'
arm-none-eabi-c++ -D__MULTICORE_MASTER -DIPC_MASTER -DPIXY -D__NEWLIB__ -DNDEBUG -D__CODE_RED -DCORE_M4 -DCPP_USE_HEAP -D__LPC43XX__ -DLPC43_MULTICORE_M0APP -I../inc -I../../libpixy_m4/inc -I../../common/inc -I../../../common/inc -O1 -Os -g -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fsingle-precision-constant -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -D__NEWLIB__ -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
arm-none-eabi-c++ -D__MULTICORE_MASTER -DIPC_MASTER -DPIXY -D__NEWLIB__ -DNDEBUG -D__CODE_RED -DCORE_M4 -DCPP_USE_HEAP -D__LPC43XX__ -DLPC43_MULTICORE_M0APP -I../inc -I../../libpixy_m4/inc -I../../common/inc -I../../../common/inc -O1 -Os -g -Wall -std=c++11 -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fsingle-precision-constant -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -D__NEWLIB__ -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Expand Down
Loading